/* ============================================================
   Edvidi — one product, one stylesheet.
   Warm print-shop editorial: ink on paper, cobalt accents,
   Fraunces display over Schibsted Grotesk, mono timestamps.
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-grotesk.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Spline Sans Mono';
  src: url('/fonts/spline-sans-mono.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f5efe2;
  --paper-high: #fdfaf1;
  --paper-dim: #ece4d2;
  --ink: #211c13;
  --ink-soft: #6b6250;
  --line: #d9cfb8;
  --cobalt: #2b44d8;
  --cobalt-deep: #1d2f9e;
  --cobalt-wash: #e4e7fa;
  --moss: #2e7a4c;
  --moss-wash: #dfeee0;
  --rust: #b23f2a;
  --rust-wash: #f6e2da;
  --amber: #eaa819;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Schibsted Grotesk', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --font-mono: 'Spline Sans Mono', 'SF Mono', Menlo, monospace;

  --radius: 14px;
  --radius-small: 9px;
  --shadow-pop: 0 3px 0 var(--ink);
  --shadow-card: 0 6px 0 rgba(33, 28, 19, 0.14);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.4, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Paper grain over everything, gently. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--cobalt); color: var(--paper-high); }

button, input, textarea { font: inherit; color: inherit; }

a { color: var(--cobalt); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--cobalt-deep); }

:focus-visible {
  outline: 2.5px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ------------------------------------------------------------ type */

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.display {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-optical-sizing: auto;
  font-weight: 560;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.accent-word {
  font-style: italic;
  font-weight: 480;
  color: var(--cobalt);
}

.time-chip {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cobalt-deep);
  background: var(--cobalt-wash);
  border: 1.5px solid var(--cobalt);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  white-space: nowrap;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.62rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-high);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 130ms var(--ease-spring), box-shadow 130ms var(--ease-spring),
    background 130ms;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary { background: var(--cobalt); color: var(--paper-high); }
.btn-primary:hover { background: var(--cobalt-deep); color: var(--paper-high); }

.btn-quiet {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
  color: var(--ink-soft);
}
.btn-quiet:hover { transform: none; box-shadow: none; color: var(--ink); background: var(--paper-dim); }

.btn-danger-quiet { color: var(--rust); }
.btn-danger-quiet:hover { color: var(--rust); background: var(--rust-wash); }

.btn-small { font-size: 0.84rem; padding: 0.4rem 0.9rem; border-width: 1.5px; }

/* ------------------------------------------------------------ fields */

.field {
  width: 100%;
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  transition: box-shadow 130ms;
}
.field::placeholder { color: #857b64; }
.field:focus { outline: none; box-shadow: 0 0 0 3px var(--cobalt-wash), var(--shadow-pop); }

textarea.field { resize: vertical; min-height: 5.2em; line-height: 1.5; }

.field-error {
  color: var(--rust);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------ masthead */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 620;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark svg { display: block; }
.wordmark:hover { color: var(--ink); }
.wordmark:hover .mark-tile { transform: rotate(-6deg); }
.mark-tile { transition: transform 200ms var(--ease-spring); transform-origin: center; }

.masthead-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ landing */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  padding: clamp(2rem, 6vh, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(2.5rem, 7vh, 5.5rem);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.3rem);
  margin: 0.9rem 0 1.1rem;
}

.hero-sub {
  font-size: clamp(1.02rem, 1.6vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 34em;
  margin-bottom: 1.8rem;
}
.hero-sub strong { color: var(--ink); font-weight: 700; }

.create-row {
  display: flex;
  gap: 0.7rem;
  max-width: 34rem;
}
.create-row .field { flex: 1; font-size: 1.02rem; padding: 0.78rem 1rem; }
.create-row .btn { flex-shrink: 0; }

.hero-fine {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.hero-fine a { font-weight: 600; }

/* — the self-playing miniature — */

.demo-min {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper-high);
  box-shadow: 0 8px 0 var(--ink);
  padding: 0.9rem;
  transform: rotate(1.2deg);
}

.demo-caption {
  position: absolute;
  top: -1.05rem;
  right: 1.4rem;
  background: var(--amber);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.7rem;
  transform: rotate(-2deg);
  box-shadow: 0 2px 0 var(--ink);
}

.demo-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  overflow: hidden;
  background: #0d1333;
}
.demo-scene { position: absolute; inset: 0; width: 100%; height: 100%; }

/* the sky churns, the stars breathe, a window flickers */
.swirl { transform-box: fill-box; transform-origin: center; animation: swirl 26s linear infinite; }
.swirl-b { animation-duration: 18s; animation-direction: reverse; }
@keyframes swirl { to { transform: rotate(360deg); } }
.star { animation: twinkle 3.4s ease-in-out infinite; }
.star-2 { animation-delay: 0.9s; }
.star-3 { animation-delay: 1.7s; }
.star-4 { animation-delay: 2.4s; }
@keyframes twinkle { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
.window { animation: flicker 5.2s ease-in-out infinite; }
.win-2 { animation-delay: 2.1s; }
@keyframes flicker { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

.demo-transport {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.25rem 0.1rem;
}

.demo-play {
  width: 26px; height: 26px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-high);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.demo-play svg { display: block; }

.demo-track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
}
.demo-progress {
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 8%;
  background: var(--cobalt);
  border-radius: 999px;
  animation: demo-progress 16s linear infinite;
}
@keyframes demo-progress {
  0% { width: 8%; }
  16% { width: 34%; }   /* reaches question 1, pauses */
  44% { width: 34%; }
  62% { width: 78%; }   /* reaches question 2, pauses */
  88% { width: 78%; }
  99%, 100% { width: 97%; }
}

.demo-pip {
  position: absolute;
  top: 50%;
  width: 11px; height: 11px;
  translate: -50% -50%;
  rotate: 45deg;
  background: var(--paper-high);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.demo-pip-1 { left: 34%; animation: demo-pip-1 16s linear infinite; }
.demo-pip-2 { left: 78%; animation: demo-pip-2 16s linear infinite; }
@keyframes demo-pip-1 {
  0%, 40% { background: var(--paper-high); border-color: var(--ink); }
  44%, 100% { background: var(--moss); border-color: var(--moss); }
}
@keyframes demo-pip-2 {
  0%, 84% { background: var(--paper-high); border-color: var(--ink); }
  88%, 100% { background: var(--moss); border-color: var(--moss); }
}

.demo-mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.demo-card {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 4.4rem;
  background: var(--paper-high);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 0.85rem 1rem 0.95rem;
  translate: 0 135%;
  opacity: 0;
}
.demo-card-1 { animation: demo-card-1 16s var(--ease-spring) infinite; }
.demo-card-2 { animation: demo-card-2 16s var(--ease-spring) infinite; }
@keyframes demo-card-1 {
  0%, 12% { translate: 0 135%; opacity: 0; }
  16%, 39% { translate: 0 0; opacity: 1; }
  43%, 100% { translate: 0 135%; opacity: 0; }
}
@keyframes demo-card-2 {
  0%, 59% { translate: 0 135%; opacity: 0; }
  63%, 83% { translate: 0 0; opacity: 1; }
  87%, 100% { translate: 0 135%; opacity: 0; }
}

/* card 2: an open answer types itself, then sends */
.demo-typed {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.55rem;
  min-height: 1.9em;
}
.demo-typed span {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  max-width: 100%;
  border-right: 2px solid var(--cobalt);
  width: 0;
  animation: demo-type 16s linear infinite;
}
@keyframes demo-type {
  0%, 66% { width: 0; animation-timing-function: steps(24, end); }
  76%, 100% { width: 100%; }
}
.demo-send {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--paper-high);
  background: var(--cobalt);
  border: 1.5px solid var(--cobalt-deep);
  border-radius: 999px;
  padding: 0.22rem 0.8rem;
  box-shadow: 0 2px 0 var(--cobalt-deep);
  animation: demo-send 16s linear infinite;
}
@keyframes demo-send {
  0%, 79% { transform: none; background: var(--cobalt); }
  80%, 83% { transform: translateY(2px) scale(0.97); background: var(--cobalt-deep); box-shadow: 0 0 0 var(--cobalt-deep); }
  84%, 100% { transform: none; background: var(--cobalt); }
}

.demo-q {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0.3rem 0 0.6rem;
}

.demo-opts { display: grid; gap: 0.4rem; }
.demo-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 0.32rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--paper-high);
}
.demo-opt b {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  width: 17px; height: 17px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.demo-opt-b { animation: demo-opt-pick 16s linear infinite; }
.demo-opt .demo-tick { margin-left: auto; opacity: 0; color: var(--moss); font-weight: 800; }
.demo-opt-b .demo-tick { animation: demo-tick 16s linear infinite; }
@keyframes demo-opt-pick {
  0%, 24% { border-color: var(--line); background: var(--paper-high); }
  27%, 31% { border-color: var(--cobalt); background: var(--cobalt-wash); }
  34%, 100% { border-color: var(--moss); background: var(--moss-wash); }
}
@keyframes demo-tick {
  0%, 32% { opacity: 0; }
  35%, 100% { opacity: 1; }
}

/* — steps — */

.steps {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(1rem, 4vw, 2.5rem) clamp(3rem, 8vh, 5rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.5vw, 2rem);
}

/* The steps section is the grid, so its heading has to span every column. */
.steps-title {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: -0.6rem;
}

.step {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}
.step-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--cobalt);
}
.step h3 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-size: 1.45rem;
  font-weight: 600;
  margin: 0.2rem 0 0.35rem;
}
.step p { color: var(--ink-soft); font-size: 0.95rem; max-width: 26em; }

/* — your videos — */

.mine {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(1rem, 4vw, 2.5rem) clamp(3rem, 8vh, 5rem);
}
.mine h2 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
/* minmax(0,1fr) — without it the column sizes to the row's min-content, and a
   long unbreakable title drags the whole page sideways. */
.mine-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.7rem; max-width: 44rem; }
.mine-item {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 1rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  padding: 0.7rem 1rem;
  box-shadow: 0 3px 0 rgba(33, 28, 19, 0.12);
}
.mine-item .title { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-item nav { display: flex; gap: 0.9rem; flex-shrink: 0; font-size: 0.9rem; font-weight: 600; }

/* — faq — */

.faq {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  padding: 0 clamp(1rem, 4vw, 2.5rem) clamp(3rem, 8vh, 5rem);
}
.faq-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  border-top: 2px solid var(--ink);
  padding-top: 1.1rem;
  margin-bottom: 1.4rem;
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem clamp(1.5rem, 4vw, 3.5rem);
}
.faq-item {
  border-top: 1.5px dashed var(--line);
  padding-top: 0.9rem;
}
.faq-item h3 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-size: 1.12rem;
  font-weight: 620;
  margin-bottom: 0.3rem;
}
.faq-item p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  max-width: 34em;
}
/* The closing answer spans both columns so it reads as a deliberate sign-off
   rather than an orphan in the left-hand column. */
.faq-item-wide { grid-column: 1 / -1; }
.faq-item-wide p { max-width: 62em; }

@media (max-width: 780px) {
  .faq-grid { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* — footer — */

.footer {
  margin-top: auto;
  border-top: 2px solid var(--ink);
  padding: 1.3rem clamp(1rem, 4vw, 2.5rem) 1.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.footer .foot-word { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.foot-credit { white-space: nowrap; }
.foot-credit a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--cobalt);
  transition: color 130ms;
}
.foot-credit a:hover { color: var(--cobalt); }
.foot-dot { color: var(--cobalt); font-weight: 800; margin: 0 0.15rem; }

/* ------------------------------------------------------------ stage & transport (shared) */

.stage {
  position: relative;
  background: #0e0c08;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.stage .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0e0c08;
}
.stage iframe, .stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Keep all clicks on our transport, not YouTube's surface. */
.stage .frame::after { content: ''; position: absolute; inset: 0; }

.transport {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--paper-high);
  border-top: 2px solid var(--ink);
  user-select: none;
}

.tbtn {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-high);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 120ms var(--ease-spring), box-shadow 120ms;
}
.tbtn:hover { transform: translateY(-1.5px); box-shadow: 0 3.5px 0 var(--ink); }
.tbtn:active { transform: translateY(1px); box-shadow: 0 0.5px 0 var(--ink); }
.tbtn svg { display: block; }
.tbtn-play { background: var(--cobalt); border-color: var(--cobalt-deep); box-shadow: 0 2px 0 var(--cobalt-deep); color: var(--paper-high); }
.tbtn-play:hover { box-shadow: 0 3.5px 0 var(--cobalt-deep); }
.tbtn-play:active { box-shadow: 0 0.5px 0 var(--cobalt-deep); }
.tbtn-ghost { width: 34px; height: 34px; border-width: 1.5px; box-shadow: none; background: transparent; border-color: transparent; color: var(--ink-soft); }
.tbtn-ghost:hover { color: var(--ink); background: var(--paper-dim); box-shadow: none; transform: none; }

/* captions */

.cc-wrap { position: relative; display: flex; align-items: center; gap: 0.1rem; flex-shrink: 0; }
.tbtn-cc.on { color: var(--cobalt); background: var(--cobalt-wash); }
.tbtn-cc-more { width: 22px; height: 34px; }
.tbtn-cc-more[hidden] { display: none; }

.cc-pop {
  position: absolute;
  bottom: calc(100% + 0.6rem);
  right: 0;
  width: 12.5rem;
  background: var(--paper-high);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  box-shadow: 0 5px 0 var(--ink);
  padding: 0.5rem;
  z-index: 40;
  animation: rise-in 200ms var(--ease-spring);
}
.cc-head {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.2rem 0.45rem 0.3rem;
}
.cc-group { display: flex; flex-direction: column; }
.cc-group + .cc-head { margin-top: 0.35rem; border-top: 1.5px dashed var(--line); padding-top: 0.5rem; }
.cc-langs { max-height: 11rem; overflow-y: auto; }
.cc-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 0.32rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}
.cc-row:hover { background: var(--paper-dim); }
.cc-row[aria-checked='true'] { color: var(--cobalt-deep); }
.cc-tick {
  width: 0.9em;
  flex-shrink: 0;
  font-weight: 800;
  color: var(--cobalt);
}

.t-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-soft);
  flex-shrink: 0;
  min-width: 6.4em;
  text-align: center;
}
.t-time b { color: var(--ink); font-weight: 600; }

.t-track-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.t-pips {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.t-track {
  position: relative;
  flex: 1;
  height: 26px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.t-rail {
  position: relative;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  overflow: visible;
}
.t-buffer, .t-fill {
  position: absolute;
  inset: -1px auto -1px -1px;
  border-radius: 999px;
  pointer-events: none;
}
.t-buffer { background: var(--line); width: 0; }
.t-fill { background: var(--cobalt); width: 0; }
.t-head {
  position: absolute;
  top: 50%;
  width: 15px; height: 15px;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--paper-high);
  border: 2.5px solid var(--cobalt);
  box-shadow: 0 1.5px 0 rgba(33, 28, 19, 0.4);
  pointer-events: none;
  transition: transform 120ms var(--ease-spring);
}
.t-track:hover .t-head { transform: scale(1.25); }

.t-pip {
  position: absolute;
  top: 50%;
  width: 12px; height: 12px;
  translate: -50% -50%;
  rotate: 45deg;
  border-radius: 3px;
  background: var(--paper-high);
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: background 200ms, border-color 200ms, scale 150ms var(--ease-spring);
  z-index: 2;
  pointer-events: auto;
  padding: 0;
}
/* A 12px diamond is far too small to tap — give it a generous invisible one. */
.t-pip::before {
  content: '';
  position: absolute;
  inset: -10px;
}
.t-pip:hover { scale: 1.35; }
.t-pip:focus-visible { outline-offset: 3px; }
.t-pip.answered { background: var(--moss); border-color: var(--moss); }
.t-pip.note { rotate: 0deg; border-radius: 50%; }
.t-pip.pop { animation: pip-pop 420ms var(--ease-spring); }
@keyframes pip-pop { 0% { scale: 0; } 70% { scale: 1.5; } 100% { scale: 1; } }

/* ------------------------------------------------------------ editor */

.editor-wrap {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem) 3rem;
}

.editor-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0 1.2rem;
  flex-wrap: wrap;
}
.editor-head .wordmark { font-size: 1.1rem; gap: 0.45rem; }

.title-edit {
  flex: 1;
  min-width: 12rem;
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 620;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  background: transparent;
  padding: 0.15rem 0.55rem;
  color: var(--ink);
  transition: border-color 130ms, background 130ms;
}
.title-edit:hover { border-color: var(--line); background: var(--paper-high); }
.title-edit:focus { outline: none; border-color: var(--ink); background: var(--paper-high); box-shadow: var(--shadow-pop); }

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 13fr) minmax(300px, 7fr);
  gap: 1.4rem;
  align-items: start;
}

.add-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
}
.add-row .hint { color: var(--ink-soft); font-size: 0.9rem; max-width: 30em; }
.add-row .hint b { color: var(--ink); }

/* rail */

.rail {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.rail-tabs {
  display: flex;
  gap: 0.4rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-high);
  padding: 0.25rem;
  width: fit-content;
  box-shadow: 0 2px 0 rgba(33, 28, 19, 0.15);
}
.rail-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.32rem 1rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.rail-tab[aria-selected='true'] { background: var(--ink); color: var(--paper-high); }
.rail-tab .count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  margin-left: 0.3rem;
  opacity: 0.75;
}

.qlist { display: flex; flex-direction: column; gap: 0.7rem; }

.qcard {
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  padding: 0.75rem 0.9rem;
  box-shadow: 0 3px 0 rgba(33, 28, 19, 0.13);
  cursor: pointer;
  transition: transform 130ms var(--ease-spring), box-shadow 130ms;
  animation: rise-in 300ms var(--ease-spring);
}
.qcard:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(33, 28, 19, 0.18); }
.qcard-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.qcard-kind {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.qcard-actions { margin-left: auto; display: flex; gap: 0.15rem; }
.qcard-actions button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
}
.qcard-actions button:hover { background: var(--paper-dim); color: var(--ink); }
.qcard-actions .q-del:hover { background: var(--rust-wash); color: var(--rust); }
.qcard-prompt { font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.qcard-meta { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.25rem; overflow-wrap: anywhere; }
.qcard-meta .right { color: var(--moss); font-weight: 700; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* empty state */

.rail-empty {
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  background: rgba(253, 250, 241, 0.6);
}
.rail-empty .doodle { margin-bottom: 0.7rem; }
.rail-empty b { color: var(--ink); }
.rail-empty p { font-size: 0.93rem; max-width: 24em; margin: 0 auto; }

/* composer */

.composer {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-high);
  box-shadow: 0 5px 0 var(--ink);
  padding: 1rem 1.1rem 1.2rem;
  display: none;
  flex-direction: column;
  gap: 0.85rem;
  animation: rise-in 260ms var(--ease-spring);
}
.composer.open { display: flex; }

.composer-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.composer-head .kicker { color: var(--ink); }
.composer-head .time-wrap { margin-left: auto; display: flex; align-items: center; gap: 0.3rem; }

.time-input {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  width: 4.6em;
  text-align: center;
  padding: 0.28rem 0.2rem;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  background: var(--paper-high);
  color: var(--cobalt-deep);
}
.nudge {
  border: 1.5px solid var(--line);
  background: var(--paper-high);
  border-radius: 7px;
  width: 26px; height: 26px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}
.nudge:hover { border-color: var(--ink); color: var(--ink); }

.kind-toggle {
  display: flex;
  flex-wrap: wrap;
  border: 2px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  width: fit-content;
}
.kind-toggle button {
  border: 0;
  background: var(--paper-high);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.kind-toggle button[aria-pressed='true'] { background: var(--ink); color: var(--paper-high); }

.opt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.opt-row .correct-pick {
  appearance: none;
  width: 22px; height: 22px;
  flex-shrink: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: var(--paper-high);
  transition: background 130ms;
}
.opt-row .correct-pick:checked { background: var(--moss); border-color: var(--moss); }
.opt-row .correct-pick:checked::after {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--paper-high);
}
/* multi uses square ticks — many can be right */
.opt-row .correct-pick[type='checkbox'] { border-radius: 7px; }
.opt-row .correct-pick[type='checkbox']:checked::after { border-radius: 2px; }
.opt-row .field { border-width: 1.5px; padding: 0.42rem 0.7rem; font-size: 0.93rem; }
.composer .legend {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.composer-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.2rem;
}
.composer-actions .spacer { flex: 1; }

/* share popover */

.share-pop {
  position: absolute;
  top: calc(100% + 0.7rem);
  right: 0;
  width: min(30rem, calc(100vw - 2rem));
  background: var(--paper-high);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 7px 0 var(--ink);
  padding: 1.1rem 1.2rem 1.25rem;
  z-index: 60;
  animation: rise-in 220ms var(--ease-spring);
}
.share-block + .share-block { margin-top: 1rem; padding-top: 1rem; border-top: 1.5px dashed var(--line); }
.share-block h4 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.share-block p { font-size: 0.83rem; color: var(--ink-soft); margin-bottom: 0.5rem; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row .field {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.45rem 0.7rem;
  border-width: 1.5px;
  color: var(--ink-soft);
  min-width: 0;
}

/* responses */

.resp-summary {
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  padding: 0.8rem 1rem;
  box-shadow: 0 3px 0 rgba(33, 28, 19, 0.13);
}
.resp-summary h4 { font-size: 0.92rem; display: flex; gap: 0.6rem; align-items: baseline; }
.resp-summary h4 .pct { margin-left: auto; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.resp-answer-list { margin-top: 0.5rem; display: grid; gap: 0.3rem; }
.resp-answer {
  font-size: 0.86rem;
  color: var(--ink-soft);
  padding-left: 0.8rem;
  border-left: 2.5px solid var(--line);
  overflow-wrap: anywhere;
}
.resp-answer b { color: var(--ink); }
.resp-answer.good { border-left-color: var(--moss); }
.resp-answer.bad { border-left-color: var(--rust); }

.sess-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.2rem;
  border-bottom: 1.5px dashed var(--line);
  font-size: 0.92rem;
}
.sess-row .who { font-weight: 700; }
.sess-row .when { color: var(--ink-soft); font-size: 0.8rem; }
.sess-row .score {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--moss);
}

/* consent */

.consent {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  translate: -50% 0;
  width: min(46rem, calc(100vw - 1.6rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--paper-high);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 5px 0 var(--ink);
  padding: 0.8rem 1rem;
  z-index: 200;
  animation: rise-in 320ms var(--ease-spring) 600ms both;
}
.consent-text { font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 14rem; }
.consent-quiet { font-weight: 400; color: var(--ink-soft); }
.consent-actions { display: flex; gap: 0.5rem; margin-left: auto; }

@media (max-width: 560px) {
  .consent-actions { width: 100%; }
  .consent-actions .btn { flex: 1; }
}

/* prose pages (privacy) */

.prose {
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  padding: clamp(1rem, 4vh, 2.5rem) clamp(1rem, 4vw, 2.5rem) 4rem;
}
.prose h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.5rem; }
.prose .lede { color: var(--ink-soft); font-size: 1.05rem; margin-bottom: 2rem; }
.prose h2 {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 600;
  font-size: 1.35rem;
  margin: 2rem 0 0.4rem;
  padding-top: 1.2rem;
  border-top: 2px solid var(--ink);
}
.prose p { margin-bottom: 0.8rem; }
.prose ul { margin: 0 0 0.9rem 1.1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose .consent-state {
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  padding: 0.9rem 1rem;
  box-shadow: 0 3px 0 rgba(33, 28, 19, 0.13);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}
.prose .consent-state .state { font-weight: 700; }
.prose .consent-state .btn { margin-left: auto; }

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--paper-high);
  box-shadow: 0 3px 0 rgba(33, 28, 19, 0.13);
  margin-bottom: 0.9rem;
}
.storage-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.88rem;
}
.storage-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.storage-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1.5px dashed var(--line);
  vertical-align: top;
}
.storage-table tr:last-child td { border-bottom: 0; }
.storage-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cobalt-deep);
  white-space: nowrap;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--paper-dim);
  border-radius: 4px;
  padding: 0.05em 0.3em;
}
.storage-table code { background: none; padding: 0; }

/* live presence readout — never colour alone: the glyph carries it too */
.storage-table .presence { white-space: nowrap; font-weight: 700; color: var(--moss); }
.storage-table .presence .dot { font-size: 0.7em; vertical-align: 0.15em; }
.storage-table tr.absent .presence { color: var(--ink-soft); font-weight: 500; }
.storage-table tr.absent td:not(.presence) { opacity: 0.55; }
.storage-table tr { transition: opacity 200ms; }

/* toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  translate: -50% 0;
  background: var(--ink);
  color: var(--paper-high);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 4px 14px rgba(33, 28, 19, 0.35);
  z-index: 120;
  animation: rise-in 260ms var(--ease-spring);
}
.toast button {
  border: 0;
  background: transparent;
  color: var(--amber);
  font-weight: 800;
  cursor: pointer;
  font-size: 0.92rem;
}
.toast.leaving { opacity: 0; transition: opacity 300ms; }

/* ------------------------------------------------------------ viewer (cinema) */

body.cinema {
  background: #171310;
  color: var(--paper);
}
body.cinema::before { opacity: 0.07; }

.cinema .masthead { padding-block: 0.85rem; }
.cinema .wordmark { color: var(--paper); font-size: 1.1rem; }
.cinema .masthead-note { color: #9d937f; }

.viewer-wrap {
  width: 100%;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 clamp(0.8rem, 3vw, 2rem) 2.5rem;
}

.viewer-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 560;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  margin: 0.4rem 0 1rem;
  overflow-wrap: anywhere;
}

.viewer-progress {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #9d937f;
}
.viewer-progress b { color: var(--paper); }

.cinema .stage { border-color: #000; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); }
.cinema .transport { background: #221d15; border-top-color: #000; }
.cinema .t-time { color: #9d937f; }
.cinema .t-time b { color: var(--paper); }
.cinema .t-rail { background: #352d22; border-color: #000; }
.cinema .t-pip { background: #171310; border-color: #cfc4a9; }
.cinema .t-pip.answered { background: var(--moss); border-color: var(--moss); }
.cinema .tbtn { background: #171310; border-color: #cfc4a9; color: var(--paper); box-shadow: 0 2px 0 #000; }
.cinema .tbtn-play { background: var(--cobalt); border-color: var(--cobalt-deep); }
.cinema .tbtn-ghost { background: transparent; border-color: transparent; color: #9d937f; box-shadow: none; }
.cinema .tbtn-ghost:hover { background: #352d22; color: var(--paper); }
.cinema .tbtn-cc.on { color: #b9c4f7; background: #2a2f52; }
.cinema .t-head { background: #171310; }

/* overlays: gate, question, end */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(0.7rem, 3vw, 1.6rem);
  background: rgba(14, 11, 6, 0.45);
  z-index: 10;
}
/* While a card is up, the film itself steps back. */
.stage.has-overlay .frame iframe,
.stage.has-overlay .frame video {
  filter: blur(6px) brightness(0.6) saturate(0.85);
}
.stage .frame iframe, .stage .frame video { transition: filter 300ms ease; }
.overlay.center { align-items: center; }

.paper-card {
  width: min(37rem, 100%);
  background: var(--paper-high);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 7px 0 var(--ink);
  padding: clamp(1rem, 3vw, 1.5rem) clamp(1rem, 3.5vw, 1.7rem) clamp(1.1rem, 3vw, 1.5rem);
  animation: card-up 340ms var(--ease-spring);
  max-height: 100%;
  overflow-y: auto;
}
@keyframes card-up {
  from { opacity: 0; transform: translateY(26px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.q-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
.q-prompt {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  overflow-wrap: anywhere;
}

.opts { display: grid; gap: 0.55rem; }
.opt-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-high);
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 120ms var(--ease-spring), background 140ms, border-color 140ms;
  overflow-wrap: anywhere;
}
.opt-btn:hover:not(:disabled) { transform: translateX(3px); background: var(--cobalt-wash); }
.opt-btn:disabled { cursor: default; }
.opt-btn .letter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--paper-high);
}
.opt-btn.picked { border-color: var(--cobalt); background: var(--cobalt-wash); }
/* Never colour alone: right/wrong also carry a glyph. */
.opt-btn .mark {
  margin-left: auto;
  padding-left: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
}
.opt-btn.right .mark { color: var(--moss); }
.opt-btn.wrong .mark { color: var(--rust); }
.opt-btn.right { border-color: var(--moss); background: var(--moss-wash); }
.opt-btn.right .letter { border-color: var(--moss); background: var(--moss); color: #fff; }
.opt-btn.wrong { border-color: var(--rust); background: var(--rust-wash); animation: shake 320ms; }
.opt-btn.wrong .letter { border-color: var(--rust); background: var(--rust); color: #fff; }
.opt-btn.dimmed { opacity: 0.55; }
@keyframes shake {
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2.5px); }
  90% { transform: translateX(2px); }
}

.multi-hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: -0.5rem 0 0.7rem;
}

/* a poll button becomes its own result bar */
.opt-btn.poll-result {
  background: linear-gradient(to right, var(--cobalt-wash) var(--pct, 0%), var(--paper-high) var(--pct, 0%));
  cursor: default;
  opacity: 1;
}
.opt-btn.poll-result.picked { border-color: var(--cobalt); }
.opt-btn.poll-result.picked .letter { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.poll-pct {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding-left: 0.6rem;
}

.verdict {
  display: none;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.9rem;
  font-weight: 700;
}
.verdict.show { display: flex; animation: rise-in 260ms var(--ease-spring); }
.verdict.good { color: var(--moss); }
.verdict.bad { color: var(--rust); }
.verdict .expl {
  display: block;
  font-weight: 500;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.q-foot { display: flex; margin-top: 1rem; }
.q-foot .btn { margin-left: auto; }

/* gate + end */

.gate-kicker { margin-bottom: 0.4rem; }
.gate-title {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 620;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.15;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}
.gate-sub { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.1rem; }
.gate-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.gate-row .field { flex: 1; min-width: 11rem; }

.end-score {
  font-family: var(--font-display);
  font-variation-settings: 'SOFT' 40, 'WONK' 1;
  font-weight: 620;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1;
  color: var(--cobalt);
}
.end-word { font-weight: 700; margin: 0.35rem 0 0.2rem; font-size: 1.1rem; }
.end-note { color: var(--ink-soft); font-size: 0.93rem; margin-bottom: 1.2rem; }
.end-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }

/* ------------------------------------------------------------ 404 + misc pages */

.lost {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
}
.lost h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 0.6rem; }
.lost p { color: var(--ink-soft); margin-bottom: 1.6rem; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .demo-min { transform: rotate(0.8deg); max-width: 34rem; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .editor-grid { grid-template-columns: 1fr; }
  .create-row { flex-direction: column; }
  .create-row .btn { width: 100%; }
}

@media (max-width: 560px) {
  .t-time { display: none; }
  .masthead-note { display: none; }
  /* Stacked, the title's flex:1 works on the vertical axis, so min-width:0 no
     longer holds it back and a long name pushes the page sideways. */
  .mine-item { flex-direction: column; align-items: stretch; gap: 0.4rem; }
  .mine-item .title { max-width: 100%; }
}

/* On phones the 16:9 frame is short — question cards take the screen instead. */
@media (max-width: 640px) {
  .overlay {
    position: fixed;
    z-index: 90;
    background: rgba(14, 11, 6, 0.66);
    padding: 0.8rem;
  }
  .demo-card { padding: 0.7rem 0.8rem 0.8rem; bottom: 3.9rem; }
  .demo-q { font-size: 0.88rem; }
  .demo-opt { font-size: 0.73rem; padding: 0.24rem 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .demo-card-1 { translate: 0 0; opacity: 1; }
  .demo-card-2 { display: none; }
  .demo-progress { width: 34%; }
  .demo-typed span { width: 100%; }
}
