/* The Hidden Curriculum: lesson page. aaronorelup.com's panel tokens (src/styles/panel.css);
   night is the default, day only when the visitor chose it (localStorage 'scene-mode'). */
:root {
  --pc-page: rgb(16, 18, 32); --pc-bg: rgba(21, 23, 38, 0.96); --pc-tile: rgb(32, 31, 44);
  --pc-hover: rgb(34, 33, 48); --pc-code: rgb(34, 33, 48); --pc-scrim: rgba(8, 9, 18, 0.44);
  --pc-head: rgb(240, 192, 106); --pc-strong: rgb(242, 231, 213); --pc-body: rgb(201, 188, 169);
  --pc-soft: rgb(156, 145, 127); --pc-quiet: rgb(142, 131, 117);
  --pc-line: rgb(48, 46, 62); --pc-line2: rgb(74, 68, 90);
  --pc-accent: rgb(226, 121, 92); --pc-gold: rgb(201, 162, 39);
  --pc-shadow: 0 34px 100px rgba(0, 0, 0, 0.6);
  --ease: cubic-bezier(.4, 0, .2, 1);
  color-scheme: dark;
}
:root[data-mode='day'] {
  --pc-page: rgb(251, 243, 232); --pc-bg: rgba(251, 243, 232, 0.97); --pc-tile: rgb(243, 231, 210);
  --pc-hover: rgb(244, 233, 216); --pc-code: rgb(240, 229, 210); --pc-scrim: rgba(251, 243, 232, 0.34);
  --pc-head: rgb(190, 122, 16); --pc-strong: rgb(58, 58, 66); --pc-body: rgb(74, 74, 80);
  --pc-soft: rgb(107, 94, 82); --pc-quiet: rgb(122, 108, 93);
  --pc-line: rgb(226, 213, 192); --pc-line2: rgb(208, 190, 163);
  --pc-accent: rgb(168, 94, 43); --pc-gold: rgb(176, 138, 46);
  --pc-shadow: 0 30px 90px rgba(58, 58, 66, 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--pc-page); color: var(--pc-body);
  font: 400 17px/1.68 Georgia, 'Times New Roman', serif;
  min-height: 100vh; transition: background 300ms ease;
}
::selection { background: var(--pc-line2); color: var(--pc-strong); }
a { color: var(--pc-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--pc-head); outline-offset: 3px; border-radius: 4px; }
button { font: 600 15px/1 Karla, 'Segoe UI', sans-serif; color: var(--pc-strong); }
.skip {
  position: absolute; left: 16px; top: -64px; z-index: 50; background: var(--pc-bg); color: var(--pc-strong);
  padding: 12px 18px; border-radius: 12px; border: 2px solid var(--pc-line2); font: 600 15px/1 Karla, sans-serif; text-decoration: none;
}
.skip:focus { top: 16px; }

/* site chrome: the same header and footer as the Ledger and Projects pages */
.site-top, .site-foot { display: flex; justify-content: center; padding: 18px clamp(18px, 4vw, 44px); font: 400 13.5px/1.4 Karla, system-ui, sans-serif; }
.site-top { border-bottom: 1px solid var(--pc-line); }
.site-foot { border-top: 1px solid var(--pc-line); margin-top: 24px; font-size: 12.5px; color: var(--pc-quiet); }
.site-row { width: 100%; max-width: 1140px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.site-home { color: var(--pc-strong); text-decoration: none; letter-spacing: .04em; padding: 6px 0; white-space: nowrap; }
.site-nav { display: flex; gap: 22px; }
/* the fixed day/night switch sits over the nav's right end until the row is narrower than the window */
@media (max-width: 1380px) { .site-nav { padding-right: 88px; } }
.site-nav a, .site-foot a { color: var(--pc-quiet); text-decoration: none; }
.site-nav a[aria-current] { color: var(--pc-head); }
.site-nav a:hover, .site-home:hover { color: var(--pc-head); }
.site-foot p { margin: 0; }
.site-foot div { display: flex; gap: 20px; flex-wrap: wrap; }
.site-foot a:hover { color: var(--pc-accent); }
.mode-toggle {
  position: fixed; top: 20px; right: 22px; z-index: 41; width: 72px; height: 36px; padding: 0;
  border: 2px solid var(--pc-line2); border-radius: 999px; background: var(--pc-bg); cursor: pointer; backdrop-filter: blur(6px);
}
.mode-knob {
  position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: var(--pc-head);
  display: flex; align-items: center; justify-content: center; transition: transform 380ms var(--ease), background 300ms ease;
}
@media (max-width: 640px) { .site-nav { padding-right: 0; gap: 16px; } .site-top { padding-right: 104px; } }

/* same measure as the site's panel pages: a 1140px column inside the side padding */
.wrap { max-width: calc(1140px + 2 * clamp(16px, 4vw, 44px)); margin: 0 auto; padding: 0 clamp(16px, 4vw, 44px); }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 30px 0 0; font: 400 13px/1.5 Karla, sans-serif; color: var(--pc-quiet); }
.crumbs a { color: var(--pc-soft); text-decoration: none; }
.crumbs a:hover { color: var(--pc-head); }

.eyebrow {
  font: 600 12px/1.4 Karla, sans-serif; letter-spacing: .12em; text-transform: uppercase;
  color: var(--pc-gold); margin: 22px 0 8px;
}
.eyebrow .tag { color: var(--pc-accent); margin-left: 10px; }
h1, h2 { font-family: 'Zen Maru Gothic', Karla, sans-serif; color: var(--pc-head); letter-spacing: -.02em; }
h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.15; margin: 0 0 14px; font-weight: 700; }
h2 { font-size: 24px; margin: 0 0 14px; font-weight: 700; }
.lede { max-width: 680px; font-size: 19px; color: var(--pc-strong); margin: 0 0 28px; }

/* the stage is the square element: media wells stay square-cornered */
.stage {
  position: relative; background: #0b0c16; box-shadow: var(--pc-shadow);
  aspect-ratio: 16 / 9; width: 100%; overflow: hidden; border: 1px solid var(--pc-line);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage:fullscreen { border: 0; }
.cc {
  position: absolute; left: 50%; bottom: 5.5%; transform: translateX(-50%);
  /* max-content: with left 50% a shrink-to-fit box is capped at half the stage and wraps every
     caption over ~36 characters; balance keeps a phone-width wrap from leaving one word behind */
  width: max-content; max-width: 88%; box-sizing: border-box; text-wrap: balance;
  padding: 6px 14px; border-radius: 8px;
  background: rgba(8,9,18,.8); color: #F2E7D5; text-align: center;
  font: 600 clamp(13px, 2.1vw, 26px)/1.35 Karla, sans-serif; pointer-events: none;
  opacity: 0; transition: opacity 180ms var(--ease);
}
.cc.on { opacity: 1; }
.bigplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  border: 1px solid var(--pc-head); background: rgba(16,18,32,.82); color: #F0C06A;
  border-radius: 999px; padding: 18px 34px; font-size: 20px; cursor: pointer;
  box-shadow: 0 20px 80px rgba(0,0,0,.5); transition: transform 180ms var(--ease), background 180ms var(--ease);
}
.bigplay:hover { transform: translate(-50%, -50%) scale(1.04); background: rgba(32,31,44,.92); }
.bigplay[hidden] { display: none; }

.controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 0 6px; font: 600 14px/1 Karla, sans-serif; color: var(--pc-soft);
}
.pill {
  border: 1px solid var(--pc-line2); background: var(--pc-tile); border-radius: 999px;
  padding: 10px 16px; cursor: pointer; transition: background 180ms var(--ease), border-color 180ms var(--ease);
  min-width: 44px; min-height: 40px;
}
.pill:hover { background: var(--pc-hover); border-color: var(--pc-head); }
.pill[aria-pressed='true'] { border-color: var(--pc-head); color: var(--pc-head); }
.time { font-family: ui-monospace, Consolas, monospace; font-weight: 400; min-width: 104px; text-align: center; }
.scrub { position: relative; flex: 1 1 260px; height: 40px; display: flex; align-items: center; }
.scrub input { width: 100%; accent-color: var(--pc-head); margin: 0; }
.ticks { position: absolute; inset: 0; pointer-events: none; }
.ticks i { position: absolute; top: 9px; width: 2px; height: 8px; background: var(--pc-line2); }
.dl { font: 600 14px/1 Karla, sans-serif; text-decoration: none; }
.dl[hidden] { display: none; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; margin: 40px 0 24px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; gap: 32px; } }
.keep { list-style: none; padding: 0; margin: 0; }
.keep li { padding: 12px 0; border-top: 1px solid var(--pc-line); }
.keep li:last-child { border-bottom: 1px solid var(--pc-line); }
.keep b { color: var(--pc-strong); }
.chapters { list-style: none; padding: 0; margin: 0; font: 400 16px/1.4 Karla, sans-serif; }
.chapters button {
  width: 100%; display: flex; gap: 14px; align-items: baseline; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--pc-line); padding: 11px 4px; cursor: pointer;
  font: 400 16px/1.4 Karla, sans-serif; color: var(--pc-body); transition: background 180ms var(--ease);
}
.chapters button:hover { background: var(--pc-hover); }
.chapters .n { font-family: ui-monospace, Consolas, monospace; color: var(--pc-gold); font-size: 13px; }
.chapters .ts { margin-left: auto; font-family: ui-monospace, Consolas, monospace; color: var(--pc-quiet); font-size: 13px; }
.chapters button.now { color: var(--pc-head); }

.transcript { max-width: 680px; margin: 24px 0 48px; }
.transcript details summary { cursor: pointer; font: 600 15px/1.4 Karla, sans-serif; color: var(--pc-soft); padding: 8px 0; }
.tx { max-height: 380px; overflow: auto; padding-right: 8px; scrollbar-color: var(--pc-line2) transparent; }
.tx h3 { font: 600 12px/1.4 Karla, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--pc-gold); margin: 22px 0 6px; }
.tx p { margin: 0; }
.tx span { cursor: pointer; border-radius: 3px; transition: background 180ms var(--ease), color 180ms var(--ease); }
.tx span:hover { color: var(--pc-strong); }
.tx span.now { background: color-mix(in srgb, var(--pc-head) 22%, transparent); color: var(--pc-strong); }

.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--pc-line); padding: 22px 0 40px; font: 600 15px/1.4 Karla, sans-serif; color: var(--pc-quiet);
}
.foot a { text-decoration: none; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.bigplay:disabled { cursor: progress; opacity: .8; }

/* lesson footer: back to the curriculum, on to the next lesson */
.foot a { color: var(--pc-accent); text-decoration: none; }
.foot a:hover { color: var(--pc-head); }
.foot .soon { color: var(--pc-quiet); font-weight: 400; }
/* on a phone the play button moves off the title card so it never covers the lesson's title */
@media (max-width: 640px) {
  .bigplay { top: auto; left: 12px; bottom: 12px; transform: none; padding: 10px 18px; font-size: 15px; }
  .bigplay:hover { transform: none; }
  .foot { flex-direction: column; gap: 10px; }
}
