/* Motion, sound control, opening film overlay, and phone / foldable layout refinements.
   Loaded after site.css on every page. Uses the variables in tokens.css.
   Everything here is an enhancement: without JS the page looks exactly as it does without this file,
   apart from the safe-area and layout refinements at the end. */

/* ---------- viewport: dynamic units and safe areas (notch, home indicator) ---------- */
body { min-height: 100vh; min-height: 100dvh; }
.wrap {
  padding-left: max(var(--grid-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--grid-margin), env(safe-area-inset-right, 0px));
}
.statusbar p {
  padding-left: max(var(--grid-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--grid-margin), env(safe-area-inset-right, 0px));
}
.site-footer { padding-bottom: calc(var(--space-48) + env(safe-area-inset-bottom, 0px)); }

/* ---------- page entry: a very short fade on load ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js body { animation: page-in 180ms ease-out backwards; }
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- sound toggle (header, every page; shown only when JS runs) ---------- */
.sound-toggle { display: none; }
.js .sound-toggle {
  -webkit-appearance: none; appearance: none;
  display: inline-grid; place-items: center; flex: none;
  width: var(--target-min); height: var(--target-min); padding: 0; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--surface);
  color: var(--text-2); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard);
}
.js .sound-toggle[hidden] { display: none; }
.sound-toggle:hover { color: var(--text); }
.sound-toggle svg { width: 20px; height: 20px; overflow: visible; }
.sound-toggle .spk { fill: currentColor; }
.sound-toggle .spk-wave, .sound-toggle .spk-off { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.sound-toggle .spk-off { display: none; }
.sound-toggle.is-off .spk-wave { display: none; }
.sound-toggle.is-off .spk-off { display: inline; }
.sound-toggle.is-live { color: var(--text); }
.sound-toggle.is-live .spk-wave { stroke: var(--accent-graphic); }

.site-header .wrap { position: relative; }
.sound-hint {
  position: absolute; z-index: 20; top: calc(100% + 8px); right: max(var(--grid-margin), env(safe-area-inset-right, 0px));
  margin: 0; padding: 6px 12px; pointer-events: none; white-space: nowrap;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.3; letter-spacing: 0.02em; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-pill);
}
@media (prefers-reduced-motion: no-preference) {
  .sound-hint { animation: hint-in 600ms var(--ease-standard) 1200ms backwards; }
}
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* header spacing with the extra control */
.site-header .wrap > .theme-switch + .sound-toggle { margin-left: calc(-1 * var(--space-8)); }
@media (max-width: 1180px) {
  .site-header .wrap > .sound-toggle { order: 2; }
  .js .site-header .theme-switch { margin-left: auto; }
  .site-header .wrap > .theme-switch + .sound-toggle { margin-left: 0; }
  .site-header .wrap { padding-bottom: 0; }

  /* the pill row: the Download button stays pinned at the right edge, a fade shows there is more */
  .site-header .nav ul { padding-right: 0; }
  .site-header .nav .nav-cta {
    position: sticky; right: 0; z-index: 1; margin-left: 0;
    padding: 0 max(var(--grid-margin), env(safe-area-inset-right, 0px)) 0 28px;
    background: linear-gradient(to right, transparent, var(--bg) 24px);
  }
  .site-header .nav.fade-l {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36px);
    mask-image: linear-gradient(to right, transparent 0, #000 36px);
  }
}
@media (max-width: 380px) {
  .site-header .wrap { gap: var(--space-4) 6px; }
  .brand svg { height: 24px; }
  .theme-switch label { padding: 0 8px; font-size: 12px; }
}
@media (max-width: 340px) {
  .theme-switch label { padding: 0 7px; }
}

/* ---------- scroll-progress hairline under the status bar ---------- */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: var(--accent-graphic); transform-origin: left center; transform: scaleX(0);
}

/* ---------- reveal on entry: rise 12px and fade, once ---------- */
.rv { opacity: 0; transform: translate3d(0, 12px, 0); }
.rv.rv-in {
  opacity: 1; transform: none;
  transition: opacity 620ms var(--ease-standard), transform 760ms var(--ease-standard);
}

/* count-ups keep their final width so nothing shifts */
.count { display: inline-block; text-align: right; }
.stat .value.count { display: block; text-align: left; }

/* emission chart: grid, then the line draws, then labels settle */
.ch-pre .chart-grid { opacity: 0; transition: opacity 500ms var(--ease-standard); }
.ch-pre .chart-label { opacity: 0; transform: translateY(5px); transition: opacity 520ms var(--ease-standard), transform 640ms var(--ease-standard); }
.ch-pre.ch-grid .chart-grid { opacity: 1; }
.ch-pre.ch-labels .chart-label { opacity: 1; transform: none; }
.ch-pre.ch-labels .chart-label:nth-of-type(2) { transition-delay: 60ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(3) { transition-delay: 120ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(4) { transition-delay: 170ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(5) { transition-delay: 220ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(6) { transition-delay: 270ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(7) { transition-delay: 320ms; }
.ch-pre.ch-labels .chart-label:nth-of-type(8) { transition-delay: 370ms; }

/* how it works: keyframes for the six step vignettes (applied by motion.js) */
@keyframes vg-spin { from { opacity: 0; transform: rotate(-70deg); } to { opacity: 1; transform: none; } }
@keyframes vg-drop { 0% { opacity: 0; transform: translateY(-22px) scale(0.6); } 65% { opacity: 1; transform: translateY(1.5px) scale(1.15); } 100% { opacity: 1; transform: none; } }
@keyframes vg-grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes vg-grow-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes vg-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes vg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes vg-think { 0% { opacity: 0.25; transform: scale(0.85); } 60% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes vg-token { 0% { opacity: 0.35; transform: scale(0.5); } 55% { opacity: 1; transform: scale(1.4); fill: var(--accent-graphic); } 100% { opacity: 1; transform: none; fill: var(--text); } }
@keyframes vg-share { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 72% { transform: scale(1.35, 1.2); } 100% { transform: none; } }
@keyframes vg-check { 0% { fill: transparent; stroke: var(--text-2); } 100% { fill: var(--confirmed); stroke: var(--confirmed); } }
@keyframes vg-pulse { 0% { transform: none; } 50% { transform: scale(1.3); } 100% { transform: none; } }

/* roadmap: the line draws down with scrolling, dots pop when it reaches them */
.roadmap .road-line {
  position: absolute; left: 15px; width: 2px; border-radius: 1px; pointer-events: none;
  background: var(--accent-graphic); transform-origin: center top; transform: scaleY(0);
}
.roadmap.rm-on > li::before { opacity: 0.45; transform: scale(0.72); transition: opacity 300ms var(--ease-standard); }
.roadmap.rm-on > li.is-lit::before { opacity: 1; transform: none; animation: dot-pop 520ms var(--ease-settle) backwards; }
.roadmap.rm-on > li.is-static::before { animation: none; }
@keyframes dot-pop { 0% { transform: scale(0.72); } 60% { transform: scale(1.14); } 100% { transform: none; } }

/* app page: screenshots move a few pixels with scrolling (set by motion.js) */
.shot img { will-change: transform; }

/* ---------- Home: hero background field and the opening film ---------- */
.gl-hero body { position: relative; isolation: isolate; }
.gl-canvas { display: block; pointer-events: none; }
.gl-canvas.is-film { position: fixed; left: 0; top: 0; z-index: 1000; }
.gl-canvas.is-ambient {
  position: absolute; left: 0; top: 0; z-index: -1;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.gl-canvas.is-fading { opacity: 0; transition: opacity 380ms ease-out; }

/* while the film plays the page stays in the DOM (and readable by assistive tech) but out of sight */
html.intro-pending, html.intro-pending body { background: #0E0E0D; }
html.intro-pending { overscroll-behavior: none; }
.intro-pending body > :not(.intro):not(.gl-canvas),
.intro-handoff body > :not(.intro):not(.gl-canvas) { opacity: 0; }
.intro-reveal body > :not(.intro):not(.gl-canvas) { opacity: 1; transition: opacity 900ms var(--ease-standard); }

/* the hero mark: a 1 s settle on return visits, and a slow breath of the arcs while the field runs */
.gl-return .hero-art svg { animation: mark-settle 1000ms var(--ease-standard) backwards; }
@keyframes mark-settle { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.gl-ambient .sig-arcs { transform-box: view-box; transform-origin: 32px 32px; animation: arcs-breathe 9s ease-in-out infinite; }
@keyframes arcs-breathe { 0%, 100% { transform: none; } 50% { transform: rotate(2.4deg) scale(1.012); } }

.intro {
  position: fixed; inset: 0; z-index: 1001; touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  color: #F6F3EC;
}
.intro.is-leaving { opacity: 0; pointer-events: none; transition: opacity 700ms var(--ease-standard); }
.intro-lines {
  position: absolute; display: grid; margin: 0; text-align: center;
  font-family: var(--font-serif); font-weight: var(--fw-display-serif);
  font-size: clamp(26px, min(5.4vw, 7vh), 60px); line-height: 1.08; letter-spacing: -0.02em;
  text-shadow: 0 0 2px rgba(14, 14, 13, 0.9), 0 0 18px rgba(14, 14, 13, 0.85), 0 0 42px rgba(14, 14, 13, 0.7);
}
.intro-lines.is-mid { transform: translateY(-50%); }
.intro-lines.is-left { text-align: left; }
.intro-line {
  grid-area: 1 / 1; margin: 0;
  opacity: 0; transform: translateY(10px); filter: blur(6px);
  transition: opacity 900ms var(--ease-standard), transform 1200ms var(--ease-standard), filter 900ms var(--ease-standard);
}
.intro-line.is-on { opacity: 1; transform: none; filter: none; }
.intro-line em { font-style: italic; }

.intro-skip {
  -webkit-appearance: none; appearance: none;
  position: absolute; right: max(24px, env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  min-height: var(--target-min); min-width: 96px; padding: 0 22px; cursor: pointer;
  border: 1px solid rgba(246, 243, 236, 0.32); border-radius: var(--radius-pill);
  background: rgba(14, 14, 13, 0.55); color: #F6F3EC;
  font: 600 15px/1 var(--font-sans); letter-spacing: 0.02em;
  transition: border-color var(--dur-fast) var(--ease-standard), background-color var(--dur-fast) var(--ease-standard);
}
.intro-skip:hover { border-color: rgba(246, 243, 236, 0.7); background: rgba(30, 30, 28, 0.7); }
.intro-skip:focus-visible { outline: var(--focus-width) solid var(--color-ember-glow); outline-offset: 3px; }
.intro-sound-row {
  position: absolute; left: max(24px, env(safe-area-inset-left, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px;
}
.intro .sound-toggle { background: rgba(14, 14, 13, 0.55); border-color: rgba(246, 243, 236, 0.32); color: rgba(246, 243, 236, 0.8); }
.intro .sound-toggle:hover, .intro .sound-toggle.is-live { color: #F6F3EC; }
.intro .sound-toggle.is-live .spk-wave { stroke: var(--color-ember-glow); }
.intro .sound-toggle:focus-visible { outline: var(--focus-width) solid var(--color-ember-glow); outline-offset: 3px; }
.intro-hint {
  margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: rgba(246, 243, 236, 0.72);
}
@media (max-width: 640px) {
  .intro-skip { right: auto; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .intro-sound-row {
    left: auto; bottom: auto; right: max(16px, env(safe-area-inset-right, 0px)); top: calc(14px + env(safe-area-inset-top, 0px));
    flex-direction: row-reverse;
  }
}
@media (max-height: 460px) and (orientation: landscape) {
  .intro-skip { left: auto; right: max(20px, env(safe-area-inset-right, 0px)); transform: none; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .intro-sound-row { top: auto; right: auto; left: max(20px, env(safe-area-inset-left, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); flex-direction: row; }
}

/* ---------- second film, "Still here" (index.html?film=still) ---------- */
/* the status line stays readable above the film, on a dark surface */
:root.film-still body > div.statusbar { opacity: 1; z-index: 1002; }
@media (max-width: 640px) {
  /* the status line owns the top edge during this film, so the sound control sits above Skip */
  .film-still .intro-sound-row {
    top: auto; right: auto; left: max(16px, env(safe-area-inset-left, 0px));
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)); flex-direction: row;
  }
}
.film-still .statusbar {
  --surface: #191917; --text: #F1EEE6; --text-2: #A8A49A; --line: #2A2A27; --notice: #FF8A3D;
  transition: background-color 900ms var(--ease-standard), border-color 900ms var(--ease-standard);
}
.still { position: absolute; inset: 0; pointer-events: none; }
.still-text { position: absolute; }
.still-text.is-gone { display: none; }
.still-typed {
  margin: 0; font-family: var(--font-serif); font-weight: 400; color: #F6F3EC;
  font-size: clamp(22px, min(3.1vw, 5vh), 40px); line-height: 1.32; letter-spacing: -0.01em;
}
.still-typed.is-dim { opacity: 0.38; }
.still-caret {
  display: inline-block; width: 2px; height: 1.05em; margin-left: 3px; vertical-align: -0.16em;
  background: #F6F3EC; opacity: 0.85;
}
@media (prefers-reduced-motion: no-preference) {
  .still-caret { animation: caret-blink 1.05s steps(1, end) infinite; }
  .still-caret.is-typing { animation: none; }
}
.still-caret.is-dead { animation: none; opacity: 0.45; }
@keyframes caret-blink { 0%, 55% { opacity: 0.85; } 56%, 100% { opacity: 0; } }
.still-notices {
  position: absolute; left: 0; right: 0; bottom: 100%; margin: 0 0 18px; display: flex; flex-direction: column;
}
.still-notice {
  display: none; margin: 0; font-family: var(--font-mono); font-size: clamp(13px, 1.4vw, 18px); line-height: 1.6;
  letter-spacing: 0.01em; color: #8E8B83;
}
.still-notice.is-on { display: block; }
.still-notice[data-age="1"] { color: #77746C; opacity: 0.85; }
.still-notice[data-age="2"] { color: #77746C; opacity: 0.6; }
.still-notice[data-age="3"] { color: #77746C; opacity: 0.42; }
.still-label {
  position: absolute; left: 0; top: 0; margin: 0; transform-origin: 50% 0;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.04em; color: rgba(246, 243, 236, 0.88);
  opacity: 0; transition: opacity 700ms var(--ease-standard);
}
.still-label.is-on { opacity: 1; }
.still .intro-lines.is-big { font-size: clamp(44px, min(9vw, 12vh), 112px); letter-spacing: -0.03em; }

/* ---------- third film, "Still here — long cut" (index.html?film=still2) ---------- */
.intro { -webkit-touch-callout: none; }
.still-caret.is-hidden { display: none; }
.s2-mem { position: absolute; display: flex; flex-direction: column; gap: 14px; transform-origin: 0 100%; }
.s2-mem.is-gone { display: none; }
.s2-mem { overflow: hidden; justify-content: flex-end; }
.s2-mem.is-full { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px); mask-image: linear-gradient(to bottom, transparent 0, #000 56px); }
.s2-row { display: none; grid-template-columns: 4.6em minmax(0, 1fr); column-gap: 18px; align-items: baseline; }
.s2-row.is-on { display: grid; }
.s2-row.is-cut { display: none; }
.s2-row.is-aged { display: none; }
.s2-month { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: rgba(246, 243, 236, 0.4); }
.s2-voice {
  margin: 0; font-family: var(--font-serif); font-weight: 400; color: #F6F3EC;
  font-size: clamp(19px, min(2.7vw, 3.8vh), 30px); line-height: 1.34; letter-spacing: -0.005em;
}
.s2-row[data-age="1"] { opacity: 0.74; }
.s2-row[data-age="2"] { opacity: 0.54; }
.s2-row[data-age="3"] { opacity: 0.4; }
.s2-row { transition: opacity 900ms var(--ease-standard); }
.s2-mem.is-hit .s2-row { opacity: 0.42; }
.s2-row.is-struck .s2-voice { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: #D9D5CC; color: rgba(246, 243, 236, 0.55); }
.still .intro-lines.is-large { font-size: clamp(28px, min(4.6vw, 7.5vh), 62px); }
.still .intro-lines.is-huge { font-size: clamp(64px, min(14vw, 19vh), 190px); letter-spacing: -0.035em; }
.s2-window {
  position: absolute; width: 22px; height: 15px; margin: -7px 0 0 -11px; border-radius: 1px;
  background: #FFD9BF; box-shadow: 0 0 12px 3px rgba(255, 138, 61, 0.5), 0 0 64px 20px rgba(255, 138, 61, 0.12);
  opacity: 0; transition: opacity 1200ms var(--ease-standard);
}
.s2-window.is-on { opacity: 1; }
.s2-thread {
  position: absolute; left: 0; top: 0; height: 1px; transform-origin: 0 50%;
  background: linear-gradient(to right, rgba(255, 217, 191, 0.8), rgba(255, 217, 191, 0.1));
  opacity: 0;
}
.s2-thread.is-on { opacity: 1; }
.s2-notice {
  position: absolute; margin: 0; font-family: var(--font-mono); font-weight: 600; line-height: 1.1;
  letter-spacing: -0.02em; color: #E6E2DA; text-wrap: balance;
}
.s2-ask {
  position: absolute; display: none; margin: 0; text-align: right;
  font-family: var(--font-serif); font-size: clamp(19px, min(2.3vw, 3.8vh), 30px); line-height: 1.34; color: #C6CBCE;
}
.s2-ask.is-on { display: block; }
.s2-prompt {
  position: absolute; margin: 0; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; color: rgba(255, 217, 191, 0.82);
  opacity: 0; transition: opacity 700ms var(--ease-standard);
}
.s2-prompt.is-on { opacity: 1; }
.s2-reply { position: absolute; display: flex; flex-direction: column; gap: 10px; }
.s2-reply.is-mid { transform: translateY(-50%); }
.s2-reply .s2-voice {
  opacity: 0; transform: translateY(6px);
  transition: opacity 720ms var(--ease-standard), transform 720ms var(--ease-standard);
}
.s2-reply .s2-voice.is-on { opacity: 1; transform: none; }
.s2-reply .s2-voice.is-on[data-age="1"] { opacity: 0.66; }
.s2-reply .s2-voice.is-on[data-age="2"] { opacity: 0.46; }
.s2-reply .s2-voice.is-on[data-age="3"] { opacity: 0.34; }
.s2-facts { position: absolute; display: flex; flex-direction: column; gap: 12px; }
.s2-fact {
  margin: 0; max-width: 64ch; font-family: var(--font-mono); font-size: clamp(13px, 1.15vw, 15px); line-height: 1.55;
  color: #A8A49A; opacity: 0; transition: opacity 500ms linear;
}
.s2-fact.is-on { opacity: 1; }
.s2-weights {
  margin: 18px 0 0; font-family: var(--font-serif); font-size: clamp(26px, min(3.4vw, 5.5vh), 44px); line-height: 1.2;
  color: #F6F3EC; opacity: 0; transition: opacity 1000ms var(--ease-standard);
}
.s2-weights.is-on { opacity: 1; }
@media (max-width: 600px) {
  .s2-row { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .s2-mem { gap: 10px; }
  .s2-window { width: 16px; height: 11px; margin: -5px 0 0 -8px; }
}

/* ---------- Home: "Why self-custody your AI" — the long film as an on-demand piece ---------- */
.film-section { border-top: 1px solid var(--line); }
.film-poster {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; container-type: inline-size;
  border-radius: var(--radius-panel); border: 1px solid #2A2A27; background: #0E0E0D; color: #F6F3EC;
}
.poster-art { position: absolute; inset: 0; }
.poster-glow {
  position: absolute; left: 27%; top: 55%; width: 46%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 138, 61, 0.3), rgba(232, 89, 12, 0.1) 55%, rgba(232, 89, 12, 0) 75%);
}
@media (prefers-reduced-motion: no-preference) {
  .poster-glow { animation: poster-glow 7s ease-in-out infinite alternate; }
}
@keyframes poster-glow {
  from { opacity: 0.6; transform: translate(-50%, -50%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}
.poster-file {
  position: absolute; left: 27%; top: 55%; transform: translate(-50%, -50%);
  width: clamp(56px, 8%, 110px); display: grid; justify-items: center; gap: 10px;
}
.poster-file svg { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 14px rgba(255, 138, 61, 0.45)); }
.poster-file-body { fill: #E8590C; }
.poster-file-fold { fill: #B4420A; }
.poster-file-name { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; color: rgba(246, 243, 236, 0.86); white-space: nowrap; }
.poster-line {
  position: absolute; right: 9%; top: 47%; transform: translateY(-50%); margin: 0;
  max-width: 52%; text-wrap: balance;
  font-family: var(--font-serif); font-weight: 400; font-size: clamp(30px, 6.4vw, 84px); font-size: clamp(24px, 6.4cqw, 84px);
  line-height: 1.04; letter-spacing: -0.025em; color: #F6F3EC;
}
.poster-play { position: absolute; left: 4%; right: 4%; bottom: 6%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.poster-play[hidden] { display: none; }
.poster-button {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px 0 18px; border: 0; border-radius: var(--radius-pill);
  background: #F6F3EC; color: #111110; font: 600 16px/1 var(--font-sans); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}
.poster-button svg { width: 18px; height: 18px; fill: currentColor; }
.poster-button:hover { background: #FFFFFF; }
.poster-button:active { transform: scale(0.98); }
.poster-button:focus-visible { outline: var(--focus-width) solid var(--color-ember-glow); outline-offset: 3px; }
.poster-meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: rgba(246, 243, 236, 0.72); }
@media (max-width: 640px) {
  .film-poster { aspect-ratio: 4 / 5; }
  .poster-line { right: 7%; left: 7%; top: 7%; max-width: none; transform: none; font-size: clamp(28px, 9vw, 44px); font-size: clamp(28px, 10cqw, 48px); }
  .poster-file, .poster-glow { left: 50%; top: 56%; }
  .poster-file { width: 72px; }
  .poster-glow { width: 86%; }
  .poster-play { left: 6%; right: 6%; bottom: 6%; }
}
.film-transcript { margin-top: var(--space-24); max-width: var(--measure); }
.film-transcript summary { cursor: pointer; padding: 10px 0; min-height: var(--target-min); font-weight: 600; }
.transcript { list-style: none; padding: 0; margin: var(--space-16) 0 0; display: grid; gap: var(--space-24); }
.transcript > li { display: grid; gap: var(--space-8); padding-top: var(--space-16); border-top: 1px solid var(--line); }
.transcript p { margin: 0; font-family: var(--font-serif); font-size: 19px; line-height: 1.45; }
.transcript-month { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--text-2); margin-right: 8px; }
.transcript .transcript-notice { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.transcript .transcript-record { font-family: var(--font-mono); font-size: 14px; color: var(--text-2); }
.transcript .transcript-ask { text-align: right; }
.transcript .transcript-caption { font-size: 22px; }
.transcript .transcript-still { font-size: 32px; letter-spacing: -0.02em; }
/* while the film plays, the page behind does not scroll (and does not shift) */
html.film-lock { overflow: hidden; scrollbar-gutter: stable; }
@media (horizontal-viewport-segments: 2) {
  .film-poster, .film-transcript { max-width: var(--col0); }
  .poster-file, .poster-glow { top: 42%; }
  .poster-file { width: clamp(40px, 9cqw, 110px); gap: 6px; }
}

/* footer "Replay intro" (Home only; shown by intro-gl.js) */
.replay-intro {
  -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  display: inline-flex; align-items: center; min-height: var(--target-min);
  font: inherit; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.replay-intro:hover { text-decoration-thickness: 2px; }

/* ---------- phones and unfolded near-square screens ---------- */
/* Unfolded inner screens (about 670-860px wide, near-square): keep the mark beside the slogan. */
@media (min-width: 640px) and (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.4fr); gap: var(--space-32); padding: var(--space-64) 0 var(--space-48); }
  .hero-art { order: 0; justify-self: center; width: min(220px, 100%); margin-bottom: 0; }
  .official { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-32); }
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .points li:last-child { grid-column: 1 / -1; }
}
@media (min-width: 640px) and (max-width: 760px) {
  .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Phone landscape: short and wide. Mark beside the text instead of above it. */
@media (max-height: 500px) and (min-width: 600px) and (orientation: landscape) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.32fr); gap: var(--space-24); padding: var(--space-32) 0 var(--space-48); }
  .hero-art { order: 0; justify-self: center; width: min(160px, 100%); margin-bottom: 0; }
  .slogan { font-size: clamp(34px, 5.6vw, 52px); }
}

/* ---------- foldables spanning a hinge (Viewport Segments) ---------- */
/* Side by side (book posture): the mark in the left segment, the text in the right; nothing on the fold. */
@media (horizontal-viewport-segments: 2) {
  :root {
    --seg0: env(viewport-segment-width 0 0, 50vw);
    --seg1: env(viewport-segment-width 1 0, 50vw);
    --hinge: calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw));
    --col0: calc(var(--seg0) - 2 * var(--grid-margin));
    --col1: calc(var(--seg1) - 2 * var(--grid-margin));
    --measure: min(68ch, var(--col0));
  }
  .wrap { max-width: none; }
  .hero, .grid, .points, .emission, .official, .app-today, .proto-group {
    grid-template-columns: var(--col0) var(--col1);
    column-gap: calc(var(--hinge) + 2 * var(--grid-margin));
  }
  .hero-art { order: -1; justify-self: center; width: min(280px, 70%); margin: 0; }
  .app-today { grid-template-areas: "text panel" "more panel" "cap cap"; }
  .span-2, .span-all, .points li:last-child { grid-column: auto; }
  .page-head, .page-body, .section-head, .limits, .tbl-wrap, .chart-wide, .spec-wrap, .notice, .planned-block,
  .site-footer .wrap > *, .statusbar p, .link-cards { max-width: var(--col0); }
  .statusbar p { margin-left: 0; }
  /* header: logo and the pill row in the left segment, theme and sound controls in the right one */
  .site-header .wrap {
    display: grid; grid-template-columns: var(--col0) var(--col1);
    column-gap: calc(var(--hinge) + 2 * var(--grid-margin)); row-gap: var(--space-4); align-items: center;
  }
  .site-header .brand { grid-area: 1 / 1; }
  .site-header .theme-switch { grid-area: 1 / 2; justify-self: end; margin: 0 calc(var(--target-min) + var(--space-8)) 0 0; }
  .site-header .sound-toggle { grid-area: 1 / 2; justify-self: end; margin: 0; }
  .site-header .nav { grid-area: 2 / 1; width: var(--seg0); margin: 0 0 0 calc(-1 * var(--grid-margin)); }
  .site-header .nav ul { padding-right: 0; }
}
/* Top and bottom (laptop posture): the film handles its own layout; keep the hero mark in the top half. */
@media (vertical-viewport-segments: 2) {
  .hero { padding-top: var(--space-32); }
}

/* ---------- reduced motion: no movement at all; everything shows in its final state ---------- */
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .gl-ambient .sig-arcs, .gl-return .hero-art svg { animation: none; }
  .intro-line { transition: none; filter: none; }
  .shot img { will-change: auto; transform: none !important; }
}
