/* ─────────────────────────────────────────────────────────────────────
   Splash homepage — full-screen black stage, brand name centered in a
   white frame, every site link tucked top-left, a minimal legal bar at
   the bottom. Deliberately self-contained (does NOT load editorial.css)
   so the marketing homepage reads as a distinct, quiet front door.
   ───────────────────────────────────────────────────────────────────── */

/* Custom brand face. Drop the real files at /fonts/milsiz-display.woff2
   (and/or .ttf / .otf) and the wordmark picks them up automatically. Until
   then it falls back to Anton — a heavy condensed display sans — so the
   page never looks unstyled. `font-display: swap` avoids invisible text
   while the custom file loads. */
@font-face {
    font-family: 'milsiz-display';
    src: url('/fonts/milsiz-display.otf') format('opentype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* UI face — Josefin Sans, self-hosted. Drives every bit of splash text
   except the brand wordmark. One @font-face per weight we use. */
@font-face {
    font-family: 'Josefin Sans';
    src: url('/fonts/josefin-sans-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Josefin Sans';
    src: url('/fonts/josefin-sans-semibold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Josefin Sans';
    src: url('/fonts/josefin-sans-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg:    #000;
    --fg:    #fff;
    --muted: #8a8a8a;
    --font-ui:    'Josefin Sans', system-ui, -apple-system, sans-serif;
    --font-brand: 'milsiz-display', 'Anton', 'Arial Narrow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body.splash {
    min-height: 100vh;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ── Lowercase-only ──────────────────────────────────────────────────
   The splash is locked to lowercase: every bit of copy is lowercased.
   (The brand wordmark opts back out below — see .brand-wordmark.) */
body.splash,
body.splash * { text-transform: lowercase !important; }

/* ── Top-left: all links ────────────────────────────────────────────── */
.splash-nav {
    position: fixed; top: 0; left: 0; z-index: 20;
    padding: 22px 26px;
    max-width: min(70vw, 1000px);
}

/* ── Socials — Instagram + envelope. They're a trailing item of the legal
   bar (see .splash-legal-social below), not a separate block. ─────────── */

/* Links — base (also the mobile burger-overlay) styling. The desktop 4-row
   grid is defined in the ≥768px block. */
.splash-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.splash-links a {
    font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--fg); opacity: 0.7;
    padding: 2px 0; border-bottom: 1px solid transparent;
    transition: opacity 0.15s ease, border-color 0.15s ease;
}
.splash-links a:hover { opacity: 1; border-bottom-color: var(--fg); }

/* ── Top-right controls ─────────────────────────────────────────────── */
.splash-controls {
    position: fixed; top: 0; right: 0; z-index: 40;   /* above the mobile menu overlay */
    padding: 22px 26px;
    display: flex; align-items: center; gap: 16px;
}
.splash-lang {
    font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--fg); opacity: 0.7;
    transition: opacity 0.15s ease;
}
.splash-lang:hover { opacity: 1; }

/* Burger — hidden on desktop, shown on mobile (see the max-width block).
   Animates into an X while the menu is open. */
.burger {
    display: none;
    flex-direction: column; justify-content: center;
    gap: 5px; width: 34px; height: 34px; padding: 6px 4px;
    background: transparent; border: none; cursor: pointer;
}
.burger span {
    display: block; height: 2px; width: 100%; background: var(--fg);
    border-radius: 2px; transition: transform 0.2s ease, opacity 0.2s ease;
}
body.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Center stage ───────────────────────────────────────────────────── */
.splash-stage {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 120px 24px;
}

/* ── Cut-paper word tags flanking the brand ──────────────────────────────
   Uniform torn-paper strips: min-width keeps spacing independent of the word
   length; each is lightly rotated and centred on its anchor. They fade out
   during the warp and are hidden on mobile. */
.brand-tags { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
/* White torn-paper outline: transparent fill, white text. A normal border
   would be clipped by clip-path, so the outline is two stacked clipped layers
   — ::before white (full), ::after page-black inset — leaving a white torn
   ring. Shared --torn polygon keeps both layers' shapes identical. */
.paper-tag {
    --torn: polygon(
        0% 16%, 4% 4%, 16% 11%, 31% 2%, 47% 10%, 63% 1%, 79% 9%, 94% 3%, 100% 15%,
        98% 38%, 100% 62%, 97% 84%, 100% 96%, 84% 90%, 67% 100%, 50% 92%,
        33% 100%, 17% 91%, 3% 98%, 0% 80%, 2% 56%, 0% 34%);
    position: absolute; isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 320px; padding: 24px 48px;
    background: transparent; color: #fff;
    font-family: var(--font-ui); font-weight: 800;
    font-size: clamp(30px, 3vw, 44px); letter-spacing: 0.04em; white-space: nowrap;
    transform: translateY(-50%) rotate(var(--r, 0deg));
    transition: opacity 0.4s ease, transform 0.25s ease;
}
.paper-tag::before,
.paper-tag::after { content: ""; position: absolute; clip-path: var(--torn); }
.paper-tag::before { inset: 0;   background: #fff; z-index: -2; }   /* white edge */
.paper-tag::after  { inset: 4px; background: #000; z-index: -1; }   /* hollow centre */
/* Four slots, diagonally around the button. Kept toward the vertical centre
   (tighter as a group) and to the far edges, so they clear the top-left nav
   links and the centre circle. */
.paper-tag--s1 { top: 40%; left: 1%;  --r: -4deg; }
.paper-tag--s2 { top: 40%; right: 1%; --r:  4deg; }
.paper-tag--s3 { top: 60%; left: 1%;  --r:  3deg; }
.paper-tag--s4 { top: 60%; right: 1%; --r: -3deg; }
/* Clear away during the portal warp. */
.splash-stage:has(.brand-dock.warp) .brand-tags { opacity: 0; }
/* Mobile: all four, ~2x text and pulled in close around the milsiz button. */
@media (max-width: 767px) {
    .paper-tag { min-width: 0; padding: 8px 14px; font-size: 28px; }
    .paper-tag::after { inset: 3px; }
    .paper-tag--s1 { top: 33%; left: 18px;  right: auto; }
    .paper-tag--s2 { top: 33%; right: 18px; left: auto; }
    .paper-tag--s3 { top: 67%; left: 18px;  right: auto; }
    .paper-tag--s4 { top: 67%; right: 18px; left: auto; }
}
/* ── Brand as a giant tactile "spacebar" button ─────────────────────────
   .brand-dock provides the 3D perspective; the portal halo and the key
   stack in the same grid cell. --portal is a random colour set per load
   (home-splash.js); --tx/--ty/--tz/--rx/--ry are driven live by the press
   physics. */
.brand-dock {
    position: relative;
    display: grid; place-items: center;
    perspective: 900px;
    transform-style: preserve-3d;
    --portal: #36c2ff;          /* overwritten on load */
    --rx: 0deg; --ry: 0deg; --tz: 0px;
}

/* Portal halo + tunnel behind the key. Horizontal-elliptic and fat at rest;
   pushed back in Z so you look INTO it like a tunnel. The concentric rings
   (repeating-radial-gradient) recede toward a dark core, and slowly drift
   inward to sell the depth. Hidden at rest, fades in on hover/press; on
   .brand-dock.warp it rushes forward to swallow the page (~1.5s). */
.brand-portal {
    position: absolute; left: 50%; top: 50%;
    width: 150%; height: 115%;
    transform: translate(-50%, -50%) translateZ(-280px) scale(0.6);
    border-radius: 50%;
    pointer-events: none; z-index: 0;
    opacity: 0;
    background:
        radial-gradient(closest-side, transparent 0 22%, #05030a 23% 30%, transparent 31%),
        repeating-radial-gradient(circle at 50% 50%,
            color-mix(in srgb, var(--portal) 92%, #fff) 0 4px,
            var(--portal) 4px 9px,
            color-mix(in srgb, var(--portal) 35%, #05030a) 9px 20px),
        radial-gradient(closest-side,
            color-mix(in srgb, var(--portal) 85%, #fff) 0%,
            var(--portal) 30%,
            color-mix(in srgb, var(--portal) 45%, transparent) 60%,
            transparent 80%);
    background-size: 100% 100%, 60% 60%, 100% 100%;
    background-position: center, center, center;
    filter: blur(2px) saturate(1.25);
    transition: opacity .35s ease, transform .4s ease;
    will-change: transform, opacity;
    animation: tunnel-drift 6s linear infinite;
}
/* Rings drift inward → tunnel depth. */
@keyframes tunnel-drift {
    from { background-size: 100% 100%, 120% 120%, 100% 100%; }
    to   { background-size: 100% 100%, 36% 36%, 100% 100%; }
}
.brand-dock:hover .brand-portal { opacity: .9; transform: translate(-50%, -50%) translateZ(-180px) scale(1); }
.brand-dock.pressing .brand-portal { opacity: 1; }
/* Click → the tunnel recedes into the distance: shrinks toward a point and
   darkens as it goes away, leaving the bright dot (the light at the end of
   the tunnel). Nav fires in JS once it's small. */
.brand-dock.warp .brand-portal {
    opacity: .2;
    transform: translate(-50%, -50%) translateZ(-1400px) scale(0.05);
    filter: blur(1px) saturate(.6) brightness(.35);
    transition: transform 1.5s cubic-bezier(.45,0,.55,1), opacity 1.5s ease, filter 1.5s ease;
}

/* Giant round key — a circle, not the old rectangle. */
.brand-frame {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; justify-content: center;
    width: clamp(260px, 42vw, 520px); aspect-ratio: 1;
    border: 4px solid var(--fg); border-radius: 50%;
    background: var(--fg);
    color: var(--bg);
    line-height: 0.9;
}
/* The tactile key: real depth via a stacked "side wall" shadow, and a 3D
   tilt toward wherever you press. transform vars are set by home-splash.js. */
.brand-key {
    transform-style: preserve-3d;
    transform: translateY(var(--tz)) rotateX(var(--rx)) rotateY(var(--ry));
    box-shadow:
        0 2px 0 #d6d6d2, 0 4px 0 #c2c2bd, 0 6px 0 #adada8,
        0 9px 0 #97978f, 0 12px 0 #7e7e76, 0 16px 18px rgba(0,0,0,.55);
    transition: transform .12s cubic-bezier(.2,.8,.3,1), box-shadow .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.brand-dock:hover .brand-key { --tz: -3px; }
/* Per-letter spans — scattered off-screen by JS on warp. */
.brand-ltr { display: inline-block; will-change: transform, opacity; }
/* Final fade — black swallows the dot before navigation. */
.warp-black {
    position: fixed; inset: 0; z-index: 9999;
    background: #000; opacity: 0; pointer-events: none;
}
.warp-black.on { opacity: 1; transition: opacity .45s ease; pointer-events: auto; }
/* End of warp: the round key collapses into a small white-ringed, yellow dot
   floating in the light. */
.brand-dock.warp .brand-key {
    width: 20px; height: 20px;
    background: #ffd23f; border-color: #fff; border-width: 3px;
    box-shadow: 0 0 30px 8px rgba(255,255,255,.85), 0 0 80px 20px color-mix(in srgb, var(--portal) 70%, transparent);
    transition: width 1.1s cubic-bezier(.6,0,.4,1) .35s, height 1.1s cubic-bezier(.6,0,.4,1) .35s,
                background .8s ease .5s, border-color .6s ease .5s, box-shadow 1s ease .5s;
}
/* Pressed: sinks down, side wall collapses → that satisfying key-press feel. */
.brand-dock.pressing .brand-key {
    box-shadow:
        0 1px 0 #d6d6d2, 0 2px 0 #c2c2bd, 0 3px 0 #adadA8,
        0 4px 0 #97978f, 0 6px 10px rgba(0,0,0,.5);
    transition: transform .06s ease, box-shadow .08s ease;
}

/* Brand wordmark — bold, lowercase, in the custom NickelBumpy display
   face. --bend is a tiny random skew set per load (home-splash.js). */
.brand-wordmark {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: clamp(40px, 8.5vw, 118px);
    letter-spacing: 0.02em;
    display: inline-block;
    transform: rotate(var(--bend, 0deg)) skewX(var(--bend, 0deg));
}

/* ── Bottom-center footer link bar ──────────────────────────────────── */
/* One wrapping row: copyright, the legal links, then the moved nav links
   (pricing / roadmap / contact). Spacing between items comes from the flex
   column-gap; the white-circle separator is drawn as an ABSOLUTELY positioned
   ::before centred in that gap, so showing/hiding it never changes any item's
   width. That matters: home-splash.js adds .no-sep to the first item of each
   visual row to hide its leading dot, and if toggling that class changed
   layout widths the wrap points would oscillate and a mid-line item could end
   up dotless (and, worse, with no space at all). column-gap also gives the
   first item of every wrapped line no leading gap for free. */
.splash-legal {
    position: fixed; bottom: 22px; left: 0; right: 0; z-index: 10;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 4px 23px;
    padding: 0 200px;
    font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted);
    pointer-events: none;
}
.splash-legal-item { position: relative; display: inline-flex; align-items: center; color: var(--muted); }
.splash-legal a.splash-legal-item { pointer-events: auto; transition: color 0.15s ease; }
.splash-legal a.splash-legal-item:hover { color: var(--fg); }
.splash-legal-item:not(:first-child)::before {
    content: "";
    position: absolute; left: -13px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 3px; border-radius: 50%;
    background: var(--fg); opacity: 0.7;
}
.splash-legal-item.no-sep::before { display: none; }

/* Social icons as the trailing legal item: one separator dot sets the group
   off from the text, and the two icons sit side-by-side with their own gap
   (no dot between them). Icons inherit the muted link colour and brighten on
   hover like the other links; size scales with the bar's font. */
.splash-legal-social { gap: 1.1em; }
.splash-legal-social a {
    display: inline-flex; pointer-events: auto; color: var(--muted);
    transition: color 0.15s ease, transform 0.15s ease;
}
.splash-legal-social a:hover { color: var(--fg); transform: translateY(-1px); }
.splash-legal-social svg { width: 1.5em; height: 1.5em; display: block; }

/* ── Copy-email toast ───────────────────────────────────────────────── */
.copy-toast {
    position: fixed; left: 50%; bottom: 84px; z-index: 60;
    transform: translateX(-50%) translateY(10px);
    background: var(--fg); color: var(--bg);
    font-family: var(--font-ui); font-weight: 600;
    font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 12px 22px; border-radius: 999px;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Non-mobile (≥768px): every UI text ~3× larger ─────────────────────
   Base sizes above are the mobile sizes; from 768px up the chrome (links,
   language, legal bar) and the social icons scale up roughly threefold.
   The brand wordmark is unaffected. */
@media (min-width: 768px) {
    .splash-nav { max-width: min(72vw, 1040px); }

    /* 4 rows: "app" alone on row 1, the other 9 links across rows 2–4 (3 each). */
    .splash-links {
        display: grid;
        grid-template-columns: repeat(3, max-content);
        gap: 16px 40px;
        align-items: start; justify-items: start;
    }
    .splash-links a:first-child { grid-column: 1 / -1; }   /* app → its own row */
    .splash-links a { font-size: clamp(20px, 2.4vw, 32px); letter-spacing: 0.04em; }

    .splash-controls { gap: 26px; padding: 26px 30px; }
    .splash-lang { font-size: 33px; }

    .splash-legal { font-size: 26px; gap: 6px 36px; padding: 0 40px; bottom: 28px; }
    .splash-legal-item:not(:first-child)::before { width: 4px; height: 4px; left: -20px; }
}

/* ── Mobile (≤767px) ────────────────────────────────────────────────────
   Nothing top-left: the nav (socials + links) collapses into a fullscreen
   overlay opened by the burger. Footer text is ~2× the base size. */
@media (max-width: 767px) {
    .burger { display: inline-flex; }

    .splash-nav {
        position: fixed; inset: 0; z-index: 35;
        max-width: none; padding: 96px 28px 56px;
        background: var(--bg);
        flex-direction: column; align-items: center; justify-content: center;
        gap: 36px;
        opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
    }
    body.menu-open .splash-nav {
        opacity: 1; visibility: visible; transform: none;
        transition: opacity 0.22s ease, transform 0.22s ease;
    }
    .splash-links { flex-direction: column; align-items: center; gap: 20px; }
    .splash-links a { font-size: 30px; letter-spacing: 0.03em; }

    /* Language switch — readable on mobile (base 11px was too small to read). */
    .splash-lang { font-size: 16px; }

    /* Footer — a wrapping row fixed to the bottom: as the viewport narrows,
       links fall to the next line and home-splash.js drops the now-leading
       dot. The social icon group is forced onto its own last row, centred. */
    .splash-legal {
        font-size: 12px; gap: 12px 23px; padding: 0 18px;
    }
    .splash-legal-social { flex-basis: 100%; justify-content: center; margin-top: 4px; }
}
@media (max-width: 600px) {
    .splash-stage { padding: 120px 18px 140px; }
    .brand-frame { padding: 20px 38px; border-width: 3px; }
}
