/* Slide theme: light, high-contrast for projectors. */
:root {
  --ink: #0f1b2d;
  --ink2: #3b4a5e;
  --ink3: #9aa6b5;
  --paper: #ffffff;
  --paper2: #f1f4f8;
  --accent: #2563eb;
  --accent-soft: #dbe7ff;
  --warn: #f08a24;
  --warn-soft: #fff0df;
  --good: #16a34a;
  --good-soft: #e3f6e9;
  --bad: #dc2626;
  --bad-soft: #fde8e8;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
html, body { background: var(--paper); }
.reveal { font-family: var(--font); font-size: 30px; color: var(--ink); }
.reveal .slides { text-align: left; }
.reveal .slides section { padding: 0 8px; height: 100%; }
.reveal h1, .reveal h2, .reveal h3 { font-family: var(--font); color: var(--ink); margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.01em; }
.reveal h1 { font-size: 2.6em; font-weight: 800; }
.reveal h2 { font-size: 1.55em; font-weight: 800; padding-bottom: .3em; border-bottom: 4px solid var(--accent); display: inline-block; margin-bottom: .7em; }
.reveal h3 { font-size: 1.05em; font-weight: 700; margin-bottom: .4em; }
.reveal p { margin: 0 0 .65em; line-height: 1.4; }
.reveal ul, .reveal ol { margin: 0 0 .6em 1.1em; line-height: 1.4; }
.reveal li { margin-bottom: .3em; }
.reveal b, .reveal strong { font-weight: 700; color: var(--ink); }
.reveal code { font-family: var(--mono); font-size: .88em; background: var(--paper2); padding: .05em .3em; border-radius: 4px; color: #b42318; }
.reveal pre { width: 100%; margin: 0 0 .6em; font-size: .62em; box-shadow: none; border-radius: 10px; overflow: hidden; }
.reveal pre code { max-height: 520px; padding: 14px 18px; border-radius: 10px; color: #f8f8f2; background: #23241f; line-height: 1.45; font-size: 1em; }
.reveal pre.label-line code { background: var(--ink); color: #fff; font-size: 1.15em; }
.reveal a { color: var(--accent); }
.reveal .small { font-size: .78em; }
.reveal .muted { color: var(--ink3); }
.reveal .strong { font-weight: 700; margin-bottom: .3em; }
.reveal .big { font-size: 1.25em; font-weight: 600; }
.reveal .center { text-align: center; }
.reveal .mono { font-family: var(--mono); }

/* title / part slides */
.reveal .title-slide, .reveal .part { color: #fff; }
.reveal .title-slide h1, .reveal .part h1 { color: #fff; }
.reveal .part { display: flex !important; flex-direction: column; justify-content: center; }
.reveal .kicker { text-transform: uppercase; letter-spacing: .18em; font-size: .7em; font-weight: 700; color: #7fb0ff; margin-bottom: .6em; }
.reveal .subtitle { font-size: 1.15em; color: #c9d6ea; max-width: 900px; }
.reveal .title-slide { padding-top: 40px !important; }
.reveal .title-img img { width: 570px; border-radius: 12px; margin-top: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.reveal .hint { margin-top: 18px; font-size: .55em; color: #8ea3c0; }
.reveal kbd { font-family: var(--mono); border: 1px solid #8ea3c0; border-radius: 4px; padding: 0 .3em; }
.reveal .nb-link { margin-top: 1em; font-size: 1.1em; }
.reveal .nb-link a { color: #7fb0ff; font-weight: 700; }

/* layout */
.cols { display: grid; gap: 34px; align-items: start; }
.c-2 { grid-template-columns: 1fr 1fr; }
.c-3 { grid-template-columns: 1fr 1fr 1fr; }
.c-6-4 { grid-template-columns: 1.45fr 1fr; }
.c-3.scales, .c-3.curves { gap: 24px; }
.arrow-col { font-size: 3em; color: var(--ink3); align-self: center; }

.card { background: var(--paper2); border-radius: 14px; padding: 20px 24px; border-top: 5px solid var(--ink3); }
.card.good { background: var(--good-soft); border-top-color: var(--good); }
.card.bad  { background: var(--bad-soft);  border-top-color: var(--bad); }
.card.warncard { background: var(--warn-soft); border-top-color: var(--warn); }
.card .verdict { font-weight: 700; margin: .4em 0 0; }
.card.good .verdict { color: var(--good); }
.card.bad .verdict { color: var(--bad); }
.callout { background: var(--accent-soft); border-left: 5px solid var(--accent); padding: 12px 16px; border-radius: 6px; }

.reveal img { margin: 0; }
.frame { width: 100%; border-radius: 10px; display: block; }
.img-overlay { position: relative; }
.img-overlay svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pix { height: 520px; image-rendering: pixelated; border-radius: 6px; }
.pix.tall { height: 560px; }
.cap { font-size: .7em; color: var(--ink2); margin-top: .4em; }

.stat { font-size: 2em; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat span { font-size: .5em; color: var(--ink2); font-weight: 600; }
.stat-sm { font-size: 1.5em; font-weight: 800; color: var(--accent); margin: 0 0 .3em; }

/* agenda */
.agenda { display: grid; gap: 16px; }
.ag { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 22px; background: var(--paper2); border-radius: 14px; padding: 14px 24px; }
.ag h3 { margin: 0; }
.ag p { margin: 0; color: var(--ink2); font-size: .85em; }
.ag .num { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 1.3em; display: grid; place-items: center; }
.ag .mins { color: var(--ink2); font-weight: 600; font-size: .8em; }

/* diagrams */
.diagram { width: 100%; height: auto; display: block; }
.diagram.wide { max-height: 380px; }
.diagram .lbl { fill: var(--ink); }
.diagram .lbl2 { fill: var(--ink2); }
.loopnode rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.loopnode rect.hot { fill: var(--warn-soft); stroke: var(--warn); }
.loopnode text { fill: var(--ink); }

/* matrices */
.mat-row { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 14px; }
.mat { border-collapse: collapse; font-family: var(--mono); font-size: .8em; }
.mat td { border: 2px solid var(--ink3); width: 54px; height: 44px; text-align: center; background: #fff; }
.mat td.d { background: #444; color: #fff; }
.mat.k td { background: var(--accent-soft); border-color: var(--accent); }
.mat td.p1 { background: #dbe7ff; } .mat td.p2 { background: #fff0df; } .mat td.p3 { background: #e3f6e9; } .mat td.p4 { background: #fde8e8; }
.op { font-size: 1.6em; color: var(--ink2); font-weight: 700; }
.result { font-weight: 800; font-size: 1.15em; margin: .2em 0 0; }
.result span { font-weight: 500; font-size: .75em; color: var(--ink2); }
.result.hot { color: var(--warn); }

/* figure grids */
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; max-width: 980px; margin: 0 auto 10px; }
.grid-4 figure, .grid-3 figure, .aug-grid figure { margin: 0; }
.grid-4 img, .grid-3 img, .aug-grid img { width: 100%; border-radius: 8px; display: block; }
.grid-4 figcaption, .aug-grid figcaption { font-size: .62em; color: var(--ink2); text-align: center; margin-top: 3px; }
.grid-4 img { max-height: 225px; object-fit: contain; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.aug-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 14px; }
.aug-note { background: var(--paper2); border-radius: 10px; padding: 12px 14px; font-size: .72em; align-self: stretch; }

/* scale grids */
.gridbox { width: 170px; height: 170px; margin: 0 auto 12px; border: 2px solid var(--ink2); border-radius: 4px; background-color: #fff; }
.g-fine { background-image: linear-gradient(var(--ink3) 1px, transparent 1px), linear-gradient(90deg, var(--ink3) 1px, transparent 1px); background-size: 8.5px 8.5px; }
.g-mid { background-image: linear-gradient(var(--ink3) 1px, transparent 1px), linear-gradient(90deg, var(--ink3) 1px, transparent 1px); background-size: 17px 17px; }
.g-coarse { background-image: linear-gradient(var(--ink3) 1.5px, transparent 1.5px), linear-gradient(90deg, var(--ink3) 1.5px, transparent 1.5px); background-size: 34px 34px; }
.scales p { margin-bottom: .2em; }

/* lists */
.reveal ul.check { list-style: none; margin-left: 0; }
.reveal ul.check li { padding-left: 1.5em; position: relative; }
.reveal ul.check li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.reveal ul.recap { list-style: none; margin: 0; font-size: 1.12em; }
.reveal ul.recap li { padding: 14px 20px; background: var(--paper2); border-left: 6px solid var(--accent); border-radius: 6px; margin-bottom: 12px; }
.reveal ol.steps li { margin-bottom: .55em; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; margin: 0 0 .7em; font-size: .82em; }
.tbl.small { font-size: .7em; }
.tbl th { text-align: left; background: var(--ink); color: #fff; padding: 9px 14px; font-weight: 700; }
.tbl td { padding: 8px 14px; border-bottom: 1px solid #dde3ea; vertical-align: top; }
.tbl tr:nth-child(even) td { background: var(--paper2); }
.tbl tr.hl td { background: var(--accent-soft); font-weight: 600; }
.pill { display: inline-block; padding: 2px 12px; border-radius: 99px; font-size: .85em; font-weight: 700; }
.pill.hi { background: var(--good-soft); color: var(--good); }
.pill.mid { background: var(--warn-soft); color: #b45309; }
.pill.lo { background: var(--paper2); color: var(--ink2); }

/* film strip */
.strip { display: flex; gap: 4px; margin: 6px 0 8px; }
.strip span, .legend span.t, .legend span.v { display: inline-block; width: 26px; height: 34px; border-radius: 3px; }
.legend span.t, .legend span.v { width: 16px; height: 16px; vertical-align: middle; }
.strip .t, .legend .t { background: var(--accent); }
.strip .v, .legend .v { background: var(--warn); }
.legend { font-size: .7em; color: var(--ink2); }
.sw { display: inline-block; width: 26px; height: 6px; border-radius: 3px; vertical-align: middle; }

/* PDF download button (hidden when printing) */
.dl-btn { position: fixed; top: 14px; right: 16px; z-index: 30; background: var(--ink); color: #fff; font: 600 14px var(--font); padding: 8px 14px; border-radius: 8px; text-decoration: none; opacity: .75; }
.dl-btn:hover { opacity: 1; }
@media print { .dl-btn { display: none !important; } }
html.print-pdf .dl-btn, html.reveal-print .dl-btn { display: none !important; }

/* summary slide */
.reveal .summary .cols { margin-top: 30px; }
.reveal .summary .card p { font-size: 1.05em; }
.reveal .qs { font-size: 2em; font-weight: 800; color: var(--accent); margin-top: 60px; }
.reveal .diag-cap { text-align: center; font-size: .78em; color: var(--ink2); margin-top: 8px; }

.reveal .train-slide .cols { grid-template-columns: 1.2fr 1fr; gap: 24px; }
.reveal .train-slide pre { font-size: .55em; }
.reveal .train-slide .tbl.small { font-size: .62em; }
.reveal .train-slide .tbl td { padding: 6px 10px; }
