@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --bg: #05031a;
    --navy: #090330;
    --blue: #4146d8;
    --cyan: #7fe0ff;
    --gold: #d8ab41;
    --text: #f3f2fb;
    --text-dim: rgba(243, 242, 251, 0.62);
    --gutter: clamp(20px, 5vw, 72px);
    --header-h: 72px;
    --header-fade: 110px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
}

/* Background layers */

#scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(to bottom, rgba(5, 3, 26, 0.7), rgba(5, 3, 26, 0) 22%),
        radial-gradient(ellipse at 50% 50%, rgba(5, 3, 26, 0) 45%, rgba(5, 3, 26, 0.75) 100%);
}

/* Shown when WebGL is unavailable. */
.no-webgl #scene {
    display: none;
}

.no-webgl body {
    background:
        radial-gradient(60vw 60vw at 75% 30%, rgba(65, 70, 216, 0.45), transparent 70%),
        radial-gradient(45vw 45vw at 20% 80%, rgba(216, 171, 65, 0.16), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}

/* Header */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    height: var(--header-h);
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: block;
    line-height: 0;
}

.brand img {
    height: 30px;
    width: auto;
}

.header-email {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 9px 16px;
    border: 1px solid rgba(243, 242, 251, 0.22);
    border-radius: 999px;
    background: rgba(9, 3, 48, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.25s, color 0.25s;
}

.header-email:hover,
.header-email:focus-visible {
    color: var(--gold);
    border-color: var(--gold);
}

/* Acts */

main {
    position: relative;
    z-index: 2;
}

.act {
    position: relative;
    padding: 0 var(--gutter);
}

h1,
.caption {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
    letter-spacing: -0.025em;
    text-wrap: balance;
    text-shadow: 0 2px 40px rgba(5, 3, 26, 0.9);
}

.act-hero {
    height: 100vh;
    height: 100svh;
    min-height: 320px;
    display: flex;
    align-items: center;
}

/* The headline fades out as it scrolls up to the header instead of running into the logo.
   main.js keeps --fade-from at the header's lower edge, measured from the top of this box.
   The padding (cancelled by the margins) keeps the mask from cutting off the text shadow. */
.hero-copy {
    --halo: 60px;
    --fade-from: -1000px;
    max-width: calc(min(50vw, 720px) + var(--gutter) + var(--halo));
    margin: calc(-1 * var(--halo)) 0 calc(-1 * var(--halo)) calc(-1 * var(--gutter));
    padding: var(--halo) var(--halo) var(--halo) var(--gutter);
    -webkit-mask-image: linear-gradient(to bottom, transparent var(--fade-from), #000 calc(var(--fade-from) + var(--header-fade)));
    mask-image: linear-gradient(to bottom, transparent var(--fade-from), #000 calc(var(--fade-from) + var(--header-fade)));
    animation: rise 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

h1 {
    font-size: clamp(40px, 6.2vw, 92px);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

/* A quiet prompt at the foot of the opening screen. main.js fades it out as soon as the page
   starts to scroll. */
.scroll-hint {
    position: absolute;
    left: var(--gutter);
    bottom: 28px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--text);
    pointer-events: none;
    animation: rise 1.4s 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.scroll-hint svg {
    width: 16px;
    height: auto;
    animation: nudge 2.2s ease-in-out infinite;
}

@keyframes nudge {
    50% {
        transform: translateY(4px);
    }
}

/* These four only give the page its scroll length; main.js maps scroll to the story. Their
   heights add up to the screens of scrolling in SCROLL_MAP before the contact section. */
.act-faint,
.act-design,
.act-prime {
    height: 115vh;
}

/* Shorter: the kill plays by itself, so it needs no scrolling of its own. */
.act-hunt {
    height: 35vh;
}

/* Captions stay fixed in place and fade in and out as their section passes (see main.js). */
.beat {
    position: fixed;
    top: 0;
    left: var(--gutter);
    right: var(--gutter);
    height: 100vh;
    height: 100svh;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: min(38vw, 500px);
    opacity: 0;
    will-change: opacity, transform;
}

/* Soft dark patch so captions stay readable when the scene passes behind them. */
.beat::before {
    content: '';
    position: absolute;
    inset: 20% -40% 20% -60%;
    z-index: -1;
    background: radial-gradient(closest-side, rgba(5, 3, 26, 0.8), rgba(5, 3, 26, 0));
}

.caption {
    font-size: clamp(26px, 3.1vw, 46px);
    line-height: 1.05;
}

/* A second sentence that starts on its own line, set a little apart from the first. */
.caption .next {
    display: block;
    margin-top: 0.45em;
}

/* The one name on the page, in the gold that marks everything "ours". */
.caption .brilliant {
    color: var(--gold);
    white-space: nowrap;
    text-shadow: 0 0 28px rgba(216, 171, 65, 0.55), 0 2px 40px rgba(5, 3, 26, 0.9);
}

.act-contact {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.contact-copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 0 60px;
}

/* The lightbulb from the logo, lit against the dark page with a small haze of gold. When the
   page is scrolled all the way to the bottom, main.js adds is-on and its light spreads. */
.contact-bulb {
    position: relative;
    isolation: isolate;
    line-height: 0;
}

/* The wider light it throws once it is fully on. */
.contact-bulb::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 40%;
    width: 460px;
    height: 460px;
    transform: translate(-50%, -50%) scale(0.5);
    background: radial-gradient(closest-side, rgba(255, 216, 130, 0.42), rgba(216, 171, 65, 0.16) 42%, rgba(216, 171, 65, 0) 72%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s;
}

.contact-bulb.is-on::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 0.9s ease-out, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.contact-mark {
    position: relative;
    width: 112px;
    height: auto;
    filter: drop-shadow(0 0 36px rgba(216, 171, 65, 0.4));
}

@media (prefers-reduced-motion: reduce) {
    .contact-bulb::before,
    .contact-bulb.is-on::before {
        transition: none;
    }
}

.contact-email {
    margin-top: 40px;
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--bg);
    background: var(--gold);
    padding: 16px 30px;
    border-radius: 999px;
    box-shadow: 0 0 60px rgba(216, 171, 65, 0.35);
    transition: transform 0.25s, box-shadow 0.25s;
}

.contact-email:hover,
.contact-email:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 0 90px rgba(216, 171, 65, 0.6);
}

.site-footer {
    width: 100%;
    padding: 28px 0;
    border-top: 1px solid rgba(243, 242, 251, 0.1);
    font-size: 12px;
    color: var(--text-dim);
}

a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
}

/* Narrow screens: copy sits at the bottom, the scene above it. */
@media (max-width: 760px) {
    :root {
        --header-h: 60px;
    }

    .brand img {
        height: 24px;
    }

    .header-email {
        font-size: 12px;
        padding: 8px 12px;
    }

    .act-hero {
        align-items: flex-end;
        padding-bottom: 84px;
    }

    .scroll-hint {
        bottom: 20px;
        font-size: 15px;
    }

    .beat {
        max-width: 100%;
    }

    .hero-copy {
        max-width: none;
        margin-right: calc(-1 * var(--gutter));
        padding-right: var(--gutter);
    }

    .beat {
        justify-content: flex-end;
        padding-bottom: 64px;
    }
}

/* A phone on its side: the headline starts close under the header, so the fade below the
   header is kept short enough not to reach it before the page has scrolled. */
@media (max-height: 520px) {
    :root {
        --header-fade: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-copy,
    .scroll-hint,
    .scroll-hint svg {
        animation: none;
    }

    .contact-email {
        transition: none;
    }
}
