/* Version 2 fixes shared by every page, from the 2026-11-14 critiques and audit.
   Loads last on every v2 page. */

/* State colours as tokens (gold drafted, green done, coral problem), and the old sky
   blue remapped to mushroom so no focus ring or link uses it. */
:root {
  --st-draft: #f2c14e;
  --st-done: #7fd6a4;
  --st-done-text: #9be3b8;
  --st-problem: #f08a6c;
  --sky: var(--mushroom);
}

/* One focus ring everywhere: 2px mushroom. */
:is(a, button, summary, [tabindex], select):focus-visible { outline: 2px solid var(--mushroom); outline-offset: 3px; border-radius: 4px; }
form.join :is(input, select, textarea):focus { outline: 2px solid var(--mushroom); outline-offset: 1px; border-color: transparent; }
::selection { background: rgb(216 195 154 / 0.38); color: var(--ink); }
input, textarea { caret-color: var(--mushroom); }

/* Skip link: hidden until focused. */
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 0.9rem; border-radius: 8px; background: var(--ink); color: #14261b; font-weight: 600; }
.skip:focus-visible { top: 0.8rem; }

/* Header: a cream hairline, and a row that can grow when text is enlarged. */
.nav { border-bottom-color: rgb(242 234 217 / 0.12); }
.nav-row { height: auto; min-height: 4rem; flex-wrap: wrap; row-gap: 0.4rem; padding-block: 0.4rem; }
.nav-links { flex-wrap: wrap; row-gap: 0.3rem; }
.brand-name { white-space: nowrap; }

/* Anchors land below the sticky header (one row on desktop, two on phones). */
[id] { scroll-margin-top: 84px; }
@media (max-width: 960px) {
  [id] { scroll-margin-top: 136px; }
  /* Role row: 44px tap targets and a faded edge that says it scrolls. */
  .role-row { padding: 0.15rem 0 0.25rem; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .role-row a { min-height: 44px; }
}

/* Hero app card: readable on phones. */
.ui-card { font-size: max(12px, calc(2.3 * var(--u))); }

/* Small scene text: never below about 12px on a phone, and at least 4.5:1. */
.rs-t3 { fill: rgb(242 234 217 / 0.74); }
@media (max-width: 560px) {
  .scene-svg :is(.rt-gk, .rv-hl-t, .sc-label-s) { font-size: 12px; }
}
.lq-narrow .lq-win-t { font-size: 11.5px; }

/* Waitlist fields: label, field and error as siblings, so the error isn't read as part
   of the label. */
.lq-field { display: grid; gap: 0.35rem; font-size: 0.82rem; color: var(--ink-2); align-content: start; }
.lq-field.wide { grid-column: 1 / -1; }
.lq-redo { margin-top: 0.6rem; padding: 0; border: 0; background: none; font: inherit; font-size: 0.85rem; color: var(--ink-2); text-decoration: underline; text-decoration-color: rgb(216 195 154 / 0.6); text-underline-offset: 0.3em; cursor: pointer; }
.lq-redo:hover { color: var(--ink); }
form.join .fine { color: var(--ink-2); }

/* The 1-2-3's phone step bar: 44px tall tap targets. */
.lq-steps button { height: 44px; }
.lq-steps button::before, .lq-steps i { top: 20px; }

/* Tiles leave room for the arrow when text is enlarged. */
.lq-tile b { padding-right: 2rem; overflow-wrap: anywhere; }

/* Phones: a smaller gnome stage, so the hero card and the first scene come sooner. */
@media (max-width: 640px) {
  .gnome-stage { max-width: 300px; }
}

/* Mid-width screens: tighter menu spacing so the longer role labels and the waitlist
   button stay on one line. */
@media (min-width: 961px) and (max-width: 1180px) {
  .nav-row { column-gap: 1.25rem; }
  .nav-links { gap: 1.05rem; font-size: 0.86rem; }
}
/* 961-1100px: too narrow for the menu in one line, so it moves to the second row the
   phones use (the landing page keeps its one-row header; its tiles are the menu). */
@media (min-width: 961px) and (max-width: 1100px) {
  .nav-links { display: none; }
  .role-row { display: flex; gap: 1.25rem; align-items: baseline; padding: 0.15rem 0 0.25rem; border-top: 1px solid var(--edge-soft); font-size: 0.86rem; color: var(--ink-2); white-space: nowrap; }
  .role-row a { min-height: 44px; display: inline-flex; align-items: center; }
  .role-row a:hover { color: var(--ink); }
  .role-row a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--mushroom); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
  .role-row .nav-k { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .lq2 .role-row { display: none; }
  [id] { scroll-margin-top: 136px; }
}

/* After the 1-2-3: one line that hands over to the examples below it, set as a small
   headline so it reads as the start of what follows. The whole line scrolls to the first
   scene. */
.lq-handoff { margin: clamp(2.2rem, 5vh, 3.2rem) 0 0; text-align: center; text-wrap: balance; }
.lq-handoff a { display: inline-flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 0.4rem 0.6rem; font-family: var(--font-display); font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72; font-weight: 600; font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.lq-handoff svg { width: 1.7rem; height: 1.7rem; color: var(--mushroom); stroke-width: 2; transition: transform 0.3s var(--ease-out); }
.lq-handoff a:hover svg { transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .lq-handoff svg { transition: none; } }

/* v3 (motion audit): the handoff arrow nudges down twice the first time it comes into view,
   then rests. The class is added by role-page.js. */
.lq-handoff.cue svg { animation: lq-nudge 0.75s cubic-bezier(0.45, 0, 0.25, 1) 0.25s 2; }
@keyframes lq-nudge { 0%, 100% { transform: none; } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .lq-handoff.cue svg { animation: none; } }

/* ---- v4: the 2026-11-15 polish pass ---- */

/* Hero card: its text is sized from the gnome stage, which is only ~300px wide on phones,
   so it came out at 7-8px. On phones and tablets it now has a 12px floor and a little more
   width to hold it. */
@media (max-width: 960px) {
  .ui-card.held { font-size: max(13px, calc(2.9 * var(--u))); width: 88%; left: -10%; }
  .ui-card.held .uc-row { font-size: max(12px, 0.92em); }
  .ui-card.held .uc-k, .ui-card.held .uc-src { font-size: max(12px, 0.82em); }
}

/* Tablets (561-960px): the 1-2-3 uses its phone layout in a centred column instead of the
   three-panel desktop drawing shrunk until its labels were 7-9px. */
/* The limit goes on the scene itself: scenes choose their layout from their own width when
   they're drawn, before the Replay wrapper exists. */
@media (min-width: 561px) and (max-width: 960px) {
  .lq-steps-sec :is(.scene, .scene-wrap) { width: 100%; max-width: 440px; margin-inline: auto; }
  :is([data-role="groups"] .scene-sec, .scene-sec.wide) :is(.scene, .scene-wrap) { width: 100%; max-width: 520px; margin-inline: auto; }
}

/* Phones: the small labels inside drawings reach 12px (they were 10.7-11.4px). */
@media (max-width: 560px) {
  .scene-svg :is(.lq-win-t, .lq-colk, .on-k, .rt-gk, .rv-hl-t, .rs-col-k) { font-size: 12.4px; }
  svg.scene-svg .sc-label-s { font-size: 13.4px; }
  .cal em { font-size: 0.8rem; }
}

/* Paragraphs don't end on a single word. */
p { text-wrap: pretty; }

/* v4: the phone 1-2-3's text is about 20% larger (it was 11-13px beside 18px body text).
   Its panels are taller to hold it (role-steps.js). */
/* Stacked on phones (each step its own full-width box), so the text can be larger still. */
.lq-narrow .rs-t3, .lq-narrow .lq-item { font-size: 17.5px; }
.lq-narrow .sc-q-t { font-size: 15.5px; }
.lq-narrow .lq-name { font-size: 16.5px; }
.lq-narrow .rs-ok, .lq-narrow .lq-btn-t { font-size: 15px; }
.lq-narrow .rs-col-k { font-size: 14.5px; }
.lq-narrow .lq-win-t { font-size: 14px; }
.lq-narrow .lq-colk { font-size: 12.4px; }

/* v4: on tablets the 3D gnome's viewer box reaches below the hero and covered the 1-2-3's
   step buttons; the 1-2-3 sits above it. */
.lq-steps-sec { position: relative; z-index: 4; }

/* A failed send: one line above the button. */
.lq-send-err { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; color: #ffb3a6; }
.lq-send-err:empty { display: none; }
