/* =====================================================================
   RL-UTN slide theme  ·  Claire Vernade
   One stylesheet for every lecture. Change colours/fonts here only.
   ===================================================================== */

:root {
  /* palette — matches the green of the Leiden/UTN Keynote deck */
  --ink:        #1b1d1a;
  --ink-soft:   #4a4f47;
  --ink-faint:  #8a9086;
  --paper:      #ffffff;
  --paper-warm: #f6f5f0;
  --rule:       #dcdcd3;
  --accent:     #2f5a24;   /* UTN-style deep green: titles, emphasis */
  --accent-2:   #6f9a3c;   /* lighter green */
  --accent-bg:  #eef3e6;
  --warm:       #b5541c;   /* sparing second colour: warnings, "small exit" */
  --warm-bg:    #fbefe6;
  --blue:       #2b5b84;   /* definitions */
  --blue-bg:    #eaf0f6;

  /* type */
  --font-text: Optima, "Optima nova", Candara, "Segoe UI", "Gill Sans", "Alegreya Sans", sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  /* slide geometry: fixed 16:9 canvas, scaled to the window by deck.js */
  --slide-w: 1280px;
  --slide-h: 720px;
  --pad-x: 72px;
  --pad-top: 56px;
}

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

/* ---------- deck & slide canvas ---------- */
.deck { position: fixed; inset: 0; }
.slide {
  position: absolute; left: 50%; top: 50%;
  width: var(--slide-w); height: var(--slide-h);
  margin-left: calc(var(--slide-w) / -2); margin-top: calc(var(--slide-h) / -2);
  background: var(--paper);
  padding: var(--pad-top) var(--pad-x) 64px;
  font-size: 28px; line-height: 1.38;
  display: none; flex-direction: column;
  transform-origin: center center;
  overflow: hidden;
}
.slide.active { display: flex; }

.slide > h2 {
  margin: 0 0 26px; font-size: 44px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); line-height: 1.1;
}
.slide > h2 .kicker {
  display: block; font-size: 17px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 8px;
}
.slide h3 { font-size: 30px; margin: 0 0 12px; color: var(--accent); }
.slide p { margin: 0 0 16px; }
.slide ul, .slide ol { margin: 0 0 16px; padding-left: 1.2em; }
.slide li { margin: 0 0 10px; }
.slide li::marker { color: var(--accent); }
.slide ul ul { font-size: .88em; margin-top: 8px; }
.slide em { color: var(--accent); font-style: normal; font-weight: 700; }
.slide strong { font-weight: 700; }
.slide code { font-family: var(--font-mono); font-size: .85em; background: var(--paper-warm); padding: 1px 6px; border-radius: 4px; }
.small { font-size: .8em; }
.tiny  { font-size: .62em; color: var(--ink-soft); }
.muted { color: var(--ink-faint); }
.center { text-align: center; }
.green { color: var(--accent); }
.hl { background: #fff2a8; padding: 0 5px; border-radius: 4px; font-weight: 700; }
.orange { color: var(--warm); }
.spacer { flex: 1; }

/* footer: number + lecture name (filled by deck.js) */
.slide .footer {
  position: absolute; left: var(--pad-x); right: var(--pad-x); bottom: 22px;
  display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-faint);
  border-top: 1px solid var(--rule); padding-top: 8px;
}
.slide.no-footer .footer, .slide.title-slide .footer, .slide.section .footer { display: none; }

/* progress bar */
.progress { position: fixed; left: 0; bottom: 0; height: 4px; background: var(--accent-2); z-index: 10; transition: width .2s; }

/* ---------- layouts ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.cols.c-60-40 { grid-template-columns: 3fr 2fr; }
.cols.c-40-60 { grid-template-columns: 2fr 3fr; }
.cols.c-3 { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
.cols.middle { align-items: center; }
.grow { flex: 1; min-height: 0; }

/* title slide */
.title-slide { justify-content: center; align-items: center; text-align: center; }
.title-slide h1 { font-size: 72px; margin: 0 0 8px; line-height: 1.08; }
.title-slide .subtitle { font-size: 32px; color: var(--ink-soft); margin-bottom: 44px; }
.title-slide .author { color: var(--accent); font-weight: 700; font-size: 28px; }
.title-slide .affil  { color: var(--accent); font-size: 24px; }
.title-slide .date   { color: var(--ink-faint); font-size: 20px; margin-top: 18px; }

/* section divider */
.section { justify-content: center; background: var(--accent); color: #fff; }
.section .num { font-size: 26px; letter-spacing: .16em; opacity: .7; text-transform: uppercase; }
.section h2 { color: #fff; font-size: 64px; margin: 6px 0 18px; }
.section p { font-size: 28px; opacity: .85; max-width: 900px; }

/* ---------- boxes ---------- */
.box {
  border-radius: 10px; padding: 16px 22px 14px; margin: 6px 0 18px;
  background: var(--paper-warm); border-left: 6px solid var(--ink-faint);
}
.box > .box-title {
  display: block; font-size: 17px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 700; margin-bottom: 6px;
}
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box > .box-title .katex, .kicker .katex { text-transform: none; letter-spacing: 0; }
.definition { background: var(--blue-bg); border-left-color: var(--blue); }
.definition > .box-title { color: var(--blue); }
.theorem { background: var(--accent-bg); border-left-color: var(--accent); }
.theorem > .box-title { color: var(--accent); }
.practice { background: var(--warm-bg); border-left-color: var(--warm); }
.practice > .box-title { color: var(--warm); }
.discuss { background: #fff; border: 2px dashed var(--accent-2); border-left-width: 2px; }
.discuss > .box-title { color: var(--accent-2); }
.algo { background: #fbfbf8; border: 1px solid var(--rule); border-left: 6px solid var(--ink); font-size: .9em; }
.algo ol { margin: 4px 0 0; }

/* "Let's practice" slide header, as in the Keynote decks */
.slide.practice-slide > h2 { color: var(--warm); }

/* placeholder for content still to write */
.todo {
  border: 2px dashed #d7a21f; background: #fff8e1; color: #6b5200; border-radius: 8px;
  padding: 10px 16px; font-size: 18px; margin: 8px 0;
}
.todo::before { content: "TODO  "; font-weight: 700; letter-spacing: .1em; }
body.hide-todo .todo { display: none; }

/* two mazes stacked in the same place; the second one (a fragment) fades in over the first */
.maze-stack { display: grid; justify-items: center; }
.maze-stack > * { grid-area: 1 / 1; background: var(--paper); }
/* compact per-episode tables */
.slide table.ep-table { font-size: 19px; }
.slide table.ep-table th, .slide table.ep-table td { padding: 3px 10px; text-align: center; }

/* code blocks */
.slide pre { margin: 0 0 14px; padding: 12px 16px; background: #f6f5f0; border: 1px solid var(--rule); border-radius: 8px; font-size: 15.5px; line-height: 1.45; overflow: hidden; }
.slide pre code { background: none; padding: 0; font-size: 1em; }

/* tables */
.slide table { border-collapse: collapse; font-size: .82em; }
.slide th, .slide td { padding: 8px 16px; border-bottom: 1px solid var(--rule); text-align: left; }
.slide th { color: var(--accent); font-weight: 700; border-bottom: 2px solid var(--accent); }

/* math */
.katex { font-size: 1.05em; }
/* never break an inline formula across lines: it moves to the next line as a whole */
.slide .katex { white-space: nowrap; }
.slide .katex .base { white-space: nowrap; }
.katex-display { margin: .5em 0; }
.eq-big .katex-display .katex { font-size: 1.25em; }

/* figures */
figure { margin: 0; }
figcaption { font-size: 17px; color: var(--ink-soft); margin-top: 6px; text-align: center; }

/* ---------- fragments ---------- */
.fragment { opacity: 0; transition: opacity .25s ease; }
.fragment.visible { opacity: 1; }
.fragment.fade-dim.visible.past { opacity: .35; }
.fragment.highlight { opacity: 1; transition: background .3s; border-radius: 6px; }
.fragment.highlight.visible { background: #fff2a8; }

/* ---------- speaker notes ---------- */
aside.notes { display: none; }
.notes-overlay {
  position: fixed; left: 0; right: 0; bottom: 0; max-height: 34vh; overflow: auto;
  background: rgba(20, 22, 18, .94); color: #e8e8e2; font: 17px/1.5 var(--font-text);
  padding: 14px 28px; z-index: 20; display: none;
}
body.show-notes .notes-overlay { display: block; }

/* overview mode (press O) */
body.overview { overflow: auto; background: #2a2c28; }
body.overview .deck { position: static; display: flex; flex-wrap: wrap; gap: 18px; padding: 24px; justify-content: center; }
body.overview .slide { display: flex; position: relative; left: auto; top: auto; margin: 0; transform: none !important; zoom: .25; cursor: pointer; outline: 12px solid transparent; }
body.overview .slide.active { outline-color: var(--accent-2); }
body.overview .fragment { opacity: 1; }
body.overview .maze-controls { pointer-events: none; }

/* blank screen (press B) */
.blank { position: fixed; inset: 0; background: #fff; z-index: 30; display: none; }
body.blanked .blank { display: block; }

/* help (press ?) */
.help { position: fixed; right: 20px; top: 20px; z-index: 40; background: #fff; border-radius: 10px; padding: 16px 22px; font-size: 15px; box-shadow: 0 8px 30px rgba(0,0,0,.35); display: none; }
.help kbd { font-family: var(--font-mono); background: var(--paper-warm); border: 1px solid var(--rule); border-radius: 4px; padding: 0 6px; }
body.show-help .help { display: block; }

/* ---------- print / PDF export: one slide per page, all fragments shown ---------- */
@page { size: 1280px 720px; margin: 0; }
@media print {
  html, body { background: #fff; overflow: visible; height: auto; }
  .deck { position: static; }
  .slide { display: flex !important; position: relative; left: 0; top: 0; margin: 0; transform: none !important; page-break-after: always; break-after: page; }
  .fragment { opacity: 1 !important; }
  .progress, .notes-overlay, .help, .maze-controls { display: none !important; }
  body.hide-todo-print .todo { display: none; }
}
