/* Look of the lecture slide decks (reveal.js), matching the rest of the site: colours and fonts
   from tokens.css, bold sans titles, serif text, mono labels. Slides are 1280×720 and reveal.js
   scales them to the window, so sizes below are in slide pixels (1em = 30px). */

html, body { background: var(--bg); }
.reveal-viewport {
  background-color: var(--bg);
  background-image:
    radial-gradient(55% 50% at 70% 30%, var(--glow-b), transparent 70%),
    radial-gradient(45% 45% at 15% 85%, var(--glow-a), transparent 70%);
}

.reveal {
  font: 400 30px/1.4 var(--f-serif);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.reveal .slides { text-align: left; }
.reveal .slides > section {
  height: 100%;
  flex-direction: column;
  padding: 34px 56px 46px;
  box-sizing: border-box;
}

.reveal h1, .reveal h2 {
  margin: 0 0 0.6em;
  font-family: var(--f-ui);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
  color: var(--ink);
}
/* titles in px so that slides.js only resizes the text below them */
.reveal h1 { font-size: 102px; }
.reveal h2 { font-size: 54px; }
.reveal .kicker {
  margin: 0 0 10px;
  font: 500 20px var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.reveal .kicker + h2 { margin-top: 0; }

.reveal p { margin: 0 0 0.6em; }
.reveal ul { margin: 0; padding-left: 1.1em; }
.reveal li { margin: 0 0 0.55em; }
.reveal li::marker { color: var(--accent); }
.reveal strong { font-weight: 700; }
.reveal a { color: var(--accent); text-decoration: none; }
.reveal a:hover { text-decoration: underline; }
.reveal img { display: block; max-width: 100%; }
.reveal .katex { font-size: 1.1em; }

/* small grey asides: "(from course plan)", "Will be discussed in Chapter 8", captions */
.reveal .aside { font: 400 22px/1.4 var(--f-ui); color: var(--ink-soft); }
.reveal .credit { font: 400 14px var(--f-mono); color: var(--ink-soft); margin-top: 6px; }

/* Layout: the part below the title fills the rest of the slide */
.reveal .fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.reveal .center { align-items: center; justify-content: center; text-align: center; }
.reveal .cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.reveal .fig { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.reveal .fig > img, .reveal .fill > img { max-height: 100%; object-fit: contain; min-height: 0; }

/* figures with a white or transparent background sit on a white plate, so they read in dark mode */
.reveal .plate { box-sizing: border-box; background: #fff; border-radius: 10px; padding: 10px; }
:root[data-theme="light"] .reveal .plate { box-shadow: 0 0 0 1px var(--edge); }

/* free placement (collages): position with inline left/top/width in slide pixels */
.reveal .abs { position: absolute; margin: 0; }
.reveal .shadow { box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); }

/* a boxed statement that appears over the slide */
.reveal .callout {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 84%;
  transform: translate(-50%, -50%);
  padding: 26px 36px;
  font-size: 34px;
  line-height: 1.35;
  text-align: center;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
/* a callout box in the flow of the text, e.g. a key equation */
.reveal .callout.inline { position: static; transform: none; width: auto; margin: 0.4em 0; padding: 8px 22px; font-size: 1em; }

/* reveal.js animates "all" on fragments, which would also animate font-size while slides.js fits the text */
.reveal .slides section .fragment { transition-property: opacity, visibility, transform; }

/* answer hidden until a click on its trigger (data-reveals) shows it; its space is kept */
.reveal .click-reveal:not(.revealed) { visibility: hidden; }

/* highlight that appears on a click (class="fragment hl") */
.reveal .slides section .fragment.hl { opacity: 1; visibility: inherit; border-radius: 0.3em; transition: background-color 0.2s, box-shadow 0.2s; }
.reveal .slides section .fragment.hl.visible, .reveal .slides section .hl:not(.fragment) {
  background: color-mix(in srgb, var(--gold) 24%, transparent);
  box-shadow: 0 0 0 3px var(--gold);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* label next to a highlighted line, e.g. "← Today's topic!" */
.reveal .hl-tag { font: 700 0.75em var(--f-ui); color: var(--gold); white-space: nowrap; margin-left: 0.5em; }
/* a box drawn over part of a figure (inline left/top/width/height in %) */
.reveal .mark-wrap { position: relative; }
/* a label placed over a figure (inside .mark-wrap) with inline left/top in % */
.reveal .overlay-label { position: absolute; transform: translate(-50%, 0); font-size: 1.2em; color: var(--accent-strong, #0e7490); }
/* marks over a figure, centred on inline left/top (in %): a dot, a ring (inline width in %), a label */
.reveal .mark-wrap .pin, .reveal .mark-wrap .ring, .reveal .mark-wrap .tag { position: absolute; transform: translate(-50%, -50%); }
.reveal .mark-wrap .pin { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.5); }
.reveal .mark-wrap .ring { aspect-ratio: 1; border: 3px solid var(--hot); border-radius: 50%; }
.reveal .mark-wrap .ring.box { border-color: #15803d; border-radius: 4px; }
/* a white patch with "z = ?" that hides one label of a figure until a click (inline top in %) */
.reveal .mark-wrap .z-hide { position: absolute; left: 72%; width: 19%; height: 6.5%; background: #fff; color: #64748b; font: 600 22px var(--f-ui); display: flex; align-items: center; justify-content: center; }
/* a box around one label of the quasar figure (inline top in %) */
.reveal .mark-wrap .z-mark { position: absolute; left: 72%; width: 19%; height: 7.5%; transform: translateY(-50%); border: 3px solid var(--hot); border-radius: 8px; pointer-events: none; }
.reveal .mark-wrap .tag.dist { font-size: 15px; background: rgba(14, 116, 144, 0.92); }
.reveal .mark-wrap .tag {
  padding: 3px 10px;
  font: 600 18px var(--f-ui);
  white-space: nowrap;
  color: #fff;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 6px;
}
.reveal .mark { position: absolute; border: 4px solid var(--gold); border-radius: 10px; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }

/* Cover: title, date, then two figures filling the rest (the history-of-the-Universe timeline in
   every lecture, and one picked for the lecture's theme) */
.reveal .cover h1 { font-size: 76px; margin-bottom: 0.1em; }
.reveal .cover .sub { margin: 0; font: 600 36px var(--f-ui); color: var(--ink-soft); letter-spacing: -0.01em; }
.reveal .cover-figs { flex: 1; min-height: 0; display: flex; gap: 32px; padding-top: 26px; }
.reveal .cover-figs figure { height: 100%; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.reveal .cover-figs img { height: 100%; width: auto; max-width: none; border-radius: 6px; }

/* Answer wall: type a phrase and press Enter to add it; click a phrase to remove it.
   Phrases are kept in this browser until "Clear". */
.reveal .wall { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.reveal .wall-items {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px dashed var(--edge);
  border-radius: 14px;
}
.reveal .wall-items button {
  padding: 8px 18px;
  font: 500 26px var(--f-ui);
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
}
.reveal .wall-items button:hover { text-decoration: line-through; }
.reveal .wall-bar { display: flex; gap: 10px; }
.reveal .wall-bar input {
  flex: 1;
  padding: 8px 14px;
  font: 400 22px var(--f-ui);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 10px;
}
.reveal .wall-bar input:focus { outline: 2px solid var(--accent); }
.reveal .wall-bar button {
  padding: 0 14px;
  font: 500 14px var(--f-mono);
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--edge);
  border-radius: 10px;
  cursor: pointer;
}
.reveal .wall-bar button:hover { color: var(--accent); border-color: var(--accent); }

.reveal h3 { margin: 0.5em 0 0.3em; font: 700 28px var(--f-ui); letter-spacing: -0.01em; color: var(--ink); }

/* History of Cosmology: one column per cosmology, images of equal height */
.reveal .history img { height: 300px; width: 100%; object-fit: contain; }
.reveal .history p { margin: 0 0 0.45em; font-size: 0.92em; line-height: 1.35; }
.reveal .history b { font-family: var(--f-ui); color: var(--accent); }

/* Clickable options (<div class="choices"> of <details class="yes|no|partly">): the summary is
   the option, the paragraph opens with the verdict and the reason */
.reveal .choices { display: grid; gap: 10px; align-content: start; }
.reveal .choices details { border: 1px solid var(--edge); border-radius: 12px; background: var(--card); }
.reveal .choices summary {
  padding: 10px 16px;
  font: 700 28px var(--f-ui);
  cursor: pointer;
  list-style: none;
}
.reveal .choices summary::-webkit-details-marker { display: none; }
.reveal .choices summary span { margin-left: 0.4em; font-weight: 400; font-size: 0.75em; color: var(--ink-soft); }
.reveal .choices summary:hover { color: var(--accent); }
.reveal .choices p { margin: 0; padding: 0 16px 12px; font-size: 0.8em; line-height: 1.4; }
.reveal .choices details.yes[open] { border-color: var(--good); }
.reveal .choices details.yes b { color: var(--good); }
.reveal .choices details.no[open] { border-color: var(--hot); }
.reveal .choices details.no b { color: var(--hot); }
.reveal .choices details.partly[open] { border-color: var(--gold); }
.reveal .choices details.partly b { color: var(--gold); }

/* Olbers' paradox widget (lectures/01-observables/olbers.js) */
.reveal .olbers-sky { width: 480px; height: 480px; border-radius: 50%; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--edge); background: #05080f; }
.reveal .olbers-label { display: block; margin-top: 0.6em; font: 600 22px var(--f-ui); color: var(--ink-soft); }
.reveal .olbers-slider { width: 100%; margin: 10px 0 14px; accent-color: var(--accent); }
.reveal .olbers-out { font-family: var(--f-ui); font-size: 0.8em; }
.reveal .olbers-paradox { margin-top: 0.4em; padding: 12px 16px; font-size: 0.8em; border: 2px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.reveal .olbers-out sup { font-size: 0.7em; }

/* Lecture 2 widgets: a figure drawn by widgets.js, its on/off switches */
.reveal .w-fig svg { display: block; overflow: visible; }
.reveal .w-toggle { display: flex; align-items: center; gap: 10px; margin: 6px 0; font: 500 21px var(--f-ui); color: var(--ink); cursor: pointer; }
.reveal .w-toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* Isotropy and homogeneity (lectures/01-observables/homogeneity.js) */
.reveal .patterns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.reveal .patterns figure { margin: 0; }
.reveal .patterns canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; box-shadow: 0 0 0 1px var(--edge); }
.reveal .patterns figcaption { margin-top: 8px; font: 400 18px/1.35 var(--f-ui); color: var(--ink-soft); }
.reveal .patterns figcaption b { color: var(--ink); }
.reveal table.scales { width: 100%; border-collapse: collapse; font-size: 0.85em; margin-top: 8px; }
.reveal table.scales th { padding: 6px 10px; text-align: left; font: 500 15px var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--edge); }
.reveal table.scales td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.reveal table.scales td { vertical-align: middle; padding: 6px 12px; }
.reveal table.scales td:first-child { width: 190px; padding-left: 0; }
.reveal table.scales td:first-child img { height: 60px; width: auto; max-width: 200px; border-radius: 4px; }
.reveal table.scales td:first-child img.plate { padding: 4px; }
.reveal table.scales td:nth-child(2) { font-family: var(--f-ui); font-weight: 700; white-space: nowrap; }
.reveal table.scales td:nth-child(2) span { font-weight: 400; color: var(--ink-soft); }
.reveal .cluster-map { width: 500px; height: 500px; border-radius: 8px; box-shadow: 0 0 0 1px var(--edge); }
.reveal .cluster-slider { width: 100%; margin: 10px 0 14px; accent-color: var(--accent); }
.reveal .cluster-shuffle {
  padding: 6px 14px;
  font: 500 16px var(--f-mono);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 10px;
  cursor: pointer;
}
.reveal .cluster-shuffle:hover { color: var(--accent); border-color: var(--accent); }
.reveal .cluster-out { font-family: var(--f-ui); font-size: 0.8em; }
.reveal .cluster-key { font-size: 0.8em; color: var(--ink-soft); }
.reveal .cluster-ok { margin-left: 0.3em; padding: 1px 8px; font-weight: 700; color: #fff; background: var(--good); border-radius: 999px; }
.reveal .cluster-key i { font-style: normal; font-weight: 700; }

/* numbered steps for an activity */
.reveal .steps { margin: 0; padding-left: 0; list-style: none; }
.reveal .steps li { margin: 0 0 0.6em; }
.reveal .steps b { font: 700 0.8em var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-right: 0.4em; }

/* reveal.js chrome */
.reveal .controls { color: var(--accent); }
.reveal .progress { color: var(--accent); }
.reveal .slide-number {
  right: 16px;
  bottom: 16px;
  padding: 0;
  font: 500 13px var(--f-mono);
  color: var(--ink-soft);
  background: transparent;
}
.reveal .controls { right: 52px; bottom: 10px; }

/* the course link and the light/dark button sit bottom-left */
.deck-home {
  position: fixed;
  left: 60px;
  bottom: 22px;
  z-index: 30;
  font: 400 12px var(--f-mono);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-decoration: none;
}
.deck-home:hover { color: var(--accent); }
#themeToggle {
  position: fixed;
  left: 16px;
  bottom: 14px;
  z-index: 30;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  cursor: pointer;
}
#themeToggle:hover { border-color: var(--accent); }
#themeToggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
:root[data-theme="light"] #themeToggle .sun, :root:not([data-theme="light"]) #themeToggle .moon { display: none; }

@media print {
  .deck-home, #themeToggle { display: none; }
}
