/* The home page (draft D, "Black Label", with a hero video). Colours and fonts are set once, here.
   public/app/app.css uses the same colours and fonts. */
:root {
  color-scheme: dark;
  --black: #000;
  --bone: #EFE8DA;         /* main text */
  --bone-soft: #D8D0C0;    /* longer text */
  --champagne: #CDB58A;    /* the metal: focus, pass state, hover */
  --blood: #FF2D3A;        /* the headline's second line and the status dot. 5.7:1 on black */
  --gore: #A8101B;         /* the wordmark's splatter only (decoration, not text): reads on white and on black */
  --muted: #A39A88;        /* small print, 7.5:1 on black */
  --oxblood: #7A1426;      /* the accent: main button and errors. Always a fill behind bone text */
  --oxblood-lit: #B03040;  /* oxblood light enough to work as a 3:1 border on black */
  --raise: #0E0C0A;        /* cards, just above the page (the app) */
  --line: #3A342B;         /* decorative hairlines */
  --line-strong: #74694F;  /* borders of controls, 3.9:1 on black */
  --logo: 'Imbue', 'Bodoni MT', Didot, 'Times New Roman', serif; /* the wordmark, in every pairing */
  /* The type pairing: headline face, text face, and how the headline is set. .typewriter on <html>
     sets the real pairing; these are only the fallbacks. */
  --display: var(--logo);
  --text: 'Jost', 'Century Gothic', 'Segoe UI', system-ui, sans-serif;
  --display-case: none;
  --display-stretch: normal;
  --display-ls: -0.005em;
  --h1-lh: 0.92;
  --h1-k: 1;               /* headline size on landscape screens, as a share of the baseline's */
  --h1-kp: 1;              /* the same on portrait screens */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --slow: 0.8s;
  --gutter: 1.25rem;
  --top-h: 5.5rem;
}
@media (min-width: 900px) {
  :root { --gutter: 4vw; --top-h: 5rem; }
}

/* A typewriter: the headline types itself in and the button is a rubber stamp (see below). The headline
   is sized so it stays left of the bullet hole on landscape screens. */
.typewriter {
  --display: 'Special Elite', 'Courier New', monospace;
  --text: 'Hanken Grotesk', 'Segoe UI', system-ui, sans-serif;
  --display-ls: 0;
  --h1-lh: 1.05;
  --h1-k: 0.8;
  --h1-kp: 0.85;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--bone);
  font: 400 1.0625rem/1.6 var(--text);
  font-synthesis: none; /* single-weight headline faces stay true instead of getting a fake bold */
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; }
::selection { background: var(--oxblood); color: var(--bone); }

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: 60;
  padding: 0.75rem 1rem; background: var(--bone); color: var(--black); font-weight: 600;
}
.skip:focus { top: 0.5rem; }
.i { flex: none; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.25; }

/* The headline face sets the first-screen headline. */
h1 { text-transform: var(--display-case); font-stretch: var(--display-stretch); letter-spacing: var(--display-ls); }
.lede { max-width: 54ch; color: var(--bone-soft); }

/* Buttons. Oxblood with a red edge; turns to solid metal on hover. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.5rem; padding: 0 2.25rem;
  border: 1px solid var(--blood); border-radius: 0;
  background: var(--oxblood); color: var(--bone);
  font: 500 1rem/1 var(--text); letter-spacing: 0.08em; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.btn:hover { background: var(--champagne); color: var(--black); }

/* Top bar and wordmark. The bar lies over the hero video. */
.top {
  position: absolute; inset: 0 0 auto; z-index: 3;
  display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: space-between;
  gap: 0 1.5rem; height: var(--top-h); padding: 0 var(--gutter);
}
.mark { display: inline-flex; align-items: center; min-height: 2.75rem; }
.mark__svg { display: block; width: auto; height: 2.25rem; overflow: visible; }
.mark__t { font: 800 40px var(--logo); font-variation-settings: 'opsz' 20; fill: #fff; }
/* The grey rim lets the hole read where it leaves the letters, over black or the video. */
.mark__hole { fill: var(--black); stroke: #9A9A9A; stroke-width: 0.5; stroke-linejoin: round; }
.mark__crack { fill: none; stroke: var(--black); stroke-width: 0.45; stroke-linecap: round; stroke-linejoin: round; }
.mark__blood { fill: var(--gore); }
.status {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font: 500 0.75rem/1.2 var(--text); letter-spacing: 0.2em; text-transform: uppercase; color: var(--bone);
}
.status__dot { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--blood); }
/* Phones: wordmark and sound toggle on the first line, status below. Wide screens: all on one line. */
.status { order: 1; flex-basis: 100%; }
@media (min-width: 900px) {
  .status { order: 0; flex-basis: auto; margin-left: auto; }
}

/* The first screen is the whole page: one viewport. The video sits in the box below the top bar and is
   always shown whole (contain) on black, which matches its dark edges. Landscape screens get the 16:9
   file. Portrait screens get the 9:16 reel when there is one (.hero--reel), otherwise the 16:9 file as a
   full-width band under the top bar with the copy below it. */
.first { overflow: hidden; overflow: clip; } /* the stamp's jolt moves .hero a few pixels: never let that scroll the page */
.hero {
  /* Width of the rendered 16:9 frame, so the copy can sit on the dark left of the dead screen. */
  --fw: min(100vw, (100svh - var(--top-h)) * 16 / 9);
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--top-h) + 1rem) var(--gutter) 0;
  background: var(--black);
}
/* Sized to the first screen, not to the hero, so a hero that grows (short landscape screens) never pushes
   the bottom of the frame below the fold. */
.hero__media {
  position: absolute; inset: var(--top-h) 0 auto; z-index: -2;
  height: calc(100vh - var(--top-h)); height: calc(100svh - var(--top-h));
}
.hero__media img, .hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain;
}
/* The poster is the video's last frame: it waits, unseen, until the copy is in. */
.hero__poster { transition: opacity 0.9s var(--ease); }
.js:not(.hero-in) .hero__poster { opacity: 0; }
/* Behind the copy, only where the copy sits over the picture. Fades in with the copy. */
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity 0.9s var(--ease); }

.hero__copy { display: grid; gap: 1.25rem; text-shadow: 0 0 1.5rem #000; /* holds up over a bright frame */ }
h1 { font: 800 calc(var(--h1-kp) * clamp(2.4rem, min(12.4vw, 13vh), 5.5rem))/var(--h1-lh) var(--display); }
h1 > span, .type > span { display: block; text-wrap: balance; }
.h1__b { margin-top: 0.08em; color: var(--blood); }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; }
.hero__cta .btn { flex: 1 1 100%; }

/* The icon-only controls: the video control and the sound toggle in the top bar. */
.vctl, .snd {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.75rem; height: 2.75rem; padding: 0;
  border: 1px solid var(--bone); border-radius: 0; background: rgba(0, 0, 0, 0.6); color: var(--bone); cursor: pointer;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.vctl .i, .snd .i { width: 1.125rem; height: 1.125rem; stroke-width: 1.5; stroke-linejoin: round; }
.vctl:hover, .snd:hover { background: var(--champagne); color: var(--black); }
.snd:not(.is-on) .snd__on, .snd.is-on .snd__off { display: none; }
/* Out of the flow so the copy alone sets the height: bottom right of the first screen, or top right on the reel. */
.vctl { position: absolute; right: var(--gutter); top: calc(100svh - 3.5rem); }

@media (orientation: landscape) {
  /* The copy starts just inside the dead screen's top left. VIDEO.md: the dark, clean area of the
     last frame is x 140-780, y 30-490 of 1280x720; the bullet hole and splatter stay clear to the right. */
  .hero {
    padding-top: calc(var(--top-h) + (100svh - var(--top-h) - var(--fw) * 9 / 16) / 2 + var(--fw) * 0.05);
    padding-left: max(var(--gutter), (100vw - var(--fw)) / 2 + var(--fw) * 0.12);
  }
  .hero__copy { max-width: max(22rem, var(--fw) * 0.5); }
  h1 { font-size: calc(var(--h1-k) * max(2rem, var(--fw) * 0.056)); }
}
@media (orientation: portrait) {
  .hero:not(.hero--reel) .hero__media { height: auto; aspect-ratio: 16 / 9; }
  .hero--video:not(.hero--reel) { padding-top: calc(var(--top-h) + 56.25vw + 1.25rem); }
  /* The reel (VIDEO.md, 720x1280 frame): dark wall above the monitor (y 0-400), which takes the top bar;
     monitor and stand y 463-922; dark desk below. The frame is pinned to the top so any spare height adds
     to the space under the stand, and the copy starts just below the stand base (y 940). */
  .hero--reel {
    --fh: min(100svh, 100vw * 16 / 9); /* rendered frame height */
    --rw: calc(var(--fh) * 9 / 16);   /* and width */
    /* Short phones: the copy starts higher, over the dark desk and stand, so headline, text and the whole
       stamp still fit one screen (--copy-room: the copy's height plus a margin; the headline grows with
       the frame width, so it does too. Measured from 360x640 to 768x1024). */
    --copy-room: calc(12rem + var(--rw) * 0.25);
    padding-top: max(calc(var(--top-h) + 0.5rem), min(calc(var(--fh) * 0.735), calc(100svh - var(--copy-room))));
    padding-bottom: 1.25rem; /* room for the tilted stamp's lower corner */
    padding-inline: calc((100vw - var(--rw)) / 2 + var(--gutter));
  }
  .hero--reel .hero__media { top: 0; height: 100vh; height: 100svh; }
  .hero--reel .hero__media img, .hero--reel .hero__video { object-position: 50% 0; }
  .hero--reel .hero__copy { gap: 0.75rem; }
  .hero--reel h1 { font-size: calc(var(--h1-kp) * max(2rem, var(--rw) * 0.093)); }
  .hero--reel .lede { font-size: 0.9375rem; line-height: 1.45; }
  .hero--reel .btn, .typewriter .hero--reel .btn__ink { min-height: 3rem; }
  /* The video control sits on the dark wall, top right, clear of the copy. */
  .hero--reel .vctl { top: calc(var(--top-h) + 0.5rem); }
  .hero--reel::after { background: linear-gradient(transparent calc(var(--fh) * 0.7), rgba(0, 0, 0, 0.7) calc(var(--fh) * 0.78)); }
}

/* While the intro plays, only the wordmark, the status and the icon control show. The copy is in the
   HTML from the start and held back by opacity alone, so screen readers and search engines still read it.
   As the video ends the headline rises in slowly, then the rest follows. "hero-now" (every other way
   in) shows it at once. */
.js:not(.hero-in) .hero--video .drop { opacity: 0; pointer-events: none; }
.js:not(.hero-in) .hero--video::after { opacity: 0; }
.hero-in:not(.hero-now) .hero--video .drop { animation: rise 2.2s var(--ease) both; }
.hero-in:not(.hero-now) .hero--video .lede { animation-duration: 1.2s; animation-delay: 1.7s; }
.hero-in:not(.hero-now) .hero--video .hero__cta { animation-duration: 1.2s; animation-delay: 2s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(1.25rem); }
}

/* Typewriter. app.js puts an aria-hidden copy of the headline in the <h1>, one span per letter, and hides
   the real text from sight only. "typing": letters wait unseen and stamp on as app.js marks them "on";
   the small text and the button wait. "stamped": the button slams down, the page jolts, the small text
   fades in. Every other way in ("hero-now") skips all of it and shows the finished state. */
.type__real {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.type__w { display: inline-block; white-space: nowrap; }
.type__c { display: inline-block; }
.typing .type__c:not(.on) { visibility: hidden; }
.typing .type__c.on { animation: strike 0.14s ease-out; }
@keyframes strike {
  from { transform: scale(1.15); -webkit-text-stroke: 0.04em currentColor; } /* hits hard, a touch more ink */
}
.typing:not(.hero-now) .hero--video h1.drop { animation: none; }
.typing:not(.stamped):not(.hero-now) .hero--video :is(.lede, .hero__cta) { opacity: 0; pointer-events: none; animation: none; }
.stamped:not(.hero-now) .hero--video .hero__cta { animation: none; }
.stamped:not(.hero-now) .hero--video .hero__cta .btn { animation: stamp 0.45s cubic-bezier(0.5, 0, 0.75, 0) backwards; }
.stamped:not(.hero-now) .hero--video .lede { animation: fade 1s 0.6s backwards; }
.stamped:not(.hero-now) .hero--video { animation: jolt 0.3s 0.27s; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-9deg) scale(2.4); filter: blur(6px); }
  60% { opacity: 1; transform: rotate(-5deg) scale(0.95); filter: blur(0); } /* the hit: STAMP_HIT_MS in app.js */
  80% { transform: rotate(-5deg) scale(1.03); }
}
@keyframes jolt {
  30% { transform: translate(0, 4px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(1px, 1px); }
}
@keyframes fade {
  from { opacity: 0; }
}

/* The stamp: red ink on the page, double border, slightly rotated, roughened by the #ink SVG filter. The
   filter sits on the inner span so the focus ring stays clean. Red on the black frame is 5.7:1. */
.defs { position: absolute; width: 0; height: 0; }
.typewriter .hero__cta .btn {
  flex: none; padding: 0; border: 0; background: none; color: var(--blood); transform: rotate(-5deg);
}
.typewriter .btn__ink {
  display: flex; align-items: center; min-height: 3.5rem; padding: 0 1.4rem;
  border: 5px double currentColor;
  font: 600 1.0625rem/1 var(--text); letter-spacing: 0.16em; text-transform: uppercase; /* bold block letters, as on a rubber stamp */
  filter: url(#ink);
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
@media (min-width: 900px) {
  .typewriter .btn__ink { font-size: 1.25rem; padding: 0 1.75rem; }
}
.typewriter .hero__cta .btn:hover { background: none; color: var(--blood); }
.typewriter .hero__cta .btn:hover .btn__ink { background: var(--blood); color: var(--black); }

@media (min-width: 900px) {
  .hero__copy { gap: 1.5rem; }
  .hero__cta .btn { flex: none; }
  .mark__svg { height: 2.5rem; }
}

/* The pre-order menu (static export only). With JavaScript it is a sliding sheet: from below on phones,
   a drawer from the right on wide screens (draft D's waitlist panel). Without it, it follows the first screen. */
html.sheet-open { overflow: hidden; }
.scrim, .sheet__bar { display: none; }
.js .scrim {
  display: block; position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.8); opacity: 0; visibility: hidden;
  transition: opacity var(--slow) var(--ease), visibility 0s linear var(--slow);
}
.sheet-open .scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
.js .sheet {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  background: var(--black); overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); visibility: hidden;
  transition: transform var(--slow) var(--ease), visibility 0s linear var(--slow);
}
.js .sheet.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.js .sheet__bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem; padding: 0 var(--gutter);
  background: var(--black); border-bottom: 1px solid var(--line);
}
.sheet__bar h2 { font: 400 1.25rem/1.1 var(--display); white-space: nowrap; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-width: 2.75rem; height: 2.75rem; padding: 0 1rem;
  border: 1px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--bone);
  font: 500 0.75rem/1 var(--text); letter-spacing: 0.2em; text-transform: uppercase; cursor: pointer;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.ctl:hover { background: var(--champagne); color: var(--black); }
@media (min-width: 900px) {
  .js .sheet { left: auto; width: min(100%, 34rem); border-left: 1px solid var(--line-strong); transform: translateX(100%); }
}

.pre { display: grid; gap: 1rem; align-content: start; padding: 1.25rem var(--gutter) 2rem; }
.pre:focus-visible { outline: none; } /* focus lands here when the sheet opens; it is not a control */
.pre .lede { font-size: 0.9375rem; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.picker { display: grid; gap: 0.75rem; }

/* Tabs: radio buttons drawn as tabs. The plan tabs and the month/year switch pick which card and price show. */
.seg, .tabs { display: flex; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.seg label, .tabs label { position: relative; flex: 1; }
.seg input, .tabs input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span, .tabs span {
  display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 0.4rem;
  border: 1px solid var(--line-strong); text-align: center;
  font: 500 0.75rem/1.15 var(--text); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.seg label + label span { border-left: 0; }
.seg label:has(input:checked) span { background: var(--bone); border-color: var(--bone); color: var(--black); }
.tabs span { border-width: 0 0 1px; }
.tabs label:has(input:checked) span { color: var(--bone); border-bottom: 3px solid var(--blood); }
.seg label:has(input:focus-visible) span, .tabs label:has(input:focus-visible) span { outline: 2px solid var(--champagne); outline-offset: 2px; }

.plan { display: none; gap: 0.75rem; padding: 1.25rem; border: 1px solid var(--line); background: var(--raise); }
.picker:has(.tabs label:nth-of-type(1) input:checked) .plan:nth-of-type(1),
.picker:has(.tabs label:nth-of-type(2) input:checked) .plan:nth-of-type(2),
.picker:has(.tabs label:nth-of-type(3) input:checked) .plan:nth-of-type(3),
.picker:has(.tabs label:nth-of-type(4) input:checked) .plan:nth-of-type(4) { display: grid; }
.picker:has(.seg input[value='month']:checked) .term--year,
.picker:has(.seg input[value='year']:checked) .term--month { display: none; }
@supports not selector(:has(*)) { .plan { display: grid; } } /* old browsers: every card, both prices */
.term { display: grid; gap: 0.6rem; }
.plan__badge { font: 500 0.6875rem/1.2 var(--text); letter-spacing: 0.2em; text-transform: uppercase; color: var(--blood); }
.plan__reg { font-size: 0.8125rem; color: var(--muted); }
.plan__credits { font: 500 0.875rem/1.2 var(--text); letter-spacing: 0.06em; text-transform: uppercase; color: var(--bone-soft); }
.plan__credits strong { font: 400 1.5rem/1 var(--display); letter-spacing: 0; text-transform: none; color: var(--bone); }
.pre__note { font-size: 0.8125rem; color: var(--muted); }
.plan ul { margin: 0; padding-left: 1.1rem; color: var(--bone-soft); font-size: 0.9375rem; line-height: 1.45; }
.plan li + li { margin-top: 0.3rem; }
.plan__price s { color: var(--muted); }
.plan__price strong { font: 400 1.75rem/1 var(--display); color: var(--bone); }
.plan .btn { width: 100%; white-space: normal; text-align: center; padding: 0.75rem 1rem; }
.btn.is-off { opacity: 0.45; cursor: not-allowed; }
.btn.is-off:hover { background: var(--oxblood); color: var(--bone); }
.pre__small { font-size: 0.8125rem; color: var(--muted); }
.pre__small summary { min-height: 2.75rem; display: flex; align-items: center; cursor: pointer; color: var(--bone-soft); }
.pre__small p + p, .pre__small summary + p { margin-top: 0.6rem; }
.pre__legal { display: flex; gap: 1.25rem; }
/* Short phones: the intro line and the credits note step aside (both are in the small print too), so the
   menu still fits one screen. */
@media (max-height: 700px) {
  .pre .lede, .pre__note { display: none; }
  .pre { gap: 0.75rem; padding-top: 0.75rem; }
  .plan { gap: 0.6rem; padding: 1rem; }
}
/* Terms and privacy pages (static export). */
.doc { display: grid; gap: 1rem; max-width: 62ch; margin: 0 auto; padding: 3rem var(--gutter) 4rem; color: var(--bone-soft); }
.doc h1 { font: 400 clamp(2rem, 7vw, 2.75rem)/1.1 var(--display); color: var(--bone); }
.doc h2 { margin: 1rem 0 0; font: 600 1.125rem/1.3 var(--text); color: var(--bone); }
.doc__date { font-size: 0.875rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  /* No playback: the poster stays, and the copy is there from the start. */
  .hero__video { display: none; }
  .hero .drop, .hero::after, .hero__poster { opacity: 1 !important; }
}
