/* Theme for the PhilML deck. Colours mirror theme/palette.json; keep both in sync. */

/* Bundled font: the installed Source Sans 3 gives the browser only its Regular weight, so bold was synthesized */
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-Light.otf") format("opentype"); font-weight: 300; font-style: normal; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-LightIt.otf") format("opentype"); font-weight: 300; font-style: italic; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-It.otf") format("opentype"); font-weight: 400; font-style: italic; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-Semibold.otf") format("opentype"); font-weight: 600; font-style: normal; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-SemiboldIt.otf") format("opentype"); font-weight: 600; font-style: italic; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; }
@font-face { font-family: "Source Sans 3"; src: url("../vendor/fonts/SourceSans3-BoldIt.otf") format("opentype"); font-weight: 700; font-style: italic; }

:root {
  --paper: #FAF7F0;
  --ink: #1F1D1A;
  --muted: #6B665F;
  --rule: #D9D3C7;
  --red: #D1495B;
  --teal: #2A9D8F;
  --gold: #E9C46A;
  --blue: #3D5A80;
  --plum: #7B4B94; /* Hoefer's conditions (Best system, Unique fit, Precise fit, Coverage); CSS only, not in palette.json */
  --font: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
}

.reveal-viewport { background: var(--paper); }
.reveal { font-family: var(--font); font-size: 34px; color: var(--ink); line-height: 1.35; }
.reveal .slides section { text-align: left; }
.reveal .slides section > * { margin-left: 0; margin-right: 0; }

.reveal h1, .reveal h2, .reveal h3, .reveal h4 {
  font-family: var(--font); color: var(--ink); text-transform: none; letter-spacing: -0.01em;
  margin: 0 0 0.6em 0; font-weight: 600;
}
.reveal h1 { font-size: 2.2em; }
.reveal h2 { font-size: 1.4em; border-bottom: 2px solid var(--rule); padding-bottom: 0.2em; }
.reveal h4 { font-size: 0.9em; margin-bottom: 0.3em; }
.reveal p { margin: 0.4em 0; }
.reveal ul { margin-left: 1em; }
.reveal li { margin: 0.35em 0; }
.reveal b, .reveal strong { font-weight: 600; }
.reveal em, .reveal i { font-style: italic; }
.reveal hr { border: 0; border-top: 2px solid var(--rule); margin: 0.8em 0; }
.reveal a { color: var(--blue); }
/* Talk progress bar (index.html): full at the conclusion, not at the last backup slide */
#talk-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: rgba(0,0,0,0.12); z-index: 10; }
#talk-progress span { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.8s cubic-bezier(0.26, 0.86, 0.44, 0.985); }

/* Text colours are darker than the fill colours, for contrast on the paper background. */
.reveal .red { color: #B83A4B; }
.reveal .cond { color: var(--plum); }
.reveal .teal { color: #1E7F74; }
.reveal .green { color: #2F8A4C; }
.reveal .tight-top { margin-top: 0.2em; }
/* numbered badge inline in text, matching the figure's red circles */
.reveal .num { display: inline-flex; width: 1.3em; height: 1.3em; align-items: center; justify-content: center; border-radius: 50%; background: var(--red); color: var(--paper); font-weight: 700; font-size: 0.75em; vertical-align: 0.12em; }
.reveal .muted { color: var(--muted); }
.reveal .small { font-size: 0.7em; color: var(--muted); }
.reveal .big { font-size: 1.3em; font-weight: 600; }
.reveal .big .cite { font-weight: 400; }
.reveal .question { margin-top: 1.4em; color: #B83A4B; }
.reveal .nowrap { white-space: nowrap; }
.reveal .cite { font-size: 0.7em; color: var(--muted); white-space: nowrap; }
.reveal .missing {
  display: inline-block; margin-top: 0.6em; padding: 0.25em 0.6em;
  background: var(--gold); color: var(--ink); font-weight: 600; border-radius: 4px;
}
.reveal .missing .sub { font-weight: 400; font-size: 0.85em; }

/* Breadcrumb (bottom left; built in index.html from the slides' data-section) and slide number */
#breadcrumb {
  position: absolute; bottom: 14px; left: 28px; z-index: 10; display: flex; gap: 1.6em;
  font-family: var(--font); font-size: calc(26px * var(--rs, 0.7)); color: #A8A298; letter-spacing: 0.02em;
}
#breadcrumb span { cursor: pointer; }
#breadcrumb span.current { color: var(--ink); font-weight: 600; }
.reveal .slide-number { background: transparent; color: var(--muted); font-family: var(--font); font-size: calc(22px * var(--rs, 0.8)); right: 150px; bottom: 14px; }
/* Navigation arrows (bottom right), as on the reveal.js demo: they show which directions lead on, including down */
.reveal .controls { color: var(--red); }

/* Plan list */
.reveal ol.plan-list { list-style: none; margin: 0.4em 0 0 0; padding: 0; }
.reveal ol.plan-list li { display: flex; align-items: center; gap: 0.8em; margin: 0.45em 0; }
.reveal ol.plan-list li > span { display: inline-flex; width: 1.5em; height: 1.5em; align-items: center; justify-content: center; border-radius: 50%; background: var(--red); color: var(--paper); font-weight: 600; font-size: 0.8em; }

/* Title and section slides */
.reveal section.title h1 { font-size: 3em; margin-bottom: 0.1em; }
.reveal section.title h2 { border: 0; font-weight: 400; color: var(--muted); font-size: 1.3em; }
.reveal section.title p { color: var(--muted); font-size: 0.8em; margin-top: 1.5em; }
.reveal section.section { height: 100%; }
.reveal section.section h1 { font-size: 2.4em; color: var(--ink); margin-top: 2.2em; max-width: 55%; line-height: 1.1; }
.reveal section.section p { color: var(--muted); font-size: 1em; }
.reveal section.section::after {
  content: attr(data-num); position: absolute; top: -6%; right: -4%; width: 42%; height: 112%;
  background: var(--red); color: var(--paper); font-weight: 700; font-size: 24em; line-height: 0.8;
  display: flex; align-items: flex-end; justify-content: flex-start; padding-left: 0.1em; overflow: hidden; z-index: -1;
}
.reveal section.section.backup::after { background: var(--muted); }

/* Scope box (slide: Plan) and examples (slide: Softmax) */
.reveal .scope { background: #F0EBE0; border-radius: 8px; padding: 0.6em 0.8em; margin-top: 1.5em; }
.reveal .scope p { margin: 0.3em 0 0 0; }
.reveal .examples { padding-top: 1.5em; }
.reveal .examples p { margin: 0 0 1em 0; }

/* Layout helpers */
.reveal .row { display: flex; gap: 1.2em; align-items: flex-start; }
.reveal .col { flex: 1 1 0; min-width: 0; }
.reveal .col.wide { flex: 1.5 1 0; }
.reveal .col.narrow { flex: 1 1 0; }
.reveal .col.fig40 { flex: 0 0 42%; }
.reveal .col.fig60 { flex: 0 0 60%; }  /* a wide animation beside a short text */  /* a cropped animation keeps its size, the text gets the rest */
.reveal img, .reveal video { max-width: 100%; height: auto; border: 0; box-shadow: none; background: transparent; }
.reveal .wide-fig { width: 100%; display: block; margin: 0.2em auto; }
.reveal video.anim { width: auto; max-width: 100%; max-height: 440px; display: block; margin: 0 auto; }
.reveal .col video.anim { max-height: 560px; }
.reveal .col video.anim.tall { max-height: 680px; }  /* a near-square animation that should fill its column */

/* Layered figure: the first image sets the size, later ones (fragments) overlay it */
.reveal .stack { position: relative; }
.reveal .stack img { display: block; width: 100%; }
.reveal .stack img + img { position: absolute; top: 0; left: 0; }

/* Fragments: stack overlays of the same image in place */
.reveal .col img.fragment { position: absolute; top: 0; left: 0; }
.reveal .col img.fragment:first-child { position: relative; }
.reveal .col { position: relative; }

/* Assumptions table (slide: Textbook Assumptions): both columns same size and weight */
.reveal table.assume { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0.2em 0 0.8em 0; font-size: 1.15em; }
/* separate borders, so each cell's rule appears with the cell */
.reveal table.assume td { width: 50%; padding: 0.3em 0.5em; border-bottom: 1px solid var(--rule); }

/* Candidate cards */
.reveal .cards { display: flex; gap: 0.8em; margin-top: 1em; }
.reveal .card { flex: 1; border: 2px solid var(--rule); border-radius: 8px; padding: 0.6em 0.7em; min-height: 5em; }
.reveal .card h4 { font-size: 1em; }
.reveal .card p { font-size: 0.85em; color: var(--muted); }
.reveal .card p .red, .reveal .card p.red { color: #B83A4B; }
/* a card that turns red when its empty .light-on fragment is shown */
.reveal .card.light-up:has(.light-on.visible) { border-color: var(--red); }
.reveal .card.light-up:has(.light-on.visible) h4 { color: var(--red); }
.reveal .card.lit { border-color: var(--red); }
.reveal .card.lit h4 { color: var(--red); }

/* Diagnosis table */
.reveal table.diag { width: 100%; border-collapse: collapse; font-size: 0.85em; margin: 0.4em 0; }
.reveal table.diag th { text-align: left; color: var(--muted); font-weight: 400; border-bottom: 2px solid var(--rule); padding: 0.2em 0.5em; }
.reveal table.diag td { padding: 0.25em 0.5em; border-bottom: 1px solid var(--rule); }
.reveal table.diag td:last-child { font-weight: 600; }

.reveal ul.claims { list-style: none; margin: 0; }
.reveal ul.claims li::before { content: "— "; color: var(--red); }

/* Live temperature demo */
.reveal .demo { margin-top: 0.4em; }
.reveal .demo .bars { position: relative; padding: 0.4em 0 0.2em 0; }
.reveal .demo .bar { position: relative; height: 1.6em; margin: 0.5em 0; background: #F0EBE0; border-radius: 4px; }
.reveal .demo .fill { height: 100%; border-radius: 4px; transition: width 0.08s linear; }
.reveal .demo .fill.red { background: var(--red); }
.reveal .demo .fill.teal { background: var(--teal); }
.reveal .demo .fill.blue { background: var(--blue); }
.reveal .demo .lab { position: absolute; left: 0.5em; top: 0; line-height: 1.6em; color: var(--ink); font-size: 0.8em; mix-blend-mode: multiply; }
.reveal .demo .threshold { position: absolute; top: 0; bottom: 0; border-left: 3px dashed var(--blue); }
.reveal .demo .threshold span { position: absolute; top: -1.2em; left: 0.3em; font-size: 0.55em; color: var(--blue); white-space: nowrap; }
.reveal .demo label { display: block; font-size: 0.8em; margin-top: 0.6em; color: var(--muted); }
.reveal .demo input[type=range] { width: 100%; accent-color: var(--red); }

/* Hide the chrome on section slides */
.reveal.on-section #breadcrumb { display: none; }
.reveal.on-section .slide-number { visibility: hidden; }
.reveal.no-crumb #breadcrumb { display: none; }

.reveal .slide-number a { color: inherit; text-decoration: none; }

/* End slide */
.reveal section.end p.who { color: var(--ink); font-size: 0.9em; line-height: 1.5; margin-top: 1.5em; }
.reveal section.end p.who b { font-size: 1.1em; }

/* Overview (Esc): reveal.js draws the background frames offset from the slides, and this deck has
   no slide backgrounds, so hide the frames and give each slide its own paper and frame. */
.reveal.overview .backgrounds { display: none; }
.reveal.overview .slides section:not(.stack) { background: var(--paper); outline: 2px solid var(--rule); outline-offset: 0; }
.reveal.overview .slides section:not(.stack):hover { outline: 6px solid var(--muted); }
.reveal.overview .slides section.present:not(.stack) { outline: 10px solid var(--red); }

/* Bold design (chosen 2026-10-07): heavier, larger titles with a short red underline; full-bleed red
   section slides with paper text. Horizontal underline only; no vertical bars. */
.reveal h2 { font-size: 1.55em; font-weight: 700; letter-spacing: -0.015em; border-bottom: 0; padding-bottom: 0.25em; position: relative; margin-bottom: 0.8em; }
.reveal h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.2em; height: 0.12em; background: var(--red); border-radius: 2px; }
.reveal section.title h2::after { display: none; }
.reveal { font-size: 35px; }
.reveal b, .reveal strong { font-weight: 700; }
.reveal .card { border-width: 3px; border-radius: 10px; }
.reveal section.title h1 { font-size: 3.6em; font-weight: 700; letter-spacing: -0.025em; }
.reveal section.title h1::after { content: ""; display: block; width: 1.6em; height: 0.09em; background: var(--red); margin-top: 0.15em; border-radius: 3px; }
.reveal section.section::after {
  top: -8%; left: -6%; right: -6%; width: auto; height: 116%; z-index: -1;
  justify-content: flex-end; padding-right: 0.15em; color: rgba(255,255,255,0.18); font-size: 30em;
}
.reveal section.section h1 { color: var(--paper); font-weight: 700; font-size: 3em; max-width: 70%; }
.reveal section.section p { color: rgba(255,255,255,0.85); }
.reveal.on-section #talk-progress span { background: var(--paper); }

/* PDF export: the stills replace the videos and keep their size; no chrome outside the slides */
html.reveal-print img.anim { width: auto; max-width: 100%; max-height: 440px; display: block; margin: 0 auto; }
html.reveal-print .col img.anim { max-height: 560px; }
html.reveal-print .col img.anim.tall { max-height: 680px; }
html.reveal-print #breadcrumb, html.reveal-print #talk-progress { display: none; }
/* Overview: reveal.js hides section::after there, so give section slides their red (grey for backup) directly */
.reveal.overview .slides section.section { background: var(--red); }
.reveal.overview .slides section.section.backup { background: var(--muted); }
