:root {
  --bg: #ffffff;
  --bg2: #f4f6f8;
  --ink: #14181d;
  --ink2: #444c56;
  --ink3: #6b7480;
  --line: #d6dbe1;
  --grey: #80868d;
  --blue: #2f5f9e;
  --blue-t: #2f67b1;
  --green: #1f6b2a;
  --green-t: #2e8b3a;
  --orange: #b85d17;
  --orange-t: #d0661a;
  --amber: #a87700;
  --stage: var(--bg);
  --page: #e9ecef;
  --font: Inter, "Noto Sans", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* dark theme: press T, use the switch on the title slide, or open with ?theme=dark */
:root[data-theme="dark"] {
  --bg: #101317; --bg2: #171b21; --ink: #eceff3; --ink2: #b4bcc6; --ink3: #7d8792; --line: #2b313a;
  --grey: #8a8a8a; --blue: #3b6ea8; --blue-t: #6c9fd9; --green: #2e7d32; --green-t: #6cc070;
  --orange: #c9772f; --orange-t: #eb9447; --amber: #e0a100;
  --stage: radial-gradient(1200px 800px at 30% 20%, #151a20 0%, #101317 60%);
  --page: #07090b;
}
:root[data-theme="dark"] .chip.on { background: rgba(108,192,112,.1); }
:root[data-theme="dark"] .shot { box-shadow: 0 30px 80px rgba(0,0,0,.6); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--ink); font-family: var(--font); overflow: hidden; }
body { -webkit-font-smoothing: antialiased; }

#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--page); }
#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0;
  background: var(--stage); overflow: hidden;
}
.slide { position: absolute; inset: 0; }
.abs { position: absolute; }

/* type */
.kicker { position: absolute; left: 96px; top: 64px; font-size: 26px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.h1 { position: absolute; left: 96px; top: 104px; font-size: 64px; font-weight: 700; letter-spacing: -.01em; line-height: 1.08; }
.big { font-size: 120px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.caption { font-size: 34px; color: var(--ink2); line-height: 1.3; }
.muted { color: var(--ink3); }
.small { font-size: 22px; color: var(--ink3); }
.g { color: var(--green-t); }
.b { color: var(--blue-t); }
.o { color: var(--orange-t); }
.a { color: var(--amber); }
.gr { color: var(--grey); }
.src { position: absolute; left: 96px; bottom: 34px; font-size: 18px; color: var(--ink3); }

svg text { font-family: var(--font); }

/* equation (slide 2) */
.eq { position: absolute; left: 96px; display: flex; align-items: center; gap: 22px; font-size: 50px; font-weight: 600; white-space: nowrap; }
.eq .term { display: inline-flex; align-items: center; gap: 14px; }
.eq .box { padding: 8px 22px; border-radius: 14px; border: 2px solid currentColor; }
.eq .paren { color: var(--ink3); font-weight: 400; font-size: 38px; }
.eq .op { color: var(--ink2); font-weight: 400; }

/* chips (slide 3) */
.chips { position: absolute; left: 96px; top: 206px; display: flex; gap: 18px; }
.chip { font-size: 26px; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--line); color: var(--ink3); white-space: nowrap; }
.chip.on { border-color: var(--green-t); color: var(--ink); background: rgba(46,139,58,.08); }
.panel { position: absolute; left: 0; top: 280px; width: 1920px; height: 800px; }

/* cards */
.card { position: absolute; background: var(--bg2); border: 1px solid var(--line); border-radius: 22px; }
.badge { display: inline-block; font-size: 19px; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1.5px solid currentColor; letter-spacing: .02em; }
.badge.hyp { color: var(--amber); }
.badge.part { color: var(--blue-t); }
.badge.ok { color: var(--green-t); }

.shot { position: absolute; border-radius: 16px; box-shadow: 0 24px 60px rgba(20,24,29,.18); border: 1px solid var(--line); }
.theme-toggle { display: flex; gap: 4px; padding: 5px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg2); z-index: 5; }
.theme-toggle button { font: 600 22px var(--font); color: var(--ink3); background: none; border: 0; border-radius: 999px; padding: 8px 22px; cursor: pointer; }
.theme-toggle button.on { color: var(--bg); background: var(--ink); }
body.preview .theme-toggle { display: none; }
.keyhint { display: inline-flex; align-items: center; gap: 16px; font-size: 34px; color: var(--ink); }
.key { display: inline-block; min-width: 56px; text-align: center; padding: 6px 14px; border-radius: 10px; border: 2px solid var(--ink2); border-bottom-width: 5px; font-weight: 700; }

.adv { position: absolute; left: 150px; display: flex; align-items: center; gap: 30px; font-size: 40px; font-weight: 500; }
.adv svg { flex: none; }

/* HUD */
#hud { position: fixed; right: 18px; bottom: 14px; display: flex; gap: 8px; align-items: center; z-index: 10; opacity: .0; transition: opacity .4s; font-size: 14px; }
body.hud-on #hud { opacity: .85; }
#hud button { background: #1c2128; color: #cfd6de; border: 1px solid #2f3640; border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer; }
#hud .count { color: #8b96a3; padding: 0 6px; font-variant-numeric: tabular-nums; }
#progress { position: fixed; left: 0; bottom: 0; height: 3px; background: var(--green-t); opacity: .55; z-index: 9; transition: width .4s; }
body.preview #hud, body.preview #progress { display: none; }

/* presenter */
/* the presenter window stays dark: it sits on the laptop screen, not the projector */
body.presenter { overflow: auto; background: #0b0d10; --ink: #eceff3; --ink2: #b4bcc6; --ink3: #7d8792; --line: #2b313a; --bg2: #171b21; --blue-t: #6c9fd9; --green-t: #6cc070; --orange-t: #eb9447; --amber: #e0a100; }
body.presenter #viewport { display: none; }
#pv { display: none; }
body.presenter #pv { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto 1fr; gap: 16px; padding: 16px; height: 100vh; }
#pv .top { grid-column: 1 / 3; display: flex; align-items: center; gap: 24px; font-size: 18px; color: #aab4bf; }
#pv .timer { font-size: 40px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
#pv .timer.over { color: var(--orange-t); }
#pv .target { font-size: 18px; }
#pv button { background: #1c2128; color: #cfd6de; border: 1px solid #2f3640; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
#pv .col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
#pv .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid #2f3640; border-radius: 8px; overflow: hidden; background: #000; }
#pv .frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
#pv .lbl { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: #7d8792; }
#pv .notes { font-size: 22px; line-height: 1.45; color: #e3e7ec; overflow: auto; padding-right: 8px; }
#pv .notes .say { font-size: 25px; color: #fff; margin: 0 0 14px; }
#pv .notes .cue { color: var(--amber); }
#pv .notes .fig { color: #9fb3c8; font-size: 18px; }
#pv .notes h3 { margin: 0 0 8px; font-size: 20px; color: var(--green-t); }
