/* h23 cinema: full-viewport story chapters, render backdrops (generated studio art) and the Foundational OS product deck.
   GPU only: every motion is transform or opacity driven by --d (-1 to 1) set by cinema.js. Reduced motion shows frame 1, still. */

/* ---------- story chapters ---------- */
.cine { --d: 0; position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: min(90svh, 980px); padding: clamp(4rem, 9vw, 7rem) 0; background: #000; color: #fff; }
.cine--light { background: #F4F1EA; color: var(--ink-primary); }
.cine-media { position: absolute; inset: -6% 0; z-index: -2; }
.cine-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transform: translate3d(0, calc(var(--d) * -4%), 0) scale(1.06); will-change: transform, opacity; }
.cine-frame--2 { opacity: clamp(0, calc((var(--d) + 0.15) * 3), 1); }
.cine-frame--3 { opacity: clamp(0, calc((var(--d) - 0.25) * 3), 1); }
.cine-scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.6) 38%, rgba(0, 0, 0, 0.05) 70%); }
.cine--light .cine-scrim { background: linear-gradient(90deg, rgba(244, 241, 234, 0.95) 0%, rgba(244, 241, 234, 0.78) 40%, rgba(244, 241, 234, 0) 72%); }
.cine-copy { position: relative; width: 100%; }
.cine-copy > * { max-width: 34rem; }
.cine .eyebrow { color: #5EEAD4; }
.cine--light .eyebrow { color: var(--accent); }
.cine-title { margin: 0.5rem 0 1rem; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -0.035em; color: inherit; }
.cine-lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.6; color: rgba(255, 255, 255, 0.82); }
.cine--light .cine-lead { color: var(--ink-secondary); }
.cine-lead p { margin: 0 0 0.85rem; }
.cine-lead a, .cine-stats a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cine-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.65rem; margin-top: 1.5rem; max-width: 36rem; }
.cine-stat { padding: 0.9rem 1rem; border-radius: 14px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.14); }
.cine--light .cine-stat { background: rgba(255, 255, 255, 0.78); border-color: var(--border-hairline); }
.cine-stat strong { display: block; font-size: 1.5rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.cine-stat span { font-size: 0.8rem; opacity: 0.8; }
.cine .fx-cta-row, .cine .cta-row { margin-top: 1.5rem; }
.cine-credit { position: absolute; right: 1rem; bottom: 0.75rem; margin: 0; font-size: 0.7rem; letter-spacing: 0.02em; color: rgba(255, 255, 255, 0.6); }
.cine--light .cine-credit { color: rgba(17, 18, 20, 0.55); }
.cine-frame-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.5rem; max-width: 36rem; }
@media (max-width: 760px) {
  .cine { min-height: auto; align-items: flex-end; padding: 52vw 0 3rem; }
  .cine-media { inset: 0 0 auto 0; height: 70vw; }
  .cine-frame { object-position: 75% 50%; }
  .cine-scrim { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.2) 30vw, #000 68vw); }
  .cine--light .cine-scrim { background: linear-gradient(180deg, rgba(244, 241, 234, 0) 0%, rgba(244, 241, 234, 0.2) 30vw, #F4F1EA 68vw); }
  .cine-credit { top: calc(70vw - 1.6rem); bottom: auto; }
}

/* ---------- Foundational OS product deck ---------- */
.os-section { background: #05070A; color: #fff; padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; }
.os-head { margin-bottom: 1.25rem; }
.os-head .eyebrow { color: #93C5FD; }
.os-title { margin: 0.4rem 0 0.6rem; font-size: clamp(1.9rem, 4.4vw, 3.2rem); line-height: 1.05; letter-spacing: -0.035em; color: #fff; }
.os-sub { margin: 0; color: rgba(255, 255, 255, 0.75); max-width: 44ch; }
.os-deck { position: relative; }
.os-rail { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding: 0.25rem clamp(1rem, 4vw, 2.5rem) 0.85rem; }
.os-rail::-webkit-scrollbar { display: none; }
.os-tab { flex: 0 0 auto; padding: 0.5rem 0.9rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: rgba(255, 255, 255, 0.72); text-decoration: none; border: 1px solid rgba(255, 255, 255, 0.14); min-height: 36px; display: inline-flex; align-items: center; }
.os-tab[aria-current="true"] { background: #fff; color: #05070A; border-color: #fff; }
.os-tab:focus-visible, .os-dock-item:focus-visible, .os-open:focus-visible { outline: 2px solid #93C5FD; outline-offset: 3px; }
.os-track { display: flex; gap: clamp(0.75rem, 2vw, 1.25rem); overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 0 clamp(1rem, 4vw, 4vw); scroll-padding: 0 clamp(1rem, 4vw, 4vw); overscroll-behavior-x: contain; outline: none; }
.os-track::-webkit-scrollbar { display: none; }
/* snap is armed by cinema.js after first interaction: snapping during first layout suppresses LCP in Chrome */
.os-track.is-snap { scroll-snap-type: x mandatory; }
.os-track:focus-visible { box-shadow: inset 0 0 0 2px #93C5FD; }
.os-card { --d: 0; position: relative; isolation: isolate; overflow: hidden; flex: 0 0 min(92vw, 1180px); height: min(76svh, 720px); min-height: 460px; border-radius: 28px; scroll-snap-align: center; scroll-snap-stop: always; background: #000; display: flex; align-items: flex-end; border: 1px solid rgba(255, 255, 255, 0.1); }
.os-media { position: absolute; inset: 0; z-index: -2; }
.os-frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 68% 50%; transform: translate3d(calc(var(--d) * -9%), 0, 0) scale(1.14); will-change: transform, opacity; }
.os-frame--2 { opacity: clamp(0, calc((max(var(--d), calc(var(--d) * -1)) - 0.12) * 4), 1); }
.os-frame--3 { opacity: clamp(0, calc((max(var(--d), calc(var(--d) * -1)) - 0.42) * 4), 1); }
.os-scrim { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0) 72%); }
.os-card--ael .os-scrim, .os-card--labs .os-scrim { background: linear-gradient(90deg, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0.05) 75%); }
.os-copy { padding: clamp(1.5rem, 4vw, 3.25rem); max-width: 34rem; transform: translate3d(calc(var(--d) * 6%), 0, 0); }
.os-kind { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); }
.os-mark { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; font-size: 0.72rem; letter-spacing: 0; color: #fff; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22); }
.os-name { margin: 0 0 0.6rem; font-size: clamp(1.9rem, 4.2vw, 3.1rem); line-height: 1.04; letter-spacing: -0.035em; color: #fff; }
.os-line { margin: 0 0 1.3rem; font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.55; color: rgba(255, 255, 255, 0.85); }
.os-open { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 46px; padding: 0 1.25rem; border-radius: 999px; background: #fff; color: #05070A; font-weight: 700; text-decoration: none; }
.os-credit { position: absolute; right: 1rem; bottom: 0.75rem; margin: 0; font-size: 0.68rem; color: rgba(255, 255, 255, 0.6); }
.os-ctrl { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin: 1rem 0 0.25rem; }
.os-count { margin: 0; min-width: 4.5rem; text-align: center; font-size: 0.85rem; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, 0.75); }
.os-section .glass-icon-btn, .os-switcher .glass-icon-btn { color: #fff; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.os-dock { display: flex; justify-content: center; gap: 0.35rem; width: max-content; max-width: calc(100% - 2rem); margin: 0.75rem auto 0; padding: 0.45rem; border-radius: 22px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow-x: auto; scrollbar-width: none; }
.os-dock-item { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; min-width: 56px; padding: 0.3rem 0.2rem; border-radius: 14px; text-decoration: none; color: rgba(255, 255, 255, 0.78); transition: transform 220ms var(--ease-expo, ease); }
.os-dock-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 0.72rem; font-weight: 800; color: #fff; background: linear-gradient(145deg, #334155, #0F172A); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.os-dock-label { font-size: 0.66rem; font-weight: 600; white-space: nowrap; }
.os-dock-item[aria-current="true"] { color: #fff; transform: translateY(-3px); }
.os-dock-item[aria-current="true"] .os-dock-icon { box-shadow: 0 0 0 2px #fff, 0 10px 24px -8px rgba(147, 197, 253, 0.7); }
.os-dock-item--trimline .os-dock-icon { background: linear-gradient(145deg, #14B8A6, #0F3D38); }
.os-dock-item--os .os-dock-icon { background: linear-gradient(145deg, #22D3EE, #0E2A3A); }
.os-dock-item--singularity .os-dock-icon { background: linear-gradient(145deg, #6366F1, #1E1B4B); }
.os-dock-item--hope .os-dock-icon { background: linear-gradient(145deg, #F59E0B, #3B2A0B); }
.os-dock-item--tfh .os-dock-icon { background: linear-gradient(145deg, #0EA5E9, #0C2A44); }
.os-dock-item--aegis .os-dock-icon { background: linear-gradient(145deg, #3B82F6, #111B3A); }
.os-dock-item--hub .os-dock-icon { background: linear-gradient(145deg, #22C55E, #0D2A1A); }
.os-dock-item--labs .os-dock-icon { background: linear-gradient(145deg, #A8A29E, #292524); }
.os-dock-item--ael .os-dock-icon { background: linear-gradient(145deg, #B08A5B, #3A2A18); }
@media (max-width: 760px) {
  .os-rail { display: none; }
  .os-card { flex-basis: 88vw; height: min(72svh, 620px); min-height: 520px; border-radius: 22px; align-items: flex-end; }
  .os-frame { object-position: 72% 50%; }
  .os-scrim { background: linear-gradient(180deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.55) 52%, rgba(0, 0, 0, 0.9) 100%); }
  .os-credit { top: 0.75rem; bottom: auto; }
  .os-dock { justify-content: flex-start; }
  .os-dock-item { min-width: 52px; }
}

/* compact switcher (nav, every site) */
.os-switch { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0 0.75rem; margin-left: 0.5rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; text-decoration: none; color: var(--ink-primary); border: 1px solid var(--border-strong); background: var(--bg-card); }
.os-switch:hover { border-color: var(--accent); }
.os-switcher { width: min(980px, calc(100vw - 1rem)); max-width: none; max-height: calc(100dvh - 1rem); margin: auto; padding: 0; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 26px; background: #05070A; color: #fff; overflow: hidden; }
.os-switcher::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.os-switcher__sheet { position: relative; padding: 1.25rem 0 4.75rem; max-height: calc(100dvh - 1rem); overflow-y: auto; }
.os-switcher__head { padding: 0 1.25rem 0.75rem; }
.os-switcher__head .eyebrow { color: #93C5FD; }
.os-switcher__head h2 { margin: 0.25rem 0 0; color: #fff; font-size: 1.5rem; }
.os-deck--compact .os-card { flex-basis: min(86vw, 560px); height: min(52svh, 420px); min-height: 340px; }
.os-deck--compact .os-name { font-size: clamp(1.5rem, 5vw, 2.1rem); }
.os-deck--compact .os-rail { display: flex; }
.os-switcher__close { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); }
body.os-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .cine-frame, .os-frame, .os-copy { transform: none !important; opacity: 1; }
  .cine-frame--2, .cine-frame--3, .os-frame--2, .os-frame--3 { display: none; }
  .os-track { scroll-behavior: auto; }
  .os-dock-item { transition: none; }
}

/* motion frames: FIT gallery frames 2 and 3 are near identical, so they crossfade over a short window */
.cine-frame--2.cine-frame--short { opacity: clamp(0, calc((var(--d) + 0.05) * 8), 1); }
.cine-frame--3.cine-frame--short { opacity: clamp(0, calc((var(--d) - 0.35) * 8), 1); }
.os-frame--2.os-frame--short { opacity: clamp(0, calc((max(var(--d), calc(var(--d) * -1)) - 0.15) * 9), 1); }
.os-frame--3.os-frame--short { opacity: clamp(0, calc((max(var(--d), calc(var(--d) * -1)) - 0.4) * 9), 1); }
@media (prefers-reduced-motion: reduce) { .cine-frame--short, .os-frame--short { display: none; } }
/* nav switch sits next to the brand; on small phones only the grid icon shows */
@media (max-width: 420px) { .os-switch span { display: none; } .os-switch { padding: 0 0.6rem; margin-left: 0.25rem; } }
.cine-shot { margin-top: 1.5rem; max-width: 30rem; }
.cine .fl-frame { color: var(--ink-primary); }
.cine .fl-frame figcaption { color: var(--ink-secondary); }
.cine .fx-btn--light, .cine-hope { background: #fff; color: #0B0D0F; border: 0; cursor: pointer; }
.cine--light .fx-btn--light { background: var(--ink-primary); color: #fff; }
.cine-src { font-size: 0.8rem; opacity: 0.75; margin-top: 0.75rem; }
.os-soon { display: inline-flex; align-items: center; min-height: 40px; margin: 0; padding: 0 1rem; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.88); font-weight: 700; font-size: 0.9rem; }

.fx-navbox a, .fx-navbox button { white-space: nowrap; }
@media (max-width: 1599px) { .fx-switch { display: none; } }
