/* CATION student application: the rail, the home page (the learning path, the Learning Rhythm rail and the other
   courses) and the views and panels around it (My Learning, search, the account menu, Q). The home page is composed
   at 1536 × 940, the shape of a laptop's browser window, and fits the window in one screen. Lengths are in --z, the
   application's own unit, so it keeps its proportions from a 1280 × 720 window to a large monitor. Learner figures are
   sample data, and the page says so. */

.app {
  /* One pixel of the 1536 × 940 composition, scaled with the window so the home page fits it (never below 0.76px; a
     window smaller than about 1280 × 720 scrolls instead). Text is set in --zt, which stops shrinking at 0.84px so small
     labels stay legible on small windows. */
  --z: clamp(0.76px, min(100vw / 1536, 100svh / 940), 2.5px);
  --zt: max(0.84px, var(--z));
  --nav-w: calc(92 * var(--z));
  --side-w: calc(440 * var(--z));
  --pad: calc(52 * var(--z));
  --paper: #f0ece0;
  --peri-2: #aab2f2;
  --ink: #0b0c18;
  --row: rgba(255, 255, 255, 0.026);
  --row-line: rgba(255, 255, 255, 0.055);
  --row-hover: rgba(255, 255, 255, 0.05);
  background: #07080a;
}
.app .defs { position: absolute; }
.app svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app .eyebrow { font-size: calc(12 * var(--zt)); font-weight: 500; line-height: 1.3; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); }

/* ---------- The rail ---------- */

.app-shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100svh; }
.app-nav {
  position: sticky; top: 0; height: 100svh; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(30 * var(--z)) 0 calc(24 * var(--z));
  background: #08090b; border-right: 1px solid var(--line);
}
.app-logo { display: grid; justify-items: center; gap: calc(12 * var(--z)); margin-bottom: calc(46 * var(--z)); color: var(--text); }
.app-logo .mark { width: calc(32 * var(--z)); }
.app-logo .word { width: calc(54 * var(--z)); overflow: visible; }
.app-logo .word path, .app-logo .word circle { stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.app-nav-list { display: flex; flex-direction: column; gap: calc(6 * var(--z)); width: 100%; padding: 0 calc(10 * var(--z)); }
.nav-item {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: calc(7 * var(--z));
  padding: calc(13 * var(--z)) 0 calc(11 * var(--z));
  border-radius: calc(12 * var(--z));
  font-size: calc(12.5 * var(--zt)); line-height: 1.2; color: var(--text-3); text-align: center;
  transition: color 0.2s, background-color 0.2s;
}
.nav-item svg { width: calc(22 * var(--z)); height: calc(22 * var(--z)); stroke-width: 1.5; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-item[aria-current='page'] { color: var(--gold); background: rgba(233, 215, 139, 0.05); }
.nav-item[aria-current='page']::before {
  content: ''; position: absolute; left: calc(-10 * var(--z)); top: 24%; bottom: 24%;
  width: calc(2.5 * var(--z)); border-radius: 0 calc(3 * var(--z)) calc(3 * var(--z)) 0; background: var(--gold);
}

/* Q's mark: a ring and a tail that starts inside it, drawn in the light that runs from Soft Gold into Periwinkle on the
   homepage's outlined words. */
.q-mark { overflow: visible; }
.q-mark circle, .q-mark path { stroke: url(#q-light); stroke-width: 1.8; }
.nav-q span { font-weight: 600; letter-spacing: 0.02em; }
.nav-q[aria-expanded='true'] { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ---------- The page and its tools ---------- */

.app-main { position: relative; min-width: 0; min-height: 100svh; display: flex; flex-direction: column; }
@media (min-width: 1180px) {
  /* On a desktop the home page fills the window exactly, or the composition's height where the window is shorter. */
  .app-main { height: max(100svh, calc(940 * var(--z))); }
}
main { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: 0; }
.noscript { margin: calc(40 * var(--z)) var(--pad); color: var(--text-2); }
.noscript a { text-decoration: underline; }
.view[hidden] { display: none !important; }

.app-tools { position: absolute; z-index: 30; top: calc(28 * var(--z)); right: calc(36 * var(--z)); display: flex; align-items: center; gap: calc(14 * var(--z)); }
.sample-chip {
  padding: calc(6 * var(--z)) calc(11 * var(--z)); border-radius: 999px; white-space: nowrap;
  font-size: calc(12 * var(--zt)); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2);
}
.sample-chip::before { content: ''; display: inline-block; width: calc(6 * var(--z)); height: calc(6 * var(--z)); margin-right: calc(7 * var(--z)); border-radius: 50%; background: var(--gold); vertical-align: 0.08em; }
.tool { position: relative; }
.avatar {
  display: grid; place-items: center; width: calc(42 * var(--z)); height: calc(42 * var(--z)); border-radius: 50%;
  font-size: calc(16 * var(--zt)); font-weight: 500; color: var(--gold);
  background: radial-gradient(circle at 32% 26%, #2b3058, #121527 72%); box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.4);
}
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: calc(40 * var(--z)); height: calc(40 * var(--z)); border-radius: 50%;
  color: var(--text-2); transition: color 0.2s, background-color 0.2s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.icon-btn svg { width: calc(20 * var(--z)); }

/* Menus that drop from a button. */
.popover {
  position: absolute; top: calc(100% + 10 * var(--z)); right: 0; z-index: 40;
  min-width: calc(260 * var(--z)); padding: calc(8 * var(--z));
  border-radius: calc(14 * var(--z)); background: #121419;
  box-shadow: 0 0 0 1px var(--line-2), 0 calc(24 * var(--z)) calc(60 * var(--z)) rgba(0, 0, 0, 0.55);
  font-size: calc(14 * var(--zt));
}
.popover[hidden] { display: none; }
.pop-title { padding: calc(8 * var(--z)) calc(10 * var(--z)) calc(6 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-4); }
.pop-item {
  display: flex; align-items: center; gap: calc(12 * var(--z)); width: 100%;
  padding: calc(10 * var(--z)); border-radius: calc(9 * var(--z)); text-align: left; color: var(--text-2);
}
.pop-item:hover, .pop-item[aria-selected='true'], .pop-item:focus-visible { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.pop-item .i { width: calc(18 * var(--z)); flex: none; color: var(--text-3); }
.pop-item small { display: block; margin-top: calc(2 * var(--z)); font-size: calc(12.5 * var(--zt)); color: var(--text-4); }
.pop-item[aria-checked='true']::after { content: ''; margin-left: auto; width: calc(7 * var(--z)); height: calc(7 * var(--z)); border-radius: 50%; background: var(--periwinkle); }
.pop-rule { height: 1px; margin: calc(6 * var(--z)); background: var(--line); }
.pop-empty { padding: calc(14 * var(--z)) calc(10 * var(--z)); color: var(--text-3); }
.account { width: calc(280 * var(--z)); }
.account-who { display: flex; align-items: center; gap: calc(12 * var(--z)); padding: calc(10 * var(--z)); }
.account-who .avatar { width: calc(40 * var(--z)); height: calc(40 * var(--z)); font-size: calc(15 * var(--zt)); }
.account-who b { display: block; font-weight: 500; color: var(--text); }
.account-who span { font-size: calc(12.5 * var(--zt)); color: var(--text-4); }

/* ---------- Home ---------- */

.home { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); grid-template-rows: minmax(0, 1fr) auto; }
.journey-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: calc(30 * var(--z)) calc(40 * var(--z)) calc(18 * var(--z)) var(--pad); }
.greeting { font-size: calc(24 * var(--zt)); font-weight: 400; line-height: calc(42 * var(--z)); letter-spacing: -0.012em; color: var(--text-2); }

/* The learning path. The course's name sits at the upper left; the chapters rise from the lower left to the upper
   right along a fine line, gold where it has been travelled and dotted ahead. */
.journey { position: relative; flex: 1; min-height: calc(560 * var(--z)); margin-top: calc(28 * var(--z)); }
.journey-head { position: relative; z-index: 2; max-width: calc(470 * var(--z)); }
.journey-head h2 { margin-top: calc(14 * var(--z)); font-size: calc(54 * var(--zt)); font-weight: 400; line-height: 1.02; letter-spacing: -0.035em; color: var(--text); }
.journey-sum { margin-top: calc(16 * var(--z)); max-width: calc(410 * var(--z)); font-size: calc(16 * var(--zt)); line-height: 1.5; color: var(--text-3); }
.journey-meta { margin-top: calc(14 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-4); }
.journey-meta a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 0.22em; transition: color 0.2s, text-decoration-color 0.2s; }
.journey-meta a:hover { color: var(--text); text-decoration-color: var(--text-3); }

.path, .chapters { position: absolute; inset: 0; }
.path-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.path-line path { fill: none; }
.path-line .is-done { stroke: rgba(233, 215, 139, 0.75); stroke-width: 1.5px; }
.path-line .is-ahead { stroke: rgba(240, 236, 224, 0.24); stroke-width: 1.3px; stroke-dasharray: 1 7; }

.chapter { --d: calc(112 * var(--z)); position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.chapter.is-current { --d: calc(168 * var(--z)); z-index: 1; }
.ch-link {
  position: absolute; top: calc(var(--d) / -2); left: 0; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; width: calc(210 * var(--z)); text-align: center;
  border-radius: calc(16 * var(--z));
}
.is-current .ch-link { width: var(--d); border-radius: 50%; }
.ch-link:focus-visible { outline: 0; }
.ch-link:focus-visible .plate { outline: calc(2 * var(--z)) solid var(--lavender-2); outline-offset: calc(5 * var(--z)); }

/* A milestone's plate: a dark disc lit a little from above, its drawing inside. */
.plate {
  position: relative; display: block; flex: none; width: var(--d); height: var(--d); border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #161922, #0b0c10 68%, #090a0d);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 calc(12 * var(--z)) calc(32 * var(--z)) rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.35s, transform 0.5s var(--ease-out);
}
.plate-art { position: absolute; inset: 0; transition: opacity 0.35s; }
.plate-art svg { display: block; width: 100%; height: 100%; }
/* Line weights are in the drawing's own units (120 across), set for each plate size so a line is about a pixel wide
   at the composition's scale on either. */
.plate-art svg { --sw: 1.12; }
.is-current .plate-art svg { --sw: 0.76; }
.plate-art svg * { fill: none; stroke-width: var(--sw); }
.plate-art .ln { stroke: rgba(240, 236, 224, 0.38); }
.plate-art .fn { stroke: rgba(240, 236, 224, 0.16); }
.plate-art .au { stroke: var(--gold); }
.plate-art .pw { stroke: #9aa3ec; }
.plate-art .wt { stroke: var(--paper); }
.plate-art .dotted { stroke-dasharray: 0 calc(var(--sw) * 3.2); stroke-width: calc(var(--sw) * 1.5); }
.plate-art .dot { fill: var(--gold); stroke: none; }
.plate-art .dep { fill: rgba(233, 215, 139, 0.5); stroke: none; }
.plate-art .q-name { fill: rgba(240, 236, 224, 0.85); stroke: none; font: 500 7.5px var(--font); text-anchor: middle; }
.plate-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--d) * 0.3); font-weight: 300; letter-spacing: -0.04em; color: var(--text-3); }

.badge { position: absolute; right: 3%; bottom: 3%; display: grid; place-items: center; width: calc(26 * var(--z)); height: calc(26 * var(--z)); border-radius: 50%; }
.badge svg { width: calc(14 * var(--z)); stroke-width: 2.2; }
.is-done .badge { background: var(--gold); color: var(--lime-ink); box-shadow: 0 0 0 calc(3 * var(--z)) #07080a; }
.is-locked .badge { background: #14161c; color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line-2), 0 0 0 calc(3 * var(--z)) #07080a; }
.is-locked .badge svg { width: calc(13 * var(--z)); stroke-width: 1.7; }

.is-done .plate { box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.4), 0 calc(12 * var(--z)) calc(32 * var(--z)) rgba(0, 0, 0, 0.5); }
.is-current .plate {
  background: radial-gradient(circle at 50% 36%, #1b1e29, #0c0d12 68%, #0a0b0e);
  box-shadow: inset 0 0 0 calc(1.5 * var(--z)) rgba(233, 215, 139, 0.85), 0 0 0 calc(9 * var(--z)) rgba(233, 215, 139, 0.045), 0 0 calc(70 * var(--z)) rgba(233, 215, 139, 0.12);
}
.is-locked .plate { background: radial-gradient(circle at 50% 38%, #121419, #0a0b0e 68%); }
.is-locked .plate-art { opacity: 0.34; }

.ch-link:hover .plate { transform: scale(1.035); }
.is-done .ch-link:hover .plate { box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.75), 0 calc(12 * var(--z)) calc(32 * var(--z)) rgba(0, 0, 0, 0.5); }
.is-locked .ch-link:hover .plate { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 calc(12 * var(--z)) calc(32 * var(--z)) rgba(0, 0, 0, 0.5); }
.is-locked .ch-link:hover .plate-art { opacity: 0.62; }
.is-current .ch-link:hover .plate { transform: scale(1.02); }

.ch-label { display: grid; gap: calc(4 * var(--z)); margin-top: calc(14 * var(--z)); }
.ch-name { font-size: calc(15.5 * var(--zt)); font-weight: 500; line-height: 1.3; color: var(--text-2); transition: color 0.2s; }
.ch-num { margin-right: calc(8 * var(--z)); font-size: calc(12 * var(--zt)); font-weight: 500; letter-spacing: 0.06em; color: var(--text-4); font-variant-numeric: tabular-nums; }
.ch-line { font-size: calc(13 * var(--zt)); color: var(--text-4); }
.is-locked .ch-name { color: var(--text-3); }
.ch-link:hover .ch-name { color: var(--text); }

/* The chapter in progress: its name, the lesson next and the one action, under its plate. */
.now { position: absolute; top: calc(var(--d) / 2 + 20 * var(--z)); left: calc(var(--d) / -2); width: calc(400 * var(--z)); }
.now .eyebrow { color: var(--gold); }
.now h3 { margin-top: calc(9 * var(--z)); font-size: calc(26 * var(--zt)); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; color: var(--text); }
.now-meta { display: flex; align-items: center; gap: calc(12 * var(--z)); margin-top: calc(10 * var(--z)); font-size: calc(14 * var(--zt)); color: var(--text-3); }
.pips { display: inline-flex; gap: calc(5 * var(--z)); }
.pips i { width: calc(7 * var(--z)); height: calc(7 * var(--z)); border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.pips .is-done { background: var(--gold); }
.pips .is-now { background: none; box-shadow: inset 0 0 0 calc(1.5 * var(--z)) var(--gold); }
.now-acts { display: flex; align-items: center; gap: calc(22 * var(--z)); margin-top: calc(18 * var(--z)); }
.continue {
  display: inline-flex; align-items: center; gap: calc(12 * var(--z));
  height: calc(52 * var(--z)); padding: 0 calc(22 * var(--z)) 0 calc(28 * var(--z));
  border-radius: 999px; background: var(--gold); color: var(--lime-ink);
  font-size: calc(16.5 * var(--zt)); font-weight: 600; letter-spacing: -0.005em;
  box-shadow: 0 calc(10 * var(--z)) calc(30 * var(--z)) rgba(233, 215, 139, 0.14);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.continue .i { width: calc(19 * var(--z)); stroke-width: 2; transition: transform 0.35s var(--ease-out); }
.continue:hover { background: var(--lime-hover); box-shadow: 0 calc(12 * var(--z)) calc(36 * var(--z)) rgba(233, 215, 139, 0.22); }
.continue:hover .i { transform: translateX(calc(3 * var(--z))); }
.ask-q { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); padding: calc(8 * var(--z)) calc(4 * var(--z)); font-size: calc(14.5 * var(--zt)); font-weight: 500; color: var(--text-3); transition: color 0.2s; }
.ask-q .q-mark { width: calc(19 * var(--z)); }
.ask-q:hover { color: var(--text); }
.continue-note { margin-top: calc(10 * var(--z)); max-width: calc(400 * var(--z)); font-size: calc(12.5 * var(--zt)); line-height: 1.45; color: var(--text-4); }
.continue-note a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 0.22em; }
.continue-note a:hover { color: var(--text); }

/* ---------- Learning Rhythm ---------- */

/* The rail's sections spread over its height, so the last one meets the course strip, with a hairline centred in each
   gap between them. */
.side { position: relative; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: calc(20 * var(--z)); padding: calc(100 * var(--z)) calc(38 * var(--z)) calc(22 * var(--z)); border-left: 1px solid var(--line); }
.side > hr { flex: none; width: 100%; height: 1px; margin: 0; border: 0; background: var(--line); }

.streak { display: flex; align-items: flex-end; gap: calc(14 * var(--z)); margin-top: calc(18 * var(--z)); }
.streak-n { font-size: calc(72 * var(--zt)); font-weight: 300; line-height: 0.8; letter-spacing: -0.03em; color: var(--gold); }
.streak-unit { padding-bottom: calc(1 * var(--z)); font-size: calc(17 * var(--zt)); line-height: 1.2; color: var(--text-2); }
.streak.is-fresh .streak-unit { font-size: calc(30 * var(--zt)); font-weight: 400; letter-spacing: -0.02em; color: var(--text); }
.streak-note { margin-top: calc(14 * var(--z)); font-size: calc(14 * var(--zt)); color: var(--text-3); }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: calc(20 * var(--z)); }
.week li { display: grid; justify-items: center; gap: calc(9 * var(--z)); }
.week .pip { display: grid; place-items: center; width: calc(32 * var(--z)); height: calc(32 * var(--z)); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); transition: transform 0.3s var(--ease-out); }
.week .pip .i { width: calc(15 * var(--z)); stroke-width: 2.2; }
.week .is-on .pip { background: var(--gold); color: var(--lime-ink); box-shadow: none; }
.week .is-today:not(.is-on) .pip { box-shadow: none; border: calc(1.5 * var(--z)) dashed rgba(233, 215, 139, 0.7); }
.week li:hover .pip { transform: scale(1.08); }
.week .wd { font-size: calc(12 * var(--zt)); color: var(--text-4); }
.week .is-today .wd { color: var(--text); font-weight: 500; }

.year-head { display: flex; align-items: baseline; justify-content: space-between; gap: calc(12 * var(--z)); }
.year-head p { margin-left: auto; font-size: calc(13 * var(--zt)); color: var(--text-3); }
.year-head b { font-weight: 500; color: var(--text); }
.heat { margin-top: calc(14 * var(--z)); border-radius: calc(4 * var(--z)); }
.heat:focus-visible { outline-offset: calc(6 * var(--z)); }
.heat-grid { display: grid; grid-template-columns: repeat(53, minmax(0, 1fr)); grid-template-rows: repeat(7, auto); grid-auto-flow: column; gap: calc(2 * var(--z)); }
.heat-grid i, .legend i { aspect-ratio: 1; border-radius: calc(1.5 * var(--z)); background: rgba(255, 255, 255, 0.055); }
.app [data-l='1'] { background: rgba(233, 215, 139, 0.2); }
.app [data-l='2'] { background: rgba(233, 215, 139, 0.4); }
.app [data-l='3'] { background: rgba(233, 215, 139, 0.66); }
.app [data-l='4'] { background: var(--gold); }
.heat-grid .is-future { visibility: hidden; }
.heat-grid .is-before { background: none; }
.heat-grid .is-active { outline: 1px solid var(--text); outline-offset: 1px; }
.heat-months { display: grid; grid-template-columns: repeat(53, minmax(0, 1fr)); margin-top: calc(8 * var(--z)); font-size: calc(11 * var(--zt)); color: var(--text-4); }
.heat-months span { grid-row: 1; white-space: nowrap; }
/* A month at a time, for learners here less than a year: a calendar, Monday first, with the months since they joined
   a step away. */
.cal-nav { display: inline-flex; gap: calc(2 * var(--z)); margin-right: calc(-6 * var(--z)); }
.cal-step { display: grid; place-items: center; width: calc(26 * var(--z)); height: calc(26 * var(--z)); border-radius: 50%; color: var(--text-3); transition: color 0.2s, background-color 0.2s; }
.cal-step .i { width: calc(15 * var(--z)); }
.cal-step:first-child .i { transform: rotate(180deg); }
.cal-step:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.cal-step:disabled { opacity: 0.28; cursor: default; }
.cal-days, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: calc(4 * var(--z)); }
.cal-days { margin-bottom: calc(6 * var(--z)); font-size: calc(11 * var(--zt)); text-align: center; color: var(--text-4); }
.cal-grid i { height: calc(16 * var(--z)); border-radius: calc(3 * var(--z)); background: rgba(255, 255, 255, 0.055); }
.cal-grid .pad { background: none; }
.cal-grid .is-future { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05); }
.cal-grid .is-before { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cal-grid .is-today[data-l='0'] { background: none; box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.6); }
.cal-grid .is-active { outline: 1px solid var(--text); outline-offset: 1px; }
.heat-foot { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--z)); margin-top: calc(12 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-4); }
.legend { display: inline-flex; align-items: center; gap: calc(4 * var(--z)); }
.legend i { width: calc(9 * var(--z)); }
.legend i:first-of-type { margin-left: calc(4 * var(--z)); }
.legend i:last-of-type { margin-right: calc(4 * var(--z)); }
.heat-note { margin-top: calc(10 * var(--z)); font-size: calc(12 * var(--zt)); line-height: 1.45; color: var(--text-4); }

.revisit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: calc(16 * var(--z)); margin-top: calc(12 * var(--z)); }
.rv-name { font-size: calc(17 * var(--zt)); font-weight: 500; color: var(--text); }
.rv-sub { margin-top: calc(4 * var(--z)); font-size: calc(13 * var(--zt)); line-height: 1.4; color: var(--text-3); }
.rv-act { display: inline-flex; align-items: center; gap: calc(6 * var(--z)); padding: calc(6 * var(--z)) 0; font-size: calc(14 * var(--zt)); font-weight: 500; color: var(--gold); transition: color 0.2s; }
.rv-act .i { width: calc(16 * var(--z)); transition: transform 0.3s var(--ease-out); }
.rv-act:hover { color: var(--lime-hover); }
.rv-act:hover .i { transform: translateX(calc(2 * var(--z))); }

.tip {
  position: fixed; z-index: 70; translate: -50% calc(-100% - 8 * var(--z));
  padding: calc(6 * var(--z)) calc(10 * var(--z)); border-radius: calc(8 * var(--z)); white-space: nowrap;
  font-size: calc(12.5 * var(--zt)); color: var(--text); background: #1a1d24;
  box-shadow: 0 0 0 1px var(--line-2), 0 calc(8 * var(--z)) calc(24 * var(--z)) rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.tip[hidden] { display: none; }

/* ---------- The other courses ---------- */

.more { grid-column: 1 / -1; padding: calc(18 * var(--z)) calc(38 * var(--z)) calc(22 * var(--z)) var(--pad); border-top: 1px solid var(--line); }
.more-head { display: flex; align-items: baseline; justify-content: space-between; gap: calc(16 * var(--z)); }
.more-links { display: flex; gap: calc(26 * var(--z)); }
.more-links a { display: inline-flex; align-items: center; gap: calc(6 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-3); transition: color 0.2s; }
.more-links .i { width: calc(15 * var(--z)); transition: transform 0.3s var(--ease-out); }
.more-links a:hover { color: var(--text); }
.more-links a:hover .i { transform: translateX(calc(2 * var(--z))); }
.more-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(18 * var(--z)); margin-top: calc(13 * var(--z)); }
.course-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: center; gap: calc(12 * var(--z));
  height: calc(92 * var(--z)); padding: 0 calc(22 * var(--z)) 0 calc(24 * var(--z));
  border-radius: calc(14 * var(--z)); background: #0b0c10;
}
.course-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.3s; pointer-events: none; }
.course-card:hover::after { box-shadow: inset 0 0 0 1px var(--line-3); }
.course-card img {
  position: absolute; z-index: -1; top: 0; right: 0; width: 68%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.6) 35%, #000 75%);
  mask-image: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.6) 35%, #000 75%);
  opacity: 0.42; filter: saturate(0.8); transition: opacity 0.4s, transform 0.9s var(--ease-out);
}
.course-card:hover img { opacity: 0.78; transform: scale(1.03); }
.cc-text { display: grid; gap: calc(3 * var(--z)); flex: 1; min-width: 0; }
.cc-subject { font-size: calc(11.5 * var(--zt)); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-4); }
.cc-title { font-size: calc(18 * var(--zt)); font-weight: 500; letter-spacing: -0.01em; color: var(--text); }
.cc-meta { font-size: calc(13 * var(--zt)); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 0 calc(10 * var(--z)) #000; }
.course-card > .i { flex: none; width: calc(18 * var(--z)); color: var(--text-2); opacity: 0; transform: translateX(calc(-4 * var(--z))); transition: opacity 0.3s, transform 0.35s var(--ease-out); }
.course-card:hover > .i, .course-card:focus-visible > .i { opacity: 1; transform: none; }

/* ---------- Arrival ---------- */

@media (prefers-reduced-motion: no-preference) {
  .home.is-ready .chapter { animation: rise 0.8s var(--ease-out) both; animation-delay: calc(120ms + var(--i) * 90ms); }
  .home.is-ready .path-line .is-done { stroke-dasharray: 1; animation: draw 1.1s var(--ease-out) 0.25s both; }
  .home.is-ready .path-line .is-ahead { animation: fade 1s ease 0.6s both; }
  .home.is-ready .is-current .plate-art .au, .home.is-ready .is-current .plate-art .pw { stroke-dasharray: 1; animation: draw 2.2s var(--ease-out) 0.55s both; }
  .home.is-ready .side > section, .home.is-ready .more { animation: fade 0.9s ease both; animation-delay: 0.3s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(calc(10 * var(--z))); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- My Learning and Settings ---------- */

.page { padding: calc(30 * var(--z)) calc(38 * var(--z)) calc(40 * var(--z)) var(--pad); }
.page-head h1 { font-size: calc(34 * var(--zt)); font-weight: 400; line-height: calc(42 * var(--z)); letter-spacing: -0.025em; }
.page-head p { margin-top: calc(8 * var(--z)); max-width: calc(640 * var(--z)); font-size: calc(15 * var(--zt)); line-height: 1.5; color: var(--text-3); }
.learning-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: calc(18 * var(--z)); margin-top: calc(28 * var(--z)); }
.page-note { display: flex; flex-wrap: wrap; gap: calc(12 * var(--z)); margin-top: calc(18 * var(--z)); }
.page-note a { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); padding: calc(10 * var(--z)) calc(16 * var(--z)); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: calc(14 * var(--zt)); color: var(--text-2); }
.page-note a:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.page-note .i { width: calc(16 * var(--z)); }

.card {
  position: relative; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  padding: calc(22 * var(--z));
  border-radius: calc(18 * var(--z));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.006) 40%), #0c0e12;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.075);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--z)); margin-bottom: calc(14 * var(--z)); }
.card-head h2 { font-size: calc(18.5 * var(--zt)); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.card-head h2 small { display: block; margin-top: calc(2 * var(--z)); font-size: calc(12.5 * var(--zt)); font-weight: 400; letter-spacing: 0; color: var(--text-4); }
.link-btn { display: inline-flex; align-items: center; gap: calc(6 * var(--z)); flex: none; font-size: calc(14 * var(--zt)); color: var(--peri-2); transition: color 0.2s; }
.link-btn .i { width: calc(16 * var(--z)); }
.link-btn:hover { color: var(--text); }
.select-btn {
  display: inline-flex; align-items: center; gap: calc(6 * var(--z));
  padding: calc(6 * var(--z)) calc(10 * var(--z)) calc(6 * var(--z)) calc(12 * var(--z));
  border-radius: calc(9 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-2);
  background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--row-line);
}
.select-btn:hover, .select-btn[aria-expanded='true'] { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.select-btn .i { width: calc(15 * var(--z)); }
.menu { position: relative; }
.menu .popover { min-width: calc(200 * var(--z)); top: calc(100% + 6 * var(--z)); }

/* The course list. */
.course-list { display: flex; flex-direction: column; gap: calc(9 * var(--z)); }
.course-list > li { display: flex; height: calc(84 * var(--z)); }
.course-row {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: calc(86 * var(--z)) minmax(0, 1fr) calc(110 * var(--z)) calc(18 * var(--z));
  align-items: center; gap: calc(16 * var(--z));
  padding: calc(6 * var(--z)) calc(16 * var(--z)) calc(6 * var(--z)) calc(6 * var(--z));
  border-radius: calc(12 * var(--z)); background: var(--row); box-shadow: inset 0 0 0 1px var(--row-line);
  transition: background-color 0.2s, box-shadow 0.2s;
}
.course-row:hover { background: var(--row-hover); box-shadow: inset 0 0 0 1px var(--line-2); }
.course-thumb { position: relative; align-self: stretch; overflow: hidden; border-radius: calc(9 * var(--z)); background: #111; }
.course-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.course-name, .course-meta { display: block; }
.course-name { font-size: calc(16.5 * var(--zt)); font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-meta { margin-top: calc(4 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-progress { display: flex; flex-direction: column; gap: calc(8 * var(--z)); }
.course-progress b { font-size: calc(14.5 * var(--zt)); font-weight: 500; font-variant-numeric: tabular-nums; }
.course-progress b small { margin-left: calc(8 * var(--z)); font-size: calc(12 * var(--zt)); font-weight: 400; color: var(--text-4); }
.bar { height: calc(5 * var(--z)); border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--periwinkle); }
.is-complete .bar > span { background: var(--gold); }
.is-complete .course-progress b small { color: var(--gold); }
.course-row > .i { width: calc(18 * var(--z)); color: var(--text-3); transition: transform 0.3s var(--ease-out), color 0.2s; }
.course-row:hover > .i { color: var(--text); transform: translateX(calc(2 * var(--z))); }
.list-empty { flex: 1; display: grid; place-items: center; color: var(--text-3); font-size: calc(14 * var(--zt)); }

/* The Understanding Map. */
.map-scroll { position: relative; height: calc(520 * var(--z)); }
.map-field { position: absolute; inset: calc(16 * var(--z)) calc(48 * var(--z)) calc(30 * var(--z)); }
.map-links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-links line { stroke: rgba(255, 255, 255, 0.13); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 0.25s, stroke-width 0.25s; }
.map-links line.is-lit { stroke: rgba(233, 215, 139, 0.55); stroke-width: 1.3; }
.map-field.is-focused line:not(.is-lit) { stroke: rgba(255, 255, 255, 0.07); }
.node {
  position: absolute; left: var(--x); top: var(--y); translate: -50% -50%;
  display: grid; justify-items: center; gap: calc(6 * var(--z));
  width: calc(26 * var(--z)); height: calc(26 * var(--z));
  border-radius: 50%; z-index: 1; transition: opacity 0.25s;
}
.orb { position: relative; width: calc(26 * var(--z)); height: calc(26 * var(--z)); border-radius: 50%; transition: transform 0.3s var(--ease-out), box-shadow 0.3s; }
.orb::after { content: ''; position: absolute; inset: 27%; border-radius: 50%; }
.node-label {
  position: absolute; top: calc(100% + 7 * var(--z)); left: 50%; translate: -50% 0;
  width: max-content; max-width: calc(120 * var(--z));
  font-size: calc(13 * var(--zt)); line-height: 1.25; text-align: center; color: var(--text-2);
  text-shadow: 0 0 calc(8 * var(--z)) #0c0e12, 0 0 calc(3 * var(--z)) #0c0e12; transition: color 0.2s;
}
.node[data-label='left'] .node-label { top: 50%; left: auto; right: calc(100% + 10 * var(--z)); translate: 0 -50%; text-align: right; }
.node[data-label='right'] .node-label { top: 50%; left: calc(100% + 10 * var(--z)); translate: 0 -50%; text-align: left; }
.node[data-state='mastered'] .orb { background: radial-gradient(circle at 50% 50%, #fff3cf 0, #e9d78b 34%, #7a6a32 70%, #2a2512 100%); box-shadow: 0 0 0 calc(4 * var(--z)) rgba(233, 215, 139, 0.1), 0 0 calc(16 * var(--z)) rgba(233, 215, 139, 0.32); }
.node[data-state='developing'] .orb { background: radial-gradient(circle, rgba(124, 135, 221, 0.25), rgba(124, 135, 221, 0.06) 70%); box-shadow: inset 0 0 0 calc(1.5 * var(--z)) #8f99e6, 0 0 calc(14 * var(--z)) rgba(124, 135, 221, 0.35); }
.node[data-state='developing'] .orb::after { background: radial-gradient(circle, #e6e8ff, #8f99e6 70%); }
.node[data-state='review'] .orb { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 calc(1.5 * var(--z)) rgba(233, 215, 139, 0.75); }
.node[data-state='review'] .orb::after { inset: 34%; background: #8d8f99; }
.node[data-state='new'] .orb { background: #0c0e12; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
.node.is-focus { width: calc(92 * var(--z)); height: calc(92 * var(--z)); z-index: 2; }
.node.is-focus .orb { width: 100%; height: 100%; background: radial-gradient(circle at 50% 40%, #1b1e36, #0d0f19 75%); box-shadow: inset 0 0 0 calc(1.5 * var(--z)) #8f99e6, 0 0 0 calc(6 * var(--z)) rgba(124, 135, 221, 0.08), 0 0 calc(30 * var(--z)) rgba(124, 135, 221, 0.3); }
.node.is-focus .orb::after { display: none; }
.node.is-focus .node-label { top: 50%; translate: -50% -50%; max-width: calc(80 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text); text-shadow: none; }
.node:hover .orb, .node[aria-expanded='true'] .orb { transform: scale(1.12); }
.node.is-focus:hover .orb, .node.is-focus[aria-expanded='true'] .orb { transform: scale(1.04); }
.node:hover .node-label, .node[aria-expanded='true'] .node-label, .node.is-near .node-label { color: var(--text); }
.map-field.is-focused .node:not(.is-near):not([aria-expanded='true']) { opacity: 0.55; }
.node:focus-visible { outline-offset: calc(5 * var(--z)); border-radius: 50%; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: calc(6 * var(--z)) calc(22 * var(--z)); font-size: calc(12.5 * var(--zt)); color: var(--text-3); }
.map-legend span { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); }
.map-legend i { width: calc(9 * var(--z)); height: calc(9 * var(--z)); border-radius: 50%; }
.map-legend [data-state='mastered'] i { background: var(--gold); }
.map-legend [data-state='developing'] i { background: #8f99e6; }
.map-legend [data-state='review'] i { background: #8d8f99; box-shadow: 0 0 0 1.5px rgba(233, 215, 139, 0.75); }
.map-legend [data-state='new'] i { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
.map-detail {
  position: absolute; z-index: 5; top: calc(64 * var(--z)); width: min(calc(300 * var(--z)), calc(100% - 24 * var(--z)));
  max-height: calc(100% - 76 * var(--z)); overflow: auto; overscroll-behavior: contain;
  padding: calc(14 * var(--z)) calc(16 * var(--z));
  border-radius: calc(14 * var(--z)); background: rgba(18, 20, 26, 0.97);
  box-shadow: 0 0 0 1px var(--line-2), 0 calc(20 * var(--z)) calc(50 * var(--z)) rgba(0, 0, 0, 0.55);
  font-size: calc(13 * var(--zt)); line-height: 1.45;
}
.map-detail[data-side='left'] { left: calc(12 * var(--z)); }
.map-detail[data-side='right'] { right: calc(12 * var(--z)); }
.map-detail .state { display: inline-flex; align-items: center; gap: calc(7 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-3); }
.map-detail .state i { width: calc(8 * var(--z)); height: calc(8 * var(--z)); border-radius: 50%; }
.map-detail h3 { margin: calc(4 * var(--z)) 0; font-size: calc(17 * var(--zt)); font-weight: 500; letter-spacing: -0.01em; }
.map-detail p { color: var(--text-2); }
.map-detail .evidence { margin-top: calc(6 * var(--z)); font-size: calc(12.5 * var(--zt)); color: var(--text-4); }
.map-detail .rel { margin-top: calc(8 * var(--z)); display: flex; flex-wrap: wrap; align-items: center; gap: calc(5 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-4); }
.map-detail .rel button { padding: calc(2 * var(--z)) calc(8 * var(--z)); border-radius: 99px; font-size: calc(12 * var(--zt)); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.map-detail .rel button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.map-detail .acts { display: flex; flex-wrap: wrap; gap: calc(8 * var(--z)); margin-top: calc(12 * var(--z)); }
.map-detail .acts a, .map-detail .acts button { display: inline-flex; align-items: center; gap: calc(7 * var(--z)); padding: calc(7 * var(--z)) calc(12 * var(--z)); border-radius: 99px; font-size: calc(13 * var(--zt)); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); }
.map-detail .acts a:first-child { background: var(--gold); color: var(--lime-ink); box-shadow: none; font-weight: 500; }
.map-detail .acts .i, .map-detail .acts .q-mark { width: calc(15 * var(--z)); }
.map-detail .acts :hover { color: var(--text); }
.map-detail .acts a:first-child:hover { background: var(--lime-hover); color: var(--lime-ink); }
.map-detail .x { position: absolute; top: calc(8 * var(--z)); right: calc(8 * var(--z)); display: grid; place-items: center; width: calc(28 * var(--z)); height: calc(28 * var(--z)); border-radius: 50%; color: var(--text-3); }
.map-detail .x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.map-detail .x .i { width: calc(16 * var(--z)); }
.state[data-state='mastered'] i { background: var(--gold); }
.state[data-state='developing'] i { background: #8f99e6; }
.state[data-state='review'] i { background: #8d8f99; box-shadow: 0 0 0 1.5px rgba(233, 215, 139, 0.75); }
.state[data-state='new'] i { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45); }

/* ---------- Search ---------- */

.search-layer {
  position: fixed; inset: 0; z-index: 80;
  display: grid; justify-items: center; align-content: start; padding: 14vh 16px 0;
  background: rgba(4, 5, 7, 0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.search-layer[hidden] { display: none; }
.search-box { width: min(calc(640 * var(--z)), 100%); overflow: hidden; border-radius: calc(16 * var(--z)); background: #111318; box-shadow: 0 0 0 1px var(--line-2), 0 calc(30 * var(--z)) calc(80 * var(--z)) rgba(0, 0, 0, 0.6); }
.search { display: flex; align-items: center; gap: calc(12 * var(--z)); height: calc(60 * var(--z)); padding: 0 calc(16 * var(--z)) 0 calc(20 * var(--z)); border-bottom: 1px solid var(--line); }
.search-icon { width: calc(21 * var(--z)); flex: none; color: var(--text-2); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: calc(17 * var(--zt)); }
.search input::placeholder { color: var(--text-4); }
.search input::-webkit-search-cancel-button { display: none; }
.search-key { flex: none; font: inherit; font-size: calc(12 * var(--zt)); color: var(--text-4); padding: calc(3 * var(--z)) calc(8 * var(--z)); border-radius: calc(7 * var(--z)); box-shadow: inset 0 0 0 1px var(--line-2); }
.search-results { max-height: min(60vh, calc(460 * var(--z))); overflow: auto; padding: calc(8 * var(--z)); font-size: calc(14 * var(--zt)); }
.search-results mark { background: none; color: var(--text); font-weight: 600; }
.search-results .ask .q-mark { width: calc(18 * var(--z)); flex: none; }

/* ---------- Shared by the lesson, Ask Q and the study room ---------- */

/* Diagrams are drawn in the composition's pixels: the probe measures 100 of them so a chamber can size its drawing. */
.z-probe { position: absolute; visibility: hidden; width: calc(100 * var(--z)); height: 0; pointer-events: none; }
.chamber { position: absolute; inset: 0; width: 100%; height: 100%; }
.chamber path, .fig-svg path { fill: none; }
.app .field { stroke: rgba(240, 236, 224, 0.08); stroke-width: 1; }
.app .field.dots { stroke: rgba(240, 236, 224, 0.16); stroke-width: 2.6; }
.app .photon { stroke: rgba(240, 236, 224, 0.82); stroke-width: 1.3; }
.app .trk { stroke-width: 1.5; }
.app .trk.e { stroke: #9aa3ec; }
.app .trk.p { stroke: var(--gold); }
.app .ann { stroke: rgba(240, 236, 224, 0.55); stroke-width: 1.1; }
.app .nuc { fill: var(--gold); stroke: none; }
.app .nuc-ring { fill: rgba(233, 215, 139, 0.06); stroke: rgba(233, 215, 139, 0.45); stroke-width: 1; }
.app .flash { fill: none; stroke: var(--gold); stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.app .recoil { stroke: rgba(233, 215, 139, 0.75); stroke-width: 1.2; }
.app .trace { opacity: 0.2; }
.app .trace .photon, .app .trace .ann, .app .trace .recoil { display: none; }
.app .guide { stroke: rgba(255, 255, 255, 0.12); stroke-width: 1; stroke-dasharray: 2 5; }
.app .photon-v { stroke: rgba(240, 236, 224, 0.85); stroke-width: 1.8; }
.app .nuc-v { stroke: rgba(233, 215, 139, 0.75); stroke-width: 1.8; stroke-dasharray: 5 4; }
.app .lbl { fill: var(--text-2); stroke: none; font: 500 13px var(--font); letter-spacing: 0.01em; }
.app .lbl.e { fill: #b9bff4; }
.app .lbl.p, .app .lbl.gold { fill: var(--gold); }
.app .note { fill: var(--text-3); stroke: none; font: 400 12.5px var(--font); }
.app .eyebrow-s { fill: var(--text-4); stroke: none; font: 500 11px var(--font); letter-spacing: 0.16em; }
.app .mid { text-anchor: middle; }
.app .end { text-anchor: end; }

/* A dark exhibit case for a drawing, lit a little from the left. */
.stage, .a-visual figure, .room-stage {
  position: relative; overflow: hidden; border-radius: calc(20 * var(--z));
  background: radial-gradient(120% 90% at 32% 42%, #0f1117, #08090c 72%);
  box-shadow: inset 0 0 0 1px var(--line);
}
.stage-fill { position: absolute; inset: 0; }
.stage-cap { position: absolute; left: calc(24 * var(--z)); bottom: calc(20 * var(--z)); font-size: calc(13 * var(--zt)); color: var(--text-4); }

/* Controls. */
.app input[type='range'] { -webkit-appearance: none; appearance: none; height: calc(24 * var(--z)); background: transparent; cursor: pointer; }
.app input[type='range']::-webkit-slider-runnable-track { height: calc(3 * var(--z)); border-radius: 99px; background: rgba(255, 255, 255, 0.16); }
.app input[type='range']::-moz-range-track { height: calc(3 * var(--z)); border-radius: 99px; background: rgba(255, 255, 255, 0.16); }
.app input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: calc(18 * var(--z)); height: calc(18 * var(--z)); margin-top: calc(-7.5 * var(--z)); border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 calc(5 * var(--z)) rgba(233, 215, 139, 0.14); }
.app input[type='range']::-moz-range-thumb { width: calc(18 * var(--z)); height: calc(18 * var(--z)); border: 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 calc(5 * var(--z)) rgba(233, 215, 139, 0.14); }
.en { display: flex; align-items: center; gap: calc(14 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-3); }
.en input { flex: 1; min-width: calc(120 * var(--z)); }
.en output { min-width: calc(86 * var(--z)); text-align: right; font-size: calc(14.5 * var(--zt)); font-weight: 500; color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: calc(10 * var(--z)); padding: calc(6 * var(--z)) 0; font-size: calc(14 * var(--zt)); color: var(--text-2); white-space: nowrap; }
.switch i { position: relative; flex: none; width: calc(34 * var(--z)); height: calc(20 * var(--z)); border-radius: 99px; background: rgba(255, 255, 255, 0.14); transition: background-color 0.2s; }
.switch i::after { content: ''; position: absolute; top: calc(3 * var(--z)); left: calc(3 * var(--z)); width: calc(14 * var(--z)); height: calc(14 * var(--z)); border-radius: 50%; background: var(--text-2); transition: transform 0.25s var(--ease-out), background-color 0.2s; }
.switch[aria-pressed='true'] i { background: rgba(233, 215, 139, 0.32); }
.switch[aria-pressed='true'] i::after { transform: translateX(calc(14 * var(--z))); background: var(--gold); }
.fire { display: inline-flex; align-items: center; gap: calc(9 * var(--z)); height: calc(44 * var(--z)); padding: 0 calc(16 * var(--z)) 0 calc(20 * var(--z)); border-radius: 99px; background: var(--gold); color: var(--lime-ink); font-size: calc(14.5 * var(--zt)); font-weight: 600; white-space: nowrap; transition: background-color 0.2s; }
.fire .i { width: calc(17 * var(--z)); stroke-width: 2; }
.fire:hover { background: var(--lime-hover); }
.continue:disabled { background: rgba(255, 255, 255, 0.07); color: var(--text-4); box-shadow: none; cursor: default; }
.continue:disabled .i { transform: none; }
.back-btn { display: inline-flex; align-items: center; height: calc(44 * var(--z)); padding: 0 calc(18 * var(--z)); border-radius: 99px; font-size: calc(14.5 * var(--zt)); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: color 0.2s, box-shadow 0.2s; }
.back-btn:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.pick { padding: calc(10 * var(--z)) calc(18 * var(--z)); border-radius: 99px; font-size: calc(15 * var(--zt)); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: color 0.2s, box-shadow 0.2s, background-color 0.2s; }
.pick:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.pick[aria-pressed='true'] { color: var(--text); background: rgba(233, 215, 139, 0.1); box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.65); }
.choices { display: grid; gap: calc(8 * var(--z)); margin-top: calc(14 * var(--z)); }
.choice { display: flex; align-items: center; gap: calc(12 * var(--z)); width: 100%; padding: calc(12 * var(--z)) calc(16 * var(--z)); border-radius: calc(12 * var(--z)); text-align: left; font-size: calc(15 * var(--zt)); line-height: 1.4; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); transition: color 0.2s, box-shadow 0.2s, background-color 0.2s; }
.choice:hover { color: var(--text); background: var(--row); box-shadow: inset 0 0 0 1px var(--line-2); }
.choice-mark { flex: none; width: calc(14 * var(--z)); height: calc(14 * var(--z)); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-3); }
.choice.is-right { color: var(--text); box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.6); }
.choice.is-right .choice-mark { background: var(--gold); box-shadow: none; }
.choice.is-wrong { box-shadow: inset 0 0 0 1px rgba(229, 150, 130, 0.45); }
.choice.is-wrong .choice-mark { box-shadow: inset 0 0 0 calc(4 * var(--z)) rgba(229, 150, 130, 0.75); }
.say { margin-top: calc(14 * var(--z)); font-size: calc(14.5 * var(--zt)); line-height: 1.55; color: var(--text-2); }
.say:empty { display: none; }
.say.yes::before, .say.no::before { content: ''; display: inline-block; width: calc(7 * var(--z)); height: calc(7 * var(--z)); margin-right: calc(9 * var(--z)); border-radius: 50%; vertical-align: 0.1em; }
.say.yes::before { background: var(--gold); }
.say.no::before { box-shadow: inset 0 0 0 1.5px rgba(229, 150, 130, 0.85); }
.link-btn .q-mark { width: calc(17 * var(--z)); }

/* ---------- The lesson ---------- */

/* The text of each step on the left, its exhibit on the right; the five steps run along the top. */
.lesson {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: calc(430 * var(--z)) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  column-gap: calc(44 * var(--z)); row-gap: calc(20 * var(--z));
  padding: calc(26 * var(--z)) calc(36 * var(--z)) calc(30 * var(--z)) var(--pad);
}
.lesson-top { align-self: center; }
.lesson-back { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); font-size: calc(14 * var(--zt)); color: var(--text-3); transition: color 0.2s; }
.lesson-back .i { width: calc(16 * var(--z)); }
.lesson-back:hover { color: var(--text); }
.lesson-where { margin-top: calc(5 * var(--z)); font-size: calc(13 * var(--zt)); color: var(--text-4); }
.steps { align-self: center; display: flex; align-items: center; max-width: calc(600 * var(--z)); }
.steps li { display: flex; align-items: center; }
.steps li + li::before { content: ''; width: calc(30 * var(--z)); height: 1px; margin: 0 calc(12 * var(--z)); background: var(--line-2); }
.steps li.is-done + li::before { background: rgba(233, 215, 139, 0.5); }
.steps button { display: inline-flex; align-items: center; gap: calc(9 * var(--z)); padding: calc(4 * var(--z)) calc(2 * var(--z)); border-radius: 99px; font-size: calc(13.5 * var(--zt)); color: var(--text-3); white-space: nowrap; transition: color 0.2s; }
.steps button:not(:disabled):hover { color: var(--text); }
.steps button:disabled { color: var(--text-4); cursor: default; }
.step-mark { display: grid; place-items: center; width: calc(24 * var(--z)); height: calc(24 * var(--z)); border-radius: 50%; font-size: calc(12 * var(--zt)); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-2); }
.step-mark .i { width: calc(13 * var(--z)); stroke-width: 2.4; }
.steps .is-done .step-mark { background: var(--gold); color: var(--lime-ink); box-shadow: none; }
.steps .is-now button { color: var(--text); }
.steps .is-now:not(.is-done) .step-mark { color: var(--gold); box-shadow: inset 0 0 0 calc(1.5 * var(--z)) var(--gold); }

.lesson-text { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.lesson-text > .eyebrow { color: var(--gold); }
.lesson-text h2 { margin-top: calc(12 * var(--z)); font-size: calc(38 * var(--zt)); font-weight: 400; line-height: 1.08; letter-spacing: -0.03em; outline: 0; }
.lesson-text .lead { margin-top: calc(18 * var(--z)); font-size: calc(17.5 * var(--zt)); line-height: 1.55; color: var(--text-2); }
.lesson-text h2 + p:not(.lead), .lesson-text .lead + p, .lesson-text .task { margin-top: calc(12 * var(--z)); font-size: calc(15.5 * var(--zt)); line-height: 1.6; color: var(--text-3); }
.lesson-text .task { color: var(--text-2); }
.picks { display: flex; flex-wrap: wrap; gap: calc(10 * var(--z)); margin-top: calc(24 * var(--z)); }
.lesson-foot { display: grid; gap: calc(10 * var(--z)); margin-top: auto; padding-top: calc(24 * var(--z)); }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: calc(16 * var(--z)); }
.foot-go { display: flex; align-items: center; gap: calc(12 * var(--z)); }
.lesson-foot .ask-q { white-space: nowrap; }
.foot-hint { font-size: calc(12.5 * var(--zt)); color: var(--text-4); text-align: right; }
.foot-hint:empty { display: none; }
.lesson-foot .continue { white-space: nowrap; height: calc(48 * var(--z)); font-size: calc(15.5 * var(--zt)); padding: 0 calc(18 * var(--z)) 0 calc(24 * var(--z)); }

/* Step 2: the ledger. Energy on one scale, before and after; charge beside it. */
.ledger { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: calc(30 * var(--z)); padding: calc(40 * var(--z)) calc(48 * var(--z)); }
.lg-row { display: grid; grid-template-columns: calc(150 * var(--z)) minmax(0, 1fr) calc(150 * var(--z)); align-items: center; gap: calc(26 * var(--z)); }
.lg-after { align-items: end; }
.lg-head { margin-bottom: calc(-18 * var(--z)); }
.lg-scale { position: relative; height: calc(16 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-4); }
.lg-scale span { position: absolute; transform: translateX(-50%); }
.lg-scale .unit { right: 0; transform: none; }
.lg-col { font-size: calc(12 * var(--zt)); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-4); }
.lg-label { display: grid; gap: calc(6 * var(--z)); }
.lg-label b { font-size: calc(16 * var(--zt)); font-weight: 500; }
.lg-stack { display: grid; gap: calc(14 * var(--z)); }
.lg-picks { display: flex; flex-wrap: wrap; gap: calc(8 * var(--z)); }
.lg-picks .pick { padding: calc(8 * var(--z)) calc(15 * var(--z)); font-size: calc(15 * var(--zt)); }
.lg-bar {
  position: relative; display: flex; height: calc(50 * var(--z)); border-radius: calc(9 * var(--z)); overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px) 0 0 / 27.7778% 100%, rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg { flex: none; display: flex; align-items: center; height: 100%; padding: 0 calc(12 * var(--z)); font-style: normal; font-size: calc(12.5 * var(--zt)); white-space: nowrap; overflow: hidden; }
.seg.photon { border-radius: calc(9 * var(--z)); background: rgba(240, 236, 224, 0.08); box-shadow: inset 0 0 0 1px rgba(240, 236, 224, 0.42); color: var(--text-2); }
.seg.e { background: rgba(154, 163, 236, 0.2); box-shadow: inset 0 0 0 1px rgba(154, 163, 236, 0.7); color: #cfd3f8; }
.seg.p { background: rgba(233, 215, 139, 0.16); box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.7); color: var(--gold); }
.seg.e:first-child, .seg.p:first-child { border-radius: calc(9 * var(--z)) 0 0 calc(9 * var(--z)); }
.seg.motion { background: repeating-linear-gradient(135deg, rgba(240, 236, 224, 0.17) 0 1px, transparent 1px 7px); color: var(--text-3); }
.seg.empty { flex: 1; color: var(--text-4); }
.lg-charge { font-size: calc(30 * var(--zt)); font-weight: 300; letter-spacing: -0.02em; white-space: nowrap; }
.lg-q { display: grid; gap: calc(4 * var(--z)); }
.lg-verdict { font-size: calc(13 * var(--zt)); }
.lg-verdict.ok { color: var(--gold); }
.lg-verdict.off { color: #e5a596; }
.lg-note { margin-left: calc(176 * var(--z)); max-width: calc(520 * var(--z)); font-size: calc(14 * var(--zt)); line-height: 1.55; color: var(--text-3); }

/* Step 3: the experiment's readout, key and controls, over the chamber. */
.readout { position: absolute; top: calc(24 * var(--z)); left: calc(26 * var(--z)); display: grid; gap: calc(6 * var(--z)); }
.readout b { font-size: calc(40 * var(--zt)); font-weight: 300; line-height: 1; letter-spacing: -0.025em; }
.readout small { font-size: calc(16 * var(--zt)); color: var(--text-3); letter-spacing: 0; }
.meter { position: relative; display: block; width: calc(230 * var(--z)); height: calc(3 * var(--z)); margin-top: calc(12 * var(--z)); border-radius: 99px; background: rgba(255, 255, 255, 0.12); }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: rgba(240, 236, 224, 0.55); transition: background-color 0.2s; }
.meter > i.is-over { background: var(--gold); }
.thr { position: absolute; top: calc(-5 * var(--z)); bottom: calc(-5 * var(--z)); width: 1px; background: var(--text-2); }
.thr span { position: absolute; top: calc(14 * var(--z)); left: 50%; transform: translateX(-50%); font-size: calc(11.5 * var(--zt)); color: var(--text-3); white-space: nowrap; }
.legend-keys { position: absolute; top: calc(24 * var(--z)); right: calc(26 * var(--z)); display: grid; gap: calc(8 * var(--z)); font-size: calc(12.5 * var(--zt)); color: var(--text-3); }
.legend-keys li { display: flex; align-items: center; justify-content: flex-end; gap: calc(10 * var(--z)); }
.legend-keys li::after { content: ''; flex: none; width: calc(22 * var(--z)); height: calc(1.6 * var(--z)); border-radius: 99px; }
.k-e::after { background: #9aa3ec; }
.k-p::after { background: var(--gold); }
.k-g::after { background: repeating-linear-gradient(90deg, rgba(240, 236, 224, 0.8) 0 calc(3 * var(--z)), transparent calc(3 * var(--z)) calc(5 * var(--z))); }
.legend-keys .k-b::after { content: '×'; width: calc(22 * var(--z)); height: auto; font-size: calc(15 * var(--zt)); line-height: 1; text-align: center; color: var(--text-4); }
.controls {
  position: absolute; left: calc(16 * var(--z)); right: calc(16 * var(--z)); bottom: calc(16 * var(--z));
  display: flex; align-items: center; gap: calc(24 * var(--z)); padding: calc(10 * var(--z)) calc(10 * var(--z)) calc(10 * var(--z)) calc(22 * var(--z));
  border-radius: calc(16 * var(--z)); background: rgba(13, 14, 19, 0.86); box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.controls .en { flex: 1; }
.objectives { display: grid; gap: calc(11 * var(--z)); margin-top: calc(22 * var(--z)); }
.objectives li { display: flex; align-items: center; gap: calc(12 * var(--z)); font-size: calc(15 * var(--zt)); line-height: 1.35; color: var(--text-2); }
.obj-mark { flex: none; display: grid; place-items: center; width: calc(22 * var(--z)); height: calc(22 * var(--z)); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-3); }
.obj-mark .i { width: calc(12 * var(--z)); stroke-width: 2.4; }
.objectives .is-done { color: var(--text-3); }
.objectives .is-done .obj-mark { background: var(--gold); color: var(--lime-ink); box-shadow: none; }

/* Step 4: two questions, with the two cases drawn one above the other. */
.stage-split { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr 1fr; }
.half { position: relative; }
.half + .half { border-top: 1px solid var(--line); }
.half .stage-cap { bottom: calc(16 * var(--z)); }
.quiz { display: grid; grid-template-columns: calc(26 * var(--z)) minmax(0, 1fr); gap: calc(14 * var(--z)); margin-top: calc(26 * var(--z)); }
.q-num { display: grid; place-items: center; width: calc(26 * var(--z)); height: calc(26 * var(--z)); border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); font-size: calc(12.5 * var(--zt)); color: var(--text-3); }
.q-text { font-size: calc(16 * var(--zt)); line-height: 1.5; color: var(--text); }
.num-ask { display: flex; align-items: center; gap: calc(10 * var(--z)); margin-top: calc(14 * var(--z)); }
.num-ask input { width: calc(120 * var(--z)); height: calc(44 * var(--z)); padding: 0 calc(14 * var(--z)); border: 0; border-radius: calc(10 * var(--z)); background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); font-size: calc(17 * var(--zt)); color: var(--text); -moz-appearance: textfield; }
.num-ask input::-webkit-inner-spin-button, .num-ask input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.num-ask input:focus { outline: 0; box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.65); }
.num-ask .unit { font-size: calc(14 * var(--zt)); color: var(--text-3); }
.check-btn { height: calc(44 * var(--z)); padding: 0 calc(18 * var(--z)); border-radius: 99px; font-size: calc(14.5 * var(--zt)); font-weight: 500; box-shadow: inset 0 0 0 1px var(--line-3); transition: background-color 0.2s; }
.check-btn:hover { background: rgba(255, 255, 255, 0.06); }

/* Step 5: what was found, and what comes next. */
.takeaways { display: grid; gap: calc(14 * var(--z)); margin-top: calc(20 * var(--z)); counter-reset: take; }
.takeaways li { position: relative; padding-left: calc(36 * var(--z)); font-size: calc(15 * var(--zt)); line-height: 1.55; color: var(--text-3); counter-increment: take; }
.takeaways li::before { content: counter(take); position: absolute; left: 0; top: calc(1 * var(--z)); display: grid; place-items: center; width: calc(22 * var(--z)); height: calc(22 * var(--z)); border-radius: 50%; background: rgba(233, 215, 139, 0.12); font-size: calc(12 * var(--zt)); color: var(--gold); }
.takeaways b { font-weight: 500; color: var(--text); }
.next-up { margin-top: calc(24 * var(--z)); padding: calc(18 * var(--z)) calc(20 * var(--z)); border-radius: calc(14 * var(--z)); background: var(--row); box-shadow: inset 0 0 0 1px var(--row-line); }
.next-up > p:not([class]) { margin-top: calc(6 * var(--z)); font-size: calc(14 * var(--zt)); line-height: 1.55; color: var(--text-3); }
.next-name { margin-top: calc(6 * var(--z)); font-size: calc(19 * var(--zt)); font-weight: 500; }
.next-acts { display: flex; flex-wrap: wrap; gap: calc(8 * var(--z)) calc(22 * var(--z)); margin-top: calc(12 * var(--z)); }
.link-btn.restart { color: var(--text-3); }
.link-btn.restart:hover { color: var(--text); }

/* ---------- Ask Q ---------- */

/* Recent questions on the left; the thread in the middle, each answer's text beside its diagram; the question box at
   the foot. */
.ask { flex: 1; min-height: 0; display: grid; grid-template-columns: calc(250 * var(--z)) minmax(0, 1fr); }
.q-side { display: flex; flex-direction: column; min-height: 0; padding: calc(30 * var(--z)) calc(20 * var(--z)) calc(26 * var(--z)) calc(28 * var(--z)); border-right: 1px solid var(--line); }
.q-new { display: inline-flex; align-items: center; gap: calc(9 * var(--z)); align-self: flex-start; height: calc(40 * var(--z)); padding: 0 calc(16 * var(--z)) 0 calc(12 * var(--z)); border-radius: 99px; font-size: calc(14 * var(--zt)); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color 0.2s; }
.q-new .i { width: calc(17 * var(--z)); }
.q-new:hover { background: rgba(255, 255, 255, 0.05); }
.q-side .eyebrow { margin-top: calc(30 * var(--z)); }
.q-recent { display: grid; align-content: start; gap: calc(2 * var(--z)); min-height: 0; margin: calc(10 * var(--z)) calc(-10 * var(--z)) 0; overflow-y: auto; }
.q-recent button { width: 100%; padding: calc(9 * var(--z)) calc(10 * var(--z)); border-radius: calc(9 * var(--z)); text-align: left; font-size: calc(14 * var(--zt)); line-height: 1.4; color: var(--text-3); transition: color 0.2s, background-color 0.2s; }
.q-recent button:hover { color: var(--text); background: var(--row-hover); }
.q-recent .is-in { color: var(--text); }
.q-none { padding: calc(8 * var(--z)) calc(10 * var(--z)); font-size: calc(13.5 * var(--zt)); line-height: 1.45; color: var(--text-4); }
.q-proto { margin-top: auto; padding-top: calc(20 * var(--z)); font-size: calc(12.5 * var(--zt)); line-height: 1.5; color: var(--text-4); }
.q-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.q-from { display: flex; align-items: center; align-self: flex-start; gap: calc(12 * var(--z)); margin: calc(28 * var(--z)) 0 0 calc(48 * var(--z)); padding: calc(8 * var(--z)) calc(8 * var(--z)) calc(8 * var(--z)) calc(16 * var(--z)); border-radius: 99px; background: rgba(124, 135, 221, 0.08); box-shadow: inset 0 0 0 1px rgba(124, 135, 221, 0.24); font-size: calc(13.5 * var(--zt)); color: var(--text-2); }
.q-from[hidden] { display: none; }
.q-from a { display: inline-flex; align-items: center; gap: calc(6 * var(--z)); color: var(--peri-2); }
.q-from a:hover { color: var(--text); }
.q-from a .i { width: calc(14 * var(--z)); }
.q-from-dot { width: calc(7 * var(--z)); height: calc(7 * var(--z)); border-radius: 50%; background: var(--periwinkle); }
.q-from-x { display: grid; place-items: center; width: calc(26 * var(--z)); height: calc(26 * var(--z)); border-radius: 50%; color: var(--text-4); }
.q-from-x:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.q-from-x .i { width: calc(14 * var(--z)); }
.q-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 calc(48 * var(--z)); }
.q-compose { display: flex; align-items: center; gap: calc(12 * var(--z)); height: calc(58 * var(--z)); margin: calc(8 * var(--z)) calc(48 * var(--z)) calc(26 * var(--z)); padding: 0 calc(9 * var(--z)) 0 calc(18 * var(--z)); border-radius: calc(16 * var(--z)); background: #101217; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow 0.2s; }
.q-compose:focus-within { box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.5); }
.q-compose-mark { display: flex; }
.q-compose-mark .q-mark { width: calc(22 * var(--z)); }
.q-compose input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: calc(16 * var(--zt)); color: var(--text); }
.q-compose input::placeholder { color: var(--text-4); }
.q-send { display: grid; place-items: center; width: calc(40 * var(--z)); height: calc(40 * var(--z)); border-radius: calc(12 * var(--z)); background: var(--gold); color: var(--lime-ink); transition: background-color 0.2s; }
.q-send:hover { background: var(--lime-hover); }
.q-send .i { width: calc(18 * var(--z)); stroke-width: 2; }

.q-welcome { max-width: calc(680 * var(--z)); margin: 0 auto; padding: calc(84 * var(--z)) 0 calc(30 * var(--z)); }
.q-big { display: flex; }
.q-big .q-mark { width: calc(52 * var(--z)); height: calc(52 * var(--z)); }
.q-big .q-mark circle, .q-big .q-mark path { stroke-width: 1.4; }
.q-welcome h1 { margin-top: calc(24 * var(--z)); font-size: calc(44 * var(--zt)); font-weight: 400; line-height: 1.08; letter-spacing: -0.03em; }
.q-welcome > p { margin-top: calc(14 * var(--z)); max-width: calc(560 * var(--z)); font-size: calc(16.5 * var(--zt)); line-height: 1.55; color: var(--text-3); }
.q-group { margin-top: calc(34 * var(--z)); }
.q-group ul { margin-top: calc(10 * var(--z)); border-top: 1px solid var(--line); }
.q-prompt { display: flex; align-items: center; justify-content: space-between; gap: calc(16 * var(--z)); width: 100%; padding: calc(15 * var(--z)) calc(4 * var(--z)); border-bottom: 1px solid var(--line); text-align: left; font-size: calc(17 * var(--zt)); color: var(--text-2); transition: color 0.2s; }
.q-prompt .i { flex: none; width: calc(18 * var(--z)); color: var(--text-4); transition: color 0.2s, transform 0.3s var(--ease-out); }
.q-prompt:hover { color: var(--text); }
.q-prompt:hover .i { color: var(--gold); transform: translateX(calc(3 * var(--z))); }

.thread { display: grid; gap: calc(56 * var(--z)); padding: calc(30 * var(--z)) 0 calc(40 * var(--z)); }
.answer { scroll-margin-top: calc(24 * var(--z)); }
.answer + .answer { padding-top: calc(48 * var(--z)); border-top: 1px solid var(--line); }
.a-asked { margin-bottom: calc(10 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-4); }
.answer h2 { max-width: calc(780 * var(--z)); font-size: calc(36 * var(--zt)); font-weight: 400; line-height: 1.1; letter-spacing: -0.028em; outline: 0; }
.a-body { display: grid; grid-template-columns: minmax(0, 1fr) calc(500 * var(--z)); align-items: start; gap: calc(52 * var(--z)); margin-top: calc(26 * var(--z)); }
.a-text { max-width: calc(600 * var(--z)); }
.a-explain p { font-size: calc(16.5 * var(--zt)); line-height: 1.62; color: var(--text-2); }
.a-explain p:first-child { font-size: calc(18.5 * var(--zt)); line-height: 1.55; color: var(--text); }
.a-explain p + p { margin-top: calc(14 * var(--z)); }
.a-explain b { font-weight: 500; color: var(--text); }
.a-check, .a-deeper { margin-top: calc(34 * var(--z)); padding-top: calc(22 * var(--z)); border-top: 1px solid var(--line); }
.a-check .q-text { margin-top: calc(10 * var(--z)); }
.a-visual { position: sticky; top: calc(86 * var(--z)); display: grid; gap: calc(14 * var(--z)); }
.fig { aspect-ratio: 520 / 340; }
.fig svg { display: block; width: 100%; height: 100%; }
.a-visual figcaption { padding: 0 calc(20 * var(--z)) calc(16 * var(--z)); font-size: calc(13 * var(--zt)); line-height: 1.5; color: var(--text-4); }
.a-explore { display: grid; gap: calc(12 * var(--z)); padding: calc(16 * var(--z)) calc(18 * var(--z)); border-radius: calc(16 * var(--z)); box-shadow: inset 0 0 0 1px var(--line); }
.a-explore .switch { justify-self: start; }
.a-readout { font-size: calc(14 * var(--zt)); line-height: 1.5; color: var(--text-2); }
.deeper { display: grid; gap: calc(2 * var(--z)); margin-top: calc(10 * var(--z)); }
.deeper a, .deeper .soon { display: flex; align-items: flex-start; gap: calc(12 * var(--z)); margin: 0 calc(-10 * var(--z)); padding: calc(10 * var(--z)); border-radius: calc(10 * var(--z)); font-size: calc(15 * var(--zt)); transition: background-color 0.2s; }
.deeper a:hover { background: var(--row-hover); }
.deeper .i { flex: none; width: calc(18 * var(--z)); margin-top: calc(1 * var(--z)); color: var(--text-3); }
.deeper small { display: block; margin-top: calc(2 * var(--z)); font-size: calc(13 * var(--zt)); color: var(--text-4); }
.deeper .soon { color: var(--text-3); }
.a-aside { margin-top: calc(14 * var(--z)); padding-left: calc(14 * var(--z)); border-left: calc(2 * var(--z)) solid rgba(233, 215, 139, 0.4); font-size: calc(14 * var(--zt)); line-height: 1.55; color: var(--text-3); }
.ask-next { margin-top: calc(22 * var(--z)); }
.a-next { margin-top: calc(8 * var(--z)); border-top: 1px solid var(--line); }
.a-next button { display: flex; align-items: center; justify-content: space-between; gap: calc(12 * var(--z)); width: 100%; padding: calc(12 * var(--z)) calc(2 * var(--z)); border-bottom: 1px solid var(--line); text-align: left; font-size: calc(15 * var(--zt)); color: var(--text-2); transition: color 0.2s; }
.a-next .i { flex: none; width: calc(16 * var(--z)); color: var(--text-4); }
.a-next button:hover { color: var(--text); }
.a-next button:hover .i { color: var(--gold); }
.a-none { margin-top: calc(14 * var(--z)); max-width: calc(640 * var(--z)); font-size: calc(16 * var(--zt)); line-height: 1.6; color: var(--text-2); }
.is-none .a-next { max-width: calc(640 * var(--z)); margin-top: calc(18 * var(--z)); }

/* ---------- The study room ---------- */

.room { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: calc(26 * var(--z)) calc(36 * var(--z)) calc(24 * var(--z)) var(--pad); }
.room[data-mode='lobby'] { justify-content: center; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) calc(420 * var(--z)); align-items: center; gap: calc(60 * var(--z)); width: 100%; max-width: calc(1200 * var(--z)); margin: 0 auto; }
.lobby-preview { display: grid; gap: calc(16 * var(--z)); }
.tile {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(18 * var(--z));
  background: radial-gradient(circle at 50% 40%, #161a2a, #0b0c12 72%);
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 calc(var(--level, 0) * 4 * var(--z)) rgba(233, 215, 139, 0.32);
}
.tile video { position: absolute; inset: 0; display: none; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.tile.is-cam video { display: block; }
.tile.is-cam .tile-off { display: none; }
.tile-off { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: calc(12 * var(--z)); }
.tile-off .avatar { width: calc(84 * var(--z)); height: calc(84 * var(--z)); font-size: calc(30 * var(--zt)); }
.tile-note { font-size: calc(13 * var(--zt)); color: var(--text-4); }
.tile-name { position: absolute; left: calc(14 * var(--z)); bottom: calc(12 * var(--z)); display: inline-flex; align-items: center; gap: calc(8 * var(--z)); padding: calc(5 * var(--z)) calc(11 * var(--z)); border-radius: 99px; background: rgba(0, 0, 0, 0.5); font-size: calc(13 * var(--zt)); }
.mic-dot { width: calc(7 * var(--z)); height: calc(7 * var(--z)); border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
.tile.is-mic .mic-dot { background: var(--gold); }
.av-row { display: flex; justify-content: center; gap: calc(10 * var(--z)); }
.av-btn { display: inline-flex; align-items: center; gap: calc(9 * var(--z)); height: calc(46 * var(--z)); padding: 0 calc(18 * var(--z)); border-radius: 99px; font-size: calc(14 * var(--zt)); color: var(--text); background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; transition: background-color 0.2s, color 0.2s; }
.av-btn .i { width: calc(19 * var(--z)); }
.av-btn:hover { background: rgba(255, 255, 255, 0.11); }
.av-btn.is-off { color: var(--text-3); background: transparent; }
.av-btn.is-off:hover { color: var(--text); }
.room-bar .av-btn[aria-pressed='true']:not(.is-off) { color: var(--gold); background: rgba(233, 215, 139, 0.08); box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.4); }
.av-btn.leave { color: #f1b9ab; background: rgba(229, 140, 120, 0.12); box-shadow: inset 0 0 0 1px rgba(229, 140, 120, 0.38); }
.av-btn.leave:hover { background: rgba(229, 140, 120, 0.2); }
.sr-status { font-size: calc(13.5 * var(--zt)); line-height: 1.5; color: var(--text-3); text-align: center; }
.sr-status:empty { display: none; }
.lobby-info h1 { margin-top: calc(12 * var(--z)); font-size: calc(42 * var(--zt)); font-weight: 400; line-height: 1.08; letter-spacing: -0.03em; }
.lobby-info .lead { margin-top: calc(16 * var(--z)); font-size: calc(16 * var(--zt)); line-height: 1.6; color: var(--text-3); }
.lobby-facts { margin-top: calc(24 * var(--z)); border-top: 1px solid var(--line); }
.lobby-facts div { display: flex; justify-content: space-between; gap: calc(16 * var(--z)); padding: calc(12 * var(--z)) 0; border-bottom: 1px solid var(--line); font-size: calc(14.5 * var(--zt)); }
.lobby-facts dt { color: var(--text-3); }
.lobby-facts dd { text-align: right; }
.lobby-note { margin-top: calc(18 * var(--z)); font-size: calc(13 * var(--zt)); line-height: 1.55; color: var(--text-4); }
.lobby-acts { display: flex; align-items: center; gap: calc(14 * var(--z)); margin-top: calc(26 * var(--z)); }

.room-top { display: flex; align-items: baseline; gap: calc(18 * var(--z)); min-height: calc(40 * var(--z)); padding-right: calc(260 * var(--z)); }
.room-top h1 { font-size: calc(24 * var(--zt)); font-weight: 400; letter-spacing: -0.015em; }
.room-meta { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); font-size: calc(13.5 * var(--zt)); color: var(--text-3); }
.live-dot { width: calc(7 * var(--z)); height: calc(7 * var(--z)); border-radius: 50%; background: var(--text-4); }
.room-body { flex: 1; min-height: 0; display: flex; gap: calc(18 * var(--z)); margin-top: calc(16 * var(--z)); }
.room-stage { flex: 1; min-width: 0; }
.room-stage > .tile { position: absolute; z-index: 2; right: calc(18 * var(--z)); bottom: calc(18 * var(--z)); width: calc(300 * var(--z)); }
.room-stage .tile-off .avatar { width: calc(56 * var(--z)); height: calc(56 * var(--z)); font-size: calc(21 * var(--zt)); }
.alone { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: calc(10 * var(--z)); max-width: calc(520 * var(--z)); margin: 0 auto; padding: calc(40 * var(--z)); text-align: center; }
.alone-title { margin-bottom: calc(4 * var(--z)); font-size: calc(26 * var(--zt)); letter-spacing: -0.02em; }
.alone p:not(.alone-title) { font-size: calc(15 * var(--zt)); line-height: 1.6; color: var(--text-3); }
.shared { position: absolute; inset: 0; }
.shared .stage-cap { top: calc(22 * var(--z)); bottom: auto; }
.shared .controls { right: calc(336 * var(--z)); }
.room-side { flex: none; display: flex; flex-direction: column; gap: calc(26 * var(--z)); width: calc(340 * var(--z)); padding: calc(22 * var(--z)); overflow-y: auto; border-radius: calc(20 * var(--z)); box-shadow: inset 0 0 0 1px var(--line); }
.room-side[hidden] { display: none; }
.app textarea, .app input { font-family: inherit; }
.room-side textarea { display: block; width: 100%; min-height: calc(170 * var(--z)); margin-top: calc(10 * var(--z)); padding: calc(12 * var(--z)) calc(14 * var(--z)); border: 0; border-radius: calc(12 * var(--z)); background: rgba(255, 255, 255, 0.035); box-shadow: inset 0 0 0 1px var(--line-2); font-size: calc(14.5 * var(--zt)); line-height: 1.55; color: var(--text); resize: vertical; }
.room-side textarea::placeholder { color: var(--text-4); }
.room-side textarea:focus { outline: 0; box-shadow: inset 0 0 0 1px rgba(233, 215, 139, 0.55); }
.saved { display: block; min-height: 1.4em; margin-top: calc(6 * var(--z)); font-size: calc(12 * var(--zt)); color: var(--text-4); }
.side-list { display: grid; margin-top: calc(6 * var(--z)); }
.side-list a { display: block; padding: calc(8 * var(--z)) 0; font-size: calc(14 * var(--zt)); line-height: 1.45; color: var(--text-2); transition: color 0.2s; }
.side-list a:hover { color: var(--text); }
.side-empty { margin-top: calc(8 * var(--z)); font-size: calc(13.5 * var(--zt)); line-height: 1.45; color: var(--text-4); }
.room-bar { display: flex; justify-content: center; gap: calc(10 * var(--z)); margin-top: calc(16 * var(--z)); }

.page-note button { display: inline-flex; align-items: center; gap: calc(8 * var(--z)); padding: calc(10 * var(--z)) calc(16 * var(--z)); border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line-2); font-size: calc(14 * var(--zt)); color: var(--text-2); }
.page-note button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--line-3); }
.settings-note { margin-top: calc(14 * var(--z)); max-width: calc(560 * var(--z)); font-size: calc(13.5 * var(--zt)); line-height: 1.5; color: var(--text-4); }

/* ---------- Narrower windows ---------- */

/* Below a desktop's width the rhythm rail moves under the path, and My Learning stacks. Not tuned for phones. */
@media (max-width: 1179px) {
  .home { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .side { padding-top: calc(32 * var(--z)); border-left: 0; border-top: 1px solid var(--line); }
  .journey { min-height: calc(640 * var(--z)); }
  .more-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-grid { grid-template-columns: minmax(0, 1fr); }
  .lesson { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto calc(560 * var(--z)); }
  .ask { grid-template-columns: minmax(0, 1fr); }
  .q-side { display: none; }
  .a-body, .lobby { grid-template-columns: minmax(0, 1fr); }
  .room-body { flex-direction: column; }
  .room-side { width: auto; }
}
