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

:root {
  --night: #0e1115;
  --text: #ece8df;
  --muted: #aaa59b;
  --rule: #2b3138;
  --rosa: #e7b981;
  --kai: #b9cbc8;
  --agreed: #fffdf8;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html {
  background: var(--night);
  color: var(--text);
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

a { color: var(--text); text-underline-offset: 0.2em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--agreed); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px var(--gutter);
  font-size: 0.85rem;
  color: var(--muted);
}
.topline a { color: var(--muted); }

/* The opening frame: fits the viewport on purpose. */
#opening {
  height: 100svh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: 1rem;
  padding: clamp(24px, 6svh, 72px) var(--gutter) 0;
  overflow: hidden;
}
.opening-text { max-width: 44rem; }
#opening h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  font-weight: 700;
  max-width: 16ch;
}
.thesis {
  margin: 0.8rem 0 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  color: var(--rosa);
}
.premise {
  margin: 0.6rem 0 0;
  max-width: 32rem;
  color: var(--text);
}
.opening-art {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* Pinned scenes: the scroll travel is set per scene from the score. */
.scene {
  position: relative;
  height: calc(100svh + var(--travel, 1.5) * 100svh);
}
.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}
.stage > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Reduced motion: designed stills instead of pinned scenes. */
.stills { height: auto; }
.stills .stage { position: static; height: auto; overflow: visible; padding: 2rem var(--gutter); }
.stills figure { margin: 0 auto 2.5rem; max-width: 1100px; }
.stills figure svg { display: block; width: 100%; height: auto; max-height: 78svh; }
.stills figcaption { margin-top: 0.6rem; color: var(--text); max-width: 44rem; }

/* The reader's turn. */
#your-turn {
  max-width: 46rem;
  margin: 0 auto;
  padding: 14svh var(--gutter) 10svh;
}
#your-turn h2, #minutes h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.15;
}
#your-turn p { margin: 0 0 1rem; }
.choice { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.2rem 0 1.4rem; }
.choice button {
  font: inherit;
  font-weight: 700;
  padding: 0.7em 1.1em;
  border: 1.5px solid var(--rosa);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.choice button:hover { background: #221b15; }
.mini { display: block; width: 100%; max-width: 640px; height: auto; font-family: inherit; }
.mini [data-card] { transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1); }
.kai-view { color: var(--kai); min-height: 1.55em; }
.result { min-height: 3em; }

/* The minute book. */
#minutes {
  max-width: 52rem;
  margin: 0 auto;
  padding: 8svh var(--gutter);
}
#minutes ol { list-style: none; margin: 1rem 0 0; padding: 0; }
#minutes li {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
}
#minutes .when { color: var(--muted); font-variant-numeric: tabular-nums; }

/* What's real, and the film. */
#close {
  max-width: 60rem;
  margin: 0 auto;
  padding: 6svh var(--gutter) 12svh;
}
.note { max-width: 42rem; margin: 0 0 2.5rem; }
.film { margin: 0 0 2rem; }
.film video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.film figcaption { margin-top: 0.5rem; color: var(--muted); }
.back { font-weight: 700; }

@media (max-width: 560px) {
  #minutes li { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .mini [data-card] { transition: none; }
}

/* Capture mode for the films: only the stage, sized to the viewport. */
#capture-stage { display: none; }
html[data-capture] body > :not(#capture-stage) { display: none; }
html[data-capture] #capture-stage { display: block; width: 100vw; height: 100vh; }
html[data-capture] #capture-stage svg { display: block; width: 100%; height: 100%; }
