/* Tutorial webpage styles.
   Colours are variables: light mode in :root, dark mode in the data-theme selector. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/inter-latin-variable.woff2") format("woff2");
}

:root {
  --bg: #f8f7f3;
  --hero-bg: #edf2f8;
  --hero-dark: 0;
  --surface: #ffffff;
  --surface-alt: #f1efe8;
  --text: #18202e;
  --muted: #586274;
  --border: #e2ded3;
  --accent: #2346b8;
  --accent-hover: #1a3790;
  --accent-soft: #e7ecfa;
  --on-accent: #ffffff;
  --warm: #b4500f;
  --todo-bg: #fff4d6;
  --todo-text: #6f4500;
  --todo-border: #d9a53a;
  --shadow: 0 1px 2px rgb(24 32 46 / 0.05), 0 10px 30px rgb(24 32 46 / 0.07);

  --radius: 14px;
  --max-width: 1100px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1320;
  --hero-bg: #08111f;
  --hero-dark: 1;
  --surface: #131b2b;
  --surface-alt: #10182a;
  --text: #e7ebf3;
  --muted: #a3adbf;
  --border: #26314a;
  --accent: #8fa8ff;
  --accent-hover: #b3c4ff;
  --accent-soft: #1b2645;
  --on-accent: #0d1320;
  --warm: #f0a35e;
  --todo-bg: #33270e;
  --todo-text: #f5d38a;
  --todo-border: #8a6a22;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0d1320;
    --hero-bg: #08111f;
    --hero-dark: 1;
    --surface: #131b2b;
    --surface-alt: #10182a;
    --text: #e7ebf3;
    --muted: #a3adbf;
    --border: #26314a;
    --accent: #8fa8ff;
    --accent-hover: #b3c4ff;
    --accent-soft: #1b2645;
    --on-accent: #0d1320;
    --warm: #f0a35e;
    --todo-bg: #33270e;
    --todo-text: #f5d38a;
    --todo-border: #8a6a22;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.25);
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 12px;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-sans); line-height: 1.2; text-wrap: balance; }
p, li { text-wrap: pretty; }

.container { width: min(100% - 32px, var(--max-width)); margin-inline: auto; }
.nowrap { white-space: nowrap; }

.theme-ready *, .theme-ready *::before, .theme-ready *::after {
  transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease,
              box-shadow 400ms ease, fill 400ms ease, stroke 400ms ease, opacity 400ms ease;
}
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { grid-area: 1 / 1; width: 20px; height: 20px; }
.theme-toggle .theme-icon-sun { opacity: 0; }
.theme-toggle .theme-icon-moon { opacity: 1; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { opacity: 1; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { opacity: 0; }
.theme-toggle:hover { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) {
  .theme-ready *, .theme-ready *::before, .theme-ready *::after { transition: none; }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.skip-link:focus { left: 16px; }

/* Placeholders still to fill in: search index.html for "todo". */
.todo {
  display: inline-block;
  padding: 0 8px;
  border: 1px dashed var(--todo-border);
  border-radius: 6px;
  background: var(--todo-bg);
  color: var(--todo-text);
  font-size: 0.86em;
  font-weight: 500;
  line-height: 1.7;
}

/* ---------- Hero ---------- */

.hero, .section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 104px 0 120px;
  color: var(--text);
  background: var(--hero-bg);
}
.hero-canvas { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.hero::before, .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.hero::before {
  opacity: calc(1 - var(--hero-dark));
  background: radial-gradient(ellipse at 50% 47%, rgb(237 242 248 / 94%) 0%, rgb(237 242 248 / 79%) 32%, rgb(237 242 248 / 8%) 77%),
              linear-gradient(0deg, rgb(237 242 248 / 65%), transparent 20%, transparent 85%, rgb(237 242 248 / 25%));
}
.hero::after {
  opacity: var(--hero-dark);
  background: radial-gradient(ellipse at 50% 47%, rgb(8 17 31 / 88%) 0%, rgb(8 17 31 / 72%) 32%, rgb(8 17 31 / 8%) 77%),
              linear-gradient(0deg, rgb(8 17 31 / 65%), transparent 20%, transparent 85%, rgb(8 17 31 / 25%));
}
.hero-content { position: relative; z-index: 2; }
.hero-text { max-width: 1100px; margin-inline: auto; text-align: center; }
.hero .eyebrow { margin-bottom: 24px; color: var(--muted); }
.hero h1 { font-size: clamp(18px, 6vw, 76px); line-height: 1.12; letter-spacing: -0.045em; }
.hero-title-line { display: block; white-space: nowrap; }
.hero .facts {
  max-width: 660px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 36px auto 32px;
  padding: 22px 0;
  border-color: var(--border);
}
.hero .facts dt { color: var(--muted); }
.hero .actions { justify-content: center; }

.eyebrow {
  margin: 0 0 14px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 20px;
  font-family: var(--font-sans);
  font-size: clamp(34px, 4.6vw, 52px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.lead { max-width: 34em; margin: 0 0 30px; color: var(--muted); font-size: 19px; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 28px;
  margin: 0 0 32px;
  padding: 18px 0;
  border-block: 1px solid var(--border);
}
.facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.facts dd { margin: 0; font-size: 15px; line-height: 1.45; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: var(--on-accent); }
.button-ghost { border-color: var(--border); background: transparent; color: var(--accent); }
.button-ghost:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ---------- Sections ---------- */

.section { padding: 80px 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--surface-alt); }

.section h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
}
.section h3 { margin: 0 0 12px; font-size: 19px; }
.section-lead { max-width: 46em; margin: 0 0 36px; color: var(--muted); }

.prose p { margin: 0 0 16px; }
.overview-intro { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 40px; }
.overview-figure {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.overview-figure img, .overview-figure svg { display: block; width: 100%; height: auto; }
.overview-figure .grid { stroke: var(--border); }
.overview-figure .quote-region { fill: var(--accent-soft); }
.overview-figure .edge { stroke: var(--muted); }
.overview-figure .band { fill: var(--accent); fill-opacity: 0.1; }
.overview-figure .draw { stroke: var(--accent); stroke-opacity: 0.22; }
.overview-figure .med { stroke: var(--warm); }
.overview-figure .q { fill: var(--text); }
.overview-figure .lab { fill: var(--muted); }
.overview-figure .axis-capsule { fill: var(--surface-alt); stroke: var(--border); }

.learning-outcomes { margin-top: 32px; }
.learning-outcomes ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.learning-outcomes li { font-size: 15.5px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 40px 0 48px;
}
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0; }

.card {
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.card-icon { display: block; width: 40px; height: 40px; flex: none; margin-bottom: 14px; color: var(--accent); }
.bayesflow-logo { padding: 4px; border-radius: 8px; background: #0d1320; object-fit: contain; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.cards-4 .card { display: flex; flex-direction: column; }
.card .status, .card .links { margin-top: auto; padding-top: 14px; }
.card .links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; font-weight: 600; }

.card-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; }
.two-col p { margin: 0 0 14px; }

.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; margin: 0 0 12px; padding-left: 30px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.5em;
  width: 13px;
  height: 7px;
  border-bottom: 2.5px solid var(--warm);
  border-left: 2.5px solid var(--warm);
  transform: rotate(-45deg);
}
.setup-list { max-width: 46em; }

/* ---------- Program ---------- */

.program-table-scroll { overflow-x: auto; }
.program-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  text-align: left;
  font-size: 16px;
}
.program-table th, .program-table td {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.program-table thead { background: var(--surface-alt); }
.program-table thead th { font-size: 14px; font-weight: 600; }
.program-table tbody th { width: 40%; font-weight: 600; }
.program-table td:first-child { padding-left: 16px; color: var(--muted); }
.program-table .material-pending { color: var(--muted); font-size: 14px; }
.program-table .notebook-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.notebook-link svg { width: 18px; height: 18px; flex: none; }

/* ---------- Presenters ---------- */

.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.person { text-align: left; }
.person h3 { margin: 0; text-align: center; }
.person .affiliation {
  margin: 4px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
/* Several affiliations stack one per line; the dot is kept for copy-paste. */
.person .affiliation > span:not(.affiliation-sep) { display: block; }
.person .affiliation-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Align photo, name, affiliation and bio rows across cards on the same row,
   so a two-line affiliation does not push one card's divider lower. */
@supports (grid-template-rows: subgrid) {
  .person { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
}
.person .bio { padding-top: 16px; border-top: 1px solid var(--border); }

.person-photo {
  position: relative;
  width: min(100%, 180px);
  aspect-ratio: 1;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 50%;
}
.person-photo img {
  position: absolute;
  width: var(--photo-width, 100%);
  max-width: none;
  height: auto;
  left: var(--photo-left, 0%);
  top: var(--photo-top, 0%);
}
/* Match head size and position across the different source compositions. */
.person-photo-francesco-muia { --photo-top: -4%; }
.person-photo-alexander-fengler { --photo-width: 136%; --photo-left: -24%; --photo-top: -5%; }
.person-photo-stefan-radev { --photo-width: 200%; --photo-left: -36%; --photo-top: -3%; }
.person-photo-jerry-huang { --photo-width: 180%; --photo-left: -40%; --photo-top: -8%; }

/* ---------- Platform-specific setup ---------- */

#setup .section-lead { max-width: none; }
.setup-tabs { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.setup-tab-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.setup-tab-list[hidden], .setup-panel[hidden] { display: none; }
.setup-tab-list button {
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.setup-tab-list button:hover { color: var(--accent); background: var(--accent-soft); }
.setup-tab-list button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--border); font-weight: 600; }
.setup-panel { padding: 24px; }
.platform-note { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.setup-steps { margin: 0; padding-left: 24px; }
.setup-steps > li + li { margin-top: 24px; }
.setup-steps p { margin: 10px 0 0; }
.setup-panel pre {
  max-width: 100%;
  margin: 12px 0;
  padding: 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
  line-height: 1.65;
}
.setup-panel code, .setup-help code, kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.88em; }
.setup-panel li { overflow-wrap: anywhere; }
.setup-help { margin: 20px 0 0; color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */

.site-footer { padding: 36px 0 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14.5px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.site-footer p { max-width: 42em; margin: 0; }

/* ---------- Smaller screens ---------- */

@media (max-width: 900px) {
  .overview-intro { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .two-col { gap: 24px; }
  .section { padding: 60px 0; }
  .learning-outcomes ul { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 88px 0 104px; }
  .hero .facts { gap: 20px; margin-top: 28px; }
  .hero .facts dd { font-size: 14px; }
  .lead { font-size: 17.5px; }
  .setup-panel { padding: 20px 16px; }
  .setup-tab-list button { padding: 10px 14px; }
}
