/* HyDeCoFfEE slides: reveal.js handles navigation only (disableLayout), this
   file lays out a 16:9 stage that scales with the window (all sizes in em). */

:root {
  /* GeoOcean logo */
  --go-indigo: #5B6BB8;
  --go-mint: #B8EBDF;
  --go-lavender: #A3ACD8;
  --go-sand: #CC8B5E;
  --go-sun: #F0D88A;

  --bg: #F3F7FB;
  --bg-2: #E6EEF6;
  --card: #FFFFFF;
  --ink: #0B2233;
  --muted: #4B6274;
  --line: #CCD9E5;
  --navy: #0B1F3A;
  --navy-2: #16306A;
  --accent: #2F6DB5;
  --accent-2: #087DA6;

  /* the three drivers, used everywhere */
  --sea: #2F6DB5;
  --river: #C47A45;
  --rain: #2A9D8F;

  /* BlueMath bricks */
  --k-data: #E8B94A;
  --k-stats: #C892C5;
  --k-model: #7DB3E3;
  --k-domain: #93BD8B;
  --k-method: #7FDBF8;
  --k-service: #F5AE90;

  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

html, body { height: 100%; margin: 0; background: #DCE5EE; }

/* ---------- 16:9 stage ---------- */
.reveal {
  --sw: min(100vw, calc(100vh * 16 / 9));
  --sh: calc(var(--sw) * 9 / 16);
  font-family: var(--font-body);
  font-size: calc(var(--sw) / 62);
  line-height: 1.45;
  color: var(--ink);
}
.reveal .slides {
  width: var(--sw); height: var(--sh);
  inset: 0; margin: auto;
  text-align: left;
  background: var(--bg);
  box-shadow: 0 0 2em rgb(11 34 51 / .15);
  overflow: hidden;
}
.reveal .slides > section {
  width: 100%; height: 100%; top: 0; left: 0;
  padding: 0; box-sizing: border-box;
}
.reveal .slides > section > .frame {
  position: absolute; inset: 0;
  padding: 2.1em 2.8em 2.3em;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  gap: 1em; box-sizing: border-box;
}
.reveal .slides > section > .frame.full { grid-template-rows: minmax(0, 1fr); }
.reveal .controls { color: var(--accent); }
.reveal .progress { color: var(--accent); height: .25em; }
.reveal .slide-number {
  background: transparent; color: var(--muted);
  font-family: var(--font-mono); font-size: .55em;
  right: calc((100vw - var(--sw)) / 2 + 1.6em); bottom: calc((100vh - var(--sh)) / 2 + .9em);
}
.deck-footer {
  position: absolute; z-index: 5; pointer-events: none;
  left: calc((100vw - var(--sw)) / 2 + 2.8em); bottom: calc((100vh - var(--sh)) / 2 + .8em);
  font-family: var(--font-mono); font-size: .52em; color: var(--muted); letter-spacing: .04em;
  display: flex; align-items: center; gap: .8em;
}
.deck-footer img { height: 1.6em; }
.reveal.dark-slide ~ .deck-footer, .deck-footer.on-dark { color: rgb(255 255 255 / .6); }

/* ---------- type ---------- */
.reveal h1, .reveal h2, .reveal h3 {
  font-family: var(--font-display); margin: 0; letter-spacing: -0.02em;
  text-wrap: balance; color: inherit; text-transform: none;
}
.reveal h1 { font-size: 3.1em; line-height: 1; font-weight: 800; }
.reveal h2 { font-size: 1.85em; line-height: 1.08; font-weight: 700; }
.reveal h3 { font-size: 1.05em; line-height: 1.2; font-weight: 700; }
.reveal p { margin: 0; }
.reveal em { font-style: normal; color: var(--accent); }
.reveal strong, .reveal b { font-weight: 600; }
.reveal a { color: var(--accent); }
.reveal code, .reveal .mono { font-family: var(--font-mono); font-size: .88em; }
.reveal code { background: var(--bg-2); padding: .05em .3em; border-radius: .2em; }
.eyebrow {
  font-family: var(--font-mono); font-size: .62em; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .45em;
  display: flex; gap: .8em; align-items: center;
}
.eyebrow .nb {
  background: var(--accent); color: white; border-radius: .25em; padding: .1em .45em;
  letter-spacing: .06em;
}
.lede { font-size: 1.02em; color: var(--muted); max-width: 46em; margin-top: .5em !important; }
.muted { color: var(--muted); }
.small { font-size: .78em; }
.tiny { font-size: .62em; }
.center { text-align: center; }
.reveal ul.clean { list-style: none; margin: 0; padding: 0; display: grid; gap: .55em; }
.reveal ul.clean li { padding-left: 1.1em; position: relative; }
.reveal ul.clean li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: .45em; height: .45em;
  border-radius: 50%; background: var(--accent);
}
.sea { color: var(--sea); } .river { color: var(--river); } .rain { color: var(--rain); }
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: .62em; font-weight: 600;
  padding: .15em .5em; border-radius: .3em; background: var(--bg-2); color: var(--muted);
  vertical-align: middle; letter-spacing: .03em;
}
.tag.sea { background: color-mix(in srgb, var(--sea) 16%, white); color: var(--sea); }
.tag.river { background: color-mix(in srgb, var(--river) 18%, white); color: #8a4f22; }
.tag.rain { background: color-mix(in srgb, var(--rain) 18%, white); color: #1d6f65; }
.reveal math { font-size: 1.05em; }

/* ---------- layout helpers ---------- */
.cols { display: grid; gap: 1.6em; min-height: 0; }
.cols > * { min-width: 0; min-height: 0; }
.c2 { grid-template-columns: 1fr 1fr; }
.c3 { grid-template-columns: repeat(3, 1fr); }
.c4 { grid-template-columns: repeat(4, 1fr); }
.c-4-6 { grid-template-columns: 4fr 6fr; }
.c-6-4 { grid-template-columns: 6fr 4fr; }
.c-3-7 { grid-template-columns: 3fr 7fr; }
.c-7-3 { grid-template-columns: 7fr 3fr; }
.c-35-65 { grid-template-columns: 35fr 65fr; }
.stack { display: flex; flex-direction: column; gap: .8em; min-height: 0; }
.stack.tight { gap: .4em; }
.row { display: flex; gap: .8em; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-height: 0; }
.fill { height: 100%; min-height: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: .5em;
  padding: .9em 1.1em; box-shadow: 0 .1em .3em rgb(11 34 51 / .05);
}
.card h3 { margin-bottom: .35em; }
.card.soft { background: var(--bg-2); box-shadow: none; }
.plot { width: 100%; height: 100%; min-height: 0; }
.figure { position: relative; min-height: 0; }
.caption { font-size: .62em; color: var(--muted); font-family: var(--font-mono); }
.callout {
  border-left: .25em solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, white);
  padding: .6em .9em; border-radius: 0 .4em .4em 0; font-size: .86em;
}
.callout.warn { border-color: var(--go-sand); background: color-mix(in srgb, var(--go-sand) 10%, white); }
.big-num { font-family: var(--font-display); font-weight: 800; font-size: 2.6em; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.controls-panel { display: grid; gap: .7em; align-content: start; }
.ctl { display: grid; gap: .15em; font-size: .78em; }
.ctl label { display: flex; justify-content: space-between; gap: 1em; align-items: baseline; }
.ctl label b { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.ctl input[type=range] { width: 100%; accent-color: var(--accent); height: 1.4em; margin: 0; cursor: pointer; }
.ctl.sea input { accent-color: var(--sea); }
.ctl.river input { accent-color: var(--river); }
.ctl.rain input { accent-color: var(--rain); }
.btns { display: flex; flex-wrap: wrap; gap: .4em; }
.btn {
  font: inherit; font-size: .72em; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: .35em .8em; border-radius: 2em; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.on { background: var(--accent); border-color: var(--accent); color: white; }
.btn.ghost { background: transparent; }
.readout { font-family: var(--font-mono); font-size: .7em; color: var(--muted); }
.readout b { color: var(--ink); font-weight: 600; }
.stat-row { display: flex; gap: 1.4em; flex-wrap: wrap; }
.stat-row .s { display: grid; }
.stat-row .s .v { font-family: var(--font-display); font-weight: 800; font-size: 1.5em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-row .s .k { font-family: var(--font-mono); font-size: .58em; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- maps (canvas + svg overlay) ---------- */
.map-wrap { position: relative; height: 100%; min-height: 0; display: flex; justify-content: center; }
.map { position: relative; height: 100%; aspect-ratio: var(--ar, 435 / 720); max-width: 100%; }
.map canvas, .map svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.map canvas { border-radius: .35em; image-rendering: auto; box-shadow: 0 .1em .4em rgb(11 34 51 / .15); }
.map svg.overlay { pointer-events: none; overflow: visible; }
.map .tip {
  position: absolute; pointer-events: none; z-index: 3; white-space: nowrap;
  font-family: var(--font-mono); font-size: .58em; background: rgb(11 31 58 / .88); color: white;
  padding: .25em .5em; border-radius: .3em; transform: translate(.8em, -50%); display: none;
}
.map .map-title {
  position: absolute; left: .5em; top: .45em; z-index: 2; font-size: .62em; font-weight: 600;
  background: rgb(255 255 255 / .85); padding: .15em .5em; border-radius: .3em;
}
.colorbar { display: grid; gap: .2em; font-family: var(--font-mono); font-size: .56em; color: var(--muted); }
.colorbar .bar { height: .7em; border-radius: .2em; border: 1px solid var(--line); }
.colorbar .ticks { display: flex; justify-content: space-between; }

/* ---------- section dividers ---------- */
.reveal section.divider { background: radial-gradient(120% 140% at 85% 10%, var(--navy-2), var(--navy) 60%); color: white; }
.reveal section.divider .frame { align-content: center; grid-template-rows: auto; }
.reveal section.divider h1 { font-size: 3.6em; }
.reveal section.divider .eyebrow { color: var(--go-mint); }
.reveal section.divider .lede { color: rgb(255 255 255 / .75); }
.divider .num {
  font-family: var(--font-display); font-weight: 800; font-size: 9em; line-height: .8;
  color: transparent; -webkit-text-stroke: .02em var(--go-mint); opacity: .9;
}
.divider .learn { display: flex; gap: .6em; flex-wrap: wrap; margin-top: 1.4em; }
.divider .learn span {
  border: 1px solid rgb(184 235 223 / .5); color: var(--go-mint); border-radius: 2em;
  padding: .25em .8em; font-size: .72em; font-family: var(--font-mono);
}
.wave-deco { position: absolute; left: 0; right: 0; bottom: 0; height: 28%; opacity: .5; pointer-events: none; }

/* ---------- hands-on slides ---------- */
.reveal section.hands-on { background: linear-gradient(135deg, #E6F7F2, #EEF1FA); }
.hands-on .frame { grid-template-rows: auto minmax(0, 1fr); }
.hands-on .nbcard {
  background: var(--card); border: 1px solid var(--line); border-radius: .6em; padding: 1em 1.3em;
  display: grid; gap: .6em; align-content: start; align-self: start;
}
.hands-on .nbname { font-family: var(--font-mono); font-size: .9em; font-weight: 600; color: var(--accent); }
.hands-on ol { margin: 0; padding-left: 1.2em; display: grid; gap: .45em; font-size: .9em; }
.hands-on .expect { font-family: var(--font-mono); font-size: .72em; background: var(--navy); color: #CFE9FF; border-radius: .4em; padding: .7em 1em; white-space: pre; }
.hands-on .clock { font-family: var(--font-display); font-size: 3.4em; font-weight: 800; color: var(--accent); line-height: 1; }

/* ---------- title slide ---------- */
.reveal section.title { background: radial-gradient(110% 130% at 100% 0%, #DDE7FA 0%, var(--bg) 55%); }
.title .logos { display: flex; gap: 2em; align-items: center; }
.title .logos img { height: 3.2em; width: auto; }
.title .logos img.wide { height: 3em; }
.title h1 em { color: var(--accent); }

/* ---------- pipeline (hybrid recipe) ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5em; align-items: stretch; }
.pipeline .step {
  position: relative; border-radius: .5em; padding: .7em .7em .8em; background: var(--card);
  border: 1px solid var(--line); display: grid; gap: .25em; align-content: start;
}
.pipeline .step .n { font-family: var(--font-mono); font-size: .58em; color: var(--muted); }
.pipeline .step h3 { font-size: 1em; }
.pipeline .step p { font-size: .72em; color: var(--muted); }
.pipeline .step .tk { font-family: var(--font-mono); font-size: .58em; font-weight: 600; padding: .15em .45em; border-radius: .25em; justify-self: start; color: var(--ink); }
.pipeline .step:not(:last-child)::after {
  content: "→"; position: absolute; right: -.62em; top: 45%; color: var(--muted); font-size: .8em; z-index: 2;
}

/* ---------- reveal fragments ---------- */
.reveal .fragment.fade-up { transform: translateY(.6em); }
.reveal .fragment.visible.fade-up { transform: none; }

/* ---------- small screens: let slides scroll instead of shrinking text ---------- */
@media (max-aspect-ratio: 1/1) {
  .reveal { --sw: 100vw; --sh: 100vh; font-size: 15px; }
  .reveal .slides > section > .frame { position: absolute; overflow-y: auto; padding: 1.2em 1em 3em; grid-template-rows: auto auto; }
  .cols, .c2, .c3, .c4, .c-4-6, .c-6-4, .c-3-7, .c-7-3, .c-35-65 { grid-template-columns: minmax(0, 1fr) !important; height: auto !important; }
  .fill, .grow, .map-wrap { height: auto !important; flex: none; }
  .plot { height: 55vh !important; min-height: 18em; }
  .map { height: auto; width: min(100%, 62vh); }
  .pipeline { grid-template-columns: 1fr 1fr !important; }
  .explorer { grid-template-columns: minmax(0, 1fr) !important; }
  .wires { display: none; }
}

/* ---------- PDF export (?print-pdf, then print to PDF in Chrome) ---------- */
html.print-pdf .reveal { --sw: 1600px; --sh: 900px; font-size: calc(1600px / 62); }
html.print-pdf .reveal .slides { box-shadow: none; inset: auto; }
html.print-pdf .reveal .slides > section { width: 1600px !important; height: 900px !important; }
html.print-pdf .deck-footer, html.print-pdf .slide-number { display: none; }
html.print-pdf .reveal .slides .pdf-page { overflow: hidden; }
@page { size: 1600px 900px; margin: 0; }

/* ---------- extrapolation alert (live surrogate) ---------- */
.extrap-alert {
  position: absolute; left: 50%; top: .6em; transform: translate(-50%, -.4em); z-index: 4; opacity: 0; pointer-events: none;
  display: grid; gap: .1em; text-align: center; width: max-content; max-width: 92%;
  background: #D1495B; color: white; border-radius: .45em; padding: .45em .8em; box-shadow: 0 .2em .6em rgb(0 0 0 / .2);
  font-size: .62em; line-height: 1.3; transition: opacity .2s, transform .2s;
}
.extrap-alert b { font-size: 1.2em; }
.extrap-alert.on { opacity: 1; transform: translate(-50%, 0); }
