/* ─────────────────────────────────────────────────────────────────────
   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;
    /* Column flow: the stage fills the viewport and the legal bar sits below
       it (the fixed nav/controls are out of flow). When the window is too
       short for the brand circle + its gap + the footer, the page scrolls
       instead of the circle dropping into the footer. */
    display: flex; flex-direction: column;
}
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; }
/* The "app" link (first nav item) is the one uppercase mark on the splash —
   and the primary CTA, so it softly breathes a glow to catch the eye. */
.splash-links .nav-app {
    text-transform: uppercase !important;
    display: inline-block;
    transform-origin: left center;   /* pulse grows rightward, stays anchored */
    animation: app-pulse 1.8s ease-in-out infinite;
}
.splash-links .nav-app:hover {
    animation: none;
    transform: scale(1.08);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.8);
}
@keyframes app-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.82; text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
    50%      { transform: scale(1.1);  opacity: 1;    text-shadow: 0 0 14px rgba(255, 255, 255, 0.6); }
}
@media (prefers-reduced-motion: reduce) {
    .splash-links .nav-app { animation: none; }
}

/* ── 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 grouped
   layout is defined in the ≥768px block. A column of three blocks — app, the
   middle nav-group (three rows), docs — with a big gap between blocks reading
   as blank lines; rows lay out horizontally on desktop. */
.splash-links { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.nav-group { display: flex; flex-direction: column; gap: 12px; }
.nav-row { display: flex; flex-wrap: wrap; gap: 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; }

/* APP CTA — mobile only (desktop has the "app" link in the top-left nav). */
.splash-controls .splash-app-cta {
    display: none;
    align-items: center;
    background: var(--fg); color: var(--bg);
    padding: 8px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase !important;
    text-decoration: none; white-space: nowrap;
}

/* 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;
    flex: 1 0 auto;
    display: flex; align-items: center; justify-content: center;
    /* The 120px bottom padding is the guaranteed minimum gap to the legal
       bar that follows in flow. */
    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. */
/* Wrap shrinks to the circle, so the tags below (inset:0) are circle-relative. */
.brand-wrap { position: relative; display: inline-flex; }
.brand-tags { position: absolute; inset: 0; z-index: 3; 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: 0; padding: 12px 26px;
    background: transparent; color: #fff;
    font-family: var(--font-ui); font-weight: 800;
    font-size: clamp(22px, 2.6vw, 40px); letter-spacing: 0.03em; white-space: nowrap;
    transform: translate(-50%, -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. */
/* Inside the circle (anchored by centre, translate(-50%,-50%)). The top pair
   overlaps and staggers so one sits partially behind the other; the bottom
   two spread out. */
.paper-tag--s1 { top: 27%; left: 33%; --r: -4deg; }
.paper-tag--s2 { top: 24%; left: 67%; --r:  4deg; }
.paper-tag--s3 { top: 71%; left: 50%; --r:  3deg; }
/* Clear away during the portal warp. */
.splash-stage:has(.brand-dock.warp) .brand-tags { opacity: 0; }
/* ── Localized slogan, OUTSIDE the circle ──────────────────────────────
   Plain big type (not a torn-paper tag), centred just below the circle.
   Anchored to the wrap (the circle box) so the gap holds at any size. Only
   the current language's slogan is rendered (server-side i18n). */
.splash-slogan {
    position: absolute;
    top: calc(100% + 28px); left: 50%;
    transform: translateX(-50%);
    margin: 0;
    white-space: nowrap;
    font-family: var(--font-ui); font-weight: 800;
    font-size: clamp(28px, 4vw, 60px); letter-spacing: 0.01em;
    color: var(--fg); text-align: center;
    pointer-events: none;
}
.splash-stage:has(.brand-dock.warp) .splash-slogan {
    opacity: 0; transition: opacity 0.4s ease;
}
/* Mobile: a big circle that the three cut-paper tags sit ON — two across the
   top, one centred at the bottom — their outer edges tucking behind the
   circle's left/right sides, clear of the milsiz wordmark in the middle. The
   two slogan banners ride the very top + bottom arcs, framing it all. */
@media (max-width: 767px) {
    .paper-tag { padding: 10px 18px; font-size: clamp(30px, 9vw, 46px); }
    .paper-tag::after { inset: 3px; }
    .paper-tag--s1 { top: 22%; left: 17%; }
    .paper-tag--s2 { top: 22%; left: 83%; }
    .paper-tag--s3 { top: 78%; left: 50%; }
    .splash-slogan { top: calc(100% + 16px); font-size: clamp(22px, 6vw, 40px); }
    /* Big enough to overflow the sides; the tags ride its top + bottom arcs. */
    .brand-frame { width: min(108vw, 600px); }
}
/* ── 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(-120px) scale(0.95);
    border-radius: 50%;
    pointer-events: none; z-index: 0;
    opacity: 0.55;
    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: static; z-index: 10;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 4px 23px;
    padding: 0 200px 22px;
    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; }

/* Copyright owns the first line on its own; the links wrap to the rows
   below it. flex-basis:100% forces the break, centred like the rest of
   the bar. */
.splash-legal-copy { flex-basis: 100%; justify-content: center; margin-bottom: 2px; }
/* Home-base line, alone and centred at the very bottom of the bar. */
.splash-legal-place { flex-basis: 100%; justify-content: center; margin-top: 8px; opacity: 0.75; }
.splash-legal-place::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) {
    /* Desktop is two full screens stacked: a brand hero (the big circle),
       then a centred list of the nav links, then the footer. APP stays
       pinned top-left (pulsing), the lang switch top-right. No parallax —
       you simply scroll past the brand to reach the links. */
    .splash-stage { order: 1; min-height: 100vh; }
    .splash-nav   { order: 2; }
    .splash-legal { order: 3; }

    /* Hero circle — big, sized to the viewport. */
    .brand-frame { width: min(80vh, 88vw, 740px); }

    /* Page 2: the nav fills a screen and centres its links as a big list. */
    .splash-nav {
        position: static; max-width: none; z-index: auto;
        min-height: 100vh; padding: 96px 24px;
        display: flex; align-items: center; justify-content: center;
    }
    .splash-links { align-items: center; gap: 30px; }
    .nav-group { align-items: center; gap: 30px; }
    .nav-row { flex-direction: column; align-items: center; gap: 30px; }
    .splash-links a { font-size: clamp(34px, 5vw, 64px); letter-spacing: 0.02em; }
    /* APP is pulled out of the page-2 list and pinned top-left at its small size. */
    .splash-links .nav-app {
        position: fixed; top: 0; left: 0; z-index: 20;
        padding: 26px 30px; font-size: clamp(20px, 2.4vw, 32px);
    }

    /* Big cut-paper tags — roughly double — clustered inside the hero circle. */
    .paper-tag { font-size: clamp(44px, 5.8vw, 88px); }

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

    .splash-legal { font-size: 26px; gap: 6px 36px; padding: 0 40px 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-controls .splash-app-cta { 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;
    }
    /* Burger overlay: everything stacks one-per-line, centred. */
    .splash-links { align-items: center; gap: 22px; }
    .nav-group { align-items: center; gap: 20px; }
    .nav-row { 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 22px;
    }
    .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; }
}
