@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/outfit-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/outfit-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/outfit-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/outfit-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/caveat-latin-700-normal.woff2") format("woff2");
}

:root {
  --ink: #1c1917;
  --muted: #57534e;
  --soft: #78716c;
  --line: #e7dfd6;
  --paper: #fbf8f4;
  --paper-2: #f3eee7;
  --card: #fffcf9;
  --orange: #f15a22;
  --orange-deep: #c2410c;
  --blue: #1d4ed8;
  --red: #dc2626;
  --green: #0f766e;
  --shadow: 0 12px 32px rgba(60, 32, 12, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #14110e;
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  overflow: hidden;
}
body.loading #stage { opacity: 0; }
button, a { font-family: inherit; }
button {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
}

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  transform: translate(-50%, -50%);
  transform-origin: center center;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  font-size: clamp(17px, 1.35vw, 28px);
}

.progress {
  position: absolute;
  z-index: 6;
  left: 0;
  top: 0;
  height: clamp(4px, 0.45vh, 8px);
  width: 0;
  background: var(--orange);
  transition: width 0.35s ease;
}

.slides { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  padding: clamp(16px, 2.2vh, 34px) clamp(28px, 2.6vw, 56px) clamp(52px, 6.4vh, 76px) clamp(36px, 3.2vw, 68px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0.45s;
  background:
    radial-gradient(880px 420px at 110% -10%, rgba(241, 90, 34, 0.09), transparent 55%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
}
.slide.active {
  opacity: 1;
  visibility: visible;
  transform: none;
  z-index: 1;
}
.slide::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: var(--orange);
}

.top { flex: 0 0 auto; margin-bottom: clamp(8px, 1.2vh, 16px); }
.kicker {
  margin: 0 0 0.2em;
  color: var(--orange);
  font-size: clamp(13px, 0.95vw, 20px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, h3, p { margin: 0; }
h2 {
  font-size: clamp(30px, 2.55vw, 52px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vh, 18px);
}
.lead { font-size: clamp(18px, 1.5vw, 30px); line-height: 1.35; color: #292524; }
.muted { color: var(--muted); }
.small { font-size: clamp(16px, 1.25vw, 24px); line-height: 1.35; color: #44403c; }
.tight h2 { font-size: clamp(26px, 2.05vw, 42px); }
.tight .top { margin-bottom: clamp(4px, 0.7vh, 10px); }
.tight .body { gap: clamp(6px, 0.8vh, 12px); }

.foot {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(42px, 5vh, 64px);
  display: flex;
  align-items: center;
  padding: 0 clamp(108px, 8vw, 160px) 0 clamp(36px, 3.2vw, 68px);
  background: rgba(243, 238, 231, 0.96);
  border-top: 1px solid rgba(28, 25, 23, 0.06);
  color: var(--soft);
  font-size: clamp(16px, 1.22vw, 26px);
}
.foot p { letter-spacing: 0.01em; }
.nav {
  position: absolute;
  z-index: 5;
  bottom: clamp(6px, 0.8vh, 12px);
  width: clamp(36px, 2.5vw, 50px);
  height: clamp(30px, 3.4vh, 42px);
  border-radius: 8px;
  color: var(--ink);
}
.nav svg { width: clamp(18px, 1.3vw, 26px); height: clamp(18px, 1.3vw, 26px); display: block; margin: 0 auto; }
.nav.prev { right: clamp(68px, 5vw, 98px); }
.nav.next { right: clamp(18px, 1.6vw, 34px); }
.nav:hover { background: rgba(241, 90, 34, 0.12); }

.reveal { opacity: 0; transform: translateY(10px); }
.reveal.show { opacity: 1; transform: none; transition: opacity 0.45s ease, transform 0.45s ease; }
.slide.settled .reveal { opacity: 1; transform: none; }

.mat {
  display: inline-flex;
  align-items: stretch;
  gap: 5px;
  vertical-align: middle;
  color: var(--ink);
}
.mat .br {
  width: 0.38em;
  border: 0.08em solid currentColor;
  border-radius: 0.32em;
}
.mat .br.l { border-right: 0; }
.mat .br.r { border-left: 0; }
.mat .g {
  display: grid;
  grid-template-columns: repeat(var(--n, 2), auto);
  gap: 0.08em 0.42em;
  align-items: center;
  justify-items: center;
  padding: 2px 1px;
}
.mat .c {
  min-width: 1.15em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 1.25;
  position: relative;
}
.mat.xl { font-size: clamp(84px, 8vw, 150px); }
.mat.lg { font-size: clamp(36px, 3vw, 60px); }
.mat.md { font-size: clamp(24px, 2vw, 40px); }
.mat.sm { font-size: clamp(16px, 1.28vw, 26px); }
.pop .c { opacity: 0; transform: translateY(5px) scale(0.92); }
.pop .c.in { opacity: 1; transform: none; transition: 0.32s ease; }
.c.hot {
  background: rgba(241, 90, 34, 0.16);
  border-radius: 6px;
  box-shadow: 0 0 0 4px rgba(241, 90, 34, 0.14);
}
.c.mark {
  background: rgba(29, 78, 216, 0.14);
  border-radius: 6px;
}
.c.dim { opacity: 0.28; }
.c.neg { color: var(--red); }
.badge {
  position: absolute;
  top: -0.55em;
  right: -0.7em;
  background: var(--orange);
  color: white;
  font-size: 0.34em;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08em 0.38em;
  opacity: 0;
  transform: scale(0.6);
}
.badge.in { opacity: 1; transform: none; transition: 0.25s ease; }

.mini {
  display: inline-flex;
  align-items: stretch;
  gap: 3px;
  margin: 0 3px;
  vertical-align: middle;
}
.mini i {
  width: 0;
  border-left: 1.5px solid var(--ink);
}
.mini .mg {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 6px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  justify-items: center;
  min-width: 28px;
}

.tex { font-size: 1.12em; }
.tex.block { font-size: clamp(26px, 2.15vw, 44px); margin: 0.15em 0; }
.katex-display { margin: 0; }

.card, .panel, .step, .app, .ex, .ref, .prop {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.apps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: clamp(12px, 1.15vw, 22px);
  flex: 1;
  min-height: 0;
}
.app {
  padding: clamp(16px, 1.5vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1vh, 16px);
  min-height: 0;
}
.app h3 { font-size: clamp(22px, 1.8vw, 36px); font-weight: 600; }
.app p { font-size: clamp(17px, 1.38vw, 27px); line-height: 1.32; color: #44403c; }
.ico { display: flex; align-items: center; gap: clamp(8px, 0.8vw, 16px); }
.ico svg { width: clamp(52px, 4.6vw, 92px); height: clamp(52px, 4.6vw, 92px); stroke: var(--orange); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tilt-sq {
  width: clamp(26px, 2.4vw, 48px);
  height: clamp(26px, 2.4vw, 48px);
  background: var(--blue);
  border-radius: 3px;
}
.app.play .tilt-sq { animation: tiltback 1.15s ease; }
@keyframes tiltback {
  0% { transform: none; background: var(--blue); }
  45% { transform: skewX(-22deg) rotate(-10deg); background: var(--orange); }
  100% { transform: none; background: var(--blue); }
}
.follow {
  margin-top: auto;
  color: var(--orange-deep);
  font-weight: 600;
  font-size: clamp(14px, 1.1vw, 20px);
  opacity: 0;
}
.follow.show { opacity: 1; transition: opacity 0.4s ease; }

.cols { display: grid; gap: clamp(12px, 1.2vw, 22px); min-height: 0; flex: 1; align-items: stretch; }
.cols.c3 { grid-template-columns: 1.05fr 0.95fr 1.08fr; }
.cols.c2 { grid-template-columns: 1fr 1fr; }
.panel {
  padding: clamp(16px, 1.5vw, 30px) clamp(16px, 1.6vw, 32px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(8px, 1vh, 16px);
  min-height: 0;
}
.panel h3 { font-size: clamp(22px, 1.7vw, 34px); font-weight: 600; }
.note { font-size: clamp(17px, 1.35vw, 26px); line-height: 1.35; color: #44403c; }

.chess {
  display: grid;
  grid-template-columns: repeat(3, clamp(68px, 6.2vw, 124px));
  gap: clamp(8px, 0.7vw, 14px);
  margin: clamp(8px, 1.4vh, 20px) auto;
  width: max-content;
}
.chess span {
  height: clamp(62px, 5.6vw, 112px);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  font-size: clamp(32px, 2.8vw, 56px);
  font-weight: 700;
  color: transparent;
}
.chess span.plus { background: #ecfdf5; color: #047857; transition: 0.25s ease; }
.chess span.minus { background: #fff1f2; color: #be123c; transition: 0.25s ease; }

.rel { position: relative; }
.hbar, .vbar {
  position: absolute;
  background: var(--red);
  border-radius: 3px;
  z-index: 2;
  pointer-events: none;
}
.hbar { height: 3px; transform: scaleX(0); transform-origin: left center; }
.vbar { width: 3px; transform: scaleY(0); transform-origin: center top; }
.hbar.draw { transform: scaleX(1); transition: transform 0.35s ease; }
.vbar.draw { transform: scaleY(1); transition: transform 0.35s ease; }

.flips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: clamp(12px, 1.15vw, 22px);
  flex: 1;
  min-height: 0;
}
.flip { perspective: 1000px; min-height: 0; }
.flip-inner {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 1.4vw, 28px);
  text-align: center;
  gap: clamp(8px, 1vh, 16px);
}
.face.front {
  background:
    linear-gradient(135deg, rgba(241, 90, 34, 0.08), transparent 40%),
    repeating-linear-gradient(45deg, rgba(28, 25, 23, 0.03) 0 2px, transparent 2px 12px),
    var(--card);
}
.face.back { transform: rotateY(180deg); }
.why { opacity: 0; transform: translateY(6px); font-size: clamp(16px, 1.35vw, 26px); color: #44403c; }
.flip.explained .why { opacity: 1; transform: none; transition: 0.35s ease 0.05s; }
.hint { font-size: clamp(14px, 1.1vw, 20px); color: var(--soft); }

.steps { display: flex; flex-direction: column; gap: clamp(8px, 1vh, 14px); min-height: 0; }
.step {
  display: grid;
  grid-template-columns: clamp(36px, 2.6vw, 52px) minmax(0, 1fr);
  gap: clamp(8px, 0.8vw, 16px);
  align-items: center;
  padding: clamp(8px, 1vh, 16px) clamp(12px, 1vw, 20px);
  font-size: clamp(17px, 1.35vw, 26px);
}
.step .n {
  width: clamp(30px, 2.3vw, 46px);
  height: clamp(30px, 2.3vw, 46px);
  border-radius: 50%;
  background: var(--orange);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: clamp(15px, 1.15vw, 22px);
}
.worked {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(12px, 1.2vw, 22px);
  min-height: 0;
  flex: 1;
}
.worked .stack { grid-column: 1; grid-row: 1; }
.worked .steps { grid-column: 2; grid-row: 1; height: 100%; }
.worked .step { flex: 1; }
.worked .verify { grid-column: 1 / -1; grid-row: 2; }
.worked .mat.sm { font-size: clamp(20px, 1.7vw, 34px); }
.stack { display: flex; flex-direction: column; gap: clamp(8px, 1vh, 16px); justify-content: center; align-items: center; min-height: 0; }
.worked .stack {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.verify {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 0.8vw, 16px);
  padding: clamp(12px, 1.4vh, 22px) clamp(14px, 1.2vw, 24px);
  font-size: clamp(18px, 1.4vw, 28px);
}
.verify .eq { font-size: 1.15em; font-weight: 600; }
.prod .c { min-width: 4.4em; font-size: 0.82em; }
.idlit { color: var(--green); font-weight: 700; }

.scene {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.scene canvas { width: 100%; height: 100%; display: block; }
.meter {
  position: absolute;
  left: clamp(8px, 0.8vw, 16px);
  top: clamp(8px, 0.8vw, 14px);
  background: rgba(255, 252, 249, 0.92);
  border-radius: 10px;
  padding: 0.25em 0.55em;
  font-size: clamp(14px, 1.05vw, 20px);
  color: var(--muted);
  z-index: 1;
}
.meter b { color: var(--orange); font-size: 1.35em; font-weight: 700; margin-right: 0.25em; }
.chips { display: flex; gap: clamp(8px, 0.7vw, 14px); align-items: center; }
.chip {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 0.25em 0.75em;
  font-weight: 600;
  font-size: clamp(16px, 1.2vw, 24px);
}
.chip.on { border-color: var(--orange); color: var(--orange-deep); background: #fff4ef; }
.graphic {
  display: grid;
  grid-template-columns: 1.28fr 0.92fr;
  gap: clamp(12px, 1.1vw, 20px);
  flex: 1;
  min-height: 0;
}
.graphic .scene { min-height: 0; height: 100%; }
.side { display: flex; flex-direction: column; justify-content: center; gap: clamp(6px, 0.8vh, 12px); min-height: 0; }
.notes { list-style: none; padding: 0; margin: 0; }
.notes li { position: relative; padding-left: 0.9em; margin: 0.2em 0; font-size: clamp(15px, 1.15vw, 22px); line-height: 1.3; }
.notes li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--orange);
  position: absolute;
  left: 0;
  top: 0.5em;
}
.calc { font-size: clamp(15px, 1.12vw, 22px); line-height: 1.3; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35em; }
.tagline { font-size: clamp(15px, 1.15vw, 22px); color: var(--muted); }

.trio, .quad {
  display: grid;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.trio { grid-template-columns: repeat(3, 1fr); }
.quad { grid-template-columns: repeat(4, 1fr); }
.vbox, .abox {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  box-shadow: var(--shadow);
}
.vbox h3, .abox h3 { font-size: clamp(16px, 1.3vw, 26px); font-weight: 700; }
.abox .scene, .vbox .scene { flex: 1; min-height: clamp(88px, 14vh, 200px); height: auto; }
.abox p, .vbox p { font-size: clamp(14px, 1.05vw, 20px); line-height: 1.28; color: #44403c; }
.rulebar {
  background: #fff7f3;
  border: 1px solid #ffd7c7;
  border-radius: 12px;
  padding: clamp(8px, 1vh, 14px) clamp(12px, 1vw, 18px);
  font-size: clamp(16px, 1.25vw, 24px);
  line-height: 1.32;
}
.noinv { position: relative; display: inline-flex; padding: 2px 6px; font-weight: 700; }
.noinv svg {
  position: absolute;
  inset: -4px -2px;
  width: calc(100% + 4px);
  height: calc(100% + 8px);
}
.noinv path {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
}
.noinv.show path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.45s ease; }

.pairrow { display: flex; gap: 14px; align-items: stretch; }
.pairrow .panel { flex: 1; }
.letters { display: flex; gap: 8px; }
.letters span {
  width: clamp(48px, 4vw, 78px);
  height: clamp(48px, 4vw, 78px);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: white;
  border: 1px solid var(--line);
  font-size: clamp(24px, 2vw, 40px);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.letters.out span { background: #fff4ef; border-color: #ffd0bf; color: var(--orange-deep); opacity: 0; }
.letters.out span.in { opacity: 1; transition: opacity 0.35s ease; }
#id6 { opacity: 0.2; }
#id6.in { opacity: 1; transition: opacity 0.45s ease; }
.letters .grouped { outline: 2px solid var(--orange); }
.clockbox { width: clamp(108px, 9vw, 168px); height: clamp(108px, 9vw, 168px); flex: 0 0 auto; }
.clockbox svg { width: 100%; height: 100%; }
.hill {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.exs { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.15vw, 22px); flex: 1; min-height: 0; }
.ex {
  padding: clamp(18px, 1.8vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.2vh, 18px);
}
.ex h3 { font-size: clamp(24px, 2vw, 40px); }
.ex p { font-size: clamp(17px, 1.4vw, 28px); line-height: 1.32; color: #44403c; }
.ex .mat.md { font-size: clamp(32px, 2.7vw, 54px); }
.hour {
  width: clamp(28px, 2.3vw, 46px);
  height: auto;
  margin-top: clamp(4px, 0.6vh, 12px);
  align-self: flex-end;
  opacity: 0;
}
.hour.show { opacity: 1; transition: opacity 0.3s ease; }
.hour svg { width: 100%; height: auto; overflow: visible; }
.sand {
  transform-origin: 11px 16px;
  animation: drip 1.6s ease-in-out infinite;
}
@keyframes drip {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(8px); opacity: 0.2; }
  100% { transform: translateY(0); opacity: 1; }
}

.sheetwrap { position: relative; overflow: hidden; border-radius: 16px; }
.sheet {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 26px, rgba(28, 25, 23, 0.04) 27px),
    #efe4d4;
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 2;
  border-bottom: 2px solid #e0d0bb;
}
.sheetwrap.open .sheet { transform: translateY(-105%); }
.hand {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-size: clamp(48px, 4.2vw, 84px);
  color: var(--orange-deep);
  letter-spacing: 1px;
  line-height: 0.9;
  display: inline-flex;
  gap: 2px;
}
.hand span { opacity: 0; transform: translateY(4px); }
.hand.write span { opacity: 1; transform: none; transition: 0.18s ease; }

.cofhead { margin-bottom: clamp(6px, 0.8vh, 12px); align-items: center; }
.cofhead .rel { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cofhead .mat.md { font-size: clamp(28px, 2.5vw, 50px); }
.cofgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 0.7vw, 12px);
  flex: 1;
  min-height: 0;
}
.cof {
  padding: clamp(6px, 0.6vw, 12px);
  font-size: clamp(14px, 1.08vw, 21px);
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25em;
  flex-wrap: wrap;
  min-height: 0;
}
.cof.in { opacity: 1; }
.cof { opacity: 0; }
.slide.settled .cof { opacity: 1; }
.cof.hot { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(241, 90, 34, 0.16); }
.blink { display: inline-block; }
.blink.go { animation: blinkred 0.55s ease 5; }
@keyframes blinkred {
  0%, 100% { color: inherit; }
  50% { color: var(--red); transform: scale(1.12); }
}

.drop1 {
  display: inline-block;
  opacity: 0;
  transform: translateY(-18px);
}
.drop1.show { opacity: 1; transform: none; transition: 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); color: var(--green); font-weight: 700; }

.refs {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2.4vh, 36px);
  flex: 1;
  min-height: 0;
}
.ref { padding: clamp(18px, 1.8vw, 32px) clamp(18px, 1.8vw, 34px); font-size: clamp(20px, 1.7vw, 34px); line-height: 1.4; }
.work { position: relative; font-style: italic; white-space: nowrap; }
.work svg {
  position: absolute;
  left: 0;
  width: 100%;
  height: 8px;
  bottom: -6px;
  overflow: visible;
}
.work path {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 210;
  stroke-dashoffset: 210;
}
.ref.show .work path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.8s ease 0.15s; }
.ref a { color: var(--orange-deep); text-decoration: none; }

.cover {
  padding: clamp(28px, 4vh, 56px) clamp(40px, 4vw, 80px) clamp(56px, 7vh, 84px);
  display: block;
}
.cover-grid {
  height: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: center;
}
.logo {
  height: clamp(58px, 5.2vw, 108px);
  width: auto;
  mix-blend-mode: multiply;
  display: block;
  margin-bottom: clamp(16px, 2.4vh, 36px);
}
.cover h1 {
  font-size: clamp(42px, 4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 600;
  min-height: 2.15em;
}
.caret {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--orange);
  margin-left: 3px;
  vertical-align: -2px;
  animation: blink 0.9s steps(1) infinite;
}
.caret.off { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.rule {
  height: 6px;
  width: 0;
  background: var(--orange);
  border-radius: 6px;
  margin: 8px 0 16px;
}
.rule.on { width: clamp(140px, 14vw, 280px); transition: width 0.55s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sub { font-size: clamp(20px, 1.7vw, 34px); color: #44403c; margin-bottom: clamp(12px, 1.8vh, 24px); }
.who { font-size: clamp(13px, 1vw, 18px); letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange); font-weight: 700; margin-bottom: 0.4em; }
.team { list-style: none; padding: 0; margin: 0 0 clamp(14px, 2vh, 28px); }
.team li { font-size: clamp(20px, 1.6vw, 32px); line-height: 1.4; }
.meta { display: flex; flex-direction: column; gap: 0.15em; font-size: clamp(16px, 1.3vw, 26px); color: #44403c; }
.bgmat { justify-self: center; opacity: 0; transition: opacity 0.8s ease; }
.bgmat .c { font-size: clamp(72px, 6.4vw, 128px); min-width: 1.15em; }
.bgmat.in { opacity: 1; }
.bgmat.fade { opacity: 0.16; }
.flyc {
  position: fixed;
  z-index: 40;
  margin: 0;
  pointer-events: none;
  font-family: "Outfit", sans-serif;
  font-weight: 600;
  background: white;
  border-radius: 6px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px rgba(60, 32, 12, 0.12);
}

.rowline { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.warn {
  background: #fff1f2;
  border-radius: 12px;
  padding: 0.45em 0.7em;
  color: #9f1239;
  font-size: clamp(16px, 1.25vw, 24px);
  line-height: 1.32;
}
.signhead { font-size: clamp(18px, 1.45vw, 28px); font-weight: 600; }
.formula { font-size: clamp(22px, 1.9vw, 38px); }
.face .formula { font-size: clamp(22px, 2vw, 40px); }
kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 5px;
  background: white;
  font-size: 0.85em;
}

.slide[data-anim="ex2i"] > .panel,
.slide[data-anim="ans2i"] > .panel { flex: 1; }
.slide[data-anim="ex2c"] .cofhead .panel,
.slide[data-anim="ans2c"] .cofhead .panel { justify-content: center; }
.hill > div { display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 1.2vh, 18px); min-height: 0; }
.hill .stack { align-items: stretch; justify-content: space-between; }
.hill .stack .panel { flex: 1; }
.sheetwrap { display: flex; min-height: 0; height: 100%; }
.sheetwrap > .panel { flex: 1; width: 100%; }
.rowline { font-size: 1em; }
.slide[data-anim="minor"] .mat.md,
.slide[data-anim="adj"] .mat.md { font-size: clamp(28px, 2.35vw, 46px); }
.slide[data-anim="grid2d"] .side .mat.sm,
.slide[data-anim="cube"] .side .mat.sm { font-size: clamp(15px, 1.05vw, 20px); }

.note { font-size: clamp(18px, 1.5vw, 30px); }
.tex.block { font-size: clamp(28px, 2.45vw, 50px); }
.face .formula { font-size: clamp(24px, 2.45vw, 48px); }
.why { font-size: clamp(18px, 1.5vw, 30px); }
.cof { font-size: clamp(16px, 1.4vw, 27px); }
.ex h3 { font-size: clamp(26px, 2.2vw, 44px); }
.ex p { font-size: clamp(18px, 1.6vw, 32px); }
.ex .mat.md { font-size: clamp(42px, 4vw, 80px); }
.slide[data-anim="ans1"] h3 { font-size: clamp(26px, 2.1vw, 42px); }
.slide[data-anim="ans1"] .small,
.slide[data-anim="ans1"] .calc { font-size: clamp(17px, 1.4vw, 27px); }
.slide[data-anim="ans1"] .mat.sm { font-size: clamp(20px, 1.8vw, 36px); }
.slide[data-anim="ex2i"] .mat.sm,
.slide[data-anim="ans2i"] .mat.sm { font-size: clamp(18px, 1.65vw, 34px); }
.worked .step { font-size: clamp(18px, 1.55vw, 32px); }
.chess { grid-template-columns: repeat(3, clamp(74px, 6.8vw, 136px)); }
.chess span {
  height: clamp(68px, 6.2vw, 124px);
  font-size: clamp(36px, 3.2vw, 64px);
}
