:root {
    --contact-bar-height: 72px;
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #07121d;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(39, 169, 227, 0.2), transparent 34%),
        radial-gradient(circle at 83% 80%, rgba(79, 203, 236, 0.13), transparent 38%),
        linear-gradient(145deg, #0b2333 0%, #07121d 48%, #06101a 100%);
}

.ambient,
.grain,
.glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.ambient {
    overflow: hidden;
}

.glow {
    width: 42vmax;
    height: 42vmax;
    border-radius: 50%;
    filter: blur(58px);
    opacity: 0.28;
    transform: translate3d(0, 0, 0);
}

.glow-one {
    inset: -20vmax auto auto -17vmax;
    background: #2fa6df;
    animation: drift-one 15s ease-in-out infinite alternate;
}

.glow-two {
    inset: auto -18vmax -23vmax auto;
    background: #117fbd;
    animation: drift-two 18s ease-in-out infinite alternate;
}

.grain {
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.viewport {
    position: relative;
    z-index: 1;
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    place-items: center;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: calc(var(--contact-bar-height) + max(18px, env(safe-area-inset-bottom)));
    padding-left: max(18px, env(safe-area-inset-left));
}

.player-frame {
    position: relative;
    width: min(calc((100svh - 36px - var(--contact-bar-height)) * 9 / 16), calc(100vw - 36px));
    height: min(calc(100svh - 36px - var(--contact-bar-height)), calc((100vw - 36px) * 16 / 9));
    max-width: 620px;
    max-height: 1102px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(199, 237, 255, 0.2);
    border-radius: clamp(20px, 3.2vh, 34px);
    background: #020507;
    box-shadow:
        0 38px 90px rgba(0, 0, 0, 0.48),
        0 12px 36px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(255, 255, 255, 0.035) inset;
}

.player-frame::after {
    position: absolute;
    z-index: 3;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 80px rgba(47, 166, 223, 0.08) inset;
    content: "";
    pointer-events: none;
}

video {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #020507;
    opacity: 0;
    transition: opacity 420ms ease;
}

body.video-ready video {
    opacity: 1;
}

.loading-mark {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    place-content: center;
    place-items: center;
    gap: 22px;
    background:
        radial-gradient(circle at 50% 44%, rgba(47, 166, 223, 0.16), transparent 33%),
        linear-gradient(165deg, #0d2433, #03080d 68%);
    opacity: 1;
    transition: opacity 350ms ease, visibility 350ms ease;
}

.loading-mark img {
    width: clamp(74px, 18%, 108px);
    height: auto;
    border-radius: 22%;
    filter: drop-shadow(0 10px 24px rgba(47, 166, 223, 0.24));
}

.loading-mark span {
    width: 76px;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}

.loading-mark span::after {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: #47b4e6;
    animation: loading 1.1s ease-in-out infinite;
    content: "";
}

body.video-ready .loading-mark {
    visibility: hidden;
    opacity: 0;
}

.play-gate {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    width: 78px;
    height: 78px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: white;
    cursor: pointer;
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
    transform: translate(-50%, -50%);
    transition: transform 160ms ease, filter 160ms ease;
}

.play-gate:hover,
.play-gate:focus-visible {
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.62));
    transform: translate(-50%, -50%) scale(1.07);
}

.play-gate:focus-visible {
    outline: 3px solid #8bdcff;
    outline-offset: 5px;
}

.play-gate svg {
    display: block;
    width: 100%;
    height: 100%;
}

.play-gate circle {
    fill: rgba(4, 18, 29, 0.72);
    stroke: rgba(255, 255, 255, 0.82);
    stroke-width: 2;
}

.play-gate path {
    fill: currentColor;
}

.contact-banner {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    min-height: var(--contact-bar-height);
    place-items: center;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border-top: 1px solid rgba(132, 220, 255, 0.22);
    background: linear-gradient(90deg, rgba(5, 24, 37, 0.97), rgba(11, 61, 86, 0.97), rgba(5, 24, 37, 0.97));
    box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(14px);
}

.contact-banner a {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 9px 22px;
    border: 1px solid rgba(148, 231, 255, 0.3);
    border-radius: 999px;
    background: rgba(38, 159, 211, 0.17);
    color: #f4fcff;
    font-size: clamp(0.98rem, 2.3vw, 1.12rem);
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.19);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.contact-banner a:hover,
.contact-banner a:focus-visible {
    border-color: rgba(166, 238, 255, 0.72);
    background: rgba(38, 159, 211, 0.3);
    transform: translateY(-2px);
}

.contact-banner a:focus-visible {
    outline: 3px solid #8bdcff;
    outline-offset: 3px;
}

.contact-banner svg {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
}

.contact-banner svg path:first-child {
    fill: #32c873;
}

.contact-banner svg path:last-child {
    fill: white;
}

.contact-banner strong {
    font-weight: 850;
}

@keyframes loading {
    from {
        transform: translateX(-115%);
    }
    to {
        transform: translateX(245%);
    }
}

@keyframes drift-one {
    to {
        transform: translate3d(8vmax, 6vmax, 0) scale(1.08);
    }
}

@keyframes drift-two {
    to {
        transform: translate3d(-7vmax, -5vmax, 0) scale(0.94);
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    body {
        background: #020507;
    }

    .ambient {
        display: none;
    }

    .viewport {
        padding: 0 0 calc(var(--contact-bar-height) + env(safe-area-inset-bottom));
    }

    .player-frame {
        width: 100vw;
        height: calc(100vh - var(--contact-bar-height) - env(safe-area-inset-bottom));
        height: calc(100svh - var(--contact-bar-height) - env(safe-area-inset-bottom));
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .contact-banner a {
        width: min(100%, 390px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
