/* Light Lab theme: Why Zero-inspired. Fonts: Instrument Serif, Inter Tight, JetBrains Mono (all OFL). */
@import url("https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300..700&family=JetBrains+Mono:wght@400;500&display=swap");
:root {
  --font-display: "Instrument Serif", Georgia, serif;
  --font-sans: "Inter Tight", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --lum: #f7f6f2; --lum-ink: #0d0d0f;
}
/* lessons: thin spectral line on top, serif titles */
body.page-lesson::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999; pointer-events: none; background: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00a2ff, #5856d6, #af52de); }
body.page-lesson h1 { font-weight: 400; letter-spacing: -0.01em; }

/* ---------- hub ---------- */
body.lumen { background: var(--lum) !important; color: var(--lum-ink); min-height: 100vh; overflow-x: clip; font-family: var(--font-sans); }
body.lumen .grain, body.lumen .spine { display: none; }
.lumen .skip { position: absolute; left: -999px; } .lumen .skip:focus { left: 12px; top: 12px; z-index: 9; background: #000; color: #fff; padding: 8px 12px; }
.lumen .beam { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.lumen .ray { fill: none; stroke-width: 2.2; mix-blend-mode: multiply; stroke-dasharray: 2 26; stroke-linecap: round; animation: photons 1.6s linear infinite; }
.lumen .ray-glow { fill: none; stroke-width: 14; opacity: .28; filter: url(#glow); mix-blend-mode: multiply; }
.lumen .mask { fill: var(--lum-ink); }
.lumen .lens { fill: rgba(170, 210, 255, .28); stroke: var(--lum-ink); stroke-width: 1.5; }
@keyframes photons { to { stroke-dashoffset: -28; } }
html.is-still .lumen .ray { animation: none; stroke-dasharray: none; stroke-width: 1.4; }
.lumen .lm-top { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto 1fr; padding: 20px clamp(16px, 4vw, 56px); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.lumen .lm-top span:last-child { text-align: right; }
.lumen .lm { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 20px; padding: 0 clamp(16px, 4vw, 56px) 64px; min-height: calc(100vh - 60px); align-content: space-between; }
.lumen .lm-title { grid-column: 1 / 9; margin: 2vh 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(5rem, 13.5vw, 13rem); line-height: .82; letter-spacing: -.035em; }
.lumen .lm-title span { display: block; }
.lumen .lm-title em { display: block; padding-left: 1.1em; font-style: italic; color: #8a8a90; }
.lumen .lm-deck { grid-column: 9 / 13; align-self: start; margin: 4vh 0 0; font-size: 1.02rem; line-height: 1.5; max-width: 34ch; background: rgba(247,246,242,.82); backdrop-filter: blur(6px); }
.lumen .lm-cue { grid-column: 1 / 5; align-self: end; margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #77777d; }
html.is-still .lumen .lm-cue { visibility: hidden; }
.lumen .lm-list { grid-column: 6 / 13; list-style: none; margin: 3vh 0 0; padding: 0; border-top: 1px solid var(--lum-ink); }
.lumen .lm-list a { display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; column-gap: 18px; align-items: baseline; padding: 18px 0 20px; border-bottom: 1px solid var(--lum-ink); color: inherit; text-decoration: none; background: rgba(247,246,242,.78); backdrop-filter: blur(6px); transition: padding .3s, background .3s; }
.lumen .lm-n { font-family: var(--font-mono); font-size: 12px; }
.lumen .lm-name { font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: .95; }
.lumen .lm-go { grid-column: 3; grid-row: 1; font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.lumen .lm-what { grid-column: 2 / 4; font-size: .98rem; color: #4a4a50; }
.lumen .lm-list a:hover, .lumen .lm-list a:focus-visible { padding-left: 18px; background: #0d0d0f; color: var(--lum); outline: none; }
.lumen .lm-list a:hover .lm-what, .lumen .lm-list a:focus-visible .lm-what { color: #c9c9cf; }
@media (max-width: 860px) {
  .lumen .lm-top { grid-template-columns: 1fr 1fr; } .lumen .lm-mid { display: none; }
  .lumen .lm { display: block; min-height: 0; }
  .lumen .lm-title { font-size: 26vw; margin-top: 6vh; }
  .lumen .lm-deck { margin-top: 30vh; }
  .lumen .lm-cue { display: none; }
  .lumen .lm-list { margin-top: 32px; }
  .lumen .lm-list a { grid-template-columns: 34px 1fr; }
  .lumen .lm-go { display: none; }
  .lumen .beam { position: absolute; height: 78vh; }
  .lumen .lm-deck { margin-top: 26vh; background: none; backdrop-filter: none; }
}

/* ================= lesson pages: lightbox frame, dark glass, spectral edges ================= */
body.page-lesson { --glass: rgba(12, 12, 16, .6); --hair: rgba(255, 255, 255, .2); --spectrum: linear-gradient(90deg, #ff3b30, #ff9500, #ffcc00, #34c759, #00a2ff, #5856d6, #af52de); }
body.page-lesson::after { content: ""; position: fixed; inset: 0; z-index: 6; pointer-events: none; box-shadow: inset 0 0 0 10px var(--lum); }
body.page-lesson .grain { opacity: .25; }
/* spine joins the white frame */
body.page-lesson .spine { background: var(--lum) !important; color: var(--lum-ink) !important; }
body.page-lesson .spine::after { background: linear-gradient(#ff3b30, #ff9500, #ffcc00, #34c759, #00a2ff, #5856d6, #af52de) !important; width: 3px !important; }
/* title */
body.page-lesson .lesson-head .kicker { color: rgba(255, 255, 255, .7) !important; margin-left: 0 !important; }
body.page-lesson .lesson-head h1 { font-weight: 400 !important; font-size: clamp(3.6rem, 7.4vw, 7rem) !important; letter-spacing: -0.035em !important; line-height: .86 !important; color: #fff; text-shadow: 0 0 40px rgba(255, 220, 160, .35); }
body.page-lesson .define { background: var(--glass) !important; color: #f4f4f6 !important; backdrop-filter: blur(14px); border: 1px solid var(--hair); border-left: 3px solid #ffcc00; box-shadow: none !important; }
/* nav + stamps */
body.page-lesson .jumps { top: 22px !important; right: 26px !important; }
body.page-lesson .jumps a { color: #fff !important; border-bottom: 2px solid transparent !important; border-image: var(--spectrum) 1 !important; }
body.page-lesson .stamps { top: 58px !important; right: 26px !important; }
@media (min-width: 861px) {
  body.page-lesson .jumps { max-width: min(640px, calc(100vw - 520px)); gap: 6px 10px; }
  body.page-lesson .jumps a { font-size: 10px; letter-spacing: 0.06em; }
  body.page-lesson .stamps { top: 92px !important; }
}
body.page-lesson .stamp { transform: none !important; outline: 0 !important; border: 0 !important; background: var(--lum) !important; color: var(--lum-ink) !important; border-radius: 999px; padding: 6px 11px !important; }
/* the panel: dark glass with a spectral top edge */
@media (min-width: 861px) { body.page-lesson .ticket { left: 66px !important; bottom: 22px !important; } }
body.page-lesson .ticket {
  --paper: rgba(255, 255, 255, .08); --paper-deep: rgba(255, 255, 255, .12); --ink-on-paper: #f4f4f6; --ash: #a9a9b0; --char: #f4f4f6; --ember: #ffcc00; --ember-hot: #ffcc00;
  background: var(--glass) !important; color: #f4f4f6 !important; backdrop-filter: blur(16px); border: 1px solid var(--hair); border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45) !important; 
}
body.page-lesson .ticket::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--spectrum); }
body.page-lesson .ticket .burn, body.page-lesson .ticket .dogear { display: none !important; }
body.page-lesson .ticket h2 { font-family: var(--font-display) !important; font-weight: 400 !important; font-size: 2.1rem !important; letter-spacing: -0.02em !important; color: #fff !important; }
body.page-lesson .ticket .tag { border: 1px solid rgba(255, 255, 255, .45) !important; color: #fff !important; background: transparent !important; border-radius: 999px; }
body.page-lesson .ticket .note, body.page-lesson .ticket .readout, body.page-lesson .ticket .world p { color: rgba(244, 244, 246, .86) !important; }
body.page-lesson .ticket .note a { color: #ffcc00 !important; }
body.page-lesson .ticket .keys, body.page-lesson .ticket .keys strong { color: rgba(244, 244, 246, .75) !important; }
body.page-lesson .ticket .keys strong { color: #fff !important; }
body.page-lesson .world summary { color: #fff !important; border-color: var(--hair) !important; }
body.page-lesson .world summary::before { color: #ffcc00 !important; }
/* controls: frosted buttons, white when on; spectral rail */
body.page-lesson .modes button { background: var(--glass) !important; color: #f4f4f6 !important; border: 1px solid var(--hair) !important; backdrop-filter: blur(12px); font-family: var(--font-mono) !important; letter-spacing: .1em; text-transform: uppercase; font-size: 11px !important; }
body.page-lesson .modes button[aria-pressed="true"] { background: var(--lum) !important; color: var(--lum-ink) !important; }
body.page-lesson .rail { background: var(--glass) !important; border: 1px solid var(--hair) !important; backdrop-filter: blur(12px); color: #fff !important; }
body.page-lesson .rail-name { color: #fff !important; }
body.page-lesson .rail-groove { background: rgba(255, 255, 255, .18) !important; }
body.page-lesson .rail-fill { background: linear-gradient(#af52de, #00a2ff, #34c759, #ffcc00, #ff3b30) !important; }
body.page-lesson .rail-knob { background: var(--lum) !important; border: 0 !important; box-shadow: 0 0 18px rgba(255, 220, 160, .8) !important; }
@media (max-width: 700px) {
  body.page-lesson::after { box-shadow: inset 0 0 0 6px var(--lum); }
  body.page-lesson .jumps { right: 14px !important; } body.page-lesson .stamps { right: 14px !important; }
}

/* ================= phones: scene on top of the page, panels stacked below it ================= */
@media (max-width: 860px) {
  /* hub: title, then the beam, then the text and lessons; nothing drawn across the words */
  body.lumen { display: flex; flex-direction: column; }
  .lumen .lm { display: contents !important; }
  .lumen .lm-top { order: 1; }
  .lumen .lm-title { order: 2; margin: 3vh clamp(16px, 4vw, 56px) 0 !important; font-size: 23vw !important; }
  .lumen .beam { order: 3; position: relative !important; inset: auto !important; height: 34vh !important; width: 100%; flex: none; }
  .lumen .lm-deck { order: 4; margin: 0 clamp(16px, 4vw, 56px) !important; }
  .lumen .lm-list { order: 5; margin: 24px clamp(16px, 4vw, 56px) 48px !important; }
  .lumen .lm-list a { min-height: 64px; }

  /* lessons: same stack as lab.css. These !important resets beat the desktop frame. */
  body.page-lesson::after { display: none; }
  body.page-lesson .lesson-head { position: relative !important; top: auto !important; left: auto !important; max-width: none !important; }
  body.page-lesson .lesson-head h1 { font-size: clamp(2.4rem, 12vw, 3.35rem) !important; }
  body.page-lesson .define { max-width: none !important; }
  body.page-lesson #stage { position: relative !important; inset: auto !important; height: clamp(210px, 36dvh, 380px) !important; min-height: 0 !important; }
  body.page-lesson .stage-fade { display: none !important; }
  body.page-lesson .dock { position: relative !important; }
  body.page-lesson .shape { position: relative !important; inset: auto !important; transform: none !important; }
  body.page-lesson .ticket,
  body.page-lesson .ticket:has(.world[open]) { position: relative !important; inset: auto !important; left: auto !important; right: auto !important; bottom: auto !important; width: auto !important; max-height: none !important; overflow: visible !important; }
  body.page-lesson .jumps { position: sticky !important; top: calc(44px + env(safe-area-inset-top)) !important; right: auto !important; max-width: none !important; background: #07060c; }
  body.page-lesson .stamps { position: relative !important; top: auto !important; right: auto !important; left: auto !important; }
  html.embed body.page-lesson #stage { position: fixed !important; inset: 0 !important; height: auto !important; }
}
/* desktop: keep the ticket clear of the lens controls and the frame */
@media (min-width: 861px) {
  body.page-lesson .ticket { max-height: min(46vh, 420px); overflow-y: auto !important; }
}
@media (max-width: 860px) {
  body.page-lesson .jumps a { color: #fff !important; }
}

/* tap room for the fold-out questions */
details > summary { padding-block: 11px; cursor: pointer; }
