/* ============ Navigator theme — "Stop Driving. Start Navigating." ============ */
/* fonts ship with the project (assets/fonts) so renders are identical and work offline */
@font-face { font-family: "Anuphan"; src: url("../assets/fonts/Anuphan-VF.ttf") format("truetype"); font-weight: 100 700; font-display: block; }
@font-face { font-family: "JetBrains Mono"; src: url("../assets/fonts/JetBrainsMono-VF.ttf") format("truetype"); font-weight: 100 800; font-display: block; }
:root {
  --bg: #060b1c;          /* deep navy, the chart at night */
  --bg-2: #0b1430;
  --panel: rgba(16, 28, 62, 0.78);
  --panel-solid: #101c3e;
  --line: rgba(120, 160, 255, 0.16);
  --line-strong: rgba(120, 160, 255, 0.34);
  --ink: #eaf0ff;
  --dim: #93a1c6;
  --faint: #5d6a90;

  --cyan: #35e3ff;        /* the route / the engineer's line */
  --purple: #a27dff;      /* AI */
  --pink: #ff5fa8;        /* emphasis */
  --yellow: #ffd23f;      /* hazard */
  --green: #3ee08f;       /* verified */
  --red: #ff5a6a;         /* failure */

  --font-th: "Anuphan", "IBM Plex Sans Thai", sans-serif;
  --font-mono: "JetBrains Mono", "Anuphan", ui-monospace, monospace; /* Thai in mono labels falls back to Anuphan */

  /* safe area inside the 1920×1080 stage: HUD owns y < 150 and y > 990 */
  --pad-x: 140px;
  --pad-top: 170px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: var(--bg); overflow: hidden; font-family: var(--font-th); color: var(--ink); }

/* Screens that are not 16:9 (MacBook 16:10, tall windows): the space around the 16:9 stage continues the chart
   instead of showing black bars. deck.js fit() sets --gs/--gx/--gy so the grid lines line up with the stage's. */
#viewport { position: fixed; inset: 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(53, 227, 255, 0.04), transparent 70%),
    linear-gradient(var(--line) 1px, transparent 1px) var(--gx, 0) var(--gy, 0) / var(--gs, 96px) var(--gs, 96px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px) var(--gx, 0) var(--gy, 0) / var(--gs, 96px) var(--gs, 96px),
    var(--bg); }
body.capture #viewport { background: #000; }
/* centred absolutely: a grid/flex parent smaller than 1920px would push the stage off-centre before scaling */
#stage { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; overflow: hidden; transform-origin: 50% 50%;
  transform: translate(-50%, -50%); background: var(--bg); }
body.capture #stage { left: 0; top: 0; transform: none; }

/* ---------- slide canvas: navigation chart ---------- */
.slide { position: absolute; inset: 0; overflow: hidden; visibility: hidden; color: var(--ink);
  background:
    radial-gradient(ellipse at 70% 18%, rgba(53, 227, 255, 0.07), transparent 55%),
    radial-gradient(ellipse at 12% 90%, rgba(162, 125, 255, 0.08), transparent 55%),
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 96px 96px,
    var(--bg);
}
.slide.is-active { visibility: visible; }
/* contour rings, like a depth chart; place with left/top and size */
.contours { position: absolute; border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 38px, rgba(53, 227, 255, 0.07) 39px 40px); }
/* a dark plain variant for code/terminal-heavy slides */
.slide[data-mode="night"] { background: radial-gradient(ellipse at 50% 0%, rgba(53, 227, 255, 0.06), transparent 60%), #04070f; }

/* ---------- typography ---------- */
.kicker { position: absolute; left: var(--pad-x); top: var(--pad-top); font-family: var(--font-mono); font-size: 26px;
  letter-spacing: 0.16em; color: var(--cyan); text-transform: uppercase; }
.headline { position: absolute; left: var(--pad-x); top: calc(var(--pad-top) + 44px); max-width: 1640px;
  font-weight: 700; font-size: 80px; line-height: 1.2; letter-spacing: -0.01em; }
.display { font-weight: 700; font-size: 128px; line-height: 1.1; letter-spacing: -0.02em; }
.lede { font-size: 38px; line-height: 1.5; color: var(--dim); }
.body { font-size: 34px; line-height: 1.5; }
.mono { font-family: var(--font-mono); }
.dim { color: var(--dim); }
.c-cyan { color: var(--cyan); } .c-pink { color: var(--pink); } .c-yellow { color: var(--yellow); }
.c-purple { color: var(--purple); } .c-green { color: var(--green); } .c-red { color: var(--red); }
em { font-style: normal; color: var(--pink); }
.w { display: inline-block; }            /* word spans from util.splitWords */

/* ---------- components ---------- */
.card { position: absolute; padding: 32px 36px; border-radius: 18px; background: var(--panel);
  border: 1.5px solid var(--line-strong); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); backdrop-filter: blur(4px); }
.card h3 { font-size: 42px; font-weight: 700; line-height: 1.25; }
.card p { font-size: 30px; line-height: 1.5; color: var(--dim); margin-top: 10px; }
.card .num { font-family: var(--font-mono); font-size: 26px; color: var(--cyan); letter-spacing: 0.1em; }
.card.cyan { border-color: rgba(53, 227, 255, 0.55); } .card.pink { border-color: rgba(255, 95, 168, 0.55); }
.card.yellow { border-color: rgba(255, 210, 63, 0.55); } .card.purple { border-color: rgba(162, 125, 255, 0.55); }
.card.green { border-color: rgba(62, 224, 143, 0.55); } .card.red { border-color: rgba(255, 90, 106, 0.55); }

.pill { display: inline-block; padding: 6px 20px; border-radius: 999px; font-weight: 700; font-size: 28px; line-height: 1.4;
  background: rgba(53, 227, 255, 0.14); color: var(--cyan); border: 1.5px solid rgba(53, 227, 255, 0.5); }
.pill.pink { background: rgba(255, 95, 168, 0.14); color: var(--pink); border-color: rgba(255, 95, 168, 0.5); }
.pill.yellow { background: rgba(255, 210, 63, 0.14); color: var(--yellow); border-color: rgba(255, 210, 63, 0.5); }
.pill.purple { background: rgba(162, 125, 255, 0.16); color: var(--purple); border-color: rgba(162, 125, 255, 0.5); }
.pill.green { background: rgba(62, 224, 143, 0.14); color: var(--green); border-color: rgba(62, 224, 143, 0.5); }
.pill.red { background: rgba(255, 90, 106, 0.14); color: var(--red); border-color: rgba(255, 90, 106, 0.5); }

/* source label: required on every number (data integrity rule) */
.src { position: absolute; font-family: var(--font-mono); font-size: 22px; line-height: 1.45; color: var(--faint); letter-spacing: 0.02em; }
.src b { color: var(--dim); font-weight: 400; }

/* terminal / editor window — Kit.term() builds the markup */
.term { position: absolute; border-radius: 16px; overflow: hidden; background: #0a0f1f; border: 1.5px solid var(--line-strong);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5); }
.term-bar { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: #0f1630; border-bottom: 1px solid var(--line); }
.term-bar i { width: 14px; height: 14px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 12px; font-family: var(--font-mono); font-size: 22px; color: var(--dim); }
.term-body { padding: 24px 30px; font-family: var(--font-mono); font-size: 30px; line-height: 1.55; white-space: pre; color: var(--ink); }
/* syntax tokens (Kit.highlight) */
.tk-k { color: #c9a6ff; } .tk-s { color: #ffd98a; } .tk-n { color: #ff8fc4; } .tk-c { color: #5f6c92; font-style: italic; }
.tk-f { color: #7fe9ff; } .tk-t { color: #ff8fc4; } .tk-p { color: #8a97bd; } .tk-e { color: var(--red); } .tk-ok { color: var(--green); }
/* typewriter char spans (Kit.typeCode / Kit.typeText) */
.ch { opacity: 0; }
.ch.on { opacity: 1; }
.ch.cur { position: relative; }
.ch.cur::after { content: ""; position: absolute; right: -3px; top: 8%; height: 84%; width: 3px; background: var(--cyan); }

/* map pins and route lines (SVG) */
.route { fill: none; stroke: var(--cyan); stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 10px rgba(53, 227, 255, 0.75)); }
.route.alt { stroke: var(--faint); stroke-width: 3; stroke-dasharray: 10 12; filter: none; }
.route.pink { stroke: var(--pink); filter: drop-shadow(0 0 10px rgba(255, 95, 168, 0.7)); }
.route.yellow { stroke: var(--yellow); filter: drop-shadow(0 0 8px rgba(255, 210, 63, 0.6)); }
.hazard { fill: var(--yellow); }
.svg-label { font-family: var(--font-mono); font-size: 24px; fill: var(--dim); letter-spacing: 0.06em; }
.svg-text { font-family: var(--font-th); font-size: 30px; fill: var(--ink); font-weight: 600; }

/* ---------- HUD (owned by the shell) ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 50; font-family: var(--font-mono); color: var(--ink); }
#hud-brand { position: absolute; left: 64px; top: 46px; }
#hud-brand b { display: block; font-family: var(--font-th); font-weight: 700; font-size: 24px; letter-spacing: 0.02em; }
#hud-brand span { display: block; margin-top: 4px; font-size: 15px; letter-spacing: 0.22em; color: var(--cyan); opacity: 0.85; }
#hud-clock { position: absolute; right: 64px; top: 42px; display: flex; gap: 18px; align-items: center; }
#hud-compass { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--line-strong); position: relative; }
#hud-compass::before { content: "N"; position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--dim); }
#hud-needle { position: absolute; left: 50%; top: 50%; width: 2px; height: 40px; margin: -20px 0 0 -1px;
  background: linear-gradient(var(--pink) 50%, var(--dim) 50%); transform-origin: 50% 50%; }
#hud-txt { text-align: right; }
#hud-section { font-size: 18px; letter-spacing: 0.16em; font-family: var(--font-th); font-weight: 600; }
#hud-ticks { position: relative; margin: 8px 0 6px auto; width: 240px; height: 8px;
  background: repeating-linear-gradient(90deg, rgba(234, 240, 255, 0.35) 0 3px, transparent 3px 7px); }
#hud-fill { position: absolute; left: 0; top: 0; height: 8px; width: 240px; transform-origin: 0 50%; background: var(--cyan); opacity: 0.85; }
#hud-read { font-size: 15px; letter-spacing: 0.12em; color: var(--dim); }
#hud-route { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; overflow: visible; }
#hud-route-base { fill: none; stroke: rgba(147, 161, 198, 0.35); stroke-width: 2; stroke-dasharray: 2 8; }
#hud-route-done { fill: none; stroke: var(--cyan); stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(53, 227, 255, 0.8)); }
#hud-route .wp { fill: #2a355a; }
#hud-route .wp.done { fill: var(--cyan); }
#hud-route .wp.here { fill: var(--pink); }
#hud-route-ring { fill: none; stroke: var(--pink); stroke-width: 2; }

/* speaker notes overlay (N) */
#notes { position: absolute; left: 0; right: 0; bottom: 0; max-height: 46%; overflow: auto; z-index: 60; display: none;
  padding: 28px 64px 36px; background: rgba(4, 8, 20, 0.94); border-top: 2px solid var(--cyan); font-size: 28px; line-height: 1.6; color: var(--ink); }
#notes b { display: block; font-family: var(--font-mono); font-size: 20px; color: var(--cyan); letter-spacing: 0.12em; margin-bottom: 8px; }
#notes p + p { margin-top: 12px; }
body.show-notes #notes { display: block; }
body.capture #notes { display: none !important; }
