/* =======================================================
   Outreach project pages — "classic isma" style
   Shared by every page under outreach/<project>/
   ======================================================= */

/* Text font: Berenis ADF Pro (Arkandis Digital Foundry, GPL + font exception).
   Put the four files in outreach/fonts/ with exactly these names. */
@font-face { font-family: "Berenis ADF Pro"; src: url("fonts/BerenisADFPro-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Berenis ADF Pro"; src: url("fonts/BerenisADFPro-Italic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Berenis ADF Pro"; src: url("fonts/BerenisADFPro-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Berenis ADF Pro"; src: url("fonts/BerenisADFPro-BoldItalic.otf") format("opentype"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --bg: #002147;
  --ink: #F4EFE6;
  --curve: #CDC87A;
  --a1: #FEAC9E;
  --a2: #9BD69C;
  --a3: #E1AFED;
  --grid: rgba(244, 239, 230, 0.055);
  --text: "Berenis ADF Pro", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.45;
  overflow: hidden;
}

a { color: var(--curve); text-decoration: none; }
a:hover { color: var(--a1); }

/* ---------- fixed chrome ---------- */
.chrome {
  position: fixed; z-index: 50;
  font-size: 0.95rem;
}
.home { top: 0.9rem; left: 1rem; }
.lang { top: 0.9rem; right: 1rem; display: flex; gap: 0.2rem; }
.lang button {
  font: inherit; color: var(--ink); background: transparent;
  border: 1px solid rgba(244, 239, 230, 0.35); border-radius: 0.3rem;
  padding: 0.1rem 0.5rem; cursor: pointer; letter-spacing: 0.05em;
}
.lang button[aria-pressed="true"] { border-color: var(--curve); color: var(--curve); }

.dots {
  position: fixed; z-index: 50; right: 0.9rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 0.55rem; list-style: none;
}
.dots button {
  width: 0.7rem; height: 0.7rem; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; display: block;
}
.dots button[aria-current="true"] { background: var(--curve); border-color: var(--curve); }
.counter {
  position: fixed; z-index: 50; right: 1rem; bottom: 0.8rem;
  font-size: 0.85rem; opacity: 0.7; font-variant-numeric: oldstyle-nums;
}

/* ---------- stages ---------- */
.deck {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.deck::-webkit-scrollbar { display: none; }

.stage {
  height: 100vh; height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  grid-template-columns: minmax(17rem, 27rem) minmax(0, 1fr);
  gap: 2rem;
  padding: 3.6rem 3.2rem 2.6rem 3.2rem;
}
.stage .txt { align-self: center; }
.stage .fig { display: flex; flex-direction: column; min-height: 0; gap: 0.8rem; }
.stage .fig .cv { flex: 1; min-height: 0; position: relative; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.stage h2 {
  font-weight: 400; font-size: 2rem; line-height: 1.15; margin-bottom: 0.9rem;
  color: var(--ink);
}
.stage h2 .num { color: var(--curve); font-size: 0.9em; margin-right: 0.5rem; }
.stage p { margin-bottom: 0.8rem; }
.stage .eq { margin: 0.9rem 0; color: var(--ink); font-size: 1.05rem; min-height: 1.6em; }
.stage .note { font-size: 0.9rem; opacity: 0.75; }

/* title stage */
.stage.title { grid-template-columns: 1fr; text-align: center; align-content: center; justify-items: center; }
.stage.title h1 { font-weight: 400; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.05; }
.stage.title .kicker { color: var(--curve); letter-spacing: 0.25em; font-size: 0.95rem; margin-bottom: 1rem; }
.stage.title .q { max-width: 34rem; margin: 1.6rem auto 0 auto; font-size: 1.3rem; }
.stage.title .hint { margin-top: 2.2rem; opacity: 0.6; font-size: 0.95rem; }
.stage.title .cv { width: min(42rem, 90vw); height: 7rem; position: relative; margin-top: 1.5rem; }

/* last stage */
.stage.end { grid-template-columns: 1fr; align-content: center; justify-items: center; text-align: center; }
.video {
  width: min(56rem, 86vw); aspect-ratio: 16 / 9; margin: 1.2rem 0;
  border: 1px dashed rgba(244, 239, 230, 0.45); border-radius: 0.4rem;
  display: flex; align-items: center; justify-content: center;
}
.video iframe { width: 100%; height: 100%; border: 0; border-radius: 0.4rem; }

/* ---------- controls ---------- */
.ctl { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; align-items: center; font-size: 0.95rem; }
.ctl button {
  font: inherit; color: var(--ink); background: transparent; cursor: pointer;
  border: 1px solid var(--ink); border-radius: 0.35rem; padding: 0.25rem 0.75rem;
}
.ctl button:hover, .ctl button:focus-visible { border-color: var(--curve); color: var(--curve); outline: none; }
.ctl button[aria-pressed="true"] { background: rgba(205, 200, 122, 0.16); border-color: var(--curve); color: var(--curve); }
.ctl button.primary { border-color: var(--curve); color: var(--bg); background: var(--curve); padding: 0.3rem 1.1rem; }
.ctl button.primary:hover, .ctl button.primary:focus-visible { background: var(--a1); border-color: var(--a1); color: var(--bg); }
.ctl button:disabled { opacity: 0.35; cursor: default; }
.ctl label { display: inline-flex; align-items: center; gap: 0.5rem; }
.ctl .val { min-width: 4.5rem; font-variant-numeric: tabular-nums; color: var(--curve); }
.caption { font-size: 1.08rem; color: var(--curve); min-height: 2.8em; margin: 0; }
.status { font-size: 0.85rem; opacity: 0.75; min-height: 1.2em; }

.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem 1rem; font-size: 0.88rem; }
.modes label { display: flex; align-items: center; gap: 0.4rem; }
.modes input[type="range"] { flex: 1; min-width: 3rem; }
.modes .sw { width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; flex: none; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; width: 11rem; height: 1.4rem; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: rgba(244, 239, 230, 0.55); }
input[type="range"]::-moz-range-track { height: 2px; background: rgba(244, 239, 230, 0.55); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--curve); border: none; margin-top: -0.42rem; }
input[type="range"]::-moz-range-thumb { width: 0.95rem; height: 0.95rem; border-radius: 50%; background: var(--curve); border: none; }
input[type="range"]:focus-visible { outline: 1px dashed var(--curve); outline-offset: 2px; }
input[type="checkbox"] { accent-color: #CDC87A; width: 0.95rem; height: 0.95rem; }

.katex { font-size: 1.12em; color: var(--ink); }

/* ---------- narrow screens ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .stage {
    grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr);
    gap: 0.7rem; padding: 3rem 1rem 1.2rem 1rem;
  }
  .stage .txt { align-self: start; max-height: 44dvh; overflow-y: auto; }
  .stage h2 { font-size: 1.45rem; margin-bottom: 0.4rem; }
  .stage p { margin-bottom: 0.45rem; font-size: 0.95rem; }
  .stage .eq { margin: 0.3rem 0; }
  .dots { right: 0.35rem; gap: 0.4rem; }
  .dots button { width: 0.5rem; height: 0.5rem; }
  .ctl { font-size: 0.88rem; gap: 0.45rem 0.8rem; }
  input[type="range"] { width: 8rem; }
  .modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counter { display: none; }
}
