/* ---------- Tokens ---------- */
:root {
  --teal: #00847a;
  --teal-dark: #006a62;
  --teal-light: #d6e9e5;
  --teal-pale: #eef6f4;
  --ink: #0b0c0c;
  --muted: #5b6366;
  --rule: #c9d3d1;
  --warn: #c0392b;
  --warn-light: #fbe5e1;
  --amber: #f0b400;
  --amber-light: #fff4cc;
  --ok: #00703c;
  --code-bg: #10302c;
  --code-ink: #e6f2ef;
  --code-key: #7fd4c1;
  --code-str: #ffd479;
  --code-num: #ff9e7a;
  --code-bool: #c3a6ff;
  --code-dim: #8fb3ac;
  --font: "Segoe UI", "Selawik", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #1f2423;
  font-family: var(--font);
  color: var(--ink);
  overflow: hidden;
}

/* ---------- Stage (fixed 16:9, scaled to fit) ---------- */
#viewport { position: fixed; inset: 0; display: grid; place-items: center; }
#stage {
  position: absolute;
  width: 1280px; height: 720px;
  left: 50%; top: 50%;
  transform-origin: 0 0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 0 0 1px #0003, 0 20px 60px #0006;
}

.chrome-top {
  position: absolute; left: 0; right: 0; top: 0; height: 88px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px; border-bottom: 5px solid var(--teal);
  background: #fff; z-index: 2;
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 19px; color: #222; }
.brand .bar { width: 2px; height: 34px; background: var(--teal); margin-right: 8px; }
.brand svg { width: 34px; height: 34px; }
.team { font-size: 20px; color: #111; }

.slide-body {
  position: absolute; left: 0; right: 0; top: 93px; bottom: 38px;
  padding: 26px 56px 0;
}
.chrome-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; height: 38px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 28px; font-size: 13px; color: #777;
}
.chrome-bottom .section { justify-self: start; letter-spacing: .02em; }
.chrome-bottom .marking { justify-self: center; letter-spacing: .03em; }
.chrome-bottom .num { justify-self: end; font-variant-numeric: tabular-nums; }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--teal); transition: width .3s; }

@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.slide-body.slide-in { animation: slide-in .35s cubic-bezier(.3,.7,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .slide-body.slide-in, [data-step] { animation: none; transition: none; } }

/* ---------- Typography ---------- */
h2.title { font-size: 34px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
.subtitle { font-size: 20px; color: var(--muted); margin: 0 0 20px; }
.kicker { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.teal-heading {
  display: inline-block; background: var(--teal); color: #fff;
  font-size: 32px; padding: 14px 56px; margin: 0 0 24px -56px;
}
p { margin: 0 0 12px; }
.big { font-size: 28px; line-height: 1.35; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.caption { font-size: 18px; color: var(--muted); margin-top: 14px; min-height: 52px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
ul.bullets { margin: 0; padding-left: 26px; font-size: 24px; line-height: 1.45; }
ul.bullets li { margin-bottom: 8px; }
ul.bullets li::marker { color: var(--teal); }
b, strong { font-weight: 700; }
em.hl { font-style: normal; background: var(--amber-light); padding: 0 4px; }
code.inline { font-family: var(--mono); font-size: .88em; background: var(--teal-pale); padding: 1px 6px; border-radius: 3px; }

/* ---------- Build steps ---------- */
[data-step] { opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; pointer-events: none; }
[data-step].shown { opacity: 1; transform: none; pointer-events: auto; }
[data-step].dim { opacity: .35; }

/* ---------- Layout helpers ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; height: 100%; }
.split.wide-left { grid-template-columns: 1.35fr 1fr; }
.split.wide-right { grid-template-columns: 1fr 1.35fr; }
.row { display: flex; gap: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.box { background: var(--teal-light); padding: 22px 28px; font-size: 24px; line-height: 1.3; }
.box.pale { background: var(--teal-pale); }
.box.warn { background: var(--warn-light); }
.box.amber { background: var(--amber-light); }
.box h3 { margin: 0 0 8px; font-size: 22px; }
.card { border: 1px solid var(--rule); border-top: 5px solid var(--teal); padding: 16px 18px; background: #fff; }
.card h3 { margin: 0 0 6px; font-size: 21px; }
.card p { font-size: 16px; color: #333; margin: 0 0 6px; }
.card .who { font-size: 13px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; }
.card.warn { border-top-color: var(--warn); }
.callout { border-left: 6px solid var(--teal); background: var(--teal-pale); padding: 14px 20px; font-size: 21px; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-light); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--teal-light); color: var(--teal-dark); letter-spacing: .04em; }
.pill.warn { background: var(--warn-light); color: var(--warn); }
.pill.dim { background: #eee; color: #666; }

/* ---------- Title / section / problem layouts ---------- */
.layout-title .slide-body { padding: 0; }
.title-block1 {
  position: absolute; left: 0; top: 140px; background: var(--teal); color: #fff;
  font-size: 92px; font-weight: 400; padding: 18px 70px 10px 70px; width: 600px; line-height: 1.1;
}
.title-block2 {
  position: absolute; left: 0; top: 264px; background: var(--teal); color: #fff;
  font-size: 40px; padding: 26px 70px; width: 1020px;
}
.title-date { position: absolute; left: 70px; top: 400px; font-size: 24px; letter-spacing: .02em; }
.title-hint { position: absolute; left: 70px; bottom: 26px; font-size: 14px; color: #999; }

.layout-section .slide-body { padding: 0; }
.section-num { position: absolute; left: 70px; top: 130px; font-size: 22px; color: var(--teal); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.section-title { position: absolute; left: 0; top: 172px; background: var(--teal); color: #fff; font-size: 58px; padding: 22px 70px; min-width: 760px; }
.section-desc { position: absolute; left: 70px; top: 320px; right: 120px; font-size: 26px; color: #333; line-height: 1.4; }

.problem-tag { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--warn); margin-bottom: 14px; }
.problem-tag::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--warn); }
.problem-statement { font-size: 40px; line-height: 1.25; background: var(--teal-light); padding: 28px 36px; border-left: 10px solid var(--teal); margin-bottom: 26px; }

/* ---------- Code panels ---------- */
.code {
  background: var(--code-bg); color: var(--code-ink);
  font-family: var(--mono); font-size: 14px; line-height: 1.5;
  padding: 14px 18px; white-space: pre; overflow: hidden; border-radius: 2px;
}
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .n { color: var(--code-num); }
.code .b { color: var(--code-bool); }
.code .c { color: var(--code-dim); }
.code .hdr { color: var(--code-dim); }
.code .new { background: #ffffff1a; display: inline-block; width: 100%; }
.code-title { font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--code-dim); margin-bottom: 6px; }
.code .line { display: block; padding: 0 6px; margin: 0 -6px; transition: background .25s; }
.code .line.on { background: #00847a80; }

/* ---------- Chat UI ---------- */
.chat { border: 1px solid var(--rule); background: #fafbfb; padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.msg { max-width: 88%; padding: 10px 14px; font-size: 17px; line-height: 1.35; border-radius: 4px; animation: pop .3s; }
.msg.user { align-self: flex-end; background: var(--teal); color: #fff; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--rule); }
.msg.system { align-self: center; background: #eef0f0; color: #444; font-size: 14px; font-style: italic; max-width: 100%; }
.msg.tool { align-self: flex-start; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: 13px; white-space: pre-wrap; }
.msg .who { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-bottom: 2px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-size: 15px; border: 2px solid var(--teal); background: #fff; color: var(--teal-dark);
  padding: 8px 14px; cursor: pointer; text-align: left; border-radius: 2px;
}
.btn:hover { background: var(--teal-pale); }
.btn.on { background: var(--teal); color: #fff; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.danger { border-color: var(--warn); color: var(--warn); }
.btn-col { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Overlays: notes, overview, help ---------- */
#notes {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 34vh; overflow: auto;
  background: #0f1413ee; color: #e8efee; font-size: 17px; line-height: 1.45;
  padding: 14px 24px; display: none; z-index: 20; border-top: 3px solid var(--teal);
}
#notes.open { display: block; }
#notes h4 { margin: 0 0 6px; color: #7fd4c1; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
#overview {
  position: fixed; inset: 0; background: #0f1413f2; z-index: 30; display: none;
  padding: 30px; overflow: auto;
}
#overview.open { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
#overview button {
  font: inherit; text-align: left; background: #fff; border: 0; border-top: 5px solid var(--teal);
  padding: 10px 12px; cursor: pointer; font-size: 14px; min-height: 76px;
}
#overview button.current { outline: 3px solid var(--amber); }
#overview button .n { display: block; font-size: 11px; color: #777; text-transform: uppercase; letter-spacing: .08em; }
#overview button.optional { border-top-color: #aaa; }
#help {
  position: fixed; right: 16px; top: 16px; background: #0f1413ee; color: #e8efee; padding: 14px 18px;
  font-size: 14px; line-height: 1.7; z-index: 25; display: none; border-radius: 4px;
}
#help.open { display: block; }
#help kbd { background: #fff2; padding: 0 6px; border-radius: 3px; font-family: var(--mono); }

/* ---------- Presenter view ---------- */
body.presenter { background: #111716; color: #e8efee; overflow: auto; }
.pv { display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 20px; height: 100vh; }
.pv-main h1 { margin: 0 0 4px; font-size: 26px; }
.pv-step { color: #7fd4c1; margin-bottom: 14px; }
.pv-notes { font-size: 22px; line-height: 1.5; white-space: pre-wrap; }
.pv-side { border-left: 1px solid #fff2; padding-left: 20px; }
.pv-clock { font-size: 42px; font-variant-numeric: tabular-nums; }
.pv-timer { font-size: 28px; color: var(--amber); font-variant-numeric: tabular-nums; margin-bottom: 20px; cursor: pointer; }
.pv-next { margin-top: 14px; color: #aab; }
.pv-buttons { display: flex; gap: 10px; margin-top: 16px; }
.pv-buttons button { font: inherit; font-size: 20px; padding: 14px 22px; background: var(--teal); color: #fff; border: 0; cursor: pointer; }
