/* Slide deck for /studies/history-of-yoga.html (needs style.css first).
   Everything inside .slides is sized from --u, a container unit of the stage, so the same
   slides fit a laptop, a projector or a phone. Without JS the slides simply stack. */

.deck-head { padding: clamp(36px, 6vw, 64px) 0 20px; }
.deck-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.deck-keys { margin: 16px 0 0; font-size: .88rem; color: var(--muted); }
.deck-keys kbd, .slide kbd { font: 600 .8em/1 var(--sans); background: #fff; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: .2em .45em; color: var(--char); }

.deck { position: relative; width: min(var(--wrap), 100% - 32px); margin: 0 auto 64px; }
.stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; overflow: clip; border-radius: 18px; border: 1px solid var(--border); background: var(--cream); box-shadow: 0 30px 60px -30px rgba(45, 41, 38, .35); container: stage / size; touch-action: pan-y; outline: none; }
.stage:focus-visible { box-shadow: 0 0 0 3px var(--gold); }
@media (max-width: 700px) { .stage { aspect-ratio: 3 / 4; } }

.stage { --u: min(1cqh, 1.6cqw); }
.slides { position: absolute; inset: 0; font-size: calc(2.7 * var(--u)); line-height: 1.4; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: calc(1.5 * var(--u)); padding: calc(6 * var(--u)) calc(7 * var(--u)) calc(10.5 * var(--u)); overflow: hidden; overflow: clip; background: var(--cream); color: var(--text); opacity: 0; visibility: hidden; transform: translateX(3%); transition: opacity .55s ease, transform .7s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .7s; }
.slide.is-past { transform: translateX(-3%); }
.slide.is-active { z-index: 1; opacity: 1; visibility: visible; transform: none; transition: opacity .55s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.slide > * { position: relative; z-index: 1; }

/* no JS: plain stacked slides */
.deck:not(.js) .stage { aspect-ratio: auto; container-type: inline-size; --u: 1.1cqw; }
.deck:not(.js) .slides { position: static; }
.deck:not(.js) .slide { position: relative; opacity: 1; visibility: visible; transform: none; min-height: 56cqw; border-bottom: 1px solid var(--border); }
.deck:not(.js) .deck-ui, .deck:not(.js) .river, .deck:not(.js) .clue-back { display: none; }
.js aside.notes { display: none; }
aside.notes { font-size: .6em; color: var(--muted); border-top: 1px dashed var(--border); padding-top: .6em; }

/* type */
.slide h1, .slide h2, .slide h3 { margin: 0; color: var(--char); }
.slide h1 { font-size: 3.3em; line-height: 1; }
.slide h2 { font-size: 2.15em; line-height: 1.06; }
.slide h3 { font-size: 1.15em; line-height: 1.15; }
.slide p { margin: 0; }
.slide a { color: inherit; text-decoration-color: rgba(168, 78, 56, .5); text-underline-offset: .15em; }
.kicker { font: 600 .6em/1.3 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--sage-dk); }
.say { font: 400 1.75em/1.12 var(--serif); color: var(--char); }
.lede { font-size: 1.12em; color: var(--muted); max-width: 32em; }
.hint { font-size: .7em; color: var(--muted); }
.hl { color: var(--terra-dk); }
.caption { font-size: .55em; color: var(--muted); text-align: center; margin-top: .8em !important; }
.deva { font-family: 'Tiro Devanagari Sanskrit', 'Nirmala UI', 'Kohinoor Devanagari', serif; }

/* source tags: links to the source, or a film clip that plays in place */
.src { display: inline-block; margin: 0 .1em 0 .3em; padding: .2em .65em; border: 0; border-radius: 99px; background: rgba(79, 97, 67, .12); color: var(--sage-dk) !important; font: 600 .48em/1.3 var(--sans); letter-spacing: .04em; text-decoration: none; vertical-align: .25em; white-space: nowrap; cursor: pointer; }
.src:hover, .src:focus-visible { background: rgba(79, 97, 67, .24); }
.src.film { background: rgba(196, 101, 74, .14); color: var(--terra-dk) !important; }
.src.film::before { content: "▶\00a0"; font-size: .85em; }
.dark .src { background: rgba(243, 223, 168, .15); color: #F3DFA8 !important; }
.dark .src.film { background: rgba(232, 148, 117, .2); color: #F6B79D !important; }

/* dark slides */
.slide.dark { background: radial-gradient(ellipse at 75% 20%, #3b3029 0%, #221c18 62%, #191512 100%); color: #E9DFD0; }
.dark h1, .dark h2, .dark h3, .dark .say { color: #FFF6E6; }
.dark .kicker { color: #F3DFA8; }
.dark .lede, .dark .hint { color: #CDBFAE; }

/* full-bleed background art (optional per slide) */
.slide > .bg { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: .16; }
.dark > .bg { opacity: .22; }
/* opening shot: the era painting fills the slide for a moment, then settles behind the content */
.is-active > .bg { animation: establish 2.8s ease-out both, drift 30s ease-in-out 2.8s infinite alternate; }
.dark.is-active > .bg { animation-name: establish-dark, drift; }
.has-bg.is-active > :not(.bg) { animation: rise .8s ease .9s both; }
@keyframes establish { 0% { opacity: 1; transform: scale(1.12); } 30% { opacity: 1; } 100% { opacity: .16; transform: scale(1.04); } }
@keyframes establish-dark { 0% { opacity: 1; transform: scale(1.12); } 30% { opacity: 1; } 100% { opacity: .22; transform: scale(1.04); } }
@keyframes rise { from { opacity: 0; transform: translateY(.8em); } }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.16) translate(-2%, -1%); } }

/* layout */
.cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: calc(5 * var(--u)); align-items: center; min-height: 0; }
.cols.rev { grid-template-columns: 1.25fr 1fr; }
.stack { display: flex; flex-direction: column; gap: calc(1.6 * var(--u)); min-width: 0; }
.center-slide { text-align: center; align-items: center; }
@container stage (orientation: portrait) {
  .slide { justify-content: flex-start; padding: calc(7 * var(--u)) calc(5 * var(--u)) calc(11 * var(--u)); }
  .cols, .cols.rev { grid-template-columns: 1fr; gap: calc(2.5 * var(--u)); }
  .no-portrait { display: none !important; }
  .slide:not(.ref) { overflow-y: auto; }
}

/* step-by-step reveals */
.js .f { opacity: 0; visibility: hidden; transform: translateY(.7em); transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1), visibility 0s linear .6s; }
.js .f.on { opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.js .f.pop { transform: scale(.85); }
.js .f.pop.on { transform: none; }
.js .f.keep { opacity: 1; visibility: visible; transform: none; }

/* image plates in the site's arch shape */
.plate { position: relative; margin: 0; justify-self: center; width: min(100%, calc(52 * var(--u))); aspect-ratio: 4 / 5; border-radius: 999px 999px 18px 18px; overflow: hidden; box-shadow: 0 20px 40px -24px rgba(45, 41, 38, .55); }
.plate img { width: 100%; height: 100%; object-fit: cover; animation: drift 26s ease-in-out infinite alternate paused; }
.is-active .plate img { animation-play-state: running; }

/* the figure: a jointed pictogram that moves between poses (deck.js) */
.fig-wrap { position: relative; justify-self: center; width: min(100%, calc(52 * var(--u))); aspect-ratio: 160 / 178; }
.fig-wrap .fig { position: absolute; inset: 0; z-index: 2; display: block; width: 100%; height: 100%; }
.fig { color: var(--sage-dk); overflow: visible; }
.fig line { stroke: currentColor; stroke-width: 9; stroke-linecap: round; }
.fig .fig-torso { stroke-width: 15; }
.fig .fig-head { fill: currentColor; }
.fig .fig-horns { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; }
.is-active .fig.breathe { animation: breathe 5s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes breathe { 50% { transform: scale(1.015, 1.03); } }
.mat { position: absolute; z-index: 1; left: 12%; right: 12%; bottom: 0; height: 4%; border-radius: 99px; background: var(--terra); opacity: .75; }
.dark .fig { color: #F3DFA8; }

/* seals */
.ghost-seal { position: absolute; z-index: 0; inset: -4% 6% 0; width: 88%; height: 104%; }
.ghost-seal rect { fill: rgba(227, 211, 181, .55); stroke: #B49C74; stroke-width: 3; stroke-dasharray: 3 6; }
.glyphs path { fill: none; stroke: #6E5B43; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: opacity .35s; }
.glyphs path.blink { opacity: .15; }
.seal-wrap { justify-self: center; width: min(100%, calc(50 * var(--u))); }
.seal { display: block; width: 100%; height: auto; filter: drop-shadow(0 16px 22px rgba(45, 41, 38, .3)); }
.seal-face { fill: #E3D3B5; stroke: #B49C74; stroke-width: 3; }
.seal-rim { fill: none; stroke: #C6B08A; stroke-width: 2; stroke-dasharray: 2 5; }
.seal .fig { color: #6E5B43; }
.tiles { display: grid; grid-template-columns: repeat(16, 1fr); gap: .25em; max-width: 22em; margin-top: .4em !important; }
.tiles i { aspect-ratio: 1; border-radius: 3px; background: #D9C6A2; border: 1px solid #B49C74; opacity: 0; transform: scale(.4); transition: opacity .3s, transform .3s; transition-delay: calc(var(--i) * 70ms); }
.on .tiles i { opacity: 1; transform: none; }

/* poll + three verdicts */
.poll { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .5em !important; }
.poll button, .quiz button { font: 600 .72em/1 var(--sans); padding: .75em 1.2em; border-radius: 99px; border: 2px solid var(--terra-dk); background: #fff; color: var(--terra-dk); cursor: pointer; transition: background .2s, color .2s, transform .2s; }
.poll button:hover { transform: translateY(-2px); }
.poll button[aria-pressed="true"] { background: var(--terra-dk); color: #fff; }
.verdicts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; }
.verdict { padding: .45em .7em; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.verdict small { display: block; font: 600 .55em/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.verdict b { font: 400 1.15em/1.1 var(--serif); color: var(--char); }
.verdict-note { grid-column: 1 / -1; font-size: .85em; }

/* Vedic slide: fire, flow, glowing word */
.fire { position: absolute !important; z-index: 0 !important; left: calc(7 * var(--u)); bottom: calc(10.5 * var(--u)); width: calc(11 * var(--u)); height: calc(15 * var(--u)); pointer-events: none; }
@container stage (orientation: portrait) { .fire { display: none; } }
.fire i { position: absolute; left: 50%; bottom: 14%; width: 46%; height: 70%; margin-left: -23%; border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%; background: radial-gradient(ellipse at 50% 80%, #FFE6A3 0%, #F7A541 35%, rgba(215, 85, 42, .9) 60%, rgba(215, 85, 42, 0) 75%); filter: blur(2px); transform-origin: 50% 100%; animation: flame 1.6s ease-in-out infinite alternate; }
.fire i:nth-child(2) { width: 34%; margin-left: -30%; height: 52%; animation-duration: 1.2s; animation-delay: -.4s; }
.fire i:nth-child(3) { width: 30%; margin-left: -2%; height: 46%; animation-duration: 1.4s; animation-delay: -.8s; }
.fire::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 0; height: 16%; border-radius: 4px; background: repeating-linear-gradient(90deg, #7a3b26 0 22%, #5b2b1c 22% 25%); box-shadow: 0 -2px 30px 6px rgba(247, 165, 65, .35); }
@keyframes flame { from { transform: scale(1, 1) rotate(-3deg); opacity: .85; } to { transform: scale(.9, 1.12) rotate(3deg); opacity: 1; } }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: .45em; font-size: .8em; }
.flow span { padding: .4em .75em; border-radius: 10px; background: rgba(243, 223, 168, .1); border: 1px solid rgba(243, 223, 168, .35); font-weight: 600; }
.flow i { width: 1.6em; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .5s ease; }
.is-active .flow i { transform: scaleX(1); }
.is-active .flow i:nth-of-type(2) { transition-delay: .5s; }
.is-active .flow i:nth-of-type(3) { transition-delay: 1s; }
.glow { color: #FFE6A3; animation: glow 2.4s ease-in-out infinite alternate; }
@keyframes glow { from { text-shadow: 0 0 0 rgba(247, 165, 65, 0); } to { text-shadow: 0 0 .5em rgba(247, 165, 65, .9); } }

/* yuj: two lights that become one */
.merge { position: absolute; z-index: 2; left: 50%; top: 52%; width: 0; height: 0; }
.merge i { position: absolute; width: calc(5 * var(--u)); height: calc(5 * var(--u)); margin: calc(-2.5 * var(--u)); border-radius: 50%; background: radial-gradient(circle, #fff 0 30%, rgba(243, 223, 168, .8) 45%, rgba(243, 223, 168, 0) 70%); }
.merge i:first-child { transform: translateX(-160%); }
.merge i:last-child { transform: translateX(160%); }
.is-active .merge i:first-child { animation: meet-l 3.2s ease-in-out .4s forwards; }
.is-active .merge i:last-child { animation: meet-r 3.2s ease-in-out .4s forwards; }
@keyframes meet-l { to { transform: translateX(0) scale(1.5); } }
@keyframes meet-r { to { transform: translateX(0) scale(1.5); } }
.plate .deva { position: absolute; z-index: 2; left: 0; right: 0; top: 12%; text-align: center; font-size: 3.2em; line-height: 1; color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }

/* classical: three paths */
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(2.5 * var(--u)); }
.path-card { display: grid; gap: .35em; align-content: start; padding: .9em 1em; border-radius: 18px; background: #fff; border: 1px solid var(--border); box-shadow: 0 14px 30px -24px rgba(45, 41, 38, .5); }
.path-card svg { width: 3.6em; height: 3.6em; overflow: visible; }
.path-card p { font-size: .82em; }
.path-card svg.lamps { width: 8em; height: 3.2em; }
.lamps circle { fill: var(--border); transition: fill .4s; }
.on .lamps circle { fill: var(--gold); filter: drop-shadow(0 0 3px rgba(197, 165, 90, .9)); }
.on .lamps circle:nth-child(2) { transition-delay: .25s; }
.on .lamps circle:nth-child(3) { transition-delay: .5s; }
.on .lamps circle:nth-child(4) { transition-delay: .75s; }
.on .lamps circle:nth-child(5) { transition-delay: 1s; }
.wheel { color: var(--sage-dk); }
.is-active .wheel { animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.wheel circle, .wheel path, .three path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; }
.three { color: var(--terra-dk); }
.three path { stroke-dasharray: 120; stroke-dashoffset: 120; transition: stroke-dashoffset 1.2s ease; }
.on .three path { stroke-dashoffset: 0; }
.three circle { fill: currentColor; }
@container stage (orientation: portrait) { .paths { grid-template-columns: 1fr; } .path-card { grid-template-columns: auto 1fr; align-items: center; column-gap: .8em; } .path-card svg { grid-row: span 2; } }

/* Patañjali: clue cards, stamp, magnifier */
.case { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5em; }
.clue { perspective: 900px; }
.clue-in { display: grid; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.js .clue:not(.on) .clue-in { transform: rotateY(180deg); }
.clue-face, .clue-back { grid-area: 1 / 1; margin: 0; padding: .6em .7em; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.clue-face { background: #fff; border: 1px solid var(--border); font-size: .74em; }
.clue-face b { display: block; font: 600 .75em/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--terra-dk); margin-bottom: .2em; }
.clue-back { display: grid; place-items: center; transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #EADFCB 0 10px, #E2D5BD 10px 20px); border: 1px solid #D6C6A8; font: 400 2.4em/1 var(--serif); color: var(--sage-dk); }
.twist { padding: .5em .8em; border-left: 4px solid var(--gold); background: var(--warm); border-radius: 0 12px 12px 0; font-size: .9em; }
.verdict-line { display: flex; align-items: center; flex-wrap: wrap; gap: .6em; }
.stamp { display: inline-block; padding: .15em .5em; border: 3px solid var(--terra-dk); border-radius: 8px; color: var(--terra-dk); font: 400 1.6em/1 var(--serif); transform: rotate(-5deg); }
.on .stamp { animation: thump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes thump { from { transform: rotate(-5deg) scale(2.2); opacity: 0; } to { transform: rotate(-5deg) scale(1); opacity: 1; } }
.lens::after { content: ""; position: absolute; z-index: 2; width: 34%; aspect-ratio: 1; border-radius: 50%; border: calc(.9 * var(--u)) solid #6E5B43; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6), 0 6px 18px rgba(0, 0, 0, .35); background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .35), rgba(255, 255, 255, .05) 60%); left: 18%; top: 30%; }
.is-active .lens::after { animation: search 9s ease-in-out infinite; }
@keyframes search { 25% { left: 50%; top: 22%; } 50% { left: 44%; top: 56%; } 75% { left: 12%; top: 50%; } }

/* timeline of dates */
.tl { --line: rgba(122, 111, 102, .35); display: grid; gap: .55em; font-size: .78em; }
.tl-axis { position: relative; height: 1.6em; border-bottom: 2px solid var(--line); }
.tl-axis span { position: absolute; bottom: .3em; transform: translateX(-50%); font-size: .8em; color: var(--muted); white-space: nowrap; }
.tl-axis span::after { content: ""; position: absolute; left: 50%; bottom: -.45em; width: 2px; height: .4em; background: var(--line); }
.tl-axis span:first-child { transform: none; }
.tl-axis span:first-child::after { left: 0; }
.tl-axis span:last-child { transform: translateX(-100%); }
.tl-axis span:last-child::after { left: auto; right: 0; }
.tl-row { position: relative; padding-top: 1.15em; }
.tl-bar, .tl-pin { position: absolute; top: .2em; height: .75em; border-radius: 99px; }
.tl-bar { left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1%); background: var(--sage); transform: scaleX(0); transform-origin: left; transition: transform 1.3s cubic-bezier(.2, .7, .2, 1); }
.tl-bar.soft { background: rgba(122, 111, 102, .35); }
.tl-pin { left: calc(var(--a) * 1%); width: .75em; margin-left: -.375em; background: var(--terra-dk); box-shadow: 0 0 0 .3em rgba(168, 78, 56, .2); transform: scale(0); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1) .6s; }
.on .tl-bar, .is-active .tl-bar.now, .on .tl-pin { transform: none; }
.tl-row em { display: block; margin-left: calc(var(--a) * 1%); font-style: normal; }

/* Haṭha: sun and moon */
.sunmoon { position: relative; height: calc(17 * var(--u)); width: calc(44 * var(--u)); max-width: 100%; }
.orb { position: absolute; top: 0; width: calc(17 * var(--u)); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 2.2em; transition: transform 1.6s cubic-bezier(.5, 0, .2, 1), box-shadow 1.6s; }
.orb.sun { left: 0; background: radial-gradient(circle at 40% 40%, #FFE9A8, #F4B13C 55%, #E07B2C); color: #7A3B10; box-shadow: 0 0 calc(4 * var(--u)) rgba(244, 177, 60, .55); }
.orb.moon { right: 0; background: radial-gradient(circle at 60% 35%, #FFFFFF, #DCE3EA 55%, #A9B6C4); color: #3E4E60; box-shadow: 0 0 calc(3 * var(--u)) rgba(220, 227, 234, .45); }
.sunmoon.on .orb.sun { transform: translateX(calc(10.5 * var(--u))); }
.sunmoon.on .orb.moon { transform: translateX(calc(-10.5 * var(--u))); mix-blend-mode: screen; }
.sunmoon.on .orb { box-shadow: 0 0 calc(7 * var(--u)) rgba(255, 233, 168, .8); }
.sm-labels { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; font-size: .78em; }
.sm-labels b { display: block; font: 400 1.5em/1.1 var(--serif); color: #FFF6E6; }
.lineage { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .4em; margin: 0; padding: 0; list-style: none; font-size: .78em; }
.lineage li { padding: .4em .7em; border-radius: 12px; background: rgba(243, 223, 168, .1); border: 1px solid rgba(243, 223, 168, .35); line-height: 1.2; }
.lineage li small { display: block; font-size: .78em; color: #CDBFAE; }
.lineage li.link { padding: 0; border: 0; background: none; font-size: .78em; color: #F3DFA8; position: relative; padding-bottom: .5em; }
.lineage li.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .5s ease; }
.lineage li.link.dash::after { background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 10px); }
.lineage.on li.link::after { transform: none; }
.lineage.on li.link:nth-of-type(4)::after { transition-delay: .3s; }
.lineage.on li.link:nth-of-type(6)::after { transition-delay: .6s; }
.lineage.on li.link:nth-of-type(8)::after { transition-delay: .9s; }

/* limbs */
.limb-count { display: grid; gap: .45em; }
.limb-row { display: grid; grid-template-columns: 11em auto 1fr; align-items: center; gap: .8em; font-size: .9em; }
.limb-row b { font: 400 1.6em/1 var(--serif); color: var(--terra-dk); }
.dots { display: flex; gap: .35em; }
.dots i { width: 1.1em; aspect-ratio: 1; border-radius: 50%; background: var(--sage); transform: scale(0); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.is-active .limb-row:not(.f) .dots i, .limb-row.on .dots i { transform: none; }
.dots i:nth-child(2) { transition-delay: .07s; } .dots i:nth-child(3) { transition-delay: .14s; } .dots i:nth-child(4) { transition-delay: .21s; }
.dots i:nth-child(5) { transition-delay: .28s; } .dots i:nth-child(6) { transition-delay: .35s; } .dots i:nth-child(7) { transition-delay: .42s; } .dots i:nth-child(8) { transition-delay: .49s; }
.debate { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.debate .say { grid-column: 1 / -1; font-size: 1.35em; }
.debate p:not(.say) { padding: .55em .8em; border-radius: 14px; background: #fff; border: 1px solid var(--border); font-size: .76em; }
.debate small { display: block; font: 600 .75em/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--terra-dk); margin-bottom: .2em; }

/* modern: years and the heartbeat */
.years { display: grid; gap: .55em; margin: 0; padding: 0; list-style: none; font-size: .82em; }
.years li { display: grid; grid-template-columns: 3.3em 1fr; gap: .7em; align-items: baseline; }
.years b { font: 400 1.5em/1 var(--serif); color: var(--terra-dk); }
.big-year { font: 400 7em/.9 var(--serif); color: rgba(168, 78, 56, .2); text-align: center; font-variant-numeric: tabular-nums; }
.ecg { display: block; width: 100%; height: 2.2em; margin-top: .2em; color: var(--terra-dk); }
.ecg path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg .base { opacity: .22; }
.ecg .blip { stroke-dasharray: 70 430; stroke-dashoffset: 500; }
.on .ecg .blip { animation: beat 2.2s linear infinite; }
@keyframes beat { to { stroke-dashoffset: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: .35em; font-size: .72em; }
.chips span { padding: .35em .7em; border-radius: 99px; background: var(--sage-lt); color: var(--sage-dk); font-weight: 600; opacity: 0; transform: translateY(.5em); transition: opacity .4s, transform .4s; transition-delay: calc(var(--i) * 90ms); }
.on .chips span { opacity: 1; transform: none; }

/* global: stats, crowd, seats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(2 * var(--u)); }
.stat { padding: .6em .8em; border-radius: 16px; background: #fff; border: 1px solid var(--border); font-size: .74em; }
.stat b { display: block; font: 400 2.3em/1 var(--serif); color: var(--terra-dk); margin-bottom: .1em; }
.crowd-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: calc(3 * var(--u)); align-items: center; }
.crowd { display: block; width: 100%; height: auto; }
.crowd circle { fill: var(--char); }
.crowd path { fill: none; stroke: var(--char); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.crowd .up { opacity: 0; }
.crowd rect { opacity: .8; }
.on .crowd .p { animation: bob 2.6s ease-in-out infinite; animation-delay: var(--d); }
.on .crowd .up { animation: arms-up 2.6s ease-in-out infinite; animation-delay: var(--d); }
.on .crowd .dn { animation: arms-dn 2.6s ease-in-out infinite; animation-delay: var(--d); }
@keyframes bob { 0%, 35%, 100% { transform: none; } 15% { transform: translateY(-2.5px); } }
@keyframes arms-up { 0%, 30%, 100% { opacity: 0; } 8%, 22% { opacity: 1; } }
@keyframes arms-dn { 0%, 30%, 100% { opacity: 1; } 8%, 22% { opacity: 0; } }
.unesco { display: grid; grid-template-columns: 1fr 1.2fr; gap: calc(4 * var(--u)); align-items: center; }
.seats { display: block; width: 100%; height: auto; }
.seats circle { fill: var(--border); transition: fill .35s; }
.on .seats circle, .is-active .seats.now circle { fill: var(--sage); transition-delay: calc(var(--i) * 70ms); }
@container stage (orientation: portrait) { .stats, .crowd-row, .unesco, .case, .debate, .verdicts { grid-template-columns: 1fr; } .limb-row { grid-template-columns: 8em auto 1fr; } }

/* close + quiz */
.yr-roll { font: 400 3.4em/1 var(--serif); color: var(--terra-dk); font-variant-numeric: tabular-nums; }
.quiz { display: grid; grid-template-columns: 1fr 1fr; gap: calc(2.4 * var(--u)); }
.quiz fieldset { margin: 0; padding: .7em .9em; border-radius: 16px; border: 1px solid var(--border); background: #fff; min-width: 0; }
.quiz legend { padding: 0; font-weight: 600; font-size: .9em; float: left; width: 100%; margin-bottom: .5em; }
.quiz .opts { clear: both; display: flex; flex-wrap: wrap; gap: .4em; }
.quiz button { font-size: .8em; padding: .65em 1.1em; }
.quiz button.right { background: var(--sage-dk); border-color: var(--sage-dk); color: #fff; }
.quiz button.wrong { border-color: var(--muted); color: var(--muted); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@container stage (orientation: portrait) { .quiz { grid-template-columns: 1fr; } }

/* reference slides */
.slide.ref { justify-content: flex-start; overflow: auto; }
.ref table { width: 100%; border-collapse: collapse; font-size: .74em; }
.ref th, .ref td { text-align: left; vertical-align: top; padding: .45em .6em; border-bottom: 1px solid var(--border); }
.ref th { font: 600 .8em/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--sage-dk); }
.src-list { columns: 2; column-gap: 2em; margin: 0; padding-left: 1.2em; font-size: .76em; }
.src-list li { break-inside: avoid; margin-bottom: .45em; }
@container stage (orientation: portrait) { .src-list { columns: 1; } }

/* chrome: progress, era river, controls, notes, laser, confetti, blank */
.deck-progress { position: absolute; z-index: 6; left: 0; top: 0; height: 4px; width: 0; background: var(--gold); transition: width .5s ease; }
.river { position: absolute; z-index: 5; left: calc(7 * var(--u)); right: calc(7 * var(--u)); bottom: calc(2.4 * var(--u)); display: grid; grid-template-columns: repeat(6, 1fr); gap: calc(.6 * var(--u)); margin: 0; padding: 0; list-style: none; font: 600 calc(1.2 * var(--u))/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; transition: opacity .5s; }
.river span { padding-top: calc(1.1 * var(--u)); border-top: calc(.45 * var(--u)) solid rgba(122, 111, 102, .22); color: rgba(122, 111, 102, .7); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: border-color .5s, color .5s; }
.river span.done { border-color: rgba(196, 101, 74, .45); }
.river span.on { border-color: var(--terra); color: var(--terra-dk); }
.deck.on-dark .river span { color: rgba(233, 223, 208, .55); border-color: rgba(233, 223, 208, .18); }
.deck.on-dark .river span.done { border-color: rgba(246, 183, 157, .45); }
.deck.on-dark .river span.on { color: #F6B79D; border-color: #F6B79D; }
.deck.no-era .river { opacity: 0; }
@container stage (orientation: portrait) { .river span:not(.on) { color: transparent !important; } }
.walker { position: absolute; bottom: calc(100% + .4 * var(--u)); left: 0; width: calc(3.2 * var(--u)); height: calc(4.4 * var(--u)); margin-left: calc(-1.6 * var(--u)); color: var(--terra-dk); overflow: visible; transition: left 1.4s cubic-bezier(.45, .05, .35, 1); }
.deck.on-dark .walker { color: #F6B79D; }
.walker path { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.walker circle { fill: currentColor; }
.walker .leg { transform-box: fill-box; transform-origin: 50% 0; }
.walker.walking .leg.l { animation: stride .38s ease-in-out infinite alternate; }
.walker.walking .leg.r { animation: stride .38s ease-in-out infinite alternate-reverse; }
@keyframes stride { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }

.deck-ui { position: absolute; z-index: 9; top: 12px; right: 12px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(6px); box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .4); font: 600 13px/1 var(--sans); color: var(--char); transition: opacity .4s; }
.deck-ui button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.deck-ui button:hover { background: var(--sand); }
.deck-ui button:focus-visible { outline: 2px solid var(--terra); }
.deck-ui button:disabled { opacity: .3; cursor: default; }
.deck-ui svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.deck-ui .deck-timer { width: auto; padding: 0 10px; border-radius: 99px; }
.deck-count, .deck-timer { padding: 0 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deck-timer::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--sage); vertical-align: 1px; }
.deck-timer.behind::before { background: var(--gold); }
.deck-timer.over { color: var(--terra-dk); }
.deck-timer.over::before { background: var(--terra-dk); }
@media (max-width: 560px) { .deck:not(.is-presenting) .deck-timer, .deck:not(.is-presenting) .ui-notes { display: none; } }

.deck-notes { position: absolute; z-index: 8; left: 0; right: 0; bottom: 0; max-height: 45%; overflow: auto; padding: 14px 20px 18px; background: rgba(29, 26, 24, .95); color: #F2E9DC; font: 400 15px/1.55 var(--sans); transform: translateY(105%); transition: transform .35s ease; }
.deck.show-notes .deck-notes { transform: none; }
.deck-notes b { color: #F3DFA8; }
.deck-notes p { margin: 0 0 .5em; }
.laser { position: absolute; z-index: 10; display: none; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #ff4b2b 0 30%, rgba(255, 75, 43, .4) 32% 55%, rgba(255, 75, 43, 0) 60%); }
.deck.laser-on .laser { display: block; }
.deck.laser-on .stage { cursor: none; }
.confetti { position: absolute; z-index: 7; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage.is-blank::after { content: ""; position: absolute; z-index: 20; inset: 0; background: #000; }
.deck-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* presenting: the deck fills the screen (fullscreen API where it exists, fixed overlay otherwise) */
.deck.is-presenting { position: fixed; z-index: 100; inset: 0; width: auto; margin: 0; background: #000; }
.deck.is-presenting .stage { position: absolute; inset: 0; aspect-ratio: auto; border: 0; border-radius: 0; box-shadow: none; }
.deck.is-presenting:not(.show-ui) .deck-ui { opacity: 0; pointer-events: none; }
.deck.is-presenting:not(.show-ui) .stage { cursor: none; }
html.deck-lock, html.deck-lock body { overflow: hidden; }

/* film clips */
.clip { width: min(960px, 94vw); padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: #000; color: #E9DFD0; }
.clip::backdrop { background: rgba(0, 0, 0, .78); }
.clip-frame { aspect-ratio: 16 / 9; background: #111; }
.clip-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.clip-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font: 400 13px/1.4 var(--sans); }
.clip-bar a { color: #F3DFA8; }
.clip-bar button { flex: none; padding: .55em 1.1em; border: 0; border-radius: 99px; background: #F3DFA8; color: #2D2926; font: 600 13px/1 var(--sans); cursor: pointer; }

/* page below the deck */
.script-list { padding-left: 1.3em; }
.script-list li { margin-bottom: 1.1em; }
.script-list li > a { font-weight: 600; }
.script-list p { margin: .2em 0 0; color: var(--text); }

/* phone held upright: smaller pictures so each slide fits (after the base rules, so these win) */
@container stage (orientation: portrait) {
  .plate { width: calc(30 * var(--u)); }
  .seal-wrap { width: calc(24 * var(--u)); }
  .fig-wrap { width: calc(38 * var(--u)); }
}

@media (prefers-reduced-motion: reduce) {
  .deck *, .deck *::before, .deck *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}
