/* Streymalvi website: base styles.
   Colours follow the official Phase 27.1 brand tokens (reference/branding/global.css-tokens.txt).
   The brand gradient is used only on brand surfaces (progress line, rail, marks), never on footage. */

@font-face { font-family: "Inter"; src: url("../media/branding/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../media/branding/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 500 650; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../media/branding/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --sm-midnight: #061c2b;
  --sm-cyan: #00b7ff;
  --sm-cyan-7: #0079ad;
  --sm-teal: #00d5bd;
  --sm-mint: #64f5b2;
  --sm-gradient: linear-gradient(135deg, #00b7ff 0%, #00d5bd 72%, #64f5b2 100%);
  --surface-900: #061c2b;
  --surface-800: #0a2436;
  --surface-700: #123247;
  --charcoal: #0b1117;
  --charcoal-2: #10181f;
  --text: #e6eef4;
  --text-muted: #8fa5b6;
  --text-soft: #c6d4df;
  --line: rgba(198, 212, 223, 0.14);
  --line-strong: rgba(198, 212, 223, 0.28);
  --energised: #f59f00;   /* simulation overlay: energised */
  --powerflow: #40c057;   /* ladder online monitor: power flow */
  --warn: #fab005;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 8px;
  --radius-lg: 14px;
  --header-h: 72px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1280px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  --focus: 0 0 0 3px var(--sm-midnight), 0 0 0 5px var(--sm-cyan);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Full-screen chapters: the page snaps to each section (wheel, touchpad, touch and keyboard all use native scrolling). */
html.js { scroll-snap-type: y proximity; }
@media (prefers-reduced-motion: no-preference) { html.js { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--charcoal);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--sm-cyan); text-underline-offset: 3px; }
a:hover { color: #62cdff; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 0.5em; font-weight: 650; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.75rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
em { font-style: italic; }
code { font-family: var(--mono); font-size: 0.92em; color: var(--text-soft); }
::selection { background: rgba(0, 183, 255, 0.28); }

:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 200; background: var(--sm-cyan); color: var(--sm-midnight); padding: 10px 16px; border-radius: var(--radius); font-weight: 650; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  --bg: transparent; --fg: var(--text); --bd: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 48px; padding: 0.7em 1.35em;
  border-radius: var(--radius); border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg);
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s var(--ease-out), border-color .25s, color .25s, transform .25s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); color: var(--fg); }
.btn:active { transform: translateY(0); }
.btn-primary { --bg: var(--sm-cyan); --fg: var(--sm-midnight); --bd: var(--sm-cyan); }
.btn-primary:hover { --bg: #33c0ff; --bd: #33c0ff; }
.btn-ghost { --bg: rgba(6, 28, 43, 0.45); --bd: rgba(230, 238, 244, 0.32); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { --bg: rgba(18, 50, 71, 0.75); --bd: rgba(230, 238, 244, 0.6); }
.btn-sm { min-height: 40px; padding: 0.45em 1em; font-size: 0.92rem; }
.btn-meta { font-family: var(--mono); font-weight: 400; font-size: 0.85em; color: var(--text-muted); }
.icon { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Scroll progress (brand surface) ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120; pointer-events: none; }
.scroll-progress span { display: block; height: 100%; background: var(--sm-gradient); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }
.no-js .scroll-progress { display: none; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  padding-top: env(safe-area-inset-top);
  transition: height .35s var(--ease-out), background-color .35s, border-color .35s, backdrop-filter .35s;
  border-bottom: 1px solid transparent;
  background: linear-gradient(to bottom, rgba(6, 28, 43, 0.72), rgba(6, 28, 43, 0));
}
.site-header.is-compact {
  --header-h: 58px;
  height: 58px;
  background: rgba(6, 28, 43, 0.86);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.nav { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: 0.01em; font-size: 1.12rem; }
.brand:hover { color: var(--text); }
.brand img { border-radius: 7px; }
.nav-menu { margin-left: auto; display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav-links > li > a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; color: var(--text-soft); text-decoration: none; font-weight: 500; font-size: 0.97rem; border-radius: 6px; position: relative; transition: color .2s; }
.nav-links > li > a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; background: var(--sm-teal); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.nav-links > li > a:hover, .nav-links > li > a[aria-current="true"] { color: var(--text); }
.nav-links > li > a:hover::after, .nav-links > li > a[aria-current="true"]::after { transform: scaleX(1); }
.nav-links > li > a[aria-current="true"] { color: var(--sm-teal); }
.has-sub { position: relative; }
.nav-sub {
  position: absolute; top: calc(100% + 8px); left: -8px; min-width: 290px;
  list-style: none; margin: 0; padding: 8px;
  background: rgba(10, 36, 54, 0.97); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .25s var(--ease-out), visibility 0s .25s;
}
.has-sub:hover .nav-sub, .has-sub:focus-within .nav-sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.nav-sub a { display: flex; gap: 12px; padding: 9px 12px; border-radius: 6px; color: var(--text-soft); text-decoration: none; font-size: 0.95rem; }
.nav-sub a span { font-family: var(--mono); color: var(--text-muted); font-size: 0.85em; min-width: 1.6em; padding-top: 1px; }
.nav-sub a:hover, .nav-sub a:focus-visible { background: var(--surface-700); color: var(--text); }
.nav-toggle { display: none; }

/* ---------- Stage (full-bleed footage) ---------- */
.stage { position: absolute; inset: 0; overflow: hidden; background: var(--surface-900); }
.stage picture, .stage-poster, .stage-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-poster, .stage-video { object-fit: cover; object-position: var(--focal, 50% 50%); }
.scrim { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Opening ---------- */
.opening { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; isolation: isolate; overflow: hidden; }
.scrim-opening {
  background:
    linear-gradient(to top, rgba(6, 28, 43, 0.96) 0%, rgba(6, 28, 43, 0.72) 32%, rgba(6, 28, 43, 0.18) 62%, rgba(6, 28, 43, 0.5) 100%),
    linear-gradient(to right, rgba(6, 28, 43, 0.75) 0%, rgba(6, 28, 43, 0) 65%);
}
.opening-content { position: relative; z-index: 2; width: 100%; max-width: var(--max); margin: 0 auto; padding: calc(var(--header-h) + 40px) max(var(--gutter), env(safe-area-inset-right)) clamp(88px, 14vh, 150px) max(var(--gutter), env(safe-area-inset-left)); }
.eyebrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--text-soft); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.eyebrow img { border-radius: 6px; }
.display { font-size: clamp(2.9rem, 1.2rem + 7vw, 7.25rem); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; max-width: 12ch; margin-bottom: 0.32em; }
.display-sm { font-size: clamp(2.4rem, 1.2rem + 4.6vw, 5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.lead { font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.42rem); line-height: 1.5; color: var(--text-soft); max-width: 40ch; }
.opening .lead { max-width: 34ch; color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.film-credit { margin-top: 28px; font-size: 0.8rem; color: var(--text-muted); }
.scroll-cue { position: absolute; z-index: 3; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; border-radius: 50%; }
.scroll-cue span { width: 22px; height: 36px; border: 2px solid rgba(230, 238, 244, 0.6); border-radius: 12px; position: relative; }
.scroll-cue span::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--text); }

/* ---------- Section headings ---------- */
.kicker { display: inline-flex; align-items: center; gap: 12px; color: var(--sm-teal); font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem; margin-bottom: 18px; }
.kicker-num { font-family: var(--mono); letter-spacing: 0; color: var(--text); padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 5px; }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 6vw, 64px); }
.section-head p:not(.kicker) { color: var(--text-soft); font-size: 1.12rem; }

/* ---------- Chapter index ---------- */
.chapters { background: var(--charcoal); padding: clamp(80px, 12vw, 150px) 0 clamp(60px, 9vw, 110px); }
.chapters h2 { font-size: clamp(1.9rem, 1.1rem + 2.6vw, 3.1rem); }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.chapter-list a { display: grid; align-content: start; gap: 4px; padding: 24px 22px 26px; height: 100%; background: var(--charcoal-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; color: var(--text); text-decoration: none; transition: background-color .3s, border-color .3s; position: relative; }
.chapter-list a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--sm-teal); transform: scaleY(0); transform-origin: top; transition: transform .4s var(--ease-out); }
.chapter-list a:hover { background: var(--surface-800); border-color: var(--line-strong); }
.chapter-list a:hover::before { transform: scaleY(1); }
.chapter-list .num { font-family: var(--mono); color: var(--text-muted); font-size: 0.85rem; margin-bottom: 10px; }
.chapter-list .ttl { font-weight: 650; font-size: 1.12rem; }
.chapter-list .sub { color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Section rail ---------- */
.rail { position: fixed; z-index: 90; right: max(18px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
.rail.is-visible { opacity: 1; visibility: visible; transition-delay: 0s; }
.rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rail a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 30px; padding: 0 4px; text-decoration: none; color: var(--text); }
.rail-dot { order: 2; width: 8px; height: 8px; border-radius: 50%; background: rgba(230, 238, 244, 0.35); transition: transform .3s var(--ease-out), background-color .3s; }
.rail-label { order: 1; font-size: 0.82rem; font-weight: 500; padding: 4px 10px; border-radius: 6px; background: rgba(6, 28, 43, 0.85); opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .3s var(--ease-out); white-space: nowrap; pointer-events: none; }
.rail a:hover .rail-label, .rail a:focus-visible .rail-label { opacity: 1; transform: none; }
.rail a[aria-current="true"] .rail-dot { background: var(--sm-teal); transform: scale(1.5); }
.no-js .rail { display: none; }

/* ---------- Act marker / interlude ---------- */
.act-marker { position: relative; height: 0; z-index: 5; }
.act-marker span { position: absolute; left: max(var(--gutter), env(safe-area-inset-left)); top: 28px; font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--text-muted); }
.interlude { background: var(--surface-900); padding: clamp(110px, 18vw, 220px) 0; text-align: center; position: relative; overflow: hidden; }
.interlude::before { content: ""; position: absolute; left: 50%; top: 0; width: 1px; height: clamp(60px, 10vw, 120px); background: linear-gradient(to bottom, transparent, var(--sm-teal)); }
.interlude h2 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 4.2rem); max-width: 18ch; margin-left: auto; margin-right: auto; }
.interlude p:not(.kicker) { max-width: 46ch; margin: 0 auto; color: var(--text-soft); font-size: 1.12rem; }

/* ---------- Feature sections ---------- */
.feature { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; isolation: isolate; overflow: hidden; background: var(--surface-900); }
.feature .scrim {
  background:
    linear-gradient(to right, rgba(6, 28, 43, 0.95) 0%, rgba(6, 28, 43, 0.88) 38%, rgba(6, 28, 43, 0.55) 56%, rgba(6, 28, 43, 0.12) 74%, rgba(6, 28, 43, 0) 86%),
    linear-gradient(to top, rgba(6, 28, 43, 0.75) 0%, rgba(6, 28, 43, 0) 30%),
    linear-gradient(to bottom, rgba(6, 28, 43, 0.55) 0%, rgba(6, 28, 43, 0) 22%);
}
.feature-right .scrim {
  background:
    linear-gradient(to left, rgba(6, 28, 43, 0.95) 0%, rgba(6, 28, 43, 0.88) 38%, rgba(6, 28, 43, 0.55) 56%, rgba(6, 28, 43, 0.12) 74%, rgba(6, 28, 43, 0) 86%),
    linear-gradient(to top, rgba(6, 28, 43, 0.75) 0%, rgba(6, 28, 43, 0) 30%),
    linear-gradient(to bottom, rgba(6, 28, 43, 0.55) 0%, rgba(6, 28, 43, 0) 22%);
}
.feature-body { position: relative; z-index: 2; padding-top: calc(var(--header-h) + 48px); padding-bottom: 72px; display: flex; }
.feature-right .feature-body { justify-content: flex-end; }
.feature-copy { width: min(540px, 100%); }
.feature h2 { font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4.1rem); }
.feature .lead { color: var(--text); }
.points { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 9px; color: var(--text-soft); }
.points li { position: relative; padding-left: 26px; }
.points li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 12px; height: 2px; background: var(--sm-teal); }
.feature-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.no-js [data-replay] { display: none; }
.media-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 10px; border-radius: 5px; color: var(--warn); border: 1px solid rgba(250, 176, 5, 0.45); background: rgba(6, 28, 43, 0.6); }

/* Explore more (native details: works without JS) */
.more { border-top: 1px solid var(--line-strong); }
.more summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 52px; padding: 12px 0; font-weight: 650; color: var(--text);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: ""; width: 12px; height: 12px; border-right: 2px solid var(--sm-cyan); border-bottom: 2px solid var(--sm-cyan); transform: rotate(45deg) translate(-3px, -3px); transition: transform .3s var(--ease-out); flex: none; }
.more[open] summary::after { transform: rotate(-135deg) translate(-3px, -3px); }
.more summary:hover { color: var(--sm-cyan); }
.more-body {
  max-height: min(56vh, 560px); overflow: auto; overscroll-behavior: contain;
  padding: 18px 18px 6px; margin-bottom: 8px;
  background: rgba(6, 28, 43, 0.9); border: 1px solid var(--line); border-radius: var(--radius-lg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 0.97rem; color: var(--text-soft);
}
.shot { margin: 0 0 16px; }
.shot img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-800); }
.shot figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 8px; }
.honesty { font-size: 0.88rem; color: var(--text-muted); border-left: 2px solid var(--line-strong); padding-left: 12px; }
.honesty strong { color: var(--text-soft); }

/* ---------- Demos ---------- */
.demo { margin: 0 0 18px; padding: 16px; border-radius: var(--radius); background: var(--surface-800); border: 1px solid var(--line); }
.demo svg { width: 100%; height: auto; margin-bottom: 12px; }
.demo-note { font-size: 0.82rem; color: var(--text-muted); margin: 10px 0 0; }
.demo-state { margin: 0; font-size: 0.92rem; color: var(--text); min-height: 2.9em; }
.demo-title { font-family: var(--mono); font-size: 0.9rem; color: var(--text); }
.demo-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.no-js .demo { display: none; }

/* switch demo */
.demo-switch .wall { fill: #eef2f5; stroke: #3d4a55; stroke-width: 5; }
.demo-switch .door-gap { fill: #eef2f5; }
.demo-switch .door { fill: none; stroke: #8fa5b6; stroke-width: 1.5; stroke-dasharray: 3 3; }
.demo-switch .board { fill: #123247; }
.demo-switch .lbl { font: 600 12px var(--font); fill: #123247; }
.demo-switch .board + .lbl { fill: #e6eef4; }
.demo-switch .cable { fill: none; stroke: #9aa7b2; stroke-width: 2; stroke-dasharray: 5 4; transition: stroke .3s; }
.demo-switch .switch-sym { fill: #fff; stroke: #123247; stroke-width: 2; }
.demo-switch .lum-sym { fill: #fff; stroke: #123247; stroke-width: 2; transition: fill .4s; }
.demo-switch .lum-x { stroke: #123247; stroke-width: 2; }
.demo-switch .lum-glow { fill: rgba(255, 214, 120, 0); transition: fill .5s var(--ease-out); }
.demo-switch.is-on .cable { stroke: var(--energised); stroke-dasharray: none; }
.demo-switch.is-on .lum-sym { fill: #ffe08a; }
.demo-switch.is-on .lum-glow { fill: rgba(255, 214, 120, 0.42); }
.demo-switch.is-on .wall { fill: #fbf6ea; }
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 16px 6px 8px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface-700); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; }
.switch-rocker { width: 30px; height: 40px; border-radius: 5px; background: #f2f4f6; border: 1px solid #c8d0d6; position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08); }
.switch-rocker::after { content: ""; position: absolute; left: 4px; right: 4px; height: 16px; top: 4px; border-radius: 3px; background: #dfe4e8; transition: top .2s var(--ease-out); }
.switch[aria-pressed="true"] .switch-rocker::after { top: 18px; }
.switch:hover { border-color: var(--sm-cyan); }

/* ladder demo */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 3px; margin: 0 0 12px; gap: 3px; }
.seg legend { font-size: 0.88rem; color: var(--text-soft); margin-bottom: 8px; padding: 0; float: left; width: 100%; }
.seg label { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 6px; font-weight: 650; cursor: pointer; color: var(--text-soft); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--sm-cyan); color: var(--sm-midnight); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus); }
.demo-ladder svg { background: #fff; border-radius: 6px; }
.demo-ladder .rail-l { stroke: #2b3640; stroke-width: 3; }
.demo-ladder .rung { fill: none; stroke: #2b3640; stroke-width: 2; }
.demo-ladder .rung-live { fill: none; stroke: var(--powerflow); stroke-width: 3; }
.demo-ladder .contact line, .demo-ladder .coil path { stroke: #2b3640; stroke-width: 2.5; fill: none; transition: stroke .3s; }
.demo-ladder .tag { font: 600 11px var(--font); fill: #0079ad; }
.demo-ladder .val { font: 500 10px var(--mono); fill: #5c6b77; }
.demo-ladder .nc-slash { opacity: 0; transition: opacity .25s; }
.demo-ladder.is-nc .nc-slash { opacity: 1; }
.demo-ladder.is-nc [data-contact] line, .demo-ladder.is-nc [data-coil] path { stroke: var(--powerflow); }

/* thermal demo */
.range { display: grid; grid-template-columns: 9.5em 1fr 4.5em; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 0.92rem; }
.range output { font-family: var(--mono); text-align: right; color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--sm-cyan); min-height: 32px; }
.thermal-result { margin-top: 6px; }
.thermal-result p { margin: 8px 0 0; }
.thermal-result strong { font-family: var(--mono); font-size: 1.3rem; color: var(--text); }
.thermal-bar { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(90deg, #1c7ed6 0%, #40c057 35%, #fab005 62%, #fd7e14 80%, #e03131 100%); }
.thermal-bar span { position: absolute; top: -5px; width: 4px; height: 20px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px var(--surface-900); left: calc(var(--pos, 50) * 1%); transform: translateX(-50%); transition: left .3s var(--ease-out); }
.thermal-bar i { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed rgba(255,255,255,.8); left: calc((var(--t) - 10) / 60 * 100%); }

/* ---------- Capabilities ---------- */
.capabilities { background: var(--charcoal); padding: clamp(90px, 13vw, 160px) 0; }
.cap-grid { list-style: none; margin: 0 0 56px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cap { display: flex; flex-direction: column; padding: 26px 24px 0; border-radius: var(--radius-lg); background: var(--charcoal-2); border: 1px solid var(--line); overflow: hidden; transition: border-color .3s, transform .4s var(--ease-out); }
.cap:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.cap p { color: var(--text-soft); font-size: 0.97rem; }
.cap-shot { margin: auto -24px 0; padding: 0 24px; }
.cap-shot img { border-radius: 8px 8px 0 0; border: 1px solid var(--line); border-bottom: 0; aspect-ratio: 16 / 9; object-fit: cover; object-position: 30% 20%; transition: transform .6s var(--ease-out); }
.cap:hover .cap-shot img { transform: translateY(-4px); }
.cap-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.cap-list li { padding: 16px 0; border-top: 1px solid var(--line); color: var(--text-soft); font-size: 0.97rem; }
.cap-list strong { color: var(--text); font-weight: 650; }
.tag-soon { display: inline-block; margin-left: 4px; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--warn); border: 1px solid rgba(250, 176, 5, 0.45); padding: 1px 7px; border-radius: 4px; vertical-align: 1px; }

/* ---------- About ---------- */
.about { background: var(--surface-900); padding: clamp(90px, 13vw, 160px) 0; border-top: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: start; }
.about h2 { font-size: clamp(2rem, 1.2rem + 2.8vw, 3.3rem); }
.about p:not(.kicker) { color: var(--text-soft); font-size: 1.08rem; max-width: 56ch; }
.facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.facts div { background: var(--surface-900); padding: 26px 22px; }
.facts dt { font-size: clamp(2.4rem, 1.6rem + 2vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin-bottom: 10px; color: var(--text); font-variant-numeric: tabular-nums; }
.facts dd { margin: 0; color: var(--text-muted); font-size: 0.93rem; }

/* ---------- Launch ---------- */
.launch { position: relative; overflow: hidden; padding: clamp(110px, 16vw, 200px) 0; text-align: center; background: var(--surface-900); isolation: isolate; }
.launch-bg { position: absolute; inset: 0; z-index: -1; background: url("../media/posters/H05_plc_automation_poster.webp") center / cover no-repeat; opacity: 0.35; }
.launch-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--surface-900), rgba(6, 28, 43, 0.4) 50%, var(--surface-900)); }
.launch-inner { display: flex; flex-direction: column; align-items: center; }
.launch-mark { width: 88px; height: 88px; margin-bottom: 30px; border-radius: 20px; }
.launch .lead { margin: 0 auto; }
.launch .actions { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); border-top: 1px solid var(--line); padding: 48px 0 calc(40px + env(safe-area-inset-bottom)); font-size: 0.88rem; color: var(--text-soft); }
.footer-inner { display: grid; gap: 14px; }
.footer-inner p { margin: 0; max-width: 80ch; }

/* ---------- Film overlay ---------- */
.film {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); overflow: hidden;
}
.film::backdrop { background: rgba(3, 12, 19, 0.94); backdrop-filter: blur(6px); }
.film[open] { display: grid; place-items: center; }
.film-frame { width: min(92vw, calc((100dvh - 150px) * 16 / 9), 1600px); padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.film-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.film-head h2 { font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem); margin: 0; font-weight: 650; letter-spacing: 0; }
.film-close { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(18, 50, 71, 0.7); color: var(--text); cursor: pointer; transition: background-color .2s, border-color .2s; }
.film-close:hover { background: var(--surface-700); border-color: var(--text-soft); }
.film-video-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); }
.film-video { width: 100%; height: 100%; background: #000; }
.film-note { font-size: 0.82rem; margin: 12px 0 0; }
.film-video::cue { font-family: var(--font); background: rgba(6, 28, 43, 0.8); }

/* ---------- Video controls added by video-manager.js ---------- */
.video-toggle .i-play { display: none; }
.video-toggle.is-paused .i-play { display: inline; }
.video-toggle.is-paused .i-pause { display: none; }
.opening-toggle { position: absolute; z-index: 3; right: max(var(--gutter), env(safe-area-inset-right)); bottom: max(28px, env(safe-area-inset-bottom)); }
[data-video-failed] .stage-poster { filter: none !important; }
html.film-open { overflow: hidden; }

/* The compact header's backdrop-filter would trap the fixed mobile menu inside the header box. */
html.menu-open .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-900); }

/* ---------- Full-viewport snapping sections ---------- */
.opening, .feature { height: 100vh; height: 100svh; min-height: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.capabilities, .about, .launch { scroll-snap-align: start; }
.site-footer { scroll-snap-align: end; }
.launch { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.feature-body { padding-top: calc(var(--header-h) + 24px); padding-bottom: 40px; }
/* While an "Explore" panel is open, the bullet list makes room for it inside the same screen. */
.feature-copy:has(.more[open]) .points { display: none; }
.more-body { max-height: min(42vh, 460px); max-height: min(42svh, 460px); }
@media (max-width: 700px) {
  .feature-copy:has(.more[open]) .lead { display: none; }
  .more-body { max-height: 52svh; }
}

/* ---------- Coming soon ---------- */
.coming-soon-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px;
  border-radius: 999px; border: 1px solid rgba(0, 213, 189, 0.55); background: rgba(6, 28, 43, 0.6);
  color: var(--sm-teal); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
}
.coming-soon-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sm-teal); }
a.coming-soon-badge:hover { color: var(--sm-mint); border-color: var(--sm-mint); }
.eyebrow .coming-soon-badge { margin-left: 6px; }
.launch .kicker { margin-top: 4px; }
@media (max-height: 1000px) { .feature-copy:has(.more[open]) .lead { display: none; } }
@media (max-width: 700px) { .eyebrow > span:first-of-type { white-space: nowrap; } .eyebrow .coming-soon-badge { margin-left: 0; } }

/* ---------- The full film (with sound) ---------- */
.film-section {
  position: relative; height: 100vh; height: 100svh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: center; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 110%, var(--surface-700) 0%, var(--surface-900) 55%, #040f17 100%);
}
.film-inner { padding-top: calc(var(--header-h) + 20px); padding-bottom: 28px; display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 3vh, 32px); }
.film-intro { text-align: center; max-width: 900px; }
.film-intro h2 { font-size: clamp(1.8rem, 1rem + 2.6vw, 3.2rem); margin-bottom: 0.3em; }
.film-intro p:not(.kicker) { color: var(--text-soft); margin: 0; }
.film-intro .kicker { margin-bottom: 10px; }
.film-frame {
  width: min(100%, calc((100vh - var(--header-h) - 300px) * 16 / 9));
  width: min(100%, calc((100svh - var(--header-h) - 300px) * 16 / 9));
  aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: #000;
  border: 1px solid var(--line); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.75);
}
.film-video { width: 100%; height: 100%; background: #000; }
@media (max-width: 700px) {
  .film-intro p:not(.kicker) { font-size: 0.98rem; }
  .film-frame { width: 100%; border-radius: var(--radius); }
}
@media (max-height: 600px) { .film-intro p:not(.kicker) { display: none; } .film-frame { width: min(100%, calc((100svh - var(--header-h) - 150px) * 16 / 9)); } }

/* Links between the homepage and the Education page */
.cap-link { display: inline-block; margin-top: 4px; color: var(--sm-cyan); font-weight: 600; text-decoration: none; white-space: nowrap; }
.cap-link:hover, .cap-link:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 32px; color: var(--text-soft); text-decoration: none; font-weight: 500; }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--sm-teal); }

/* ---------- Multi-page site: Home, Features, Education, About ---------- */
/* The current page in the shared navigation (an in-page section highlighted while scrolling takes over) */
.nav-links > li > a[aria-current="page"] { color: var(--sm-teal); }
.nav-links > li > a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links:has(a[aria-current="true"]) > li > a[aria-current="page"] { color: var(--text-soft); }
.nav-links:has(a[aria-current="true"]) > li > a[aria-current="page"]::after { transform: scaleX(0); }

/* Home: the pages of the site */
.site-pages { background: var(--charcoal); padding: clamp(90px, 13vw, 150px) 0; scroll-snap-align: start; }
.page-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.page-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; text-decoration: none; color: var(--text);
  background: var(--surface-900); border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .25s, transform .3s var(--ease-out);
}
.page-card:hover, .page-card:focus-visible { border-color: rgba(0, 213, 189, 0.55); transform: translateY(-3px); }
.page-card img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; border-bottom: 1px solid var(--line); }
.page-card-body { display: grid; gap: 10px; padding: 22px 22px 24px; flex: 1; align-content: start; }
.page-card-body .kicker { margin: 0; }
.page-card-body strong { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
.page-card-body > span:not(.kicker):not(.page-card-go) { color: var(--text-soft); }
.page-card-go { margin-top: 6px; color: var(--sm-cyan); font-weight: 600; }

/* About: its own page, below the fixed header */
.about-page { border-top: 0; padding-top: calc(var(--header-h) + clamp(56px, 9vw, 120px)); }
.about-page h1 { font-size: clamp(2.2rem, 1.3rem + 3vw, 3.8rem); }

@media (max-width: 900px) {
  .page-cards { grid-template-columns: 1fr; max-width: 560px; }
}
