﻿/* ============================================================
   I CAN — home
   Night valley. Dark card stock, acid-lime creases, fog.
   One pinned stage, seven acts, HTML copy on top of the canvas.
   ============================================================ */

:root {
  --paper:      #040906;
  --paper-2:    #061009;
  --card:       #08150f;
  --ink:        #eafff2;
  --ink-2:      #a9c3b4;
  --muted:      #6f8a7b;
  --line:       rgba(var(--ar), 0.14);
  --line-soft:  rgba(var(--ar), 0.06);
  --lime:       #22e07d;
  --lime-2:     #5cf5a5;
  --mint:       #14c9a2;
  --gold:       #ffce5c;

  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 0.75, 0.24, 1);

  --pad: clamp(20px, 4.2vw, 64px);
}

* { box-sizing: border-box; }

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow-x: hidden;
  min-height: 100%;
}

body.is-gated { overflow: hidden; }

h1, h2, h3, p, ul, li { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection {
  background: var(--lime);
  color: var(--bg);
}

/* ------------------------------------------------------------
   WORLD LAYERS
   ------------------------------------------------------------ */

.world {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
body.is-live .world { opacity: 1; }

body.is-static .world { display: none; }

/* Poster: always painted, sits under the canvas. If WebGL dies or
   the motion preference is reduced, this is what the page is. */
.world__poster {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease);
  background:
    radial-gradient(120% 78% at 50% 108%, rgba(var(--ar), 0.16), transparent 58%),
    radial-gradient(80% 56% at 50% 4%, rgba(var(--ar), 0.09), transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 46%, var(--sf) 72%, var(--bg) 100%);
}

/* the canvas paints over the poster the moment it is live */
body.is-live .world__poster { opacity: 0; }

.world__poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(180deg, rgba(var(--ar), 0.05) 0 1px, transparent 1px 26px);
  mask-image: linear-gradient(180deg, transparent 30%, #000 88%);
  -webkit-mask-image: linear-gradient(180deg, transparent 30%, #000 88%);
  opacity: 0.55;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 96% at 50% 50%, transparent 40%, rgba(var(--valley-ink), 0.62) 100%),
    linear-gradient(180deg, rgba(var(--valley-ink), 0.55) 0%, transparent 16%, transparent 74%, rgba(var(--valley-ink), 0.72) 100%);
}

/* Mist: only thickens while a focus session is running. Set --mist to 0..1. */
.mist {
  position: fixed;
  inset: -10%;
  z-index: 2;
  pointer-events: none;
  opacity: var(--mist, 0);
  transition: opacity 2.4s var(--ease);
  background:
    radial-gradient(60% 44% at 22% 62%, rgba(var(--ar), 0.16), transparent 70%),
    radial-gradient(52% 40% at 78% 34%, rgba(var(--ar), 0.13), transparent 72%),
    radial-gradient(70% 52% at 50% 96%, rgba(var(--ar), 0.16), transparent 76%);
  filter: blur(18px);
}

.grain {
  position: fixed;
  inset: -40px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 7s steps(6) infinite;
}

@keyframes grainShift {
  0%   { transform: translate3d(0, 0, 0); }
  20%  { transform: translate3d(-8px, 6px, 0); }
  40%  { transform: translate3d(6px, -10px, 0); }
  60%  { transform: translate3d(-4px, -4px, 0); }
  80%  { transform: translate3d(10px, 8px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* ------------------------------------------------------------
   PROGRESS HAIRLINE
   ------------------------------------------------------------ */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 8;
  background: rgba(255, 255, 255, 0.06);
}

.progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--mint), var(--lime), var(--lime-2));
  box-shadow: 0 0 12px rgba(var(--ar), 0.6);
}

/* ------------------------------------------------------------
   TOP BAR
   ------------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px var(--pad);
  mix-blend-mode: normal;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lime);
  color: var(--on-ac);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__note {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__note b { color: var(--lime-2); font-weight: 500; }

.topbar__exit {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease), background 0.3s var(--ease);
}

.topbar__exit:hover {
  color: var(--lime-2);
  border-color: rgba(var(--ar), 0.4);
  background: rgba(var(--ar), 0.06);
}

/* the account door: a small monogram puck that opens account.html */
.topbar__me {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(var(--ar), 0.08);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--lime-2);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
}

.topbar__me:hover {
  border-color: rgba(var(--ar), 0.55);
  background: rgba(var(--ar), 0.16);
  transform: translateY(-1px);
}

html[data-theme="light"] .topbar__me { color: var(--ac); }

/* ---- shortcut menu + customise pops ------------------------------ */

.nav,
.cust { position: relative; flex-shrink: 0; }

.nav__btn,
.cust__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 18, 12, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav__btn:hover,
.cust__btn:hover,
.is-open > .nav__btn,
.is-open > .cust__btn {
  color: var(--lime-2);
  border-color: rgba(var(--ar), 0.4);
  background: rgba(var(--ar), 0.08);
}

.nav__glyph {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
}

.nav__glyph i {
  position: absolute;
  left: 0;
  width: 10px;
  height: 1px;
  background: currentColor;
}

.nav__glyph i:first-child { top: 3px; }
.nav__glyph i:last-child  { top: 7px; }

.cust__swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lime), var(--mint));
  box-shadow: 0 0 8px rgba(var(--ar), 0.55);
}

/* the popovers */

.pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(var(--sf-rgb), 0.97), rgba(var(--bg-rgb), 0.97));
  backdrop-filter: blur(22px) saturate(120%);
  -webkit-backdrop-filter: blur(22px) saturate(120%);
  box-shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.95);
  transform-origin: top right;
  animation: popIn 0.22s var(--ease);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.nav__menu {
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
}

.nav__cap {
  padding: 5px 10px 9px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav__item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 1px 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.22s var(--ease);
}

.nav__item:hover { background: rgba(var(--ar), 0.08); }
.nav__item.is-here { background: rgba(var(--ar), 0.1); }

/* the act this year starts with */
.nav__item.is-lead { background: rgba(var(--ar), 0.06); }
.nav__item.is-lead .nav__n { color: var(--lime); }
.nav__item.is-lead .nav__hint { color: rgba(var(--ar), 0.72); }

.nav__n {
  grid-row: span 2;
  padding-top: 1px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.nav__item.is-here .nav__n { color: var(--lime); }

.nav__name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.nav__hint {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.cust__panel {
  width: min(292px, calc(100vw - 32px));
  padding: 14px;
}

.cust__cap {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.cust__row { display: flex; gap: 6px; }

.cust__input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.cust__input:focus {
  border-color: rgba(var(--ar), 0.45);
  background: rgba(var(--ar), 0.05);
}

.cust__save {
  flex: none;
  height: 34px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--lime);
  color: var(--on-ac);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}

.cust__save:hover { background: var(--lime-2); }

.cust__note {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.6;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cust__sep {
  height: 1px;
  margin: 14px 0;
  background: var(--line-soft);
}

.cust__themes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.th {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.th.is-on {
  color: var(--lime-2);
  border-color: rgba(var(--ar), 0.5);
  background: rgba(var(--ar), 0.08);
}

.th__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.th--dark .th__dot  { background: #05100a; }
.th--light .th__dot { background: #eef3ec; }

/* ------------------------------------------------------------
   LIGHT THEME
   The valley stays night — it is the product. What changes is
   every reading surface laid over it: panels, the gate, the bar.
   ------------------------------------------------------------ */

html[data-theme="light"] body { background: var(--bg, #eaf0e8); }

html[data-theme="light"] .panel {
  border-color: rgba(var(--valley-ink), 0.16);
  background: linear-gradient(160deg, rgba(var(--sf-rgb), 0.95), rgba(var(--sf2-rgb), 0.92));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 30px 70px -34px rgba(4, 22, 13, 0.55);
}

html[data-theme="light"] .panel::before,
html[data-theme="light"] .panel::after { border-color: rgba(var(--ar), 0.4); }

html[data-theme="light"] .panel__head { border-bottom-color: rgba(var(--valley-ink), 0.1); }
html[data-theme="light"] .panel__foot { border-top-color: rgba(var(--valley-ink), 0.1); }

html[data-theme="light"] .panel__label { color: var(--tx2); }
html[data-theme="light"] .panel__meta,
html[data-theme="light"] .panel__note,
html[data-theme="light"] .shelf__tag { color: var(--mu); }

html[data-theme="light"] .shelf__name { color: var(--tx); }
html[data-theme="light"] .shelf__item { border-bottom-color: rgba(var(--valley-ink), 0.12); }
html[data-theme="light"] .shelf__group { color: var(--ac); opacity: 1; }

html[data-theme="light"] .panel-cta {
  border-color: rgba(var(--ar), 0.42);
  background: linear-gradient(135deg, rgba(var(--ar), 0.26), rgba(var(--ar), 0.09));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 12px 30px -22px rgba(4, 22, 13, 0.5);
}
html[data-theme="light"] .panel-cta:hover {
  border-color: rgba(var(--ar), 0.7);
  background: linear-gradient(135deg, rgba(var(--ar), 0.36), rgba(var(--ar), 0.14));
}
html[data-theme="light"] .panel-cta__title { color: var(--tx); }
html[data-theme="light"] .panel-cta__sub,
html[data-theme="light"] .panel-cta__go { color: var(--ac); }
html[data-theme="light"] .shelf__link:hover,
html[data-theme="light"] .shelf__link:focus-visible {
  background: rgba(var(--ar), 0.08);
  border-color: rgba(var(--ar), 0.3);
}
html[data-theme="light"] .shelf__link:hover .shelf__name,
html[data-theme="light"] .shelf__link:focus-visible .shelf__name { color: var(--ac); }
html[data-theme="light"] .shelf__go {
  border-color: rgba(var(--ar), 0.35);
  background: rgba(var(--ar), 0.08);
  color: var(--ac);
}
html[data-theme="light"] .shelf__link:hover .shelf__go,
html[data-theme="light"] .shelf__link:focus-visible .shelf__go {
  background: var(--ac);
  border-color: var(--ac);
  color: var(--on-ac);
}
html[data-theme="light"] .bud { color: var(--mu); }
html[data-theme="light"] .subj__name { color: var(--tx); }
html[data-theme="light"] .subj__val { color: var(--tx2); }
html[data-theme="light"] .subj__bar { background: rgba(var(--valley-ink), 0.1); }

html[data-theme="light"] .nav__btn,
html[data-theme="light"] .cust__btn,
html[data-theme="light"] .topbar__exit {
  border-color: rgba(var(--valley-ink), 0.16);
  background: rgba(var(--sf-rgb), 0.72);
  color: var(--ink-2);
}

html[data-theme="light"] .nav__btn:hover,
html[data-theme="light"] .cust__btn:hover,
html[data-theme="light"] .is-open > .nav__btn,
html[data-theme="light"] .is-open > .cust__btn,
html[data-theme="light"] .topbar__exit:hover {
  color: var(--ac);
  border-color: rgba(var(--ar), 0.45);
  background: rgba(var(--ar), 0.16);
}

html[data-theme="light"] .pop {
  border-color: rgba(var(--valley-ink), 0.16);
  background: linear-gradient(165deg, rgba(var(--sf-rgb), 0.98), rgba(var(--sf2-rgb), 0.98));
  box-shadow: 0 24px 60px -28px rgba(4, 22, 13, 0.5);
}

html[data-theme="light"] .nav__cap,
html[data-theme="light"] .nav__n,
html[data-theme="light"] .nav__hint,
html[data-theme="light"] .cust__cap,
html[data-theme="light"] .cust__note { color: var(--mu); }

html[data-theme="light"] .nav__name { color: var(--tx); }
html[data-theme="light"] .nav__item:hover { background: rgba(var(--ar), 0.09); }
html[data-theme="light"] .nav__item.is-here { background: rgba(var(--ar), 0.13); }
html[data-theme="light"] .nav__item.is-here .nav__n { color: var(--ac); }

html[data-theme="light"] .cust__input {
  border-color: rgba(var(--valley-ink), 0.18);
  background: var(--sf);
  color: var(--tx);
}

html[data-theme="light"] .cust__input:focus {
  border-color: rgba(var(--ar), 0.5);
  background: var(--sf);
}

html[data-theme="light"] .th {
  border-color: rgba(var(--valley-ink), 0.16);
  background: var(--sf);
  color: var(--ink-2);
}

html[data-theme="light"] .th.is-on {
  border-color: rgba(var(--ar), 0.5);
  background: rgba(var(--ar), 0.1);
  color: var(--ac);
}

html[data-theme="light"] .th__dot { border-color: rgba(var(--valley-ink), 0.25); }

html[data-theme="light"] .gate {
  background:
    radial-gradient(80% 60% at 50% 20%, rgba(var(--ar), 0.16), transparent 60%),
    rgba(var(--bg-rgb), 0.95);
}

html[data-theme="light"] .gate__card {
  border-color: rgba(var(--valley-ink), 0.16);
  background: linear-gradient(160deg, rgba(var(--sf-rgb), 0.98), rgba(var(--sf2-rgb), 0.98));
  box-shadow: 0 40px 100px -50px rgba(4, 22, 13, 0.6);
  color: var(--tx);
}

html[data-theme="light"] .gate__kicker,
html[data-theme="light"] .gate__body { color: var(--mu); }

html[data-theme="light"] .gate .btn--ghost {
  background: rgba(var(--valley-ink), 0.04);
  border-color: rgba(var(--valley-ink), 0.16);
  color: var(--tx);
}

html[data-theme="light"] .progress { background: rgba(var(--valley-ink), 0.12); }

/* the valley itself is repainted in daylight by home-world.js — these fixed
   layers sit above it, so they must stop re-darkening the daytime frame */
html[data-theme="light"] .vignette {
  background:
    radial-gradient(120% 96% at 50% 50%, transparent 46%, rgba(var(--valley-ink), 0.10) 100%),
    linear-gradient(180deg, rgba(var(--bg-rgb), 0.55) 0%, transparent 16%, transparent 76%, rgba(var(--bg-rgb), 0.6) 100%);
}

html[data-theme="light"] .grain { opacity: 0.035; }

html[data-theme="light"] .mist { opacity: calc(var(--mist, 0) * 0.45); }

html[data-theme="light"] .act__body { text-shadow: none; }

/* ------------------------------------------------------------
   TRACK / PINNED STAGE
   ------------------------------------------------------------ */

.track {
  position: relative;
  z-index: 4;
  /* 7 acts × ~92vh of scroll each */
  height: 700vh;
}

.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: block;
  overflow: hidden;
}

.act {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(76px, 9vh, 120px) var(--pad) clamp(48px, 8vh, 96px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 0.62s var(--ease),
    transform 0.62s var(--ease),
    visibility 0s linear 0.62s;
}

.act.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 0.62s var(--ease),
    transform 0.62s var(--ease),
    visibility 0s linear 0s;
}

/* acts that have been passed drift up a touch, so the descent reads */
.act.is-past { transform: translateY(-22px); }

.act__inner {
  width: min(1160px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  align-items: center;
  gap: clamp(28px, 5vw, 76px);
}

.act__inner--hero { grid-template-columns: 1fr; }
.act__inner--return { grid-template-columns: 1fr; max-width: 880px; }

.act--hero { align-items: flex-end; padding-bottom: clamp(64px, 12vh, 130px); }

/* ------------------------------------------------------------
   COPY
   ------------------------------------------------------------ */

.act__copy { max-width: 640px; }

.act__kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: clamp(14px, 2.2vh, 24px);
}

.act__num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--lime-2);
  letter-spacing: 0.1em;
  background: rgba(var(--ar), 0.05);
}

.act__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 78px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin-bottom: clamp(16px, 2.6vh, 28px);
  text-wrap: balance;
}

.act__title--xl {
  font-size: clamp(52px, 9vw, 132px);
  line-height: 0.86;
  letter-spacing: -0.045em;
}

.act__title em {
  font-style: normal;
  color: var(--lime);
}

.act__body {
  font-size: clamp(14.5px, 1.12vw, 17px);
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 46ch;
  text-shadow: 0 1px 18px rgba(2, 8, 5, 0.9);
}

.act__points {
  display: grid;
  gap: 9px;
  margin-top: clamp(18px, 3vh, 30px);
}

.act__points li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.act__points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 7px;
  height: 7px;
  border-left: 1px solid var(--lime);
  border-bottom: 1px solid var(--lime);
  transform: rotate(-45deg);
  opacity: 0.85;
}

.cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(28px, 5vh, 52px);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.cue__line {
  display: block;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--lime), transparent);
  position: relative;
}

.cue__line::after {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: cueRun 2.4s var(--ease) infinite;
}

@keyframes cueRun {
  0%   { transform: translateX(0);    opacity: 0; }
  22%  { opacity: 1; }
  100% { transform: translateX(42px); opacity: 0; }
}

/* the same cue, used to point at the 3D prop that opens a panel */

.cue--open {
  margin-top: clamp(16px, 2.6vh, 24px);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--lime-2);
}

.cue--open .cue__line { width: 28px; }
.cue--open .cue__line::after { animation: none; opacity: 0.8; }

/* ------------------------------------------------------------
   PANELS — the usable bit of every act
   ------------------------------------------------------------ */

.panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  justify-self: end;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(var(--sf-rgb), 0.82), rgba(var(--bg-rgb), 0.78));
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.045) inset,
    0 30px 70px -34px rgba(0, 0, 0, 0.9);
  pointer-events: auto;
  max-height: calc(100vh - 132px);
  max-height: calc(100svh - 132px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ar), 0.28) transparent;
}

.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(var(--ar), 0.28);
}

/* shelves stay shut until their subject is clicked --------------- */

.panel[hidden] { display: none; }

.panel--open {
  animation: shelfIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes shelfIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* corner ticks */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border: 1px solid rgba(var(--ar), 0.42);
  pointer-events: none;
}
.panel::before  { top: 8px;    left: 8px;    border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.panel::after   { bottom: 8px; right: 8px;   border-left: 0;  border-top: 0;    border-radius: 0 0 4px 0; }

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.panel__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--line-soft);
}

.panel__note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(111, 138, 123, 0.85);
}

[hidden] { display: none !important; }

/* loud feature button inside a panel -------------------------------- */

.panel-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 15px 0 4px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(var(--ar), 0.55);
  background: linear-gradient(135deg, rgba(var(--ar), 0.24), rgba(var(--ar), 0.07));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 12px 30px -20px rgba(var(--ar), 0.9);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.panel-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--ar), 0.9);
  background: linear-gradient(135deg, rgba(var(--ar), 0.34), rgba(var(--ar), 0.12));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 18px 40px -20px rgba(var(--ar), 1);
}

.panel-cta:active { transform: translateY(1px) scale(0.995); }

.panel-cta:focus-visible { outline: 2px solid var(--lime-2); outline-offset: 3px; }

/* several doors stacked at the top of one panel — pull them together */
.panel-cta + .panel-cta { margin-top: 10px; }

.panel-cta__icon {
  flex: none;
  font-size: 20px;
  line-height: 1;
}

.panel-cta__txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.panel-cta__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-cta__sub {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--ar), 0.9);
}

.panel-cta__go {
  flex: none;
  font-size: 15px;
  color: var(--lime-2);
  transition: transform 0.2s var(--ease);
}

.panel-cta:hover .panel-cta__go { transform: translateX(3px); }

/* shelf — the placeholder list of features that will live here -------- */

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.shelf__item {
  border-bottom: 1px dashed rgba(var(--ar), 0.1);
}

.shelf__item:last-child { border-bottom: 0; }

/* static row beside the clickable ones — same rhythm, no hover affordance */
.shelf__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 10px;
  margin: 1px 0;
}
.shelf__row .shelf__name { flex: 1; min-width: 0; }

.shelf__link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  margin: 1px 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              transform 0.2s var(--ease);
}
.shelf__link .shelf__name { flex: 1; min-width: 0; }
.shelf__link:hover,
.shelf__link:focus-visible {
  background: rgba(var(--ar), 0.09);
  border-color: rgba(var(--ar), 0.28);
  transform: translateX(2px);
}
.shelf__link .shelf__name { transition: color 0.2s var(--ease); }
.shelf__link:hover .shelf__name,
.shelf__link:focus-visible .shelf__name { color: var(--lime); }
.shelf__link:focus-visible { outline: 2px solid var(--lime-2); outline-offset: 2px; }

.shelf__go {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(var(--ar), 0.4);
  background: rgba(var(--ar), 0.1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--lime-2);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              color 0.2s var(--ease), transform 0.2s var(--ease);
}
.shelf__link:hover .shelf__go,
.shelf__link:focus-visible .shelf__go {
  background: var(--lime);
  border-color: var(--lime);
  color: #04281a;
  transform: translateX(2px);
}

.shelf__name {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.shelf__tag {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* toggle rows inside the hour shelf ------------------------- */

.shelf__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px;
  border-bottom: 1px dashed rgba(var(--ar), 0.1);
}

.shelf__row:last-child { border-bottom: 0; }

.shelf__txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.shelf__hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.switch {
  flex: none;
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}

.switch__dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}

.switch[aria-checked="true"] {
  background: rgba(var(--ar), 0.16);
  border-color: rgba(var(--ar), 0.55);
  box-shadow: 0 0 18px -4px rgba(var(--ar), 0.55);
}

.switch[aria-checked="true"] .switch__dot {
  transform: translateX(20px);
  background: var(--lime-2);
}

.switch:focus-visible {
  outline: 2px solid var(--lime-2);
  outline-offset: 2px;
}

.shelf__group {
  margin: 22px 0 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lime);
  opacity: 0.72;
}

/* the hubs panel carries three doors plus three shelves, so it runs tight —
   trim the rhythm just enough that the whole panel lands inside the viewport */
[data-panel="hubs"] .panel-cta { padding: 11px 16px; }
[data-panel="hubs"] .shelf__group { margin: 12px 0 2px; }
[data-panel="hubs"] .shelf__row { padding: 9px 2px; }


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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: translateY(1px) scale(0.99); }
.btn:focus-visible,
.mini:focus-visible,
.chip:focus-visible,
.day:focus-visible {
  outline: 2px solid var(--lime-2);
  outline-offset: 3px;
}

.btn--lime {
  background: var(--lime);
  color: var(--on-ac);
  box-shadow: 0 8px 26px -12px rgba(var(--ar), 0.9);
}
.btn--lime:hover { background: var(--lime-2); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: rgba(var(--ar), 0.4);
  background: rgba(var(--ar), 0.07);
  color: var(--lime-2);
}

.mini {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.mini:hover { color: var(--lime-2); border-color: rgba(var(--ar), 0.42); }

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.row--start { margin-top: clamp(22px, 3.4vh, 34px); }

/* meter ----------------------------------------------------- */

.meter {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin: 16px 0 12px;
}

.meter--tall { height: 5px; }

.meter__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--lime));
  box-shadow: 0 0 12px rgba(var(--ar), 0.55);
  transition: width 0.5s var(--ease);
}

.meter__fill--gold {
  background: linear-gradient(90deg, #c98a2a, var(--gold));
  box-shadow: 0 0 12px rgba(255, 206, 92, 0.45);
}

/* subject progress — the plan panel's live rows ---------------------- */

.subj {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.subj__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.subj__name {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
}

.subj__val {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.subj__bar {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.subj__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--lime));
  box-shadow: 0 0 10px rgba(var(--ar), 0.4);
}

.subj__fill--gold {
  background: linear-gradient(90deg, #c98a2a, var(--gold));
  box-shadow: 0 0 10px rgba(255, 206, 92, 0.32);
}

/* BUDI line -------------------------------------------------- */

.bud {
  display: flex;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.62;
  letter-spacing: 0.03em;
  color: var(--muted);
  min-height: 34px;
}

.bud::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 9px var(--lime);
  opacity: 0.8;
}

/* ------------------------------------------------------------
   01 · WEEK BOARD
   ------------------------------------------------------------ */

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 12px 2px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 0.28s var(--ease), background 0.28s var(--ease),
              transform 0.28s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.day:hover {
  border-color: rgba(var(--ar), 0.32);
  transform: translateY(-2px);
}

.day__n {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.28s var(--ease);
}

.day__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(var(--ar), 0.35);
  background: transparent;
  transition: background 0.28s var(--ease), box-shadow 0.28s var(--ease),
              border-color 0.28s var(--ease), transform 0.28s var(--ease);
}

.day.is-on {
  border-color: rgba(var(--ar), 0.5);
  background: rgba(var(--ar), 0.075);
}

.day.is-on .day__n { color: var(--lime-2); }

.day.is-on .day__dot {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 10px rgba(var(--ar), 0.85);
  transform: scale(1.28);
}

.day[data-rest="true"].is-on .day__dot {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 206, 92, 0.75);
}

.day[data-rest="true"].is-on { border-color: rgba(255, 206, 92, 0.4); background: rgba(255, 206, 92, 0.06); }
.day[data-rest="true"].is-on .day__n { color: var(--gold); }

/* a day that has a task named but is not closed yet */
.day.is-set { border-color: rgba(var(--ar), 0.26); }
.day.is-set .day__dot {
  border-color: rgba(var(--ar), 0.7);
  background: rgba(var(--ar), 0.32);
}

.plan-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 12px;
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field__cap {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.field__input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(2, 8, 5, 0.66);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12.5px;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.field__input::placeholder { color: rgba(111, 138, 123, 0.72); }
.field__input:focus {
  outline: none;
  border-color: rgba(var(--ar), 0.5);
  background: rgba(var(--ar), 0.05);
  box-shadow: 0 0 0 3px rgba(var(--ar), 0.08);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
              background 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.check__box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(var(--ar), 0.42);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}

.check[aria-pressed="true"] {
  color: var(--lime-2);
  border-color: rgba(var(--ar), 0.5);
  background: rgba(var(--ar), 0.1);
}

.check[aria-pressed="true"] .check__box {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 8px rgba(var(--ar), 0.8);
}

/* ------------------------------------------------------------
   02 · FOCUS DIAL
   ------------------------------------------------------------ */

.dial {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 4px auto 6px;
}

.dial__svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }

.dial__track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 3;
}

.dial__fill {
  fill: none;
  stroke: var(--lime);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  filter: drop-shadow(0 0 6px rgba(var(--ar), 0.6));
  transition: stroke-dashoffset 0.9s linear, stroke 0.4s var(--ease);
}

.dial__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 4px;
}

.dial__time {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.dial__cap {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.session {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 2px 0 4px;
}

.presets { display: flex; gap: 6px; }

.preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 62px;
  padding: 7px 10px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.preset b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.preset span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.preset:hover { border-color: rgba(var(--ar), 0.3); }

.preset.is-on {
  border-color: rgba(var(--ar), 0.46);
  background: rgba(var(--ar), 0.1);
}
.preset.is-on b { color: var(--lime-2); }

/* mistake log ------------------------------------------------ */

.log {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.log__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.log__label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.log__count {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.log__list {
  list-style: none;
  display: grid;
  gap: 5px;
  max-height: 104px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ar), 0.3) transparent;
}

.log__list:empty::after {
  content: "Nothing yet — the log fills while you work.";
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.6;
  color: rgba(111, 138, 123, 0.7);
}

.log__list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-2);
}

.log__list li > span { flex: 1 1 auto; min-width: 0; }

.log__x {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: rgba(111, 138, 123, 0.85);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.log__x:hover { color: var(--gold); border-color: rgba(255, 206, 92, 0.35); }

.log__add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 7px;
}

/* ------------------------------------------------------------
   03 · PAPER DESK
   ------------------------------------------------------------ */

.chips { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }

.chip {
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}

.chip:hover { color: var(--ink-2); border-color: rgba(var(--ar), 0.3); }

.chip.is-on {
  background: rgba(var(--ar), 0.12);
  border-color: rgba(var(--ar), 0.46);
  color: var(--lime-2);
}

.paper-card {
  position: relative;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, rgba(var(--ar), 0.035) 0 1px, transparent 1px 22px),
    rgba(4, 12, 8, 0.6);
}

.paper-card::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--ar), 0.3);
}

.paper-card__code {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

.paper-card__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
}

.paper-card__stats {
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.paper-card__stats b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-right: 3px;
}

#paperBegin { width: 100%; margin-top: 14px; }

#paperBegin.is-done {
  background: rgba(var(--ar), 0.12);
  border-color: rgba(var(--ar), 0.4);
  color: var(--lime-2);
}

/* question sheet — shared by the paper desk and the duel ------- */

.quiz { display: grid; gap: 10px; }

.quiz__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiz__clock {
  color: var(--lime-2);
  font-variant-numeric: tabular-nums;
}

.quiz__q {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -0.01em;
  color: var(--ink);
  min-height: 46px;
}

.quiz__opts { display: grid; gap: 6px; }

.quiz__opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease),
              color 0.22s var(--ease), opacity 0.22s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.quiz__opt b {
  flex: 0 0 auto;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
}

.quiz__opt:hover:not(:disabled) {
  border-color: rgba(var(--ar), 0.3);
  background: rgba(var(--ar), 0.06);
}

.quiz__opt.is-right {
  border-color: rgba(var(--ar), 0.55);
  background: rgba(var(--ar), 0.13);
  color: var(--ink);
}

.quiz__opt.is-wrong {
  border-color: rgba(255, 206, 92, 0.5);
  background: rgba(255, 206, 92, 0.1);
  color: var(--ink);
}

.quiz__opt.is-mute { opacity: 0.4; }
.quiz__opt:disabled { cursor: default; }

.quiz__note {
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: var(--muted);
  min-height: 28px;
}
.quiz__note.is-good { color: var(--lime-2); }
.quiz__note.is-bad { color: var(--gold); }

.quiz__foot {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz__foot .btn { flex: 1 1 auto; }

.quiz--duel .quiz__q { min-height: 42px; }

/* ------------------------------------------------------------
   04 · DUEL
   ------------------------------------------------------------ */

.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 6px 0 16px;
}

.duel__side { min-width: 0; }
.duel__side--r { text-align: right; }

.duel__name {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}

.duel__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.duel__side--r .duel__bar { transform: scaleX(-1); }

.duel__fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--lime));
  transition: width 0.5s var(--ease);
}

.duel__fill--r { background: linear-gradient(90deg, #7a3b2c, #ff8a5c); }

.duel__score {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

.duel__vs {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(111, 138, 123, 0.7);
  padding-top: 18px;
}

#roomFire { width: 100%; margin-top: 4px; }

/* ------------------------------------------------------------
   05 · VAULT
   ------------------------------------------------------------ */

.vault {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 6px;
}

.vault__num {
  font-family: var(--font-display);
  font-size: clamp(44px, 5.4vw, 62px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--gold), #b8761f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(255, 206, 92, 0.2));
}

.vault__cap {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

/* arcade counter --------------------------------------------- */

.shop { display: grid; gap: 6px; margin: 2px 0 12px; }

.shop__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              opacity 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.shop__name { font-size: 12px; color: var(--ink-2); }

.shop__cost {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.shop__cost::after { content: " tk"; opacity: 0.55; }

.shop__item:hover:not(:disabled) {
  border-color: rgba(255, 206, 92, 0.4);
  background: rgba(255, 206, 92, 0.07);
}

.shop__item.is-short { opacity: 0.42; cursor: not-allowed; }

.shop__item.is-owned {
  opacity: 1;
  border-color: rgba(var(--ar), 0.4);
  background: rgba(var(--ar), 0.08);
  cursor: default;
}
.shop__item.is-owned .shop__cost { color: var(--lime-2); }
.shop__item.is-owned .shop__cost::after { content: "owned"; opacity: 0.75; }

/* ------------------------------------------------------------
   06 · RECAP
   ------------------------------------------------------------ */

.recap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(22px, 3.4vh, 36px);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--line-soft);
  max-width: 520px;
}

.recap__cell {
  padding: 16px 14px;
  background: rgba(var(--bg-rgb), 0.72);
}

.recap__n {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--lime-2);
  font-variant-numeric: tabular-nums;
}

.recap__l {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 5px;
}

/* ------------------------------------------------------------
   RAIL
   ------------------------------------------------------------ */

.rail {
  position: fixed;
  right: clamp(14px, 2.4vw, 34px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  height: min(340px, 46vh);
  width: 12px;
  pointer-events: none;
}

.rail__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(var(--ar), 0.22), transparent);
}

.rail__mark {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
}

.rail__mark::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(111, 138, 123, 0.55);
  transition: all 0.4s var(--ease);
}

.rail__mark.is-on::before {
  width: 6px;
  height: 6px;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(var(--ar), 0.9);
}

.rail__mark.is-done::before { background: rgba(var(--ar), 0.55); }

.rail__head {
  position: absolute;
  left: 50%;
  top: 0;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  margin-top: -5.5px;
  border-radius: 50%;
  border: 1px solid var(--lime);
  background: rgba(var(--valley-ink), 0.9);
  box-shadow: 0 0 0 3px rgba(var(--valley-ink), 0.8), 0 0 16px rgba(var(--ar), 0.5);
  transition: top 0.6s var(--ease);
}

.rail__head::after {
  content: "";
  position: absolute;
  inset: 3.5px;
  border-radius: 50%;
  background: var(--lime);
}

/* ------------------------------------------------------------
   GATE
   ------------------------------------------------------------ */

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(80% 60% at 50% 20%, rgba(var(--ar), 0.07), transparent 60%),
    rgba(3, 7, 5, 0.93);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.5s var(--ease), visibility 0s linear 0.5s;
}

.gate.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate--static { z-index: 60; }

/* the checking curtain — the landing page's splash, reused here so the gate
   card (and its "locked" headline) is never painted while firebase is still
   answering. it lifts the instant the gate resolves, open or closed */
.gate__splash {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.55s var(--ease), visibility 0s linear 0.55s;
}

.gate__splash::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, 72vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ar), 0.10), transparent 64%);
  pointer-events: none;
}

[data-theme="light"] .gate__splash::before {
  background: radial-gradient(circle, rgba(27, 158, 116, 0.09), transparent 64%);
}

.gate.is-ready .gate__splash {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate__splash-in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
}

.gate__splash-mark {
  font-family: var(--font-display, inherit);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.gate__splash-line {
  position: relative;
  display: block;
  width: 132px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--ar), 0.16);
}

.gate__splash-line i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  transform-origin: left center;
  animation: gateSplashRun 1.15s var(--ease) infinite;
}

@keyframes gateSplashRun {
  0%   { transform: translateX(-100%); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .gate__splash { transition: none; }
  .gate__splash-line i { animation: none; }
}

.gate__card {
  position: relative;
  width: min(440px, 100%);
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(var(--sf-rgb), 0.94), rgba(var(--bg-rgb), 0.96));
  box-shadow: 0 40px 100px -50px #000;
  text-align: left;
}

.gate__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--lime);
  color: var(--on-ac);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 20px;
}

.gate__kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.gate__kicker::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 9px var(--lime);
  animation: pulse 1.6s ease-in-out infinite;
  vertical-align: 1px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 1; }
}

.gate__title {
  font-family: var(--font-display);
  font-size: clamp(25px, 3.4vw, 32px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-wrap: balance;
}

.gate__body {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 34ch;
  margin-bottom: 24px;
}

.gate__row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------
   GRADE GATE — class + stream, once per account
   ------------------------------------------------------------ */

.ggate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(70% 55% at 50% 10%, rgba(var(--ar), 0.09), transparent 62%),
    rgba(3, 7, 5, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
}

.ggate.is-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s var(--ease), visibility 0s linear 0s;
}

body.is-grade-gated { overflow: hidden; }

.ggate__card {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(24px, 3.6vw, 36px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(var(--sf-rgb), 0.96), rgba(var(--bg-rgb), 0.97));
  box-shadow: 0 50px 120px -60px #000;
}

/* only the options scroll, so the mark, title and Continue stay put */
.ggate__card > :not(.ggate__opts) { flex: none; }

.ggate__opts {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 2px -6px 2px 0;
  padding: 2px 6px 8px 0;
  scrollbar-width: thin;
}

.ggate__kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.ggate__title {
  font-family: var(--font-display);
  font-size: clamp(23px, 3vw, 29px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  text-wrap: balance;
}

.ggate__body {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: 20px;
}

.ggate__grades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ggrade {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 14px 15px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease),
              box-shadow 0.22s var(--ease);
}

.ggrade:hover {
  border-color: rgba(var(--ar), 0.42);
  background: rgba(var(--ar), 0.06);
}

.ggrade.is-on {
  border-color: var(--lime);
  background: rgba(var(--ar), 0.1);
  box-shadow: inset 0 0 0 1px rgba(var(--ar), 0.35);
}

.ggrade__n {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.ggrade.is-on .ggrade__n { color: var(--lime); }

.ggrade__t {
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ggrade__h { font-size: 10.5px; color: var(--ink-2); }

.ggate__stream { margin-top: 20px; }

.ggate__cap {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 9px;
}

.ggate__streams {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.gstream {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.gstream:hover {
  border-color: rgba(var(--ar), 0.42);
  background: rgba(var(--ar), 0.06);
}

.gstream.is-on {
  border-color: var(--lime);
  background: rgba(var(--ar), 0.1);
}

.gstream__t { font-size: 12.5px; font-weight: 600; }
.gstream.is-on .gstream__t { color: var(--lime-2); }
.gstream__h { font-size: 9.5px; color: var(--muted); line-height: 1.4; }

.ggate__combos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.gcombo {
  display: grid;
  gap: 2px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.gcombo:hover {
  border-color: rgba(var(--ar), 0.42);
  background: rgba(var(--ar), 0.06);
}

.gcombo.is-on {
  border-color: var(--lime);
  background: rgba(var(--ar), 0.1);
}

.gcombo__t { font-size: 12px; font-weight: 600; }
.gcombo.is-on .gcombo__t { color: var(--lime-2); }
.gcombo__h { font-size: 9px; color: var(--muted); line-height: 1.35; }

.ggate__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.ggate__now {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  flex: 1;
  min-width: 160px;
}

#gradeSave { min-width: 132px; }
#gradeSave[disabled] { opacity: 0.4; pointer-events: none; }

/* customise panel — current class line */
.cust__grade {
  flex: 1;
  min-width: 0;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .ggate {
  background:
    radial-gradient(70% 55% at 50% 10%, rgba(var(--ar), 0.16), transparent 62%),
    rgba(var(--bg-rgb), 0.95);
}

html[data-theme="light"] .ggate__card {
  border-color: rgba(var(--valley-ink), 0.16);
  background: linear-gradient(160deg, rgba(var(--sf-rgb), 0.98), rgba(var(--sf2-rgb), 0.98));
  box-shadow: 0 50px 120px -60px rgba(4, 22, 13, 0.6);
  color: var(--tx);
}

html[data-theme="light"] .ggate__kicker,
html[data-theme="light"] .ggate__cap,
html[data-theme="light"] .ggate__body,
html[data-theme="light"] .ggate__now { color: var(--mu); }

html[data-theme="light"] .ggrade,
html[data-theme="light"] .gstream,
html[data-theme="light"] .gcombo {
  background: rgba(var(--valley-ink), 0.03);
  border-color: rgba(var(--valley-ink), 0.16);
  color: var(--tx);
}

html[data-theme="light"] .ggrade.is-on,
html[data-theme="light"] .gstream.is-on,
html[data-theme="light"] .gcombo.is-on {
  background: rgba(var(--ar), 0.16);
  border-color: var(--ac);
}

html[data-theme="light"] .gstream.is-on .gstream__t,
html[data-theme="light"] .gcombo.is-on .gcombo__t,
html[data-theme="light"] .ggrade.is-on .ggrade__n { color: var(--ac); }

@media (max-width: 560px) {
  .ggate__grades { grid-template-columns: 1fr; }
  .ggate__streams { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 960px) {
  .act__inner {
    grid-template-columns: 1fr;
    align-content: center;
    gap: clamp(14px, 2.6vh, 26px);
    max-height: 100%;
  }

  .act { align-items: center; padding-top: clamp(64px, 10vh, 96px); }

  .act--hero { align-items: flex-end; }

  .panel { justify-self: stretch; max-width: 100%; max-height: calc(100svh - 200px); }

  .act__points { display: none; }

  .act__body { max-width: 52ch; font-size: 13.5px; }

  .act__title { font-size: clamp(32px, 7.6vw, 52px); }
  .act__title--xl { font-size: clamp(46px, 13vw, 84px); }

  .rail { display: none; }

  .dial { width: 138px; height: 138px; }
  .dial__time { font-size: 28px; }

  .recap { max-width: 100%; }
}

@media (max-width: 860px) {
  .nav__label,
  .cust__label { display: none; }
  .nav__btn,
  .cust__btn { gap: 0; padding: 0 11px; }
}

@media (max-width: 560px) {
  .topbar { padding: 13px 16px; gap: 10px; }
  .brand__name { display: none; }
  .topbar__note { font-size: 9px; letter-spacing: 0.1em; }
  .topbar__exit { padding: 7px 11px; font-size: 9px; }
  .topbar__me { width: 30px; height: 30px; font-size: 12px; }
  .nav__btn, .cust__btn { height: 30px; padding: 0 10px; }

  /* portrait: copy up top, shelf docked to the bottom, and the
     middle of the screen left open so the world can be seen */
  .act {
    padding-left: 18px; padding-right: 18px;
    align-items: stretch;
    padding-top: clamp(70px, 11vh, 96px);
    padding-bottom: 14px;
  }
  .act--hero { padding-bottom: 14px; }

  /* flex, not grid, so the shelf gives way instead of pushing
     itself off the bottom of the screen */
  .act__inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
  }
  .act__copy { flex: 0 0 auto; }

  .panel {
    flex: 0 1 auto;
    min-height: 0;
    padding: 16px;
    border-radius: 17px;
    margin-top: auto;
    max-height: 42svh;
  }

  /* the shelf is long enough on a phone without the sign-off line */
  .panel .bud { display: none; }

  .act__title { font-size: clamp(30px, 8.6vw, 40px); }
  .act__title--xl { font-size: clamp(38px, 11vw, 52px); }
  .act__body { font-size: 12.5px; line-height: 1.5; }

  .week { gap: 4px; }
  .day { padding: 10px 1px 9px; border-radius: 9px; }
  .day__n { font-size: 7.5px; letter-spacing: 0.04em; }
  .day__dot { width: 6px; height: 6px; }

  .paper-card { padding: 14px; }
  .paper-card__name { font-size: 17px; }
  .paper-card__stats { gap: 12px; }

  .plan-edit { gap: 6px; }
  .field__input { height: 34px; font-size: 12px; }
  .check { height: 34px; padding: 0 10px; font-size: 9px; }

  .preset { min-width: 54px; padding: 6px 8px 5px; }
  .log__list { max-height: 78px; }
  .log__add { grid-template-columns: minmax(0, 1fr) auto; }

  .quiz__q { font-size: 14px; min-height: 42px; }
  .quiz__opt { font-size: 11.5px; padding: 8px 9px; }

  .shop__name { font-size: 11.5px; }
  .shop__item { padding: 8px 10px; }

  .duel__score { font-size: 22px; }

  .recap__cell { padding: 12px 10px; }
  .recap__l { font-size: 7.5px; letter-spacing: 0.08em; }

  .btn { height: 38px; padding: 0 16px; font-size: 12px; }
}

@media (max-height: 660px) {
  .act__body { display: none; }
  .act__points { display: none; }
  .cue { margin-top: 18px; }
  .dial { width: 120px; height: 120px; }
  .panel__foot { margin-top: 12px; padding-top: 10px; }
}

/* ------------------------------------------------------------
   MOTION PREFERENCES
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .cue__line::after { animation: none; opacity: 0.7; }
  .gate__kicker::after { animation: none; opacity: 0.8; }
  .act { transition: opacity 0.2s linear, visibility 0s linear 0.2s; transform: none !important; }
  .act.is-on { transition: opacity 0.2s linear, visibility 0s linear 0s; }
}
