/* Key & Cue, the pitch page.
   Playbill on brushed hardware, outside the login wall. The tokens are the
   app's own (src/platform/styles/tokens.css), copied rather than imported
   so the page stands on its own with no app code and no service worker. */

:root {
  --slate-950: #313d48;
  --slate-900: #475664;
  --slate-850: #3d4a57;
  --slate-800: #354250;
  --slate-700: #51616f;
  --sage: #9daea3;
  --sage-bright: #cdddd3;
  --sage-text: #c8d8cd;
  --sage-dim: rgba(157, 174, 163, 0.16);
  --cream: #e5dcc3;
  --cream-bright: #f2ecd9;
  --cream-dim: rgba(229, 220, 195, 0.14);
  --gold: #c9b98f;
  --gold-deep: #a8945e;
  --nickel: #c9d1d6;
  --nickel-dim: #b4bfc7;
  --text-body: #dfe3e1;
  --line-soft: rgba(226, 233, 236, 0.16);
  --rose: #f0bccb;

  --bg: var(--slate-900);
  --surface: var(--slate-850);
  --surface-raised: var(--slate-800);
  --line: var(--sage);
  --line-strong: var(--sage-bright);
  --text: var(--cream);
  --text-dim: var(--nickel);
  --text-faint: var(--nickel-dim);

  --font-display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: Chivo, "Segoe UI", system-ui, sans-serif;

  --t-display: 38px;
  --t-h1: 27px;
  --t-h2: 21px;
  --t-body: 16px;
  --t-sm: 13.5px;
  --t-micro: 11.5px;
  --lh-display: 1.08;
  --lh-head: 1.22;
  --lh-body: 1.55;
  --tr-display: -0.014em;
  --tr-head: -0.008em;
  --tr-label: 0.1em;

  --s1: 4px; --s2: 8px; --s2h: 12px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 72px; --s8: 112px;
  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-pill: 999px;
  --touch: 44px;

  --weave:
    repeating-linear-gradient(45deg, rgba(240, 245, 247, 0.02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.04) 0 1px, transparent 1px 3px);
  --engrave-sm: 0 0.5px 0 rgba(18, 26, 34, 0.3);
  --engrave: 0 1px 0 rgba(18, 26, 34, 0.42);
  --engrave-deep: 0 1px 0 rgba(18, 26, 34, 0.55), 0 2px 3px rgba(0, 0, 0, 0.22);
  --emboss: inset 0 1px 0 rgba(240, 245, 247, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  --emboss-deep: inset 0 1px 0 rgba(240, 245, 247, 0.1), inset 0 -2px 3px rgba(0, 0, 0, 0.26);
  --struck-ground: rgba(0, 0, 0, 0.22);
  --struck: inset 0 2px 5px rgba(0, 0, 0, 0.38), inset 0 -1px 0 rgba(240, 245, 247, 0.09);
  --foil: linear-gradient(168deg, #fdf6e3 0%, var(--cream-bright) 26%, var(--cream) 58%, var(--gold) 100%);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.26);
  --shadow-3: 0 12px 40px rgba(0, 0, 0, 0.34);
  --focus-ring: 0 0 0 2px var(--slate-900), 0 0 0 4px var(--sage-bright);

  --gutter: clamp(16px, 5vw, 64px);
  --measure: 62ch;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--weave);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: var(--lh-head);
  letter-spacing: var(--tr-head);
  text-wrap: balance;
}
/* The app's ladder stops at 38px because nothing in a rehearsal room is a
   headline. A pitch page has one, so the display rung stretches with the
   viewport, from the app's own 38 up to 56 on a wide screen. */
h1 { font-size: clamp(38px, 5vw, 56px); line-height: var(--lh-display); letter-spacing: var(--tr-display); text-shadow: var(--engrave-deep); }
h2 { font-size: clamp(27px, 3.2vw, 38px); line-height: var(--lh-display); letter-spacing: var(--tr-display); text-shadow: var(--engrave); }
h3 { font-size: var(--t-h2); text-shadow: var(--engrave-sm); }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--s3); }
.lead { font-size: var(--t-body); line-height: 1.6; color: var(--text-body); max-width: var(--measure); }
em { font-style: italic; }
strong { color: var(--text); font-weight: 700; }
a { color: var(--sage-text); text-decoration: none; }
a:hover { color: var(--sage-bright); }
img { display: block; max-width: 100%; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(157, 174, 163, 0.35); color: var(--cream-bright); }
:root { accent-color: var(--sage); caret-color: var(--sage); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--slate-950); }
::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 6px; border: 3px solid var(--slate-950); }
::-webkit-scrollbar-thumb:hover { background: var(--sage); }

.skip {
  position: absolute; left: var(--s3); top: -60px;
  padding: var(--s2) var(--s3); background: var(--slate-950); color: var(--cream);
  border-radius: var(--radius); z-index: 10;
}
.skip:focus { top: var(--s3); }

/* ── controls, in the app's own vocabulary ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); padding: 0 var(--s4);
  border-radius: var(--radius-pill); border: 1px solid var(--line-soft);
  background: var(--surface-raised); color: var(--text-body);
  font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.01em;
  box-shadow: var(--emboss);
  transition: background-color 0.15s, color 0.15s, transform 0.08s;
  white-space: nowrap;
}
.btn:hover { background: var(--slate-700); color: var(--text); }
.btn:active { transform: translateY(1px); box-shadow: var(--emboss-deep); }
.btn-ghost { background: transparent; color: var(--text-dim); box-shadow: none; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-raised); color: var(--text-body); }
.btn-foil {
  background: var(--foil); color: var(--slate-950); border-color: var(--gold-deep);
  box-shadow: var(--emboss), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.btn-foil:hover { background: linear-gradient(168deg, #fffdf4 0%, #fdf6e3 30%, var(--cream-bright) 62%, var(--gold) 100%); color: var(--slate-950); }
.btn-lg { min-height: 52px; padding: 0 var(--s5); font-size: var(--t-body); }

.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 var(--s2h);
  border-radius: var(--radius-pill); background: var(--cream-dim); color: var(--cream);
  font-size: var(--t-micro); font-weight: 700; letter-spacing: var(--tr-label); text-transform: uppercase;
}

/* ── the masthead ───────────────────────────────────────────────── */
.masthead {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--gutter);
  border-bottom: 1px solid var(--line-soft);
  background: var(--slate-950);
  box-shadow: var(--emboss);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2h); flex: 0 0 auto; }
.brand-owl { width: 44px; height: auto; }
.brand-word { width: 196px; height: auto; }
.masthead-nav { display: flex; gap: var(--s1); margin-left: auto; }
.masthead-nav a {
  display: inline-flex; align-items: center; min-height: var(--touch); padding: 0 var(--s3);
  border-radius: var(--radius); color: var(--text-dim); font-size: var(--t-sm); font-weight: 500;
}
.masthead-nav a:hover { background: var(--surface-raised); color: var(--text-body); }
.masthead-cta { flex: 0 0 auto; }

/* ── frames: a screen recessed into the hardware ───────────────── */
.frame {
  margin: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--slate-950);
  padding: 6px;
  /* A screen sunk into the hardware: struck, never cast. Depth goes down. */
  box-shadow: var(--struck);
}
.frame img { border-radius: var(--radius); }
.frame figcaption {
  padding: var(--s2h) var(--s2) var(--s1);
  color: var(--text-faint); font-size: var(--t-sm); line-height: 1.4;
}
/* A crop is a window onto part of a screen: --x/--y say where the window's
   top-left sits on the image, as fractions, and --w how much of the image's
   width it shows. The image is laid at 1/--w of the frame and slid. */
.frame-crop { aspect-ratio: 16 / 9; overflow: hidden; position: relative; padding: 0; }
.frame-crop img {
  position: absolute; top: 0; left: 0; max-width: none;
  width: calc(100% / var(--w, 1)); height: auto;
  transform: translate(calc(-100% * var(--x, 0)), calc(-100% * var(--y, 0)));
  border-radius: 0;
}

/* ── the hero ───────────────────────────────────────────────────── */
.hero {
  padding: var(--s7) var(--gutter) var(--s8);
  display: grid; gap: var(--s4);
  grid-template-areas: "copy" "frame" "keys" "note";
}
.hero-copy { grid-area: copy; max-width: 720px; }
.hero-copy h1 { max-width: 14ch; }
.hero-copy .lead { margin-top: var(--s4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2h); margin-top: var(--s5); }
.hero-note { grid-area: note; color: var(--text); font-size: var(--t-sm); max-width: none; text-align: center; }
/* The three names the app is made of, set under the screen like the facts
   under the mechanism: what Key is, what Cue is, who Jasper is. */
.hero-keys {
  grid-area: keys; display: grid; gap: var(--s4); margin: 0;
  padding-top: var(--s4); border-top: 1px solid var(--line-soft);
}
@media (min-width: 720px) { .hero-keys { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); } }
.hero-keys dt { font-family: var(--font-display); font-weight: 700; font-size: var(--t-h2); color: var(--text); text-shadow: var(--engrave-sm); }
.hero-keys dd { margin: var(--s2) 0 0; color: var(--text-dim); }
.frame-hero { grid-area: frame; max-width: 1180px; }
@media (min-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "copy frame" "keys keys" "note note"; column-gap: var(--s6); align-items: center; }
  .hero-keys { margin-top: var(--s3); }
}

/* ── the first few things to do ─────────────────────────────────── */
/* The order is the information: these happen in this sequence, so each step
   carries its number, set small in the display face above the heading. */
.path { border-top: 1px solid var(--line-soft); }
.path-head { max-width: 760px; margin-bottom: var(--s6); }
.path-head .lead { margin-top: var(--s3); }
.path-steps { counter-reset: path; }
.path-steps .step { counter-increment: path; }
.path-steps .step-copy h3::before {
  content: counter(path);
  display: block; margin-bottom: var(--s2);
  font-family: var(--font-display); font-weight: 700; font-size: var(--t-h2);
  color: var(--sage); text-shadow: var(--engrave-sm);
}
/* A frame not yet captured: the shot described in the place it will fill,
   for review. Dashed, so it can never pass for the real thing. */
.frame-plan {
  /* Width from the column, height from the width: an aspect ratio on a box
     whose height comes from its text would size the width from the text
     instead, and did, to 1800px. */
  width: 100%; min-width: 0; box-sizing: border-box; aspect-ratio: 16 / 9; overflow: auto;
  display: grid; align-content: center; gap: var(--s2);
  padding: var(--s4); border: 1px dashed var(--sage); background: var(--slate-900); box-shadow: none;
}
@media (max-width: 600px) { .frame-plan { aspect-ratio: auto; min-height: 180px; padding: var(--s3); } }
.plan-label { font-size: var(--t-micro); font-weight: 700; letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--sage-text); }
.plan-what { margin: 0; font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text); line-height: 1.3; }
.plan-how { margin: 0; color: var(--text-dim); font-size: var(--t-sm); line-height: 1.45; }

/* ── the mechanism ──────────────────────────────────────────────── */
section { padding: var(--s8) var(--gutter); }
.how { border-top: 1px solid var(--line-soft); }
.how-head, .walk-head, .kept-head { max-width: 760px; margin-bottom: var(--s6); }
.how-head .lead, .walk-head .lead, .kept-head .lead { margin-top: var(--s3); }
.how-pair { display: grid; gap: var(--s4); align-items: center; }
.how-arrow { color: var(--sage); justify-self: center; transform: rotate(90deg); }
@media (min-width: 900px) {
  .how-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .how-arrow { transform: none; }
}
.how-facts {
  display: grid; gap: var(--s4); margin: var(--s6) 0 0;
  padding-top: var(--s5); border-top: 1px solid var(--line-soft);
}
@media (min-width: 720px) { .how-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); } }
.how-facts dt { font-family: var(--font-display); font-weight: 700; font-size: var(--t-h2); color: var(--text); text-shadow: var(--engrave-sm); }
.how-facts dd { margin: var(--s2) 0 0; color: var(--text-dim); }

/* ── one scene, everything hangs off it ─────────────────────────── */
.walk { background: var(--slate-850); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); box-shadow: var(--emboss); }
.walk-grid { display: grid; gap: var(--s6); }

.steps { display: grid; gap: var(--s7); counter-reset: none; }
.step { display: grid; gap: var(--s4); }
.step-copy { max-width: 56ch; }
.step-copy p { margin-top: var(--s2h); color: var(--text-body); }
@media (min-width: 1200px) {
  .step { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
}

/* ── the rehearsal, kept ─────────────────────────────────────────── */
.kept-lead { display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 1000px) { .kept-lead { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); } }
.kept-lead-copy { max-width: 48ch; }
.kept-lead-copy p { margin-top: var(--s2h); }
.kept-list {
  margin-top: var(--s7); padding-top: var(--s5); border-top: 1px solid var(--line-soft);
  display: grid; gap: var(--s5) var(--s6);
}
@media (min-width: 720px) { .kept-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .kept-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kept-list p { margin-top: var(--s2); color: var(--text-dim); }

/* ── Jasper ─────────────────────────────────────────────────────── */
.jasper {
  background: var(--slate-950); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--struck);
  display: grid; gap: var(--s5);
}
@media (min-width: 900px) { .jasper { grid-template-columns: 200px minmax(0, 1fr); gap: var(--s7); } }
.jasper-mark img { width: 120px; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)); }
.jasper-copy { max-width: 720px; }
.jasper-copy .lead { margin-top: var(--s3); }
.jasper-copy > p:not(.lead) { margin-top: var(--s3); color: var(--text-dim); }
.doors { margin-top: var(--s5); display: flex; flex-wrap: wrap; gap: var(--s2); }
.doors li {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; padding: 0 var(--s3);
  border-radius: var(--radius-pill); border: 1px solid var(--line-soft); background: var(--surface-raised);
  color: var(--text-body); font-size: var(--t-sm); font-weight: 500; box-shadow: var(--emboss);
}
/* Every door wears the marker the app gives it: the owl. */
.doors li::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto;
  background: url(/welcome/brand/jasper.png) center / contain no-repeat; opacity: 0.85;
}

/* ── the index ───────────────────────────────────────────────────── */
.index h2 { margin-bottom: var(--s6); }
.index-grid { display: grid; gap: var(--s5) var(--s6); }
@media (min-width: 720px) { .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .index-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.index-grid h3 { padding-bottom: var(--s2); border-bottom: 1px solid var(--line-soft); }
.index-grid p { margin-top: var(--s2h); color: var(--text-dim); font-size: var(--t-sm); line-height: 1.5; }

/* ── the door ────────────────────────────────────────────────────── */
.access { padding-top: var(--s6); }
.access-plate {
  max-width: 760px; margin: 0 auto; text-align: center;
  padding: var(--s7) var(--gutter);
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--slate-850); box-shadow: var(--emboss);
}
.access-plate .lead { margin: var(--s3) auto 0; }
.access-plate .btn { margin-top: var(--s5); }

/* ── the foot ────────────────────────────────────────────────────── */
.foot {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s5) var(--gutter) var(--s6);
  border-top: 1px solid var(--line-soft);
  color: var(--text-dim); font-size: var(--t-sm); font-variant-numeric: tabular-nums;
}
.foot-owl { width: 26px; height: auto; opacity: 0.8; }
.foot a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 0.15em; }
.foot a:hover { color: var(--text); }

/* ── small screens ───────────────────────────────────────────────── */
@media (max-width: 720px) {
  section { padding: var(--s7) var(--gutter); }
  /* On a phone the first viewport must carry the headline, the screen and
     its staging caption together: the rhythm tightens by a rung each. */
  .hero { padding-top: var(--s4); padding-bottom: var(--s7); gap: var(--s3); }
  .hero-copy .lead { margin-top: var(--s3); }
  .hero-actions { margin-top: var(--s4); }
  .hero-note { margin-top: var(--s2); }
  .masthead { gap: var(--s2h); }
  .masthead-nav { display: none; }
  .brand-word { width: 150px; }
  .brand-owl { width: 34px; }
  .frame { padding: 4px; }
  .frame img { border-radius: var(--radius); }
  .hero-actions .btn { flex: 1 1 auto; }
  .access-plate { padding: var(--s6) var(--s4); }
  .access-plate .btn { white-space: normal; text-align: center; min-height: 52px; padding: var(--s2) var(--s4); }
}
