/* ==========================================================================
   E11EVEN APEX CREATIVE-ENGINEERING LAYER (Tasks 83-100)
   Daylight industrial luxury: every motion serves product comprehension.
   Springs: critically damped (zeta = 1) -> cubic-bezier(0.22, 1, 0.36, 1)
   ========================================================================== */

:root {
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --spring-fast: 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  --spring-med: 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  --emerald-glow: #5CE1A6;
  --xray-ink: #07132C;
  --stage-day-a: #FFFFFF;
  --stage-day-b: #F2F0E8;
}

/* --------------------------------------------------------------------------
   0. View Transitions API (cross-document shared-element morphing)
   -------------------------------------------------------------------------- */
/* Sticky-safe horizontal clipping: "hidden" on both html and body turns <body> into a
   scroll container, which silently breaks every position: sticky stage. "clip" does not. */
@supports (overflow-x: clip) {
  html, body { overflow-x: clip; overflow-y: visible; }
}

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.34s;
  animation-timing-function: var(--spring);
}

::view-transition-group(*) {
  animation-duration: 0.56s;
  animation-timing-function: var(--spring);
}

::view-transition-image-pair(*) { isolation: isolate; }

html.apex-calm { scroll-behavior: auto; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* --------------------------------------------------------------------------
   1. Global micro-interactions (spring physics, tactile press, focus rings)
   -------------------------------------------------------------------------- */
.btn, .filter-pill, .model-tab-btn, .angle-chip, .thumb-btn, .apex-chip, .apex-seg button {
  transition: background-color var(--spring-fast), color var(--spring-fast), border-color var(--spring-fast),
    box-shadow var(--spring-fast), transform var(--spring-med);
}

.btn:active, .filter-pill:active, .model-tab-btn:active, .angle-chip:active, .thumb-btn:active,
.apex-chip:active, .apex-seg button:active {
  transform: scale(0.98);
}

/* Specificity fix: "button.btn { border: transparent }" was beating .btn-outline, leaving outline CTAs borderless. */
.btn.btn-outline { border-color: rgba(9, 27, 64, 0.34); }
.btn.btn-outline:hover { border-color: var(--ink-primary); }
.btn.btn-ghost-dark { border-color: rgba(255, 255, 255, 0.3); }

.btn.apex-magnetic { transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0); }
.btn.apex-magnetic:active { transform: translate3d(var(--mag-x, 0px), var(--mag-y, 0px), 0) scale(0.98); }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid #1E6FD9;
  outline-offset: 2px;
  border-radius: 6px;
}

.apex-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Foveal price-pain dampening micro-pulse (one-shot when a model enters view) */
@keyframes apexPulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 107, 77, 0.42); }
  70% { box-shadow: 0 0 0 9px rgba(11, 107, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 107, 77, 0); }
}
@keyframes apexCheck {
  0% { transform: scale(0.6); opacity: 0.2; }
  60% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.foveal-save-pill.apex-pulse { animation: apexPulse 1.4s var(--spring) 2; }
.foveal-micro-trust.apex-pulse svg { animation: apexCheck 0.7s var(--spring) both; }
.foveal-micro-trust.apex-pulse span:nth-child(2) svg { animation-delay: 0.08s; }
.foveal-micro-trust.apex-pulse span:nth-child(3) svg { animation-delay: 0.16s; }
.foveal-micro-trust.apex-pulse span:nth-child(4) svg { animation-delay: 0.24s; }

/* Mechanical odometer digits (tabular-nums locked: width never jitters) */
.odo-d {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.15;
  height: 1.15em;
  font-variant-numeric: tabular-nums;
}
.odo-d > .odo-n { display: inline-block; animation: odoIn 0.62s var(--spring) both; }
.odo-d::before {
  content: attr(data-prev);
  position: absolute;
  left: 0;
  top: 0;
  animation: odoOut 0.62s var(--spring) both;
}
.odo-d.odo-down > .odo-n { animation-name: odoInDown; }
.odo-d.odo-down::before { animation-name: odoOutDown; }
@keyframes odoIn { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes odoOut { from { transform: translateY(0); } to { transform: translateY(-105%); } }
@keyframes odoInDown { from { transform: translateY(-105%); } to { transform: translateY(0); } }
@keyframes odoOutDown { from { transform: translateY(0); } to { transform: translateY(105%); } }

/* --------------------------------------------------------------------------
   2. Interactive architectural blueprint grid + topographic contour layer
   -------------------------------------------------------------------------- */
.section, .site-footer {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.045;
  background-image:
    url("/assets/media/apex/topo-light.svg"),
    linear-gradient(to right, rgba(9, 27, 64, 0.55) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9, 27, 64, 0.55) 1px, transparent 1px);
  background-size: 800px 600px, 40px 40px, 40px 40px;
}

.dark-band::before {
  opacity: 0.09;
  background-image:
    url("/assets/media/apex/topo-dark.svg"),
    radial-gradient(circle, rgba(124, 232, 184, 0.9) 1px, transparent 1.6px),
    linear-gradient(to right, rgba(124, 232, 184, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124, 232, 184, 0.35) 1px, transparent 1px);
  background-size: 800px 600px, 40px 40px, 40px 40px, 40px 40px;
  background-position: 0 0, -20px -20px, 0 0, 0 0;
}

/* Cursor spotlight: a 560px composited disc that re-aligns its pattern (cheap repaint). */
.apex-spot {
  position: absolute;
  left: 0;
  top: 0;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--spring);
  transform: translate3d(var(--sx, -999px), var(--sy, -999px), 0);
  background-image:
    url("/assets/media/apex/topo-light.svg"),
    linear-gradient(to right, rgba(9, 27, 64, 0.6) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(9, 27, 64, 0.6) 1px, transparent 1px);
  background-size: 800px 600px, 40px 40px, 40px 40px;
  background-position: var(--bx, 0) var(--by, 0);
  -webkit-mask-image: radial-gradient(circle at center, #000 0%, rgba(0, 0, 0, 0.55) 34%, transparent 70%);
  mask-image: radial-gradient(circle at center, #000 0%, rgba(0, 0, 0, 0.55) 34%, transparent 70%);
}
.section.apex-spot-on > .apex-spot { opacity: 0.13; }
.dark-band > .apex-spot {
  background-image:
    url("/assets/media/apex/topo-dark.svg"),
    radial-gradient(circle, rgba(124, 232, 184, 1) 1.2px, transparent 2px),
    linear-gradient(to right, rgba(124, 232, 184, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(124, 232, 184, 0.5) 1px, transparent 1px);
  background-size: 800px 600px, 40px 40px, 40px 40px, 40px 40px;
}
.dark-band.apex-spot-on > .apex-spot { opacity: 0.32; }

/* --------------------------------------------------------------------------
   3. Depth-layered parallax + watermark model typography
   -------------------------------------------------------------------------- */
[data-parallax-speed] { will-change: transform; transform: translate3d(0, var(--py, 0px), 0); }

.apex-watermark {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  font-size: clamp(3.4rem, 11vw, 11.5rem);
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(9, 27, 64, 0.085);
}
.apex-watermark.is-dark { -webkit-text-stroke-color: rgba(124, 232, 184, 0.14); }

.hero-section .apex-watermark { right: -1vw; top: 2.5rem; }

/* Reveal (scroll-driven where supported, IntersectionObserver elsewhere) */
html.apex-js .apex-reveal { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 0.7s var(--spring), transform 0.9s var(--spring); }
html.apex-js .apex-reveal.is-in { opacity: 1; transform: none; }
@supports (animation-timeline: view()) {
  html.apex-js .apex-reveal,
  html.apex-js .apex-reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
    animation: apexRise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 18%;
  }
}
@keyframes apexRise { from { opacity: 0.001; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   4. WebGL studio stage (2.5D depth-relit PBR clearcoat, turntable, lenses)
   -------------------------------------------------------------------------- */
.apex-stage { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.apex-stage > canvas.apex-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  opacity: 0;
  transition: opacity 0.45s var(--spring);
  z-index: 1;
}
.apex-stage.gl-ready > canvas.apex-gl { opacity: 1; }
.apex-stage.gl-ready > img { opacity: 0; transition: opacity 0.45s var(--spring); }
.apex-stage.gl-ready.pdp-main-viewport img { transform: none !important; }
.apex-stage #js-pdp-hotspots { position: absolute; inset: 0; z-index: 3; transition: opacity 0.35s var(--spring); }
.apex-stage.angle-off-profile #js-pdp-hotspots,
.apex-stage.mode-xray #js-pdp-hotspots { opacity: 0; pointer-events: none; }
.apex-stage.lens-on #js-pdp-hotspots { opacity: 0.22; }
.apex-stage.is-night .hotspot-pin { background: rgba(124, 232, 184, 0.92); color: #07132C; border-color: #07132C; }
.apex-stage.mode-rotate { cursor: grab; }
.apex-stage.mode-rotate.is-dragging { cursor: grabbing; }
.apex-stage.mode-loupe.gl-ready, .apex-stage.mode-xray.gl-ready { cursor: crosshair; }
html.apex-fine .apex-stage.mode-loupe.gl-ready, html.apex-fine .apex-stage.mode-xray.gl-ready { cursor: none; }

.apex-stage-hud {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.65rem;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-secondary);
}
.apex-stage.is-night .apex-stage-hud { color: #DCE6F7; }
.apex-angle-meter { display: flex; gap: 4px; align-items: center; }
.apex-angle-meter i { display: block; width: 18px; height: 3px; border-radius: 2px; background: rgba(9, 27, 64, 0.18); transition: background var(--spring-fast), width var(--spring-med); }
.apex-angle-meter i.on { background: var(--ink-primary); width: 28px; }
.apex-stage.is-night .apex-angle-meter i { background: rgba(220, 230, 247, 0.25); }
.apex-stage.is-night .apex-angle-meter i.on { background: var(--emerald-glow); }
.apex-hud-pill { background: rgba(255, 255, 255, 0.86); border: 1px solid var(--border-hairline); border-radius: 999px; padding: 0.28rem 0.6rem; backdrop-filter: blur(6px); }
.apex-stage.is-night .apex-hud-pill { background: rgba(7, 19, 44, 0.75); border-color: rgba(124, 232, 184, 0.3); }

/* Stage control deck */
.apex-deck {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
}
.apex-deck-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.apex-deck-label { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.apex-solar-readout { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 800; color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.apex-solar-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.apex-chip {
  min-height: 44px;
  padding: 0.3rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 6px;
  color: var(--ink-secondary);
  cursor: pointer;
}
.apex-chip.active, .apex-chip[aria-pressed="true"] { background: var(--ink-primary); color: #FFFFFF; border-color: var(--ink-primary); }
.apex-finish { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.apex-finish strong { color: var(--ink-primary); }
.apex-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; margin-right: 0.3rem; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), inset -3px -3px 6px rgba(0, 0, 0, 0.25), inset 3px 3px 5px rgba(255, 255, 255, 0.45); }

.apex-seg { display: inline-grid; grid-auto-flow: column; gap: 0.3rem; }
.apex-seg button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--ink-primary);
  cursor: pointer;
}
.apex-seg button[aria-pressed="true"] { background: var(--ink-primary); color: #FFFFFF; }

input[type="range"].apex-range { accent-color: var(--accent-crimson); }

/* --------------------------------------------------------------------------
   5. Precision reticle cursor (fine pointers only)
   -------------------------------------------------------------------------- */
.apex-cursor { position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none; opacity: 0; transition: opacity 0.25s var(--spring); }
html.apex-cursor-on .apex-cursor { opacity: 1; }
.apex-cursor-ring {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(9, 27, 64, 0.55);
  border-radius: 50%;
  transition: width var(--spring-med), height var(--spring-med), left var(--spring-med), top var(--spring-med),
    border-color var(--spring-fast), background-color var(--spring-fast), border-radius var(--spring-med);
}
.apex-cursor-ring::before, .apex-cursor-ring::after { content: ""; position: absolute; background: currentColor; opacity: 0; transition: opacity var(--spring-fast); }
.apex-cursor.is-link .apex-cursor-ring { left: -18px; top: -18px; width: 36px; height: 36px; border-color: rgba(184, 41, 47, 0.6); background: rgba(184, 41, 47, 0.04); }
.apex-cursor.is-loupe .apex-cursor-ring { left: -3px; top: -3px; width: 6px; height: 6px; border-color: var(--accent-crimson); background: var(--accent-crimson); }
.apex-cursor.is-drag .apex-cursor-ring { left: -30px; top: -30px; width: 60px; height: 60px; border-color: rgba(9, 27, 64, 0.7); background: rgba(255, 255, 255, 0.55); }
.apex-cursor.is-play .apex-cursor-ring { left: -38px; top: -38px; width: 76px; height: 76px; border-color: #FFFFFF; background: rgba(184, 41, 47, 0.92); }
.apex-cursor-label {
  position: absolute;
  left: 18px;
  top: 16px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-hairline);
  border-radius: 4px;
  padding: 0.22rem 0.45rem;
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  transition: opacity var(--spring-fast), transform var(--spring-med);
}
.apex-cursor.has-label .apex-cursor-label { opacity: 1; transform: none; }
.apex-cursor.is-drag .apex-cursor-label { left: -44px; top: 36px; }
.apex-cursor.is-play .apex-cursor-label { left: -52px; top: -9px; background: transparent; border: 0; color: #FFFFFF; font-size: 0.6rem; width: 104px; text-align: center; white-space: normal; line-height: 1.15; }
.apex-cursor-readout { display: block; font-weight: 600; color: var(--ink-muted); margin-top: 2px; }
.apex-cursor-scale { display: none; margin-top: 4px; height: 8px; border-left: 1.5px solid var(--ink-primary); border-right: 1.5px solid var(--ink-primary); border-bottom: 1.5px solid var(--ink-primary); background-image: linear-gradient(to right, var(--ink-primary) 1px, transparent 1px); background-size: 20% 50%; background-repeat: repeat-x; background-position: 0 100%; }
.apex-cursor.has-scale .apex-cursor-scale { display: block; }

/* --------------------------------------------------------------------------
   6. 3D tilt bento cards + specular glare + inspection drawer
   -------------------------------------------------------------------------- */
.apex-tilt {
  position: relative;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 0.6s var(--spring), box-shadow 0.4s var(--spring);
}
.apex-tilt.is-tilting { transition: transform 0.12s linear, box-shadow 0.4s var(--spring); box-shadow: var(--shadow-elevated); }
.apex-tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s var(--spring);
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 45%);
  mix-blend-mode: soft-light;
}
.apex-tilt.is-tilting::after { opacity: 1; }
.apex-bento { cursor: zoom-in; text-align: left; font: inherit; color: inherit; width: 100%; }
.apex-bento-cta { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.6rem; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 800; color: var(--ink-primary); }

.apex-drawer {
  width: min(1180px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--ink-primary);
  box-shadow: 0 30px 80px rgba(7, 19, 44, 0.35);
  overflow: auto;
}
.apex-drawer::backdrop { background: rgba(7, 19, 44, 0.58); backdrop-filter: blur(3px); }
.apex-drawer[open] { animation: apexDrawerIn 0.5s var(--spring) both; }
@keyframes apexDrawerIn { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(0.985); } to { opacity: 1; transform: none; } }
.apex-drawer-grid { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .apex-drawer-grid { grid-template-columns: 1.55fr 1fr; } }
.apex-drawer-media { position: relative; background: #F2F0E8; aspect-ratio: 3 / 2; overflow: hidden; }
.apex-drawer-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s var(--spring); }
.apex-drawer-media svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.apex-drawer-body { padding: clamp(1rem, 2.5vw, 1.75rem); }
.apex-callout-line { stroke: #FFFFFF; stroke-width: 2; fill: none; stroke-dasharray: 600; stroke-dashoffset: 600; animation: apexDraw 1.1s var(--spring) 0.15s forwards; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.apex-callout-ring { fill: none; stroke: #FFFFFF; stroke-width: 2; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.apex-callout-label { font-family: var(--font-mono); font-size: 13px; font-weight: 800; fill: #FFFFFF; paint-order: stroke; stroke: rgba(7, 19, 44, 0.78); stroke-width: 4px; }
@keyframes apexDraw { to { stroke-dashoffset: 0; } }
.apex-spec-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.apex-spec-list li { display: grid; grid-template-columns: 28px 1fr; gap: 0.5rem; align-items: start; font-size: 0.86rem; color: var(--ink-secondary); }
.apex-spec-list li b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-primary); color: #FFFFFF; font-family: var(--font-mono); font-size: 0.7rem; }

/* --------------------------------------------------------------------------
   7. Pinned scrollytelling engineering sequence
   -------------------------------------------------------------------------- */
.apex-scrolly { padding: 0; }
.apex-scrolly-track { position: relative; height: calc(var(--steps, 4) * 92svh); }
.apex-scrolly-sticky { position: sticky; top: 72px; height: calc(100svh - 72px); display: flex; align-items: center; }
.apex-scrolly-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; align-items: center; width: 100%; }
@media (min-width: 1024px) { .apex-scrolly-grid { grid-template-columns: 1.25fr 1fr; gap: 2.5rem; } }
.apex-scrolly-head { margin-bottom: 0.25rem; }
.apex-scrolly-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: min(64svh, 640px);
  width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: radial-gradient(circle at 50% 55%, #FFFFFF 0%, #ECEAE1 100%);
  border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-elevated);
}
@media (max-width: 1023px) { .apex-scrolly-stage { max-height: 42svh; aspect-ratio: auto; height: 42svh; } }
.apex-scrolly-cam { position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 4 / 3; transform-origin: 0 0; will-change: transform; }
.apex-scrolly-cam img, .apex-scrolly-cam svg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.apex-scrolly-cam img { object-fit: contain; }
.apex-scrolly-svg .sx { opacity: 0; transition: opacity 0.5s var(--spring); }
.apex-scrolly[data-step="0"] .sx-0, .apex-scrolly[data-step="1"] .sx-1, .apex-scrolly[data-step="2"] .sx-2,
.apex-scrolly[data-step="3"] .sx-3, .apex-scrolly.is-static .sx { opacity: 1; }
.apex-scrolly-svg .sx-ring { fill: none; stroke: #B8292F; stroke-width: 2.5; }
.apex-scrolly-svg .sx-ring-soft { fill: rgba(184, 41, 47, 0.08); stroke: none; }
.apex-scrolly-svg .sx-label { font-family: var(--font-mono); font-size: 15px; font-weight: 800; fill: #091B40; paint-order: stroke; stroke: rgba(255, 255, 255, 0.9); stroke-width: 5px; }
.apex-scrolly-svg .sx-cell { fill: rgba(11, 107, 77, 0.12); stroke: #0B6B4D; stroke-width: 1.4; }
.apex-scrolly-svg .sx-pack { transition: transform 0.6s var(--spring); }
.apex-scrolly-svg .sx-rotor { fill: none; stroke: #B8292F; stroke-width: 2; stroke-dasharray: 6 5; }
.apex-scrolly-progress { position: absolute; left: 0.75rem; top: 0.75rem; z-index: 2; display: flex; gap: 5px; }
.apex-scrolly-progress i { display: block; width: 26px; height: 4px; border-radius: 2px; background: rgba(9, 27, 64, 0.15); overflow: hidden; position: relative; }
.apex-scrolly-progress i b { position: absolute; inset: 0; background: var(--ink-primary); transform-origin: 0 50%; transform: scaleX(var(--f, 0)); }
.apex-scrolly-copy { position: relative; min-height: 22rem; }
@media (max-width: 1023px) { .apex-scrolly-copy { min-height: 0; height: calc(100svh - 72px - 42svh - 2.4rem); } }
.apex-step {
  position: absolute;
  inset: 0 0 auto 0;
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.5s var(--spring), transform 0.7s var(--spring);
  pointer-events: none;
}
.apex-step.is-active { opacity: 1; transform: none; pointer-events: auto; }
.apex-step-card { background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md); padding: clamp(0.9rem, 2vw, 1.5rem); box-shadow: var(--shadow-subtle); }
.apex-step-num { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: var(--accent-crimson); }
.apex-step h3 { font-size: clamp(1.1rem, 2vw, 1.55rem); margin: 0.3rem 0 0.45rem; }
.apex-step p { font-size: 0.9rem; color: var(--ink-secondary); margin-bottom: 0.65rem; }
@media (max-width: 1023px) { .apex-step p { font-size: 0.84rem; margin-bottom: 0.45rem; } .apex-step h3 { font-size: 1.05rem; } }
.apex-step-metrics { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.apex-metric { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 800; padding: 0.3rem 0.55rem; border-radius: 4px; background: var(--bg-canvas); border: 1px solid var(--border-hairline); color: var(--ink-primary); font-variant-numeric: tabular-nums; }
.apex-torque-canvas { width: 100%; height: 104px; border-radius: 6px; background: #FBFAF6; border: 1px solid var(--border-hairline); margin: 0.55rem 0; }
@media (max-width: 1023px) { .apex-torque-canvas { height: 72px; } }
.apex-big-odo { font-family: var(--font-mono); font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 800; color: var(--accent-emerald); line-height: 1.1; font-variant-numeric: tabular-nums; }
.apex-bars { display: grid; gap: 0.4rem; margin: 0.5rem 0; }
.apex-bar { display: grid; grid-template-columns: 7.2rem 1fr auto; gap: 0.5rem; align-items: center; font-size: 0.76rem; font-weight: 700; }
.apex-bar-track { display: block; height: 12px; border-radius: 6px; background: var(--bg-subtle); overflow: hidden; }
.apex-bar-fill { display: block; height: 100%; border-radius: 6px; background: var(--ink-primary); transform-origin: 0 50%; transform: scaleX(var(--w, 0)); transition: transform 0.9s var(--spring); }
.apex-bar-fill.is-emerald { background: var(--accent-emerald); }
.apex-bar-fill.is-muted { background: #9AA3B5; }
.apex-bar-fill.is-crimson { background: var(--accent-crimson); }
.apex-footnote { font-size: 0.7rem; color: var(--ink-muted); }
.apex-shields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; margin: 0.5rem 0; }
.apex-shield { text-align: center; padding: 0.5rem 0.25rem; border-radius: 6px; background: var(--accent-emerald-bg); color: var(--accent-emerald); font-family: var(--font-mono); font-size: 0.66rem; font-weight: 800; line-height: 1.25; }
.apex-shield svg { margin: 0 auto 0.2rem; }

.apex-scrolly.is-static .apex-scrolly-track { height: auto; }
.apex-scrolly.is-static .apex-scrolly-sticky { position: static; height: auto; padding: clamp(2.5rem, 5vw, 4rem) 0; }
.apex-scrolly.is-static .apex-scrolly-copy { height: auto; min-height: 0; display: grid; gap: 0.75rem; }
.apex-scrolly.is-static .apex-step { position: static; opacity: 1; transform: none; pointer-events: auto; }
.apex-scrolly.is-static .apex-scrolly-stage { height: auto; aspect-ratio: 4 / 3; max-height: none; }

/* --------------------------------------------------------------------------
   8. Kinematic loop stage + acoustic telemetry
   -------------------------------------------------------------------------- */
.kinematic-loop-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #12295A 0%, #07132C 75%);
  border: 1px solid var(--border-dark-subtle);
}
.kinematic-loop-stage > video, .kinematic-loop-stage > .apex-stage { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kinematic-loop-stage .apex-stage > img { position: absolute; inset: 8% 6%; width: 88%; height: 84%; object-fit: contain; }
.kinematic-loop-caption { position: absolute; left: 0.75rem; bottom: 0.65rem; z-index: 3; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; color: #B8C4DC; letter-spacing: 0.06em; }

.apex-acoustic { display: grid; gap: 0.75rem; }
.apex-acoustic .apex-seg { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
@media (max-width: 1023px) { .apex-scrolly-head { display: none; } }
.apex-scope { width: 100%; height: 150px; border-radius: 8px; background: #FBFAF6; border: 1px solid var(--border-hairline); }

/* --------------------------------------------------------------------------
   9. Studio: kinematic rider, airflow + power-pulse field, hitch rack
   -------------------------------------------------------------------------- */
.apex-canvas-card { position: relative; padding: 0; overflow: hidden; min-width: 0; max-width: 100%; }
/* Studio output column: let canvas cards shrink to the phone width instead of their bitmap width */
.grid-2 > div[style*="display:grid"] { grid-template-columns: minmax(0, 1fr); }
.apex-canvas-card .apex-canvas-head { padding: 1rem 1.15rem 0; }
.apex-kin-canvas, .apex-flow-canvas { width: 100%; aspect-ratio: 16 / 10; max-width: none; background: #FBFAF6; border-top: 1px solid var(--border-hairline); border-bottom: 1px solid var(--border-hairline); }
.apex-flow-wrap { position: relative; }
.apex-flow-wrap canvas { width: 100%; aspect-ratio: 16 / 9; max-width: none; }
.apex-flow-wrap canvas + canvas { position: absolute; inset: 0; height: 100%; }
.apex-flow-tilt { transition: transform 0.8s var(--spring); transform-origin: 50% 80%; }
.apex-kin-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; padding: 0.85rem 1.15rem 1.1rem; }
@media (min-width: 600px) { .apex-kin-readouts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.apex-band-ok { color: var(--accent-emerald) !important; }
.apex-band-warn { color: var(--accent-amber-ink) !important; }
.apex-band-bad { color: var(--accent-crimson) !important; }
.apex-assumptions { font-size: 0.72rem; color: var(--ink-muted); padding: 0 1.15rem 1rem; margin: 0; max-width: none; }

@media (min-width: 1024px) {
  .apex-studio-sticky { position: sticky; top: 88px; }
}

.apex-rack-stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; align-items: end; padding: 1rem 0.5rem 0; min-height: 190px; }
.apex-rack-tray { display: grid; gap: 0.45rem; justify-items: center; }
.apex-rack-tray img { height: auto; max-width: 100%; transition: width 0.7s var(--spring), filter 0.4s var(--spring); filter: drop-shadow(0 8px 10px rgba(9, 27, 64, 0.12)); }
.apex-rack-bar { width: 100%; }
.apex-rack-beam { height: 10px; border-radius: 4px; background: linear-gradient(#3A475F, #1B2438); margin: 0 0.25rem; }

/* --------------------------------------------------------------------------
   10. Explorers: fleet stage, US coverage map, exploded parts schematic, depot
   -------------------------------------------------------------------------- */
.apex-fleet-stage { margin-top: 1rem; }
.apex-fleet-bikes { display: flex; align-items: flex-end; justify-content: center; gap: clamp(0.25rem, 2vw, 1.25rem); padding: 1rem 0.5rem 0; min-height: 150px; border-bottom: 2px solid var(--ink-primary); }
.apex-fleet-bike { display: grid; justify-items: center; gap: 0.25rem; min-width: 0; animation: apexRiseIn 0.7s var(--spring) both; }
.apex-fleet-bike img { height: auto; max-width: 100%; transition: width 0.7s var(--spring); }
.apex-fleet-bike span { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 800; color: var(--ink-secondary); text-align: center; line-height: 1.25; }
@keyframes apexRiseIn { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }
.apex-brief {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--ink-primary);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}
.apex-brief h4 { font-size: 1rem; margin: 0 0 0.35rem; }
.apex-brief dl { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; margin: 0.5rem 0; font-size: 0.8rem; }
.apex-brief dt { font-family: var(--font-mono); font-weight: 800; color: var(--ink-muted); font-size: 0.7rem; text-transform: uppercase; }
.apex-brief dd { margin: 0; font-weight: 600; }

.apex-lineup-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.75rem; }
@media (min-width: 900px) { .apex-lineup-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.apex-lineup-card { display: grid; gap: 0.35rem; padding: 0.75rem; background: var(--bg-surface); border: 1px solid var(--border-hairline); border-radius: var(--radius-md); }
.apex-lineup-card .bike-card-stage { margin-bottom: 0.15rem; }
.apex-lineup-card strong { font-size: 0.92rem; }
.apex-lineup-card span { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.apex-map-wrap { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; margin-bottom: 2rem; }
@media (min-width: 1024px) { .apex-map-wrap { grid-template-columns: 1.4fr 1fr; } }
.apex-map-card { padding: clamp(0.75rem, 2vw, 1.25rem); }
.apex-usmap { width: 100%; height: auto; max-width: none; }
.apex-usmap .st { cursor: pointer; }
.apex-usmap .st rect { fill: #ECEAE1; stroke: #FFFFFF; stroke-width: 2; transition: fill var(--spring-fast), transform var(--spring-med); transform-box: fill-box; transform-origin: center; }
.apex-usmap .st text { font-family: var(--font-mono); font-size: 11px; font-weight: 800; fill: #4A566E; pointer-events: none; }
.apex-usmap .st:hover rect, .apex-usmap .st:focus rect { fill: #D8D4C7; }
.apex-usmap .st:focus { outline: none; }
.apex-usmap .st:focus-visible rect { stroke: #1E6FD9; stroke-width: 3; }
.apex-usmap .st.has-dealer rect { fill: #091B40; }
.apex-usmap .st.has-dealer text { fill: #FFFFFF; }
.apex-usmap .st.is-active rect { fill: #B8292F; transform: scale(1.06); }
.apex-usmap .st.is-active text { fill: #FFFFFF; }
.apex-usmap .pin { fill: #5CE1A6; stroke: #07132C; stroke-width: 1.2; pointer-events: none; }
.apex-usmap .pin-pulse { fill: none; stroke: #5CE1A6; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: apexPin 2.2s var(--spring) infinite; pointer-events: none; }
@keyframes apexPin { 0% { transform: scale(0.6); opacity: 0.95; } 100% { transform: scale(2.6); opacity: 0; } }
.apex-map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-secondary); margin-top: 0.6rem; }
.apex-map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 0.3rem; }
.apex-coverage-card { animation: apexRiseIn 0.5s var(--spring) both; }

.apex-schematic-card { margin-bottom: 1.5rem; }
.apex-schematic { width: 100%; height: auto; max-width: none; }
.apex-schematic .zone { cursor: pointer; transition: opacity 0.4s var(--spring), transform 0.6s var(--spring); }
.apex-schematic .zone:focus { outline: none; }
.apex-schematic .zone .hit { fill: transparent; }
.apex-schematic .zone .ln { fill: none; stroke: #091B40; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--spring-fast); }
.apex-schematic .zone .fl { fill: #ECEAE1; stroke: #091B40; stroke-width: 2.5; transition: fill var(--spring-fast); }
.apex-schematic .zone:hover .ln, .apex-schematic .zone:focus-visible .ln, .apex-schematic .zone.is-active .ln { stroke: #B8292F; }
.apex-schematic .zone:hover .fl, .apex-schematic .zone:focus-visible .fl, .apex-schematic .zone.is-active .fl { fill: #FBE3E3; stroke: #B8292F; }
.apex-schematic.has-active .zone:not(.is-active) { opacity: 0.32; }
.apex-schematic .zone-tag rect { fill: #FFFFFF; stroke: #091B40; stroke-width: 1.5; }
.apex-schematic .zone.is-active .zone-tag rect { fill: #B8292F; stroke: #B8292F; }
.apex-schematic .zone-tag text { font-family: var(--font-mono); font-size: 15px; font-weight: 800; fill: #091B40; }
.apex-schematic .zone.is-active .zone-tag text { fill: #FFFFFF; }
.apex-schematic .zone-lead { stroke: #4A566E; stroke-width: 1.2; stroke-dasharray: 4 4; fill: none; }
.apex-zone-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.part-card.apex-enter { animation: apexCardIn 0.5s var(--spring) both; }
@keyframes apexCardIn { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.97); } to { opacity: 1; transform: none; } }

.apex-depot { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; margin-top: 1rem; }
.apex-depot i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--bg-subtle); position: relative; transition: background var(--spring-fast); }
.apex-depot i.on { background: var(--ink-primary); animation: apexDepot 0.45s var(--spring) both; }
.apex-depot i.on::after { content: ""; position: absolute; inset: 22% 16%; border: 2px solid #7CE8B8; border-radius: 50% 50% 4px 4px; opacity: 0.8; }
@keyframes apexDepot { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.apex-ring { width: 120px; height: 120px; }
.apex-ring circle { fill: none; stroke-width: 10; }
.apex-ring .trk { stroke: var(--bg-subtle); }
.apex-ring .val { stroke: var(--accent-emerald); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 0.9s var(--spring); }

/* Video facade (lite embed: zero third-party JS until the rider asks to play) */
.yt-facade { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #07132C; cursor: pointer; overflow: hidden; }
.yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.92; transition: transform 0.6s var(--spring), opacity 0.3s var(--spring); }
.yt-facade:hover img { transform: scale(1.035); opacity: 1; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(184, 41, 47, 0.94); display: flex; align-items: center; justify-content: center; color: #FFFFFF; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); transition: transform var(--spring-med); }
.yt-facade:hover .yt-play { transform: scale(1.08); }
.yt-tag { position: absolute; left: 0.5rem; bottom: 0.5rem; padding: 0.2rem 0.45rem; border-radius: 4px; background: rgba(7, 19, 44, 0.82); color: #FFFFFF; font-family: var(--font-mono); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; }

/* Motion comfort toggle */
.apex-motion-toggle { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.06); color: #FFFFFF; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; cursor: pointer; }
.mobile-nav-drawer .apex-motion-toggle { border-color: var(--border-hairline); background: var(--bg-canvas); color: var(--ink-primary); width: 100%; justify-content: center; margin-top: 0.5rem; }

/* --------------------------------------------------------------------------
   11. Calm mode + reduced motion: every flourish degrades to a still, legible state
   -------------------------------------------------------------------------- */
html.apex-calm [data-parallax-speed] { transform: none !important; }
html.apex-calm .apex-tilt { transform: none !important; }
html.apex-calm .apex-tilt::after { display: none; }
html.apex-calm .apex-cursor { display: none; }
html.apex-calm .btn.apex-magnetic { transform: none; }
html.apex-calm .apex-usmap .pin-pulse { animation: none; opacity: 0; }
html.apex-calm .apex-reveal { opacity: 1 !important; transform: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .odo-d > .odo-n, .odo-d::before { animation: none !important; }
  .odo-d::before { display: none; }
  .apex-usmap .pin-pulse { animation: none; opacity: 0; }
  .foveal-save-pill.apex-pulse, .foveal-micro-trust.apex-pulse svg { animation: none; }
}

/* Print: the Partner / Spouse Decision Brief prints alone */
.apex-print-host { display: none; }
@media print {
  body.apex-printing > *:not(main) { display: none !important; }
  body.apex-printing main > * { display: none !important; }
  body.apex-printing main > .apex-print-host { display: block !important; }
  body.apex-printing .apex-brief { border: 2px solid #000; }
  body.apex-printing .apex-brief button { display: none; }
}

/* Utility ribbon: keep phone and code legible on phones (no mid-number wraps) */
@media (max-width: 640px) {
  .ribbon-contact { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: center; }
  .ribbon-contact a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
  .ribbon-contact a[href^="mailto:"] { display: none; }
}

/* Narrow phones (360-400px): fit logo + Bag + Menu without clipping */
@media (max-width: 400px) {
  .header-inner { gap: 8px; }
  .brand-logo { gap: 8px; min-width: 0; }
  .brand-sub { font-size: 0.56rem; letter-spacing: 0.08em; }
  .header-actions { gap: 6px; flex-shrink: 0; }
  .header-actions .btn, .header-actions .mobile-menu-btn { padding-left: 12px; padding-right: 12px; }
}
