/* ==========================================================================
   FUTURE TECH GLOBAL — LINEAR × MAPBOX DESIGN SYSTEM
   Near-monochrome obsidian • single crimson brand accent • asymmetric bento
   Motion rule: animate only transform / opacity so every effect stays on
   the compositor (60 FPS); everything collapses under reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Surfaces (Linear graphite scale) */
  --bg: #08090A;
  --surface-1: #0E0F11;
  --surface-2: #141518;
  --surface-3: #1B1C20;
  --surface-glass: rgba(12, 13, 15, 0.72);

  /* Hairlines */
  --line-1: rgba(255, 255, 255, 0.06);
  --line-2: rgba(255, 255, 255, 0.10);
  --line-3: rgba(255, 255, 255, 0.16);

  /* Text */
  --text-1: #F7F8F8;
  --text-2: #B4B8BF;
  --text-3: #8A8F98;
  --text-4: #62666D;

  /* Single brand accent (matches the red logo mark) */
  --accent: #FF3366;
  --accent-hover: #FF4D7A;
  --accent-soft: rgba(255, 51, 102, 0.12);
  --accent-line: rgba(255, 51, 102, 0.45);
  --accent-glow: rgba(255, 51, 102, 0.35);

  /* Status only (live dots) — never decorative */
  --ok: #3FCF8E;

  /* Product identity — used only where C-A, MyFuture or AI Core is named */
  --prod-ca: #FF3366;
  --prod-mf: #4FA9F5;
  --prod-ai: #34D399;

  /* Type */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Motion */
  /* Motion — hover timings calibrated on linear.app (measured: 100ms colour,
     160ms state changes on easeOutQuad); longer curves only for movement. */
  --ease-hover: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 100ms;
  --dur-2: 160ms;
  --dur-3: 280ms;
  --dur-4: 700ms;

  /* Layout */
  /* Fluid full-width shell: content spans the viewport up to 2560px with a
     responsive side gutter, then centres on 4K-class screens. */
  --container-max: 2560px;
  --page-gutter: clamp(20px, 4.2vw, 88px);
  --header-height: 64px;
  --gutter: max(var(--page-gutter), calc((100vw - var(--container-max)) / 2 + var(--page-gutter)));
  /* Radii — Linear uses 12px shells with 8px nested surfaces */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 14px;
  --fw-display: 560;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 40px -16px rgba(0, 0, 0, 0.7);
}

/* --------------------------------------------------------------------------
   02. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body {
  background-color: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: clip;
  min-height: 100vh;
  position: relative;
}

/* Root size grows on large displays so every rem-based size scales with the
   screen (declared after the base html rule so it wins the cascade). */
@media (min-width: 1680px) { html { font-size: 17px; } }
@media (min-width: 2200px) { html { font-size: 19px; } }
@media (min-width: 3000px) { html { font-size: 22px; } }

::selection { background: rgba(255, 51, 102, 0.3); color: #FFFFFF; }

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
}

img, svg { display: block; max-width: 100%; }

ol, ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.kbd {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-2);
  color: var(--text-3);
  font-weight: 500;
}

.t-mono { font-family: var(--font-mono); font-size: 0.74rem; }
.t-muted { color: var(--text-3); }
.t-mono strong { color: var(--text-1); font-weight: 600; }

.dot-ok {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px rgba(63, 207, 142, 0.6);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   03. AMBIENCE (static gradients — no blur filters, no blend modes)
   -------------------------------------------------------------------------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-key-light {
  position: absolute;
  top: -30vh;
  left: 50%;
  width: 140vw;
  height: 90vh;
  transform: translateX(-50%);
  background:
    radial-gradient(50% 50% at 50% 50%, rgba(255, 51, 102, 0.07) 0%, rgba(255, 51, 102, 0) 70%),
    radial-gradient(35% 45% at 50% 60%, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0) 70%);
}

.ambient-noise {
  position: absolute;
  inset: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   04. LAYOUT & SECTION HEADERS
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  position: relative;
  z-index: 1;
}

main { position: relative; z-index: 1; }

.section {
  padding: clamp(88px, 9vw, 160px) 0;
  position: relative;
  z-index: 1;
}

.section-header { margin-bottom: 56px; }
.section-header.text-center { text-align: center; }

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 20px;
}

.section-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.section-title {
  font-size: clamp(2rem, 3.6vw, 4.25rem);
  font-weight: var(--fw-display);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-1);
  margin-bottom: 20px;
  text-wrap: balance;
}

.section-title > span { display: block; }

.text-gradient {
  background: linear-gradient(90deg, #F7F8F8 0%, rgba(247, 248, 248, 0.5) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-crimson {
  background: linear-gradient(90deg, #FF7A98 0%, #FF3366 45%, #FF9DB3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-desc {
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  color: var(--text-3);
  line-height: 1.6;
  max-width: 760px;
  text-wrap: pretty;
}

.section-header.text-center .section-desc { margin: 0 auto; }

/* Scroll reveal — only armed when JS is present (html.js set inline in <head>) */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity var(--dur-4) var(--ease-out) var(--reveal-delay, 0ms),
    transform var(--dur-4) var(--ease-out) var(--reveal-delay, 0ms);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   05. NAVIGATION
   -------------------------------------------------------------------------- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  background: rgba(8, 9, 10, 0.55);
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid transparent;
  transition: background-color var(--dur-2) var(--ease-hover), border-color var(--dur-2) var(--ease-hover);
}

.site-nav.scrolled {
  background: rgba(8, 9, 10, 0.82);
  border-bottom-color: var(--line-1);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.nav-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-logo-img {
  height: 26px;
  width: auto;
  transition: opacity var(--dur-2) var(--ease-hover);
}

.brand-link:hover .nav-logo-img { opacity: 0.8; }


.nav-links {
  display: flex;
  align-items: center;
  position: relative;
}

/* Sliding hover pill (positioned by micro-interactions.js) */
.nav-hover-pill {
  --rn: 8;
  --pill-bg: #1B1C1F;
  top: 50%;
  height: 32px;
  margin-top: -16px;
  opacity: 0;
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-hover);
}

.nav-links.is-hovering .nav-hover-pill { opacity: 1; }

.nav-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease-hover);
}

.nav-link:hover, .nav-link.active { color: var(--text-1); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
  white-space: nowrap;
}

/* Language switch: two equal segments; the thumb slides with a transform.
   Shown once i18n-engine.js is ready (it does nothing without it). */
.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--line-2);
  isolation: isolate;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) ease;
}

.i18n-ready .lang-switch { opacity: 1; pointer-events: auto; }

.lang-switch-thumb {
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: #242529;
  transition: transform var(--dur-3) var(--ease-out);
}

.lang-switch[data-lang="en"] .lang-switch-thumb { transform: translate3d(100%, 0, 0); }

.lang-switch-btn {
  height: 30px;
  min-width: 36px;
  padding: 0 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
  transition: color var(--dur-1) var(--ease-hover);
}

.lang-switch-btn:hover, .lang-switch-btn[aria-pressed="true"] { color: var(--text-1); }

/* Saved English choice: keep the page hidden until the copy is swapped */
.i18n-pending body { visibility: hidden; }

.pulse-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ok);
  animation: pingRing 2s var(--ease-out) infinite;
}

@keyframes pingRing {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(3); opacity: 0; }
}

.mobile-menu-btn {
  display: none;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
}

.mobile-menu-btn span {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 1.5px;
  background: var(--text-1);
  border-radius: 1px;
  transition: transform var(--dur-3) var(--ease-out);
}

.mobile-menu-btn span:nth-child(1) { transform: translate3d(0, -3px, 0); }
.mobile-menu-btn span:nth-child(2) { transform: translate3d(0, 3px, 0); }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { transform: rotate(-45deg); }

.mobile-drawer {
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 99;
  background: rgba(8, 9, 10, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-3) ease, visibility 0s linear var(--dur-3);
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-3) ease;
}

.mobile-drawer-panel { max-height: 100%; padding: 24px; overflow-y: auto; overscroll-behavior: contain; }

/* In-depth pages: a quieter second list under the home sections */
.mobile-drawer-label {
  margin: -8px 0 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-4);
}

.mobile-drawer-sublinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 20px; margin-bottom: 24px; }
.mobile-drawer-sublinks a { display: flex; align-items: center; min-height: 44px; font-size: 0.95rem; color: var(--text-2); border-bottom: 1px solid var(--line-1); transition: color var(--dur-1) var(--ease-hover); }
.mobile-drawer-sublinks a:hover, .mobile-drawer-sublinks a[aria-current="page"] { color: var(--text-1); }

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.mobile-drawer-links li {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease-out);
}

.mobile-drawer.open .mobile-drawer-links li { opacity: 1; transform: none; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(2) { transition-delay: 30ms; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(3) { transition-delay: 60ms; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(4) { transition-delay: 90ms; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(5) { transition-delay: 120ms; }
.mobile-drawer.open .mobile-drawer-links li:nth-child(6) { transition-delay: 150ms; }

.mobile-drawer-links a {
  display: block;
  padding: 14px 0;
  font-size: 1.1rem;
  font-weight: 500;
  border-bottom: 1px solid var(--line-1);
}

/* --------------------------------------------------------------------------
   06. BUTTONS & MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */
.btn {
  --btn-h: 40px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--dur-1) var(--ease-hover),
    border-color var(--dur-1) var(--ease-hover),
    color var(--dur-1) var(--ease-hover),
    box-shadow var(--dur-2) var(--ease-hover),
    transform var(--dur-2) var(--ease-out);
}

/* Press: quick physical squash, spring back on release */
.btn:active { transform: scale(0.97); transition-duration: 60ms; }

.btn-xs { --btn-h: 28px; padding: 0 10px; font-size: 0.75rem; border-radius: 6px; }
.btn-sm { --btn-h: 32px; padding: 0 12px; font-size: 0.8rem; }
.btn-lg { --btn-h: 46px; padding: 0 20px; font-size: 0.925rem; }
.btn-block { width: 100%; }

.btn-primary {
  color: #FFFFFF;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 100%), var(--accent);
  box-shadow:
    0 0 0 1px rgba(255, 51, 102, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 24px -10px var(--accent-glow);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow:
    0 0 0 1px var(--accent-hover),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 32px -8px rgba(255, 51, 102, 0.55);
}

.btn-secondary {
  color: #08090A;
  background: #E9EAED;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Light button on a dark page: brighten + soft white halo reads clearly as hover */
.btn-secondary:hover {
  background: #FFFFFF;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 22px -6px rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-2);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line-3); }

.btn:disabled { opacity: 0.55; pointer-events: none; }

/* Cursor-tracked specular glow (coords written by micro-interactions.js) */
[data-pointer-glow]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(90px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.28), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-3) ease;
  pointer-events: none;
}

.btn-ghost[data-pointer-glow]::after { background: radial-gradient(110px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.12), transparent 70%); }

[data-pointer-glow]:hover::after { opacity: 1; }

.btn-arrow { transition: transform var(--dur-3) var(--ease-out); }
.btn:hover .btn-arrow { transform: translate3d(3px, 0, 0); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--dur-1) var(--ease-hover);
}

.link-arrow[hidden] { display: none; }
.link-arrow > span[aria-hidden="true"] { display: inline-block; transition: transform var(--dur-3) var(--ease-out); }
.link-arrow:hover { color: var(--text-1); }
.link-arrow:hover > span[aria-hidden="true"], .spotlight-card:hover .link-arrow > span[aria-hidden="true"] { transform: translate3d(3px, 0, 0); }

/* --------------------------------------------------------------------------
   07. HERO + STICKY 3D SCROLLYTELLING
   -------------------------------------------------------------------------- */
.story { position: relative; z-index: 1; }

.story-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  z-index: 0;
  background: var(--bg);
}

.three-canvas-container {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.three-canvas-container canvas { display: block; width: 100% !important; height: 100% !important; }

/* Legibility mask: dark on the copy side, fades into the next section */
.story-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 9, 10, 0.9) 0%, rgba(8, 9, 10, 0.62) 26%, rgba(8, 9, 10, 0) 44%),
    linear-gradient(180deg, rgba(8, 9, 10, 0.55) 0%, rgba(8, 9, 10, 0) 14%, rgba(8, 9, 10, 0) 82%, var(--bg) 100%);
}

/* Landscape tablets: the copy column is wider relative to the screen, so the
   side mask reaches further before the scene takes over. */
@media (min-width: 769px) and (max-width: 1100px) and (orientation: landscape) {
  .story-vignette {
    background:
      linear-gradient(90deg, rgba(8, 9, 10, 0.92) 0%, rgba(8, 9, 10, 0.7) 34%, rgba(8, 9, 10, 0) 54%),
      linear-gradient(180deg, rgba(8, 9, 10, 0.55) 0%, rgba(8, 9, 10, 0) 14%, rgba(8, 9, 10, 0) 82%, var(--bg) 100%);
  }
}

.story-hud {
  position: absolute;
  top: calc(var(--header-height) + 20px);
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 3;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.live-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.hud-chip-label { display: inline-block; }
.hud-chip-label.is-swapping { animation: labelSwap var(--dur-3) var(--ease-out); }

@keyframes labelSwap {
  from { opacity: 0; transform: translate3d(0, 4px, 0); }
  to { opacity: 1; transform: none; }
}

.hud-presets {
  position: relative;
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-glass);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Shared sliding "active" pill used by HUD presets and solution tabs */
/* Sliding pills are built from three parts (two fixed caps + a 1px middle
   scaled with scaleX) so both the slide and the resize are pure transforms
   and stay on the compositor; animating `width` forced layout every frame.
   Parts are opaque so the 0.5px overlaps never show seams. */
.hud-presets-pill, .tabs-pill, .seg-pill, .nav-hover-pill {
  --r: calc(var(--rn) * 1px);
  position: absolute;
  left: 0;
  width: 0;
  transform: translate3d(var(--pill-x, 0px), 0, 0);
  transition: transform var(--dur-3) var(--ease-out);
  pointer-events: none;
}

.hud-presets-pill, .tabs-pill, .seg-pill { top: 3px; bottom: 3px; }
.hud-presets-pill { --rn: 13; --pill-bg: #242529; }
.tabs-pill { --rn: 17; --pill-bg: #26272A; }
.seg-pill { --rn: 14; --pill-bg: #2B2C2F; }

.pill-part {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--pill-bg);
  transition: transform var(--dur-3) var(--ease-out);
}

.pill-cap { width: var(--r); border-radius: var(--r) 0 0 var(--r); }
.pill-cap-end { border-radius: 0 var(--r) var(--r) 0; transform: translate3d(calc((var(--pill-wn, 0) - var(--rn)) * 1px), 0, 0); }

.pill-mid {
  width: 1px;
  transform-origin: 0 50%;
  transform: translate3d(calc(var(--r) - 0.5px), 0, 0) scaleX(max(0, calc(var(--pill-wn, 0) - 2 * var(--rn) + 1)));
}

.pill-no-anim, .pill-no-anim .pill-part { transition: none !important; }

.scrolly-btn {
  position: relative;
  z-index: 1;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-3);
  transition: color var(--dur-1) var(--ease-hover);
}

.scrolly-btn:hover { color: var(--text-1); }
.scrolly-btn.active { color: var(--text-1); }

.story-rail {
  position: absolute;
  left: var(--gutter);
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-4);
}

.story-rail-track {
  width: 120px;
  height: 2px;
  border-radius: 2px;
  background: var(--line-2);
  overflow: hidden;
}

.story-rail-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 51, 102, 0.4), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.story-rail-index span { color: var(--text-1); }

.story-telemetry {
  position: absolute;
  right: var(--gutter);
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 3;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-glass);
  border: 1px solid var(--line-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-4);
}

.telemetry-param .val {
  color: var(--text-1);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.telemetry-fps { display: flex; align-items: center; gap: 8px; }

.mini-equalizer { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }

.mini-equalizer span {
  width: 2px;
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transform-origin: 50% 100%;
  animation: equalizerFlutter 0.9s ease-in-out infinite alternate;
}

.mini-equalizer span:nth-child(1) { animation-delay: -0.1s; }
.mini-equalizer span:nth-child(2) { animation-delay: -0.5s; }
.mini-equalizer span:nth-child(3) { animation-delay: -0.3s; }
.mini-equalizer span:nth-child(4) { animation-delay: -0.7s; }

@keyframes equalizerFlutter {
  from { transform: scaleY(0.25); }
  to { transform: scaleY(1); }
}

/* Narrative steps scroll over the pinned stage */
.story-steps {
  position: relative;
  z-index: 2;
  margin-top: -100vh;
  margin-top: -100svh;
  pointer-events: none;
}

.story-step {
  min-height: 115vh;
  display: flex;
  align-items: center;
  position: relative;
}

.story-step-hero {
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-height);
}

.story-step:last-child { min-height: 120vh; }

.hero-content {
  max-width: clamp(420px, 34vw, 680px);
  pointer-events: auto;
}

.hero-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 12px 0 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  margin-bottom: 28px;
  font-size: 0.78rem;
  color: var(--text-2);
  transition: border-color var(--dur-1) var(--ease-hover), background-color var(--dur-1) var(--ease-hover);
}

.hero-pill-badge:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.05); }

.hero-pill-tag {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero-pill-arrow { color: var(--text-3); transition: transform var(--dur-3) var(--ease-out); }
.hero-pill-badge:hover .hero-pill-arrow { transform: translate3d(2px, 0, 0); }

.hero-title {
  font-size: clamp(2.1rem, 3.5vw, 4.4rem);
  font-weight: var(--fw-display);
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--text-1);
  margin-bottom: 24px;
  text-wrap: balance;
}

.hero-title > span { display: block; }

.hero-lead {
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 100%;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero-metrics-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line-1);
  max-width: 100%; /* stays inside the copy column, clear of the 3D */
}

.hero-metric-item { display: flex; flex-direction: column-reverse; gap: 4px; }

.hero-metric-val {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.hero-metric-val .unit, .hero-metric-val .unit-prefix { font-size: 0.95rem; font-weight: 500; color: var(--accent); }
.hero-metric-val .unit-prefix { margin-right: 4px; color: var(--text-3); }

.hero-metric-lbl {
  font-size: 0.68rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  line-height: 1.4;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  pointer-events: auto;
  transition: opacity var(--dur-3) ease;
}

.story.is-past-hero .scroll-cue { opacity: 0; }

.scroll-cue-line {
  width: 1px;
  height: 36px;
  background: var(--line-2);
  position: relative;
  overflow: hidden;
}

.scroll-cue-line::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 12px;
  background: var(--accent);
  animation: cueDrop 1.8s var(--ease-in-out) infinite;
}

@keyframes cueDrop {
  from { transform: translate3d(0, -12px, 0); }
  to { transform: translate3d(0, 36px, 0); }
}

/* Narrative card */
.story-card {
  pointer-events: auto;
  max-width: clamp(380px, 30vw, 540px);
  padding: 28px;
  border-radius: var(--radius-lg);
  background: rgba(12, 13, 15, 0.78);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  opacity: 0.35;
  transform: translate3d(0, 12px, 0) scale(0.985);
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out), border-color var(--dur-4) ease;
}

.story-step.is-active .story-card {
  opacity: 1;
  transform: none;
  border-color: var(--line-3);
}

.story-card-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 14px;
}

.story-card-index {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.story-card-title {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  text-wrap: balance;
}

.story-card-desc {
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 22px;
}

.story-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-1);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.story-kpis div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
}

.story-kpis div + div { border-left: 1px solid var(--line-1); }
.story-kpis strong { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.story-kpis span { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; }

.story-terminal {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-1);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  margin-bottom: 20px;
}

.story-terminal-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 6px;
  color: var(--text-2);
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.story-step.is-active .story-terminal-row { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   PRODUCT IDENTITY (C-A / MyFuture / AI Core)
   Any element with data-product exposes --prod for its children.
   -------------------------------------------------------------------------- */
[data-product="ca"] { --prod: var(--prod-ca); --prod-soft: rgba(255, 51, 102, 0.12); --prod-line: rgba(255, 51, 102, 0.4); }
[data-product="mf"] { --prod: var(--prod-mf); --prod-soft: rgba(79, 169, 245, 0.12); --prod-line: rgba(79, 169, 245, 0.4); }
[data-product="ai"] { --prod: var(--prod-ai); --prod-soft: rgba(52, 211, 153, 0.12); --prod-line: rgba(52, 211, 153, 0.4); }

.story-step[data-product] .story-card-index { color: var(--prod); background: var(--prod-soft); }
.story-step[data-product].is-active .story-card { border-color: var(--prod-line); }

.story-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }

.story-chips li {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font-size: 0.76rem;
  color: var(--text-2);
}

.story-step[data-product] .story-chips li:first-child { color: var(--prod); border-color: var(--prod-line); }
.story-kpis strong { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: clamp(1rem, 1.3vw, 1.3rem); }
.story-step[data-product] .story-kpis div:first-child strong { color: var(--prod); }

.dot-ai { width: 6px; height: 6px; border-radius: 50%; background: var(--prod-ai); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); flex-shrink: 0; }

.scrolly-btn[data-product].active { color: var(--prod); }
.story[data-product] .hud-chip .live-indicator { background: var(--prod); box-shadow: 0 0 10px var(--prod); }

/* Hero product pills */
.product-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 100%;
  margin-bottom: 24px;
}

.product-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  background: rgba(14, 15, 17, 0.72);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-1) var(--ease-hover), transform var(--dur-2) var(--ease-out), background-color var(--dur-1) var(--ease-hover);
}

.product-pill:hover { border-color: var(--prod-line); background: rgba(20, 21, 24, 0.85); transform: translate3d(0, -1px, 0); }
.product-pill:active { transform: scale(0.97); }
.product-pill[data-pointer-glow]::after { background: radial-gradient(90px circle at var(--gx, 50%) var(--gy, 50%), var(--prod-soft), transparent 70%); }

.product-pill-name { font-size: 0.92rem; font-weight: 700; letter-spacing: -0.01em; color: var(--prod); }
.product-pill-desc { font-size: 0.7rem; color: var(--text-3); text-align: center; line-height: 1.35; }

/* Labels pinned to the 3D product models */
.hotspots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

.hotspot {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 10px;
  margin: -44px 0 0 -18px; /* anchor the dot on the projected point */
  border-radius: 999px;
  background: rgba(12, 13, 15, 0.92);
  border: 1px solid var(--line-2);
  pointer-events: auto;
  will-change: transform;
  transition: opacity var(--dur-3) ease, border-color var(--dur-2) var(--ease-hover), background-color var(--dur-2) var(--ease-hover);
}

.hotspot.is-hidden { opacity: 0; pointer-events: none; }
.story.labels-off .hotspot { opacity: 0; pointer-events: none; }

/* Data layer panel */
.data-layers {
  position: absolute;
  right: var(--gutter);
  bottom: 84px;
  z-index: 3;
  width: 250px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  border: 1px solid var(--line-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.78rem;
}

.data-layers-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
  transition: background-color var(--dur-2) var(--ease-hover), color var(--dur-1) var(--ease-hover);
}

.layer-toggle:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-1); }
.layer-toggle input { position: absolute; opacity: 0; pointer-events: none; }

/* Switch: knob slides with transform, track fades with opacity */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 26px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
}

.switch::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-hover);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform var(--dur-3) var(--ease-spring);
}

.layer-toggle input:checked + .switch::before { opacity: 1; }
.layer-toggle input:checked + .switch::after { transform: translate3d(10px, 0, 0); }
.layer-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.layer-toggle:active .switch::after { transform: scale(0.9); }
.layer-toggle:active input:checked + .switch::after { transform: translate3d(10px, 0, 0) scale(0.9); }

.inv-legend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  margin: 0 4px 8px 40px;
  font-size: 0.68rem;
  color: var(--text-3);
}

.inv-legend li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.inv-legend strong { margin-left: auto; font-family: var(--font-mono); font-weight: 500; color: var(--text-1); font-variant-numeric: tabular-nums; }
.inv-swatch { width: 6px; height: 6px; border-radius: 50%; background: var(--sw); box-shadow: 0 0 6px var(--sw); flex-shrink: 0; }
.story:has(input[data-layer="inventory"]:not(:checked)) .inv-legend { opacity: 0.35; }
/* In a focused step only the spotlighted product keeps its label */
.story.is-past-hero .hotspot:not(.is-active) { opacity: 0; pointer-events: none; }
.hotspot:hover, .hotspot.is-active { border-color: var(--prod-line); background: rgba(18, 19, 22, 0.92); }

.hotspot-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--prod);
  box-shadow: 0 0 10px var(--prod);
  flex-shrink: 0;
}

.hotspot-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--prod);
  animation: pingRing 2s var(--ease-out) infinite;
}

.hotspot-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.hotspot-title { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.hotspot.is-active .hotspot-title { color: var(--prod); }
.hotspot-sub { font-size: 0.68rem; color: var(--text-3); white-space: nowrap; }
.story-step.is-active .story-terminal-row:nth-child(2) { transition-delay: 120ms; }
.story-step.is-active .story-terminal-row:nth-child(3) { transition-delay: 240ms; }

/* --------------------------------------------------------------------------
   08. BENTO GRID & SPOTLIGHT CARDS
   -------------------------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.bento-l1 { grid-column: span 8; }
.bento-l2 { grid-column: span 4; grid-row: span 2; }
.bento-l3, .bento-l4 { grid-column: span 4; }
.bento-stat { grid-column: span 3; }

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.008) 100%), var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
  transition: border-color var(--dur-2) var(--ease-hover);
}

/* Spotlight: soft fill glow + specular border that follow the cursor */
.spotlight-card::before,
.spotlight-card::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--dur-3) ease;
}

.spotlight-card::before {
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 51, 102, 0.07), transparent 65%);
}

.spotlight-card::after {
  inset: -1px;
  z-index: 3;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.32), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.spotlight-card:hover { border-color: var(--line-2); }
.spotlight-card:hover::before, .spotlight-card:hover::after { opacity: 1; }

/* Border beam: a rotating conic light clipped to the 1px border.
   Rotation is a transform, so it runs on the compositor. The <span class="beam">
   is injected by micro-interactions.js into every .has-beam element. */
.beam {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.beam::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 250%;
  aspect-ratio: 1;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 290deg, rgba(255, 51, 102, 0.9) 340deg, #FFFFFF 352deg, transparent 360deg);
  transform: translate3d(-50%, -50%, 0) rotate(0deg);
  animation: beamSpin 7s linear infinite;
}

@keyframes beamSpin {
  to { transform: translate3d(-50%, -50%, 0) rotate(360deg); }
}

.card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.card-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: color var(--dur-1) var(--ease-hover), border-color var(--dur-2) var(--ease-hover), transform var(--dur-3) var(--ease-spring);
}

.card-icon-box.is-accent { color: var(--accent); border-color: rgba(255, 51, 102, 0.3); background: var(--accent-soft); }
.spotlight-card:hover .card-icon-box { color: var(--text-1); border-color: var(--line-3); transform: translate3d(0, -1px, 0) rotate(-4deg); }
.spotlight-card:hover .card-icon-box.is-accent { color: var(--accent); }

.card-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-1);
  color: var(--text-3);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.3;
  color: var(--text-1);
  margin-bottom: 10px;
  text-wrap: balance;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 24px;
}

.card-visual {
  position: relative;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line-1);
  padding: 16px;
  margin-bottom: 24px;
}

.card-visual-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-4);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.card-footer-action {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line-1);
}

/* Two labels share the footer; the short reference wraps whole to its own line */
.security-bento-card .card-footer-action { flex-wrap: wrap; row-gap: 8px; }
.security-bento-card .security-foot:last-child { white-space: nowrap; }

.card-metric-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--text-4);
}

.card-metric-tag strong { color: var(--text-1); font-weight: 500; }

/* Metric tiles */
.bento-stat {
  padding: 24px 28px;
  justify-content: center;
  gap: 6px;
}

.bento-stat-val {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.bento-stat-val .unit { color: var(--accent); font-size: 0.6em; margin-left: 2px; }

.bento-stat-lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-4);
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   09. LAYER-SPECIFIC VISUALS
   -------------------------------------------------------------------------- */
.national-node-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.gis-city-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-1);
  text-align: left;
  transition: border-color var(--dur-1) var(--ease-hover), background-color var(--dur-1) var(--ease-hover), transform var(--dur-2) var(--ease-out);
}

.gis-city-node:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.04); }
.gis-city-node:active { transform: scale(0.97); }

.gis-city-node.active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.gis-city-node.active::after {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.gis-city-name { font-size: 0.8rem; font-weight: 600; color: var(--text-1); }
.gis-city-units { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-4); }

.urban-visual {
  position: relative;
  flex: 1;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 44px 16px;
  background:
    radial-gradient(60% 50% at 60% 40%, rgba(255, 51, 102, 0.1), transparent 70%),
    linear-gradient(var(--line-1) 1px, transparent 1px) 0 0 / 100% 24px,
    rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.urban-canvas {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 240 / 220;
  transition: transform var(--dur-4) var(--ease-out);
}

/* Lift the whole <svg> (an HTML-level box, so it composites) on hover */
.bento-l2:hover .urban-canvas { transform: translate3d(0, -6px, 0); }

.urban-iso-svg { display: block; width: 100%; height: 100%; }

.urban-pin {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: pinPulse 2.4s var(--ease-out) infinite;
}

@keyframes pinPulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.urban-chip {
  position: absolute;
  z-index: 1;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: rgba(8, 9, 10, 0.8);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-3);
  white-space: nowrap;
}

.urban-chip strong { color: var(--text-1); font-weight: 500; }
.urban-chip-tl { top: 12px; left: 12px; }
.urban-chip-br { right: 12px; bottom: 12px; }

.ai-scoring-simulator { display: flex; flex-direction: column; gap: 12px; }

.ai-query-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.ai-query-text { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ai-match-badge {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ai-meter { height: 4px; border-radius: 4px; background: var(--line-1); overflow: hidden; }

.ai-meter-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 51, 102, 0.3), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(var(--v, 0));
  transition: transform 700ms var(--ease-out);
}

.ai-sim-footer { display: flex; align-items: center; justify-content: space-between; }

.clearing-terminal-mockup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.clearing-status { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.clearing-time { font-size: 1rem; font-weight: 600; color: var(--text-1); }

/* VietQR settlement flow — a highlight walks down the four steps */
.qr-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
}

.qr-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-3);
  isolation: isolate;
}

.qr-steps li::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-soft), transparent 80%);
  opacity: 0;
  animation: qrStep 4.8s linear infinite;
  animation-delay: calc(var(--i) * 1.2s);
}

.qr-dot { position: relative; width: 6px; height: 6px; margin-left: 4px; border-radius: 50%; background: var(--text-4); }

.qr-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0;
  animation: qrStep 4.8s linear infinite;
  animation-delay: calc(var(--i) * 1.2s);
}

@keyframes qrStep {
  0% { opacity: 0; }
  6% { opacity: 1; }
  24% { opacity: 1; }
  32% { opacity: 0; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   11. SOLUTIONS
   -------------------------------------------------------------------------- */
.solutions-tabs-bar {
  position: relative;
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 28px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  overflow-x: auto;
  scrollbar-width: none;
}

.solutions-tabs-bar::-webkit-scrollbar { display: none; }

.solution-tab-btn {
  position: relative;
  z-index: 1;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease-hover);
}

.solution-tab-btn:hover, .solution-tab-btn.active { color: var(--text-1); }

.solution-display-pane {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  padding: 36px;
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--shadow-card);
}

.solution-swap { transition: opacity var(--dur-2) var(--ease-hover), transform var(--dur-3) var(--ease-out); }
.solution-swap.is-swapping { opacity: 0; transform: translate3d(0, 6px, 0); transition-duration: 120ms; }

.solution-pane-left h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 14px;
  text-wrap: balance;
}

.solution-pane-left p { font-size: 0.95rem; color: var(--text-3); line-height: 1.65; margin-bottom: 24px; }

.solution-feature-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.solution-pane-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.solution-pane-actions .btn { max-width: 100%; height: auto; min-height: var(--btn-h); padding-top: 8px; padding-bottom: 8px; white-space: normal; text-align: center; }

/* Link from a home section to its in-depth page */
.section-more { margin-top: 20px; }
.section-header.text-center .section-more { justify-content: center; }

.solution-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-2);
}

.solution-feature-list li svg { color: var(--accent); flex-shrink: 0; margin-top: 3px; }

.solution-pane-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(255, 51, 102, 0.1), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--line-1);
}

.kpi-stat-box { display: flex; flex-direction: column; gap: 8px; }

.kpi-stat-val {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-stat-lbl, .kpi-footnote {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-4);
  text-transform: uppercase;
}

.kpi-footnote { border-top: 1px solid var(--line-1); padding-top: 16px; }

/* --------------------------------------------------------------------------
   13. SECURITY
   -------------------------------------------------------------------------- */
.security-bento-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 16px;
}

.security-bento-card {
  position: relative;
  padding: 36px;
  border-radius: var(--radius-xl);
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  isolation: isolate;
}

.security-badge-top {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 20px;
}

.security-badge-top.is-accent { color: var(--accent); border-color: rgba(255, 51, 102, 0.3); background: var(--accent-soft); }
.security-title { font-size: clamp(1.3rem, 2vw, 1.55rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.25; margin-bottom: 14px; }
.security-desc { font-size: 0.93rem; color: var(--text-3); line-height: 1.7; margin-bottom: 24px; }
.security-foot { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-4); letter-spacing: 0.03em; }

/* --------------------------------------------------------------------------
   14. SHORTCUT TOAST
   -------------------------------------------------------------------------- */
.kbd-toast-hud {
  position: fixed;
  top: calc(var(--header-height) + 14px);
  left: var(--gutter);
  z-index: 90;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.9);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-2);
  opacity: 0;
  transform: translate3d(0, -8px, 0) scale(0.96);
  transform-origin: 0 50%;
  transition: opacity var(--dur-3) ease, transform var(--dur-3) var(--ease-spring);
  pointer-events: none;
}

.kbd-toast-hud.is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   15. MODAL
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 6, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-3) ease, visibility 0s linear var(--dur-3);
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-3) ease;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.97);
  transition: transform var(--dur-3) var(--ease-out), opacity var(--dur-2) var(--ease-hover);
}

.modal-backdrop.open .modal-dialog { opacity: 1; transform: none; }

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: background-color var(--dur-1) var(--ease-hover), color var(--dur-1) var(--ease-hover), transform var(--dur-2) var(--ease-out);
}

.modal-close-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-1); }
.modal-close-btn:active { transform: scale(0.92); }

.modal-eyebrow { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 8px; }
.modal-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 6px; }
.modal-subtitle { font-size: 0.88rem; color: var(--text-3); margin-bottom: 24px; }

.form-group-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }

.form-field label { font-size: 0.76rem; font-weight: 500; color: var(--text-2); }

.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  border: 1px solid var(--line-2);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color var(--dur-1) var(--ease-hover), box-shadow var(--dur-2) var(--ease-hover);
}

.form-field input::placeholder, .form-field textarea::placeholder { color: var(--text-4); }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--line-3); }

.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.15);
}

#demo-consultation-form .btn-block { margin-top: 8px; }

/* Field errors (validation in app.js) */
.form-field.is-invalid input,
.form-field.is-invalid textarea,
.form-field.is-invalid input:hover,
.form-field.is-invalid textarea:hover { border-color: var(--accent-line); }

.form-error { font-size: 0.74rem; line-height: 1.4; color: var(--accent-hover); }

/* Personal-data consent (Decree 13/2023) */
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-3);
}

.form-consent input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0; /* undo the text-field styling of .form-field input */
  border: 0;
  background: none;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-field-consent.is-invalid .form-consent input { outline: 1px solid var(--accent-line); outline-offset: 2px; }

/* Honeypot: invisible to people, still in the DOM for bots. Clipped in place,
   not pushed off screen: a far-off box makes .modal-dialog scroll sideways */
.form-hp {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   15b. ALERT (components/alert.js — SweetAlert-style, self-hosted)
   -------------------------------------------------------------------------- */
.ft-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 6, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--dur-3) ease;
}

.ft-alert-backdrop.open { opacity: 1; }

.ft-alert {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 8px, 0) scale(0.94);
  transition: transform var(--dur-3) var(--ease-spring), opacity var(--dur-2) var(--ease-hover);
}

.ft-alert-backdrop.open .ft-alert { opacity: 1; transform: none; }

.ft-alert-icon {
  --icon: var(--ok);
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(63, 207, 142, 0.1);
  color: var(--icon);
}

.ft-alert-icon.is-error { --icon: var(--accent); background: var(--accent-soft); }

.ft-alert-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Ring draws itself, then the mark (dash lengths ≥ path lengths) */
.ft-alert-ring { stroke-dasharray: 151; stroke-dashoffset: 151; opacity: 0.45; transform: rotate(-90deg); transform-origin: center; }
.ft-alert-mark { stroke-dasharray: 48; stroke-dashoffset: 48; }

.ft-alert-backdrop.open .ft-alert-ring { animation: ft-alert-draw 0.5s var(--ease-out) 0.08s forwards; }
.ft-alert-backdrop.open .ft-alert-mark { animation: ft-alert-draw 0.36s var(--ease-out) 0.42s forwards; }

@keyframes ft-alert-draw { to { stroke-dashoffset: 0; } }

.ft-alert-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; text-wrap: balance; }
.ft-alert-text { font-size: 0.9rem; line-height: 1.55; color: var(--text-3); text-wrap: pretty; }
.ft-alert-confirm { min-width: 140px; margin-top: 24px; }

/* --------------------------------------------------------------------------
   16. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line-1);
  padding: 72px 0 36px;
  background: var(--bg);
}

.footer-top-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr) 1.3fr;
  gap: 40px;
  margin-bottom: 56px;
}

.footer-logo { height: 26px; width: auto; }
.footer-brand-col p { color: var(--text-3); font-size: 0.86rem; margin-top: 16px; max-width: 320px; line-height: 1.6; }

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-3);
}

.footer-col-title { font-size: 0.8rem; font-weight: 500; color: var(--text-1); margin-bottom: 16px; }
.footer-links-list { display: flex; flex-direction: column; gap: 10px; }
.footer-links-list a { font-size: 0.85rem; color: var(--text-3); transition: color var(--dur-1) var(--ease-hover); }
.footer-links-list a:hover { color: var(--text-1); }
.footer-legal { font-size: 0.82rem; color: var(--text-3); line-height: 1.7; }
.footer-legal strong { color: var(--text-2); font-weight: 500; }
.footer-legal code { font-family: var(--font-mono); font-size: 0.78rem; }

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line-1);
  font-size: 0.78rem;
  color: var(--text-4);
}

.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { transition: color var(--dur-1) var(--ease-hover); }
.footer-bottom-links a:hover { color: var(--text-1); }

/* --------------------------------------------------------------------------
   17. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1360px) {
  .nav-status-pill { display: none; }
  .nav-link .kbd { display: none; }
}

@media (max-width: 1024px) {
  .bento-l1 { grid-column: span 12; }
  .bento-l2 { grid-column: span 6; grid-row: span 2; }
  .bento-l3, .bento-l4 { grid-column: span 6; }
  .bento-stat { grid-column: span 6; }
  .solution-display-pane { grid-template-columns: 1fr; }
  .footer-top-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand-col { grid-column: 1 / -1; }
  .story-telemetry .telemetry-param:not(.telemetry-fps) { display: none; }
  .data-layers { display: none; }
}

/* The full menu plus the language switch fits from 1181px in Vietnamese and
   from 1241px in English; below that the drawer takes over */
@media (max-width: 1180px) {
  .nav-menu, .nav-actions .btn-secondary { display: none; }
  .mobile-menu-btn { display: block; }
}

@media (min-width: 1181px) and (max-width: 1240px) {
  html[lang="en"] .nav-menu, html[lang="en"] .nav-actions .btn-secondary { display: none; }
  html[lang="en"] .mobile-menu-btn { display: block; }
}

/* Stacked story — phones and portrait tablets. The 3D owns the top of the
   screen; the hero copy starts below it on its own dark panel and scrolls up
   over the pinned scene, and product cards sit at the bottom. */
@media (max-width: 768px), (max-width: 1100px) and (orientation: portrait) {
  .story-vignette {
    background:
      linear-gradient(180deg, rgba(8, 9, 10, 0.75) 0%, rgba(8, 9, 10, 0) 22%, rgba(8, 9, 10, 0.2) 45%, rgba(8, 9, 10, 0.92) 78%, var(--bg) 100%);
  }
  .story-telemetry, .scroll-cue { display: none; }
  .story:not(.is-past-hero) .story-rail { opacity: 0; }

  .story-step { align-items: flex-end; padding-bottom: 88px; min-height: 110vh; }
  .story-step-hero {
    align-items: flex-start;
    min-height: 0;
    padding-top: 50svh;
    padding-bottom: 40px;
  }

  .story-step-hero .hero-content {
    position: relative;
    isolation: isolate;
    max-width: 640px;
    padding-top: 36px;
  }

  /* Full-bleed panel: reaches both screen edges whatever the copy width */
  .story-step-hero .hero-content::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: calc(var(--gutter) * -1);
    width: 100vw;
    top: 0;
    bottom: -120px;
    background: linear-gradient(180deg, rgba(8, 9, 10, 0) 0, rgba(8, 9, 10, 0.9) 84px, rgba(8, 9, 10, 0.97) calc(100% - 120px), rgba(8, 9, 10, 0) 100%);
    pointer-events: none;
  }
  .story-card { max-width: 640px; }
}

/* Tablets in portrait frame the scene larger, so the copy starts a little lower */
@media (min-width: 600px) and (max-width: 1100px) and (orientation: portrait) {
  .story-step-hero { padding-top: 54svh; }
}

/* The scroll cue would run into the full telemetry bar in this range */
@media (min-width: 1025px) and (max-width: 1240px) {
  .scroll-cue { display: none; }
}

@media (max-width: 768px) {
  .section { padding: 88px 0; }
  .section-header { margin-bottom: 40px; }

  .story-hud { top: calc(var(--header-height) + 12px); left: 16px; right: 16px; justify-content: space-between; }
  .hud-chip { display: none; }
  .hotspot { padding: 5px 9px 5px 8px; margin: -34px 0 0 -14px; }
  .hotspot-sub { display: none; }
  .product-pills { gap: 8px; }
  .product-pill { padding: 10px 6px; }
  .product-pill-desc { font-size: 0.68rem; white-space: normal; text-align: center; }
  .hud-presets { width: 100%; justify-content: space-between; }
  .scrolly-btn { flex: 1; padding: 0 6px; }
  .story-rail { left: 16px; bottom: 16px; }
  .story-card { max-width: none; padding: 22px; }
  .story-card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-metrics-strip { gap: 24px; }
  .hero-metric-val { font-size: 1.3rem; }

  .bento { grid-template-columns: 1fr; }
  .bento-l1, .bento-l2, .bento-l3, .bento-l4, .bento-stat { grid-column: auto; grid-row: auto; }
  .bento-card { padding: 22px; }
  .national-node-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .security-bento-grid { grid-template-columns: 1fr; }
  .solutions-tabs-bar { margin-left: 0; margin-right: 0; }
  .solution-display-pane { padding: 22px; }
  .security-bento-card { padding: 24px; }
  .form-group-row { grid-template-columns: 1fr; gap: 0; }
  .footer-top-grid { grid-template-columns: 1fr; }
  .kbd-toast-hud { display: none; }
}

@media (max-width: 480px) {
  /* Long English phrases wrap instead of running out of their cards */
  .link-arrow { white-space: normal; flex-shrink: 1; }
  .hero-metrics-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .hero-metric-lbl { font-size: 0.68rem; white-space: normal; }
  .hero-pill-badge { max-width: 100%; }
  .hero-pill-badge .badge-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .story-kpis strong { font-size: 1.05rem; }
  .modal-dialog { padding: 24px 20px; }
}

/* --------------------------------------------------------------------------
   17b. TOUCH TARGETS — on touch screens every control is at least ~36–40px
   tall (Apple/Material guidance) without changing the visual rhythm.
   -------------------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 768px) {
  .brand-link { display: inline-flex; align-items: center; min-height: 40px; }
  .nav-link { min-height: 40px; }
  .lang-switch-btn { height: 38px; min-width: 42px; }
  .nav-actions .btn-sm { --btn-h: 40px; }
  .scrolly-btn { height: 36px; }
  .hero-pill-badge { height: 38px; }
  .hotspot { min-height: 36px; }
  .link-arrow { min-height: 40px; }
  .btn-xs { --btn-h: 36px; }
  .solution-tab-btn { height: 40px; }
  .ai-sim-footer { flex-wrap: wrap; gap: 8px; }
  .footer-links-list a, .footer-bottom-links a { display: inline-flex; align-items: center; min-height: 36px; }
  .footer-links-list { gap: 2px; }
  /* 16px form text stops iOS/iPadOS Safari from zooming on focus */
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   17c. PHONE LAYOUT REFINEMENTS
   -------------------------------------------------------------------------- */
.stage-title, .modal-title, .card-title, .engine-title { text-wrap: balance; }

/* Horizontal scrollers fade at the edge that still has content */
.seg, .solutions-tabs-bar {
  --fade-l: 0px;
  --fade-r: 0px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}
.seg.can-scroll-left, .solutions-tabs-bar.can-scroll-left { --fade-l: 28px; }
.seg.can-scroll-right, .solutions-tabs-bar.can-scroll-right { --fade-r: 36px; }

@media (max-width: 768px) {
  /* Story cards stay compact so the 3D scene remains visible above them */
  .story-card { padding: 18px; }
  .story-card-title { font-size: 1.3rem; margin-bottom: 8px; }
  .story-chips { display: none; }
  .story-kpis div { padding: 10px 12px; }

  /* Bento: layers full width, the four metrics as a 2 × 2 grid */
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .bento-l1, .bento-l2, .bento-l3, .bento-l4 { grid-column: 1 / -1; }
  .bento-stat { grid-column: auto; padding: 18px 16px; }
  .bento-stat-val { font-size: 1.7rem; }

  /* Security card footers stack instead of squeezing two columns */
  .security-bento-card .card-footer-action { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Footer: link columns side by side, brand and legal full width */
  .footer-top-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 20px; }
  .footer-brand-col, .footer-top-grid > div:last-child, .footer-top-grid > div:nth-last-child(2) { grid-column: 1 / -1; }

  /* Form controls at 16px so iOS Safari does not zoom on focus */
  .form-field input, .form-field select, .form-field textarea { font-size: 16px; }
  .modal-close-btn { width: 40px; height: 40px; top: 12px; right: 12px; }
}

/* Smallest phones: logo, language switch and menu button share 280px
   (after the touch-target block so these widths win); story KPIs become rows
   so values like "One tap" are never cut off */
@media (max-width: 374px) {
  .nav-logo-img { height: 22px; }
  .nav-actions { gap: 8px; }
  .lang-switch-btn { min-width: 36px; padding: 0 7px; }

  .story-kpis { grid-template-columns: 1fr; }
  .story-kpis div { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; }
  .story-kpis div + div { border-left: 0; border-top: 1px solid var(--line-1); }
  .story-kpis span { text-align: right; }
}

/* --------------------------------------------------------------------------
   18. REDUCED MOTION — keep state changes, drop movement
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .beam, .scroll-cue-line::after { display: none; }
}
