/* ============================================================
   Manara — styles.css
   Renovation "The Console" — governed by Manara Design System v1.4.
   RENOVATION.md supersedes PLAN.md's locked Direction-A decisions.
   Order: fonts → tokens (light + dark) → reset → base → layout →
   sections (Phase 2+) → components (Phase 3+) → motion (Phase 4+).
   ============================================================ */

/* ---- FONTS · self-hosted, latin-subset variable woff2 ---- */
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/fonts/dm-sans-var.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* ---- TOKENS · Manara Design System v1.4 ----
   Marketing surface restricts itself to the ocean / sage / slate
   ramps (locked decision). Gold / rose / violet / ember stay
   defined for system fidelity but are not used on this page. */
:root {
  /* 01. Color ramps — 7 × 10, --{ramp}-{stop} */
  --slate-50:  #F0F3F7;
  --slate-100: #DDE4ED;
  --slate-200: #C2CEDC;
  --slate-300: #9AADC2;
  --slate-400: #6D89A3;
  --slate-500: #4A6480;
  --slate-600: #354D63;
  --slate-700: #243749;
  --slate-800: #162434;
  --slate-900: #0D1822;

  --ocean-50:  #EEF4FB;
  --ocean-100: #D3E5F6;
  --ocean-200: #A9CBF0;
  --ocean-300: #74A8E6;
  --ocean-400: #4284D4;
  --ocean-500: #1B6FCB;
  --ocean-600: #1459A8;
  --ocean-700: #0E4284;
  --ocean-800: #092D60;
  --ocean-900: #051C3D;

  --ember-50:  #FDF3EE;
  --ember-100: #F9E0D2;
  --ember-200: #F4C0A0;
  --ember-300: #EC9A6E;
  --ember-400: #E07B54;
  --ember-500: #CA5F38;
  --ember-600: #A84828;
  --ember-700: #833519;
  --ember-800: #5C240F;
  --ember-900: #371508;

  --sage-50:  #EEFAF4;
  --sage-100: #D0F0E0;
  --sage-200: #9ADFC0;
  --sage-300: #5EC89A;
  --sage-400: #30AD7A;
  --sage-500: #108F5D;
  --sage-600: #0A7049;
  --sage-700: #065337;
  --sage-800: #033827;
  --sage-900: #011F16;

  --gold-50:  #FDF8ED;
  --gold-100: #FAEBC7;
  --gold-200: #F5D48A;
  --gold-300: #EDB84A;
  --gold-400: #D99E27;
  --gold-500: #B47E12;
  --gold-600: #8C600A;
  --gold-700: #664605;
  --gold-800: #422C02;
  --gold-900: #231701;

  --rose-50:  #FDF0F0;
  --rose-100: #FAD8D8;
  --rose-200: #F4ACAC;
  --rose-300: #EB7575;
  --rose-400: #DC4545;
  --rose-500: #C22A2A;
  --rose-600: #9A1E1E;
  --rose-700: #741515;
  --rose-800: #4D0D0D;
  --rose-900: #2A0707;

  --violet-50:  #F3F0FD;
  --violet-100: #E3DCFA;
  --violet-200: #C7B9F5;
  --violet-300: #A48EED;
  --violet-400: #8265E0;
  --violet-500: #6344CC;
  --violet-600: #4C2FAF;
  --violet-700: #381E8A;
  --violet-800: #251163;
  --violet-900: #14093C;

  /* 02. Surface tokens — light (default) */
  --surface-page:           #F2F4F7;
  --surface-card:           #FFFFFF;
  --surface-raised:         #F8FAFC;
  --surface-sunken:         #E9EDF3;
  --surface-sidebar:        #14202E;
  --surface-sidebar-hover:  #1E2F40;
  --surface-sidebar-active: #1B6FCB;
  --surface-overlay:        rgba(13,24,34,0.5);

  /* 03. Text tokens */
  --text-primary:        #1C2B3A;
  --text-secondary:      #3D546A;
  --text-tertiary:       #6D89A3;
  --text-disabled:       #9AADC2;
  --text-inverse:        #FFFFFF;
  --text-link:           #1B6FCB;
  --text-link-hover:     #0E4284;
  --text-sidebar:        #B8CEDE;
  --text-sidebar-muted:  #5A7A96;
  --text-sidebar-active: #FFFFFF;
  --text-success:        #0A7049;
  --text-warning:        #8C600A;
  --text-danger:         #9A1E1E;
  --text-info:           #1459A8;

  /* 04. Border tokens */
  --border-subtle:  #E4EAF1;
  --border-default: #C8D4E0;
  --border-strong:  #9AADC2;
  --border-focus:   #1B6FCB;
  --border-error:   #DC4545;
  --border-success: #108F5D;
  --border-info:    #A9CBF0;
  --border-warn:    #F5D48A;
  --border-ok:      #9ADFC0;
  --border-bad:     #F4ACAC;

  /* 05. Semantic background tokens — pair with matching --text-{role} */
  --bg-info:    #EEF4FB;
  --bg-success: #EEFAF4;
  --bg-warning: #FDF8ED;
  --bg-danger:  #FDF0F0;
  --bg-ember:   #FDF3EE;
  --bg-violet:  #F3F0FD;

  /* 06. Action / fill tokens */
  --fill-primary:        #1B6FCB;
  --fill-primary-hover:  #1459A8;
  --fill-primary-active: #0E4284;
  --fill-accent:         #E07B54;
  --fill-accent-hover:   #CA5F38;
  --fill-danger:         #DC4545;
  --fill-danger-hover:   #C22A2A;
  --fill-success:        #108F5D;

  /* 07. Typography */
  --font-display: "DM Sans", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Fira Code", monospace;

  --text-2xs:  10px;
  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  38px;
  --text-5xl:  48px;

  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.5;
  --leading-relaxed: 1.65;
  --leading-loose:   1.8;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  --tracking-tighter: -0.03em;
  --tracking-tight:   -0.015em;
  --tracking-normal:   0em;
  --tracking-wide:     0.02em;
  --tracking-wider:    0.06em;
  --tracking-widest:   0.10em;

  /* 08. Spacing — 4px base grid */
  --space-px:  1px;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;

  /* 09. Border radius */
  --radius-xs:   3px;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-pill: 9999px;

  /* 10. Shadows */
  --shadow-xs:          0 1px 2px rgba(13,24,34,0.05);
  --shadow-sm:          0 1px 3px rgba(13,24,34,0.07), 0 1px 2px rgba(13,24,34,0.04);
  --shadow-md:          0 3px 10px rgba(13,24,34,0.08), 0 1px 3px rgba(13,24,34,0.05);
  --shadow-lg:          0 8px 20px rgba(13,24,34,0.10), 0 2px 6px rgba(13,24,34,0.06);
  --shadow-xl:          0 16px 36px rgba(13,24,34,0.12), 0 4px 10px rgba(13,24,34,0.07);
  --shadow-focus:       0 0 0 3px rgba(27,111,203,0.22);
  --shadow-focus-error: 0 0 0 3px rgba(220,69,69,0.18);

  /* 11. Component sizing */
  --layout-sidebar-w:   236px;
  --layout-topbar-h:     54px;
  --layout-content-max: 1280px;

  --input-h-sm:   30px;
  --input-h-md:   36px;
  --input-h-lg:   44px;
  --input-px:     var(--space-3);
  --input-radius: var(--radius-sm);

  --btn-h-sm:   30px;
  --btn-h-md:   36px;
  --btn-h-lg:   44px;
  --btn-px-sm:  var(--space-3);
  --btn-px-md:  var(--space-4);
  --btn-px-lg:  var(--space-6);
  --btn-radius: var(--radius-sm);

  --avatar-xs:  24px;
  --avatar-sm:  32px;
  --avatar-md:  40px;
  --avatar-lg:  52px;

  --icon-xs:    12px;
  --icon-sm:    14px;
  --icon-base:  16px;
  --icon-md:    18px;
  --icon-lg:    20px;
  --icon-xl:    24px;
  --icon-2xl:   32px;
  --icon-3xl:   40px;
  --icon-4xl:   48px;

  --icon-stroke-thin:   1.25;
  --icon-stroke-base:   1.5;
  --icon-stroke-bold:   2;

  --table-row-h:     44px;
  --table-header-h:  36px;
  --table-row-hover: #EEF4FB;
  --table-row-sel:   #D3E5F6;

  --badge-px: 10px;
  --badge-py:  3px;

  --card-p:      var(--space-6);
  --card-radius: var(--radius-lg);

  /* 12. Z-index stack */
  --z-base:     1;
  --z-sticky:   10;
  --z-sidebar:  20;
  --z-topbar:   30;
  --z-dropdown: 40;
  --z-modal:    50;
  --z-toast:    60;
  --z-tooltip:  70;

  /* 13. Motion */
  --ease-sharp:  cubic-bezier(0.40, 0.00, 0.20, 1.00);
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-instant:  60ms;
  --dur-fast:    120ms;
  --dur-base:    200ms;
  --dur-slow:    320ms;
  --dur-slower:  480ms;

  /* Legacy layout aliases kept during the phase-by-phase rebuild
     (Phase 2 removes these once sections are re-laid to the grid). */
  --gutter: var(--space-6);
  --maxw:   var(--layout-content-max);
}

/* Light-only. The dark-theme token blocks and the OS-preference/[data-theme]
   overrides were removed — the site ships a single light instrument-panel look
   (dark bands are section-level, not a global theme). */

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
ul, ol { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { background: none; border: none; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   BASE
   ============================================================ */
html { scroll-behavior: smooth; overflow-x: hidden; }

/* Scrollbar, on-brand instead of the OS default: a slim ocean-accent thumb on
   the page surface, the same pairing the nav underline and primary button use.
   Firefox gets the two-value shorthand; WebKit/Blink get the pseudo-elements
   (Windows Chrome is where the default scrollbar reads most off-brand, being
   a wide flat gray column against this page's light instrument-panel look). */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--ocean-400) var(--surface-page);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-page); }
::-webkit-scrollbar-thumb {
  background: var(--ocean-400);
  border-radius: var(--radius-pill);
  border: 2px solid var(--surface-page);
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ocean-500); }

body {
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  transition: background var(--dur-base) var(--ease-sharp), color var(--dur-base) var(--ease-sharp);
}

::selection { background: var(--ocean-200); color: var(--ocean-900); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sidebar);
  color: var(--text-sidebar);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; top: 0; }

/* Section-label marker — a short ocean tick + mono label. Echoes the hero
   badge's "indicator + label" DNA in a quieter, repeatable form so every
   section header reads as part of one system. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}
.eyebrow::before {
  content: "";
  width: 24px; height: 2px;
  background: var(--ocean-500);
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.eyebrow--dark { color: var(--slate-300); }
.eyebrow--dark::before { background: var(--ocean-400); }

.tabular, .amt, .console-value, .plan-amount, .stat-tile-value { font-variant-numeric: tabular-nums; }


/* ============================================================
   LAYOUT PRIMITIVES — light room / dark instrument alternation
   ============================================================ */
.section {
  max-width: var(--layout-content-max);
  margin: 0 auto;
  padding: var(--space-24) var(--space-6);
}

.room { background: var(--surface-sidebar); }
.room-inner {
  max-width: var(--layout-content-max);
  margin: 0 auto;
  padding: calc(var(--space-24) * 1.3) var(--space-6);
}
.room-inner--narrow { max-width: 760px; text-align: left; }

.section-head { max-width: 60ch; margin-bottom: var(--space-10); }

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  max-width: 20ch;
}
.section-title--dark { color: #EEF4FB; }

.section-lead {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  max-width: 54ch;
}
.section-lead--dark { color: var(--slate-200); }

.section-foot { margin-top: var(--space-10); }

/* Faint dot-grid graph-paper texture behind light sections only. Static, no animation.
   Kept barely perceptible per the "remove it if it reads at all" rule. */
.section, body {
  background-image: radial-gradient(rgba(74,100,128,0.14) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -8px -8px;
}
.room { background-image: none; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-h-md);
  padding: 0 var(--btn-px-md);
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-sharp), border-color var(--dur-fast) var(--ease-sharp), transform var(--dur-instant) var(--ease-sharp);
  border: 1px solid transparent;
}
.btn:active { transform: scale(0.97); }
.btn-lg { height: var(--btn-h-lg); padding: 0 var(--btn-px-lg); font-size: var(--text-md); }

.btn-primary { background: var(--fill-primary); color: var(--text-inverse); box-shadow: 0 0 0 rgba(27,111,203,0); transition: background var(--dur-fast) var(--ease-sharp), box-shadow var(--dur-base) var(--ease-sharp), transform var(--dur-instant) var(--ease-sharp); }
.btn-primary:hover { background: var(--fill-primary-hover); box-shadow: 0 6px 20px rgba(27,111,203,0.35); transform: translateY(-1px); }
.btn-primary:active { background: var(--fill-primary-active); transform: translateY(0) scale(0.97); }

.btn-secondary { background: var(--surface-card); color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-raised); }

.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border-default); }
.btn-outline:hover { background: var(--surface-raised); border-color: var(--border-strong); }
.btn-outline--dark { color: var(--text-sidebar); border-color: var(--surface-sidebar-hover); }
.btn-outline--dark:hover { background: var(--surface-sidebar-hover); }

.btn-ghost { color: var(--text-link); padding: 0; height: auto; position: relative; }
.btn-ghost::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--text-link); transition: right var(--dur-fast) var(--ease-out);
}
.btn-ghost:hover::after { right: 0; }
.btn-ghost--dark { color: var(--ocean-300); }
.btn-ghost--dark::after { background: var(--ocean-300); }

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: transparent;
  transition: background var(--dur-base) var(--ease-sharp), box-shadow var(--dur-base) var(--ease-sharp);
}
.site-nav.is-condensed {
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
}
.site-nav nav {
  max-width: var(--layout-content-max);
  margin: 0 auto;
  height: var(--layout-topbar-h);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  margin-right: auto;
}
.wordmark--dark { color: #EEF4FB; }

.nav-links { display: flex; gap: var(--space-6); }
.nav-links a {
  position: relative;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: var(--ocean-500); border-radius: var(--radius-pill);
  transition: right var(--dur-slow) var(--ease-out);
}
.nav-links a.is-active { color: var(--text-primary); font-weight: var(--weight-medium); }
.nav-links a.is-active::after { right: 0; }

.nav-actions { display: flex; align-items: center; gap: var(--space-3); margin-left: auto; }

/* Language toggle — globe + the name of the language you'll switch TO. Same
   structure in both directions, so the nav reads identically mirrored (no
   internal reordering that would make EN and AR look like different menus). */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 var(--space-3);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-sharp), color var(--dur-fast) var(--ease-sharp), border-color var(--dur-fast) var(--ease-sharp);
}
.lang-toggle:hover { background: var(--surface-raised); color: var(--text-primary); }
.lang-globe {
  width: 16px; height: 16px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.nav-cta {
  opacity: 0; pointer-events: none; transform: translateX(6px);
  transition: opacity var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp);
}
.site-nav.is-condensed .nav-cta { opacity: 1; pointer-events: auto; transform: translateX(0); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 1px; transition: transform var(--dur-fast) var(--ease-sharp), opacity var(--dur-fast) var(--ease-sharp); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Over the dark beacon hero (nav not yet condensed), the nav goes light so it
   sits on the cinematic scene; once scrolled onto the light page it reverts. */
.site-nav:not(.is-condensed) .wordmark { color: #F2F7FC; }
.site-nav:not(.is-condensed) .nav-links a { color: var(--slate-200); }
.site-nav:not(.is-condensed) .nav-links a:hover,
.site-nav:not(.is-condensed) .nav-links a.is-active { color: #fff; }
.site-nav:not(.is-condensed) .lang-toggle { color: var(--slate-200); border-color: rgba(255,255,255,0.22); }
.site-nav:not(.is-condensed) .lang-toggle:hover { background: rgba(255,255,255,0.10); color: #fff; }
.site-nav:not(.is-condensed) .nav-toggle span { background: #F2F7FC; }

/* ============================================================
   HERO — "The Beacon" — cinematic dark night scene (the one showpiece).
   Always dark regardless of theme; uses theme-independent ramp tokens.
   ============================================================ */
.hero--beacon {
  position: relative;
  /* Run full-bleed under the transparent nav for an immersive top edge. */
  margin-top: calc(-1 * var(--layout-topbar-h));
  padding-top: var(--layout-topbar-h);
  min-height: min(94vh, 860px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #070d15;
  isolation: isolate;
}

/* ---- the scene (decorative, aria-hidden) ----
   One geometry contract for the whole scene. Every light source — the beam, the
   halo, the reflection on the water — and every wire endpoint resolves to the
   lamp. Move the lamp by editing these values and the scene stays coherent.
   --lamp-y is DERIVED, not chosen: the tower spans 24%→66% of the hero and its
   SVG puts the lamp 16.25% down its own 400-unit box, so 24% + (0.1625 × 42%) ≈ 31%. */
.beacon-scene {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  --lamp-x: 78%;
  --lamp-y: 31%;
  --horizon: 66%;
}

.beacon-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(52% 56% at var(--lamp-x) var(--lamp-y), rgba(27,111,203,0.24), transparent 66%),
    /* night sky darkens with altitude; the air thickens and pales at the horizon */
    linear-gradient(to bottom, #04070d 0%, #070f1b 26%, #0c1c2e 50%, #14304a 64%, #17364f 66%);
}

/* Starfield. Sparse, uneven, and fading out into the haze above the horizon —
   a night sky is what tells you the dark is *air* and not just a dark panel. */
.beacon-stars {
  position: absolute; left: 0; right: 0; top: 0; height: var(--horizon);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,0.90), transparent),
    radial-gradient(1px 1px     at 27% 8%,  rgba(210,229,246,0.70), transparent),
    radial-gradient(1.4px 1.4px at 41% 26%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px     at 8% 42%,  rgba(210,229,246,0.60), transparent),
    radial-gradient(1.1px 1.1px at 55% 12%, rgba(255,255,255,0.65), transparent),
    radial-gradient(1px 1px     at 88% 20%, rgba(210,229,246,0.70), transparent),
    radial-gradient(1.3px 1.3px at 94% 46%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px     at 66% 34%, rgba(210,229,246,0.50), transparent),
    radial-gradient(1.2px 1.2px at 33% 52%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px     at 78% 6%,  rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px     at 19% 62%, rgba(210,229,246,0.40), transparent),
    radial-gradient(1.1px 1.1px at 48% 44%, rgba(255,255,255,0.45), transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 88%);
  animation: star-twinkle 7s ease-in-out infinite;
}
@keyframes star-twinkle { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.6; } }

/* The sea body, and the hard horizon that makes it a sea rather than a floor. */
.beacon-sea {
  position: absolute; left: 0; right: 0; top: var(--horizon); bottom: 0;
  background:
    linear-gradient(to bottom, #17364f 0%, #0c1e31 30%, #050a12 100%),
    radial-gradient(56% 88% at var(--lamp-x) 0%, rgba(66,132,212,0.16), transparent 64%);
}
.beacon-horizon {
  position: absolute; left: 0; right: 0; top: var(--horizon); height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(147,197,253,0.16) 18%, rgba(206,229,250,0.7) var(--lamp-x), rgba(147,197,253,0.16) 92%, transparent);
  box-shadow: 0 0 14px rgba(116,168,230,0.45);
}

/* THE WATER: hand-placed moonlight glints, not a texture.
   A uniform repeating line pattern reads as ruled paper, and turbulence-noise
   reads as static — both tried, both failed. What a night sea actually shows is
   a handful of separate horizontal specular dashes: dense and short near the
   horizon, longer and sparser as the water nears the viewer. So the glints are
   placed by hand, exactly the way the starfield above the horizon places its
   stars — sky and sea built with the same craft. Soft-ended dashes (each fades
   in/out along its own length), breathing gently as a group. */
.beacon-water {
  position: absolute; top: var(--horizon); bottom: 0; left: 0; right: 0;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(90deg, transparent, rgba(198,224,250,0.38) 30%, rgba(198,224,250,0.38) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.30) 30%, rgba(178,210,244,0.30) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(198,224,250,0.34) 30%, rgba(198,224,250,0.34) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(214,233,252,0.48) 30%, rgba(214,233,252,0.48) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(198,224,250,0.42) 30%, rgba(198,224,250,0.42) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.24) 30%, rgba(178,210,244,0.24) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.22) 30%, rgba(178,210,244,0.22) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(198,224,250,0.32) 30%, rgba(198,224,250,0.32) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.26) 30%, rgba(178,210,244,0.26) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.16) 30%, rgba(178,210,244,0.16) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.15) 30%, rgba(178,210,244,0.15) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(198,224,250,0.22) 30%, rgba(198,224,250,0.22) 70%, transparent),
    linear-gradient(90deg, transparent, rgba(178,210,244,0.12) 30%, rgba(178,210,244,0.12) 70%, transparent);
  background-size:
    64px 2px, 44px 1px, 84px 2px, 56px 2px, 76px 2px,
    90px 1px, 60px 1px, 110px 2px, 64px 1px, 80px 1px,
    130px 2px, 100px 2px, 150px 2px;
  background-position:
    8% 4%, 27% 7%, 52% 5%, 71% 9%, 84% 13%,
    18% 14%, 44% 19%, 66% 23%, 90% 28%, 12% 31%,
    38% 40%, 74% 44%, 55% 60%;
  animation: glint-breathe 7s ease-in-out infinite;
}
@keyframes glint-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }

/* The lamp's light pooling on the sea. Only a soft glow — it carries no texture
   of its own. The glints of .beacon-water ride on top of it, and that is what
   turns a glow into a reflection instead of a painted cone. */
.beacon-glitter {
  position: absolute; top: var(--horizon); bottom: 0;
  left: var(--lamp-x); width: 30%;
  transform: translate(calc(-50% + var(--par-x, 0px)), var(--par-y, 0px));
  mix-blend-mode: screen;
  background: linear-gradient(to bottom, rgba(147,197,253,0.30), rgba(66,132,212,0.07) 55%, transparent 85%);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40%, #000 60%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 40%, #000 60%, transparent);
  animation: glitter-breathe 5s ease-in-out infinite;
}
@keyframes glitter-breathe { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

/* Volumetric beam — a soft angular wedge thrown from the lamp.
   Screen blend adds light on the dark sky; soft edges via wide colour stops.

   The beam does NOT orbit. A full 360° rotation spends most of its cycle
   pointing away from the viewer — it sweeps empty sky behind the lamp, and the
   only thing you actually read is the wedge popping in and out of frame. So it
   sweeps the FRONT instead: out to the left, back across the viewer, out to the
   right, and back. The lamp is facing you the whole time; it is searching the
   water in front of it, which is what a beacon is for.

   Geometry: the conic wedge sits at roughly 0–10deg, i.e. it points straight UP
   at rotate(0). CSS angles run clockwise, so 90deg = right, 180deg = down/front,
   270deg = left. The swing below therefore runs 125deg (down-right) through
   180deg (straight at the viewer) to 235deg (down-left) — the front arc, never
   the sky behind. */
.beacon-sweep {
  position: absolute; left: var(--lamp-x); top: var(--lamp-y);
  width: 190vmax; height: 190vmax;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  mix-blend-mode: screen; opacity: 0.6;
  background: conic-gradient(from -14deg at 50% 50%,
    transparent 0deg,
    rgba(116,168,230,0.00) 6deg,
    rgba(116,168,230,0.16) 15deg,
    rgba(210,229,246,0.22) 19deg,
    rgba(116,168,230,0.16) 23deg,
    transparent 32deg,
    transparent 360deg);
  /* Brightest at the lamp, dissipating into the night — a beam is a volume of
     lit air, so it must lose itself with distance rather than end at an edge. */
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0,0,0,0.6) 20%, transparent 46%);
  mask-image: radial-gradient(circle at 50% 50%, #000 0%, rgba(0,0,0,0.6) 20%, transparent 46%);
  animation: beacon-sweep-front 11s var(--ease-sharp) infinite;
  will-change: transform;
}
/* Eased, not linear: the beam slows and hangs at each end of its arc, the way a
   real sweeping light does as it reverses, then accelerates back through the
   middle. A linear back-and-forth reads as a windscreen wiper. */
@keyframes beacon-sweep-front {
  0%   { transform: translate(calc(-50% + var(--par-x, 0px)), calc(-50% + var(--par-y, 0px))) rotate(125deg); }  /* out to the right */
  50%  { transform: translate(calc(-50% + var(--par-x, 0px)), calc(-50% + var(--par-y, 0px))) rotate(235deg); }  /* out to the left  */
  100% { transform: translate(calc(-50% + var(--par-x, 0px)), calc(-50% + var(--par-y, 0px))) rotate(125deg); }
}

/* Static halo so the lantern always reads as a light source between passes. */
.beacon-halo {
  position: absolute; left: var(--lamp-x); top: var(--lamp-y);
  width: 220px; height: 220px;
  transform: translate(calc(-50% + var(--par-x, 0px)), calc(-50% + var(--par-y, 0px)));
  background: radial-gradient(circle, rgba(214,233,252,0.34), rgba(27,111,203,0.13) 36%, transparent 66%);
  mix-blend-mode: screen;
  animation: lamp-flash 11s var(--ease-sharp) infinite;
}
/* The flash rides the SAME 11s clock as the beam. The sweep faces the viewer at
   25% and 75% of its arc, so the lamp blooms exactly then — the glass flares as
   the optic comes round to you, and dims as it turns away. If these two ever
   drift apart, the light stops looking like it is coming from the lamp. */
@keyframes lamp-flash {
  0%,  100% { opacity: 0.5; }
  25%       { opacity: 1; }
  50%       { opacity: 0.5; }
  75%       { opacity: 1; }
}

/* holds the tower and its wiring — same --par offset as the light above, so the
   link lines stay welded to the lamp they terminate on */
.beacon-stage {
  position: absolute; inset: 0;
  transform: translate(var(--par-x, 0px), var(--par-y, 0px));
  will-change: transform;
}

/* The wiring: each operational domain run home to the lantern. Two passes over
   the same six paths — a continuous wire (without it the nodes look like they
   are floating unattached) and the traffic flowing along it.
   NB: stroke-width is in CSS px here because of vector-effect: non-scaling-stroke,
   NOT in viewBox units. The old 0.15 rendered as a 0.15px scratch. */
.beacon-links { position: absolute; inset: 0; width: 100%; height: 100%; }
.beacon-links line { vector-effect: non-scaling-stroke; }
.beacon-links .blink-wire { stroke-width: 1; opacity: 0.26; }
.beacon-links .blink {
  stroke-width: 1.4; opacity: 0.8;
  stroke-dasharray: 1.4 4; stroke-dashoffset: 0;
  /* positive drift = dashes travel TOWARD the lamp: guided home, not broadcast out */
  animation: link-flow 2.8s linear infinite;
}
.beacon-links .blink:nth-child(2n) { animation-duration: 3.6s; }
.beacon-links .blink:nth-child(3n) { animation-duration: 3.1s; }
@keyframes link-flow { to { stroke-dashoffset: 27; } }

/* ---- the islet ----
   A dark landmass with real body — not a thin outlined sliver (that read as an
   eyebrow). Its waterline sits at y=46 of its own 90-unit box, and the numbers
   below pin that line exactly onto --horizon: height 12% of the hero, so the
   offset is 46/90 × 12% ≈ 6.1% above the horizon. Sized by HEIGHT, same axis as
   the tower, so the islet stays ~3× the tower's width at every viewport. Painted
   after the tower in the DOM: its crest overlaps the plinth, and the tower rises
   from behind it. No outline stroke — silhouette contrast against the pale
   horizon band is what draws the shape. */
.beacon-islet {
  position: absolute; left: var(--lamp-x); top: calc(var(--horizon) - 6.1%);
  height: 12%; width: auto; aspect-ratio: 300 / 90;
  transform: translateX(-50%);
  overflow: visible;
}
.bi-land { fill: url(#bi-land-grad); }
/* the islet mirrored into the water: dark, soft, and quieter than the real
   thing — a reflection is the one cue that says "sitting in water" that no
   amount of shoreline drawing can say */
.bi-reflection { fill: #02060c; opacity: 0.5; filter: url(#bi-soft); }

/* ---- the lighthouse ----
   Pushed back to a middle distance: its base sits on the horizon and the islet's
   crest overlaps its plinth, so it stands IN the scene instead of being pasted
   onto it. Even at this size a flat cut-out reads as cardboard, so the tower
   stays MODELLED: a cylinder, not a trapezoid. That means three things, and all
   three are why it holds up:
     · CURVATURE — a vertical light-to-dark ramp across the shaft, so the stone
       turns away from us at the edges instead of ending on a flat rim.
     · A LIT SIDE — the moon rakes it from the left, and the lantern spills its
       own light down the top of the shaft. Two light sources, both consistent.
     · TEXTURE — faint courses of stone, and grain, so the surface isn't a
       vector fill. Flat #hex is the thing that reads as "illustration".
   The banding stays whisper-faint: candy stripes are the fastest way back to a
   cartoon, no matter how well the rest is modelled. */
.beacon-tower {
  position: absolute; left: var(--lamp-x); top: 24%;
  height: 42%; width: auto; aspect-ratio: 130 / 400;
  transform: translateX(-50%);
  overflow: visible;
}
.bt-shaft    { fill: url(#bt-cyl-grad); }   /* the cylinder: curvature, not a flat fill */
.bt-band     { fill: rgba(198,224,250,0.045); }
.bt-course   { stroke: rgba(4,8,14,0.30); stroke-width: 0.6; }  /* courses of stone */
/* Grain gives the stone a surface, but too much of it lights the tower up like
   daylit concrete. Night stone is mostly shadow with a little tooth. */
.bt-grain    { fill: url(#bt-grain); opacity: 0.22; mix-blend-mode: overlay; }
.bt-edge     { fill: none; stroke: rgba(147,197,253,0.22); stroke-width: 0.8; }
.bt-lit      { fill: url(#bt-lit-grad); }   /* the lamp spilling down its own masonry */
.bt-deck     { fill: #0b1420; stroke: rgba(147,197,253,0.26); stroke-width: 0.8; }
.bt-rail     { fill: none; stroke: rgba(147,197,253,0.34); stroke-width: 0.7; }
.bt-roof     { fill: url(#bt-roof-grad); stroke: rgba(147,197,253,0.26); stroke-width: 0.8; }
.bt-glass    { fill: url(#bt-glass-grad); }
.bt-astragal { stroke: rgba(6,11,19,0.92); stroke-width: 1.2; }
.bt-finial   { fill: none; stroke: rgba(147,197,253,0.4); stroke-width: 0.9; }
.bt-door     { fill: #05090f; stroke: rgba(147,197,253,0.18); stroke-width: 0.6; }
.bt-window   { fill: rgba(214,233,252,0.10); stroke: rgba(147,197,253,0.20); stroke-width: 0.5; }
/* the lamp — the single point every other light in the scene resolves to */
.bt-lamp     { fill: #ffffff; filter: url(#bt-bloom); animation: lamp-flash 11s var(--ease-sharp) infinite; }
/* the lantern's glow washing the gallery and the stone just beneath it */
.bt-lantern-wash { fill: url(#bt-wash-grad); mix-blend-mode: screen; animation: lamp-flash 11s var(--ease-sharp) infinite; }

/* Domain nodes — the ISP's real operational surfaces, wired to the hub. */
.beacon-nodes { position: absolute; inset: 0; }
.bnode {
  position: absolute; left: var(--nx); top: var(--ny); transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 5px var(--space-3);
  font-family: var(--font-mono); font-size: var(--text-xs); white-space: nowrap;
  color: var(--ocean-100); background: rgba(13,24,34,0.72);
  border: 1px solid rgba(116,168,230,0.35); border-radius: var(--radius-pill);
  box-shadow: 0 0 0 3px rgba(7,13,21,0.4), 0 8px 20px rgba(0,0,0,0.35);
  backdrop-filter: blur(2px);
  animation: node-float 6s var(--ease-sharp) infinite; animation-delay: var(--nd);
}
.bnode::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ocean-300); box-shadow: 0 0 8px rgba(116,168,230,0.9);
}
.bnode--ok { color: var(--sage-200); border-color: rgba(94,200,154,0.4); }
.bnode--ok::before { background: var(--sage-300); box-shadow: 0 0 8px rgba(94,200,154,0.9); }
@keyframes node-float { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, calc(-50% - 6px)); } }

.beacon-particles { position: absolute; inset: 0; }
.particle {
  position: absolute; left: var(--px); top: var(--py);
  width: var(--ps, 3px); height: var(--ps, 3px); border-radius: 50%;
  background: var(--pc, rgba(147,197,253,0.7));
  animation: particle-drift var(--pd, 14s) ease-in-out var(--pdl, 0s) infinite;
  will-change: transform, opacity;
}
@keyframes particle-drift {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: var(--po, 0.7); }
  80% { opacity: var(--po, 0.7); }
  100% { transform: translate(var(--pdx, 20px), var(--pdy, -40px)); opacity: 0; }
}

/* Left scrim keeps the headline legible as the beam sweeps behind it. */
.beacon-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(100deg, #070d15 0%, rgba(7,13,21,0.82) 30%, rgba(7,13,21,0.2) 55%, transparent 72%);
}

/* ---- content overlay ---- */
.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: var(--layout-content-max);
  margin: 0 auto; padding: var(--space-16) var(--space-6);
}
.hero-copy { max-width: 40rem; }

/* Kicker, not a badge. The old pill — tinted fill, blur, pulsing status dot,
   mono caps — is the stock "AI SaaS" chip. This is just a quiet standfirst line
   in the body face, led by a short accent rule. Reads as editorial, not UI. */
.hero-kicker {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--slate-300);
  letter-spacing: 0.01em; margin-bottom: var(--space-6);
}
.hero-kicker-tick {
  width: 22px; height: 1px; background: var(--ocean-400); flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.3rem + 4vw, 4rem);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tighter);
  line-height: var(--leading-tight);
  color: #F2F7FC;
}
.hero-line { display: block; }
.hero-title .accent { color: var(--ocean-300); }
.hero-sub { margin-top: var(--space-5); font-size: var(--text-lg); color: var(--slate-200); max-width: 48ch; }
.hero-actions { margin-top: var(--space-8); display: flex; gap: var(--space-4); flex-wrap: wrap; }
.btn-play {
  width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor; margin-right: 2px;
}
.btn-beacon { background: rgba(255,255,255,0.06); color: #F2F7FC; border: 1px solid rgba(255,255,255,0.22); }
.btn-beacon:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }

/* Resting frame: the sea is lit and the beam is cast out over the front — it
   simply doesn't move. Everything resolves to its final state; nothing is
   hidden. 180deg = facing the viewer, the midpoint of the arc it would sweep. */
@media (prefers-reduced-motion: reduce) {
  .beacon-sweep { animation: none; transform: translate(-50%, -50%) rotate(180deg); }
  .beacon-stars, .beacon-water, .beacon-glitter,
  .beacon-halo, .bt-lamp, .bnode, .beacon-links .blink { animation: none; }
  .beacon-halo, .bt-lamp { opacity: 1; }
  .beacon-links .blink { stroke-dasharray: none; }
}

/* ---- LOAD CHOREOGRAPHY — "power-on", pure CSS, plays once on load ---- */
.boot { opacity: 0; animation: boot-in var(--dur-slower) var(--ease-out) forwards; animation-delay: calc(var(--boot-order, 0) * 90ms + 120ms); }
@keyframes boot-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .boot { animation: none; opacity: 1; transform: none; }
}

/* ---- CONSOLE CHROME — the shared instrument language. Now used only by
   the white-label switcher panel; the hero renders the beacon scene. ---- */
.console-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.console-topbar { display: flex; align-items: center; gap: var(--space-2); }
.console-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-400); }
@keyframes pulse-dot {
  0%   { opacity: 1;    box-shadow: 0 0 0 0 rgba(94,200,154,0.5); }
  70%  { opacity: 0.6;  box-shadow: 0 0 0 6px rgba(94,200,154,0); }
  100% { opacity: 1;    box-shadow: 0 0 0 0 rgba(94,200,154,0); }
}
.console-tenant { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-sidebar); }

.console-body { display: flex; flex-direction: column; justify-content: space-between; flex: 1; }
.console-row { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: var(--space-3); border-bottom: 1px solid var(--surface-sidebar-hover); }
.console-label { font-size: var(--text-xs); color: var(--text-sidebar-muted); text-transform: uppercase; letter-spacing: var(--tracking-wider); }
.console-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); color: var(--text-sidebar-active); display: inline-block; }

/* ============================================================
   THE PROBLEM — dark room, disagreement strip
   ============================================================ */
/* ---- split room: copy left, living ecosystem right ---- */
.problem2 { overflow: hidden; }
.problem2-grid {
  max-width: var(--layout-content-max); margin: 0 auto;
  padding: var(--space-24) var(--space-6);
  display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(var(--space-10), 5vw, var(--space-24)); align-items: center;
}
.problem2-copy { min-width: 0; }
.problem2 .section-title--dark { margin: var(--space-4) 0 var(--space-6); max-width: 16ch; }
.problem2-body { display: flex; flex-direction: column; gap: var(--space-4); font-size: var(--text-md); color: var(--slate-200); max-width: 46ch; }
.problem2-turn { color: #EAF2FB; font-weight: var(--weight-medium); }
.problem2-legend {
  list-style: none; margin: var(--space-8) 0 var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-2xs);
  letter-spacing: 0.03em; color: var(--slate-400);
}
.problem2-legend li { display: flex; align-items: center; gap: var(--space-2); }
.p2l-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.p2l-swatch--off { background: var(--gold-400); box-shadow: 0 0 8px rgba(217,158,39,0.6); }
.p2l-swatch--on  { background: var(--sage-400); box-shadow: 0 0 8px rgba(48,173,122,0.6); }

/* ============================================================
   THE ECOSYSTEM — the animated proof. Solid instrument panels on a dark
   field, ocean-blue core, amber/red disconnected → green connected. No glass.
   The whole thing runs on one class: .is-synced on #ecosystem flips every
   state at once. JS only fires packets and toggles that class.
   ============================================================ */
/* No panel. The ecosystem sits directly in the dark room — no border, no fill,
   no box-shadow, no hard clip. Instead of a card with edges, it's a field of
   light on the section itself: a soft central bloom, and grid/wires that fade
   to nothing before they reach any edge. Nothing announces "a box." */
.ecosystem {
  position: relative; min-width: 0;
  aspect-ratio: 1 / 1;
  background: transparent;
  isolation: isolate;
}

/* thin technical grid — faded to nothing well before the edges so it dissolves
   into the section rather than terminating on a border */
.eco-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(116,168,230,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(116,168,230,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 18%, transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 18%, transparent 62%);
}
/* central glow — the only "fill" left. A wide, soft bloom of light on the
   section behind the core. Amber-neutral while disconnected, ocean when synced. */
.eco-glow {
  position: absolute; left: 50%; top: 50%; width: 90%; height: 90%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(217,158,39,0.10), transparent 60%);
  transition: background var(--dur-slower) var(--ease-out); pointer-events: none;
}
.ecosystem.is-synced .eco-glow {
  background: radial-gradient(circle, rgba(27,111,203,0.22), transparent 60%);
}

/* ---- wires ---- */
.eco-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.eco-wire {
  fill: none; stroke: rgba(147,168,196,0.28); stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 4;  /* broken — a severed connection */
  transition: stroke var(--dur-slower) var(--ease-out), stroke-width var(--dur-slower) var(--ease-out);
}
.ecosystem.is-synced .eco-wire {
  stroke: rgba(66,132,212,0.7); stroke-width: 1.4;
  stroke-dasharray: none;  /* healed — one clean line */
  filter: drop-shadow(0 0 3px rgba(66,132,212,0.5));
}

/* ---- data packets (spawned by JS, animate node → core) ---- */
.eco-packets { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
/* position is driven by JS (rAF, in %); this is just the glowing dot. Amber
   while disconnected, cool blue once the core is synced. */
.eco-packet {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-200);
  box-shadow: 0 0 8px 2px rgba(217,158,39,0.7);
}
.ecosystem.is-synced .eco-packet {
  background: var(--ocean-200);
  box-shadow: 0 0 9px 2px rgba(116,168,230,0.85);
}

/* ---- the Manara Core ---- */
.eco-core {
  position: absolute; left: var(--cx); top: var(--cy); z-index: 4;
  transform: translate(-50%, -50%);
  width: clamp(96px, 22%, 132px); aspect-ratio: 1;
}
.eco-core-ring {
  position: absolute; inset: -18%; border-radius: 50%;
  border: 1px solid rgba(217,158,39,0.4);
  transition: border-color var(--dur-slower) var(--ease-out);
}
.eco-core-ring--2 { inset: -40%; border-color: rgba(217,158,39,0.18); }
.ecosystem.is-synced .eco-core-ring   { border-color: rgba(66,132,212,0.55); animation: core-pulse 3s var(--ease-sharp) infinite; }
.ecosystem.is-synced .eco-core-ring--2 { border-color: rgba(66,132,212,0.25); animation: core-pulse 3s var(--ease-sharp) infinite 0.4s; }
@keyframes core-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.7; } }

.eco-core-body {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: radial-gradient(circle at 50% 34%, #2a2013, #14202e 78%);
  border: 1px solid rgba(217,158,39,0.5);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 12px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(217,158,39,0.14);
  transition: background var(--dur-slower) var(--ease-out), border-color var(--dur-slower) var(--ease-out), box-shadow var(--dur-slower) var(--ease-out);
}
.ecosystem.is-synced .eco-core-body {
  background: radial-gradient(circle at 50% 34%, #163457, #0d1c2e 78%);
  border-color: rgba(66,132,212,0.7);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 12px 34px rgba(27,111,203,0.4), inset 0 0 24px rgba(66,132,212,0.28);
}
.eco-core-mark {
  font-family: var(--font-display); font-weight: var(--weight-bold);
  font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1;
  color: var(--gold-300); transition: color var(--dur-slower) var(--ease-out);
}
.ecosystem.is-synced .eco-core-mark { color: #CFE4FB; }
.eco-core-label {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em;
  color: var(--slate-400);
}
.eco-core-state {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em;
  color: var(--gold-300); transition: color var(--dur-slower) var(--ease-out);
}
.ecosystem.is-synced .eco-core-state { color: var(--sage-300); }

/* ---- the system nodes ---- */
.eco-nodes { position: absolute; inset: 0; list-style: none; z-index: 3; }
.eco-node {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: var(--space-2); align-items: center;
  padding: 8px 12px; min-width: 118px;
  background: linear-gradient(160deg, #16273a, #101d2b);
  border: 1px solid rgba(147,168,196,0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  animation: eco-float var(--fdur, 6s) var(--ease-sharp) infinite; animation-delay: var(--fdelay, 0s);
  transition: border-color var(--dur-slower) var(--ease-out), box-shadow var(--dur-slower) var(--ease-out), transform var(--dur-base) var(--ease-out);
  will-change: transform;
}
.eco-node-icon {
  grid-row: 1 / 3; width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(147,168,196,0.12); color: var(--slate-300);
  font-size: 14px; line-height: 1;
  transition: background var(--dur-slower) var(--ease-out), color var(--dur-slower) var(--ease-out);
}
.eco-node-name {
  font-family: var(--font-display); font-size: var(--text-sm); font-weight: var(--weight-medium);
  color: #E4ECF5; align-self: end;
}
.eco-node-status {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.04em;
  color: var(--gold-300); align-self: start; margin-top: 2px;
  display: flex; align-items: center; gap: 5px;
}
/* disconnected: the error the node is reporting, with an amber warning dot */
.eco-node-status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-400); box-shadow: 0 0 6px rgba(217,158,39,0.8);
  transition: background var(--dur-slower) var(--ease-out), box-shadow var(--dur-slower) var(--ease-out);
}
.eco-node-status::after { content: attr(data-err); }
/* two nodes read as hard errors (red) rather than warnings, for tonal variety */
.eco-node:nth-child(3) .eco-node-status,
.eco-node:nth-child(5) .eco-node-status { color: var(--rose-300); }
.eco-node:nth-child(3) .eco-node-status::before,
.eco-node:nth-child(5) .eco-node-status::before { background: var(--rose-400); box-shadow: 0 0 6px rgba(220,69,69,0.8); }

/* connected: every node flips to green, wire healed, panel lifts to ocean */
.ecosystem.is-synced .eco-node {
  border-color: rgba(66,132,212,0.4);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4), 0 0 0 1px rgba(66,132,212,0.14);
}
.ecosystem.is-synced .eco-node-icon { background: rgba(66,132,212,0.18); color: var(--ocean-200); }
.ecosystem.is-synced .eco-node-status { color: var(--sage-300) !important; }
.ecosystem.is-synced .eco-node-status::before { background: var(--sage-400) !important; box-shadow: 0 0 6px rgba(48,173,122,0.85) !important; }
.ecosystem.is-synced .eco-node-status::after { content: "Connected"; }

.eco-node:hover { transform: translate(-50%, -50%) scale(1.04); z-index: 5; }

@keyframes eco-float {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50%      { transform: translate(-50%, -50%) translateY(-5px); }
}

/* caption */
.eco-caption {
  position: absolute; left: var(--space-4); bottom: var(--space-4); z-index: 4;
  display: flex; align-items: center; gap: var(--space-2);
  font-family: var(--font-mono); font-size: var(--text-2xs); letter-spacing: 0.04em;
  color: var(--slate-400);
}
.eco-caption-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold-400); box-shadow: 0 0 8px rgba(217,158,39,0.7);
  transition: background var(--dur-slower) var(--ease-out), box-shadow var(--dur-slower) var(--ease-out);
}
.ecosystem.is-synced .eco-caption { color: var(--sage-300); }
.ecosystem.is-synced .eco-caption-dot { background: var(--sage-400); box-shadow: 0 0 8px rgba(48,173,122,0.8); }

/* reduced motion: no float, no packets — the section resolves straight to the
   connected end-state so it still tells the story, just without movement. */
@media (prefers-reduced-motion: reduce) {
  .eco-node { animation: none; }
  .eco-core-ring { animation: none !important; }
  .eco-packet { display: none; }
}

/* ============================================================
   PLATFORM — pillars, varied rhythm
   ============================================================ */
/* Bento card grid: P1 spans full width as the section hero, P2–P5 form a
   2×2 grid beneath. Deliberately varied (1 wide + 4 equal), never five
   identical rows. Every card is a real elevation surface (v1.4 §10). */
.pillars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); }
.pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-sharp), border-color var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp);
}
/* Ocean accent bar wipes in along the top edge on hover — the card "powers on". */
.pillar::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ocean-500), var(--ocean-300));
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-slow) var(--ease-out);
}
.pillar:hover { box-shadow: var(--shadow-lg); border-color: var(--border-default); transform: translateY(-3px); }
.pillar:hover::before { transform: scaleX(1); }

.pillar--feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: var(--space-10);
  row-gap: var(--space-4);
  padding: var(--space-10);
  background:
    radial-gradient(120% 160% at 100% 0%, var(--bg-info), transparent 55%),
    var(--surface-card);
}

.pillar-head { display: flex; align-items: center; gap: var(--space-3); }
.pillar-index {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: var(--weight-medium);
  color: var(--ocean-600); background: var(--bg-info);
  padding: 2px var(--space-2); border-radius: var(--radius-xs);
}

/* Icon chip — fills with ocean on hover, the mark flips to white. */
.pillar-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--bg-info); flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-sharp);
}
.pillar--feature .pillar-icon { width: 56px; height: 56px; }
.pillar:hover .pillar-icon { background: var(--ocean-500); }
.pillar:hover .pillar-icon .mark { stroke: #fff; }
.mark { width: var(--icon-lg); height: var(--icon-lg); stroke: var(--ocean-500); fill: none; stroke-width: var(--icon-stroke-base); stroke-linecap: round; stroke-linejoin: round; }
.mark--lg { width: var(--icon-xl); height: var(--icon-xl); }

/* Pillar marks draw themselves in on reveal — the one restrained "wow" icon
   moment, per the design language (used nowhere else). 64 comfortably covers
   these small hand-drawn paths without a per-icon path-length measurement. */
.pillar .mark {
  stroke-dasharray: 64;
  stroke-dashoffset: 64;
  transition: stroke-dashoffset 900ms var(--ease-out);
}
.pillar .mark.is-drawn { stroke-dashoffset: 0; }
.mark--sm { width: var(--icon-sm); height: var(--icon-sm); }
.mark--chevron { width: var(--icon-md); height: var(--icon-md); stroke: var(--text-tertiary); stroke-width: var(--icon-stroke-base); fill: none; stroke-linecap: round; stroke-linejoin: round; margin-left: auto; transition: transform var(--dur-base) var(--ease-sharp); }

.pillar-head h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); }
.pillar--feature .pillar-head { grid-column: 1; grid-row: 1; }
.pillar--feature .pillar-head h3 { font-size: var(--text-3xl); }
.pillar-desc { color: var(--text-secondary); font-size: var(--text-sm); }
.pillar--feature .pillar-desc { grid-column: 1; grid-row: 2; font-size: var(--text-md); max-width: 48ch; }

/* Schema entities read as a chip row at each card's foot (margin-top:auto
   keeps the row bottom-aligned so cards in a row line up). */
.pillar-schema { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-2); }
.pillar-schema li {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary);
  background: var(--surface-raised); border: 1px solid var(--border-subtle);
  padding: 3px var(--space-3); border-radius: var(--radius-pill);
}
/* On the hero card the schema becomes a bordered instrument panel on the right. */
.pillar--feature .pillar-schema {
  grid-column: 2; grid-row: 1 / 3; align-self: stretch; align-content: center;
  flex-direction: column; flex-wrap: nowrap; gap: 0; margin: 0; padding: var(--space-2) var(--space-5);
  background: var(--surface-raised); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.pillar--feature .pillar-schema li { background: transparent; border: none; border-bottom: 1px solid var(--border-subtle); border-radius: 0; padding: var(--space-3) 0; width: 100%; }
.pillar--feature .pillar-schema li:last-child { border-bottom: none; }


/* ============================================================
   WHITE-LABEL SWITCHER
   ============================================================ */
.whitelabel { background: var(--surface-page); }
.switcher { display: grid; grid-template-columns: minmax(0,6fr) minmax(0,4fr); gap: var(--space-10); align-items: center; }
.switcher > * { min-width: 0; }

.switcher-panel {
  position: relative;
  background: var(--surface-sidebar);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  color: var(--text-sidebar);
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: var(--space-5);
  transition: background var(--dur-slow) var(--ease-sharp);
}
.switcher-panel .console-topbar { grid-column: 1 / -1; }
.switcher-side { grid-row: 2; display: flex; flex-direction: column; gap: var(--space-2); }
.switcher-side span { font-size: var(--text-sm); color: var(--text-sidebar-muted); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); }
.switcher-side span.is-active { color: #fff; font-weight: var(--weight-medium); transition: background var(--dur-slow) var(--ease-sharp); }
.switcher-panel .console-body { grid-row: 2; }
.switcher-cta { grid-column: 1 / -1; align-self: end; color: #fff; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: var(--weight-medium); transition: background var(--dur-slow) var(--ease-sharp); }

.tenant-chips { display: flex; gap: var(--space-2); }
.tenant-chip {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-default);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease-sharp);
}
.tenant-chip.is-active { background: var(--text-primary); color: var(--surface-card); border-color: var(--text-primary); }

.custom-tenant[hidden] { display: none; }
.custom-tenant { margin-top: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.swatch-picker { display: flex; gap: var(--space-2); }
.swatch-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.swatch-btn.is-active { border-color: var(--text-primary); }

.switcher-controls { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.switcher-tag { font-size: var(--text-sm); color: var(--text-secondary); }

/* ============================================================
   PROOF — copy + honest stat tiles (shares the hero's stat language)
   ============================================================ */
.proof-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-16); align-items: center; }
.proof-grid > * { min-width: 0; }
.proof-copy .btn-ghost--dark { margin-top: var(--space-6); }

.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.stat-tile {
  background: var(--surface-sidebar-hover);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: border-color var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp);
}
.stat-tile:hover { border-color: rgba(66,132,212,0.4); transform: translateY(-2px); }
.stat-tile-value {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight); color: #EEF4FB; line-height: 1;
  display: flex; align-items: baseline;
}
.stat-tile-value--ok { color: var(--sage-300); }
.stat-tile-sep { color: var(--ocean-400); padding: 0 2px; }
.stat-tile-label { margin-top: var(--space-3); font-size: var(--text-sm); color: var(--slate-300); line-height: var(--leading-snug); }

/* ============================================================
   AUDIENCE
   ============================================================ */
.audience-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.audience-item { padding: var(--space-6); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); transition: box-shadow var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp); }
.audience-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.audience-tag { display: inline-block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-info); background: var(--bg-info); padding: 2px var(--space-2); border-radius: var(--radius-xs); margin-bottom: var(--space-3); }
.audience-item p { font-size: var(--text-sm); color: var(--text-secondary); }

/* ============================================================
   PRICING
   ============================================================ */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); align-items: start; }
.plan {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--card-p);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp);
}
.plan:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); border-color: var(--border-strong); }
.plan--featured { border: 2px solid var(--ocean-500); box-shadow: var(--shadow-lg); position: relative; }
.plan--featured:hover { box-shadow: var(--shadow-xl), 0 0 24px rgba(27,111,203,0.18); transform: translateY(-4px); }
.plan-badge { display: inline-block; background: var(--bg-info); color: var(--text-info); font-size: var(--text-xs); font-weight: var(--weight-semibold); padding: var(--badge-py) var(--badge-px); border-radius: var(--radius-pill); margin-bottom: var(--space-2); }
.plan-name { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); }
.plan-for { color: var(--text-secondary); font-size: var(--text-sm); margin-top: var(--space-1); }
.plan-price { margin: var(--space-5) 0; }
.plan-amount { font-family: var(--font-display); font-size: var(--text-4xl); font-weight: var(--weight-bold); }
.plan-cycle { color: var(--text-secondary); font-size: var(--text-sm); }
.plan-spec { display: flex; flex-direction: column; gap: var(--space-2); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); padding: var(--space-4) 0; margin-bottom: var(--space-4); }
.plan-spec li { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.plan-spec li span:last-child { color: var(--text-secondary); font-weight: var(--weight-medium); }
.plan-includes { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-6); font-size: var(--text-sm); color: var(--text-secondary); }
.plan-inc-lead { color: var(--text-secondary); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wider); }
.plan-cta { width: 100%; }
.pricing-escape { margin-top: var(--space-8); font-size: var(--text-sm); color: var(--text-secondary); }
.pricing-escape a { color: var(--text-link); }

/* ============================================================
   FAQ
   ============================================================ */
.faq-list { display: flex; flex-direction: column; gap: var(--space-3); }
.faq-item { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2) var(--space-5); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) 0; font-weight: var(--weight-medium); cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary .mark--chevron { transform: rotate(180deg); }
.faq-answer { padding-bottom: var(--space-4); color: var(--text-secondary); max-width: 65ch; }

/* ============================================================
   FINAL CTA + FORM
   ============================================================ */
.final-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--space-16); align-items: start; }
.final-actions { margin-top: var(--space-8); display: flex; gap: var(--space-4); flex-wrap: wrap; }

.final-steps { margin-top: var(--space-12); display: flex; flex-direction: column; gap: var(--space-6); border-top: 1px solid var(--border-subtle); padding-top: var(--space-8); }
.final-steps li { display: grid; grid-template-columns: auto minmax(0,1fr); gap: var(--space-4); align-items: start; }
.final-step-num { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--ocean-500); font-weight: var(--weight-medium); padding-top: 2px; }
.final-steps h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-bottom: var(--space-1); }
.final-steps p { color: var(--text-secondary); font-size: var(--text-sm); max-width: 46ch; }

.demo-form {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--card-p);
  display: flex; flex-direction: column; gap: var(--space-5);
}
.demo-form-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.bot-field { position: absolute; left: -9999px; }
.field { display: flex; flex-direction: column; gap: var(--space-2); }
.field-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary); }
.field-input {
  height: var(--input-h-lg); padding: 0 var(--input-px);
  border: 1px solid var(--border-default); border-radius: var(--input-radius);
  background: var(--surface-card); color: var(--text-primary);
  transition: border-color var(--dur-fast) var(--ease-sharp), box-shadow var(--dur-fast) var(--ease-sharp);
}
.field-input:focus { border-color: var(--border-focus); box-shadow: var(--shadow-focus); outline: none; }
.field.has-error .field-input { border-color: var(--border-error); }
.field.has-error .field-input:focus { box-shadow: var(--shadow-focus-error); }
.field-error { color: var(--text-danger); font-size: var(--text-xs); }
.demo-form-submit { width: 100%; }
.demo-form-success[hidden], .demo-form-fallback[hidden] { display: none; }
.demo-form-success, .demo-form-fallback { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.demo-form-success { color: var(--text-success); }
.demo-form-success .mark { stroke: var(--text-success); }
.demo-form-fallback { color: var(--text-danger); }
.demo-form-fallback a { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--surface-sidebar); color: var(--text-sidebar); }
.footer-inner {
  max-width: var(--layout-content-max); margin: 0 auto; padding: var(--space-16) var(--space-6) var(--space-10);
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--space-10);
}
/* .footer-nav is a semantic wrapper only — display:contents lets its three
   .footer-col children act as direct grid items of .footer-inner, so the
   grid actually gets one real child per declared column. */
.footer-nav { display: contents; }
.footer-tag { color: var(--text-sidebar); font-size: var(--text-sm); margin-top: var(--space-3); max-width: 34ch; }
.footer-col-head { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: var(--tracking-wider); color: var(--text-sidebar); margin-bottom: var(--space-3); }
.footer-links { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.footer-links a, .footer-link-btn { color: var(--text-sidebar); font-size: var(--text-sm); text-align: left; }
.footer-links a:hover, .footer-link-btn:hover { color: #fff; }
.footer-demo-cta { margin-top: var(--space-2); }
.footer-mail { color: var(--text-sidebar); font-size: var(--text-sm); text-decoration: underline; }

.footer-newsletter { margin-top: var(--space-6); max-width: 340px; }
.footer-newsletter-label { display: block; font-size: var(--text-xs); color: var(--text-sidebar); margin-bottom: var(--space-2); }
.footer-newsletter-row { display: flex; gap: var(--space-2); }
.footer-newsletter-input {
  flex: 1; min-width: 0; height: var(--input-h-md); padding: 0 var(--input-px);
  background: var(--surface-sidebar-hover); border: 1px solid var(--surface-sidebar-hover);
  border-radius: var(--input-radius); color: #fff; font-size: var(--text-sm);
}
.footer-newsletter-input::placeholder { color: var(--text-sidebar-muted); }
.footer-newsletter-input:focus { border-color: var(--ocean-400); outline: none; box-shadow: var(--shadow-focus); }
.footer-newsletter-submit { height: var(--input-h-md); flex-shrink: 0; }
.footer-newsletter .field-error { color: var(--rose-300); font-size: var(--text-xs); margin-top: var(--space-2); }
.footer-newsletter-success, .footer-newsletter-fallback { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); margin-top: var(--space-2); }
.footer-newsletter-success[hidden], .footer-newsletter-fallback[hidden] { display: none; }
.footer-newsletter-success { color: var(--sage-300); }
.footer-newsletter-success .mark { stroke: var(--sage-300); }
.footer-newsletter-fallback { color: var(--rose-300); }
.footer-newsletter-fallback a { text-decoration: underline; }

.footer-trust {
  max-width: var(--layout-content-max); margin: 0 auto; padding: 0 var(--space-6) var(--space-8);
  display: flex; gap: var(--space-8); flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-sidebar);
}
.footer-base {
  border-top: 1px solid var(--surface-sidebar-hover);
  max-width: var(--layout-content-max); margin: 0 auto; padding: var(--space-5) var(--space-6);
  display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-sidebar);
}

/* ============================================================
   2-MIN TOUR
   ============================================================ */
.tour-overlay[hidden] { display: none; }
.tour-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: var(--surface-overlay);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
}
.tour-dialog {
  background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  max-width: 520px; width: 100%; padding: var(--space-8);
  position: relative;
}
.tour-close { position: absolute; top: var(--space-4); right: var(--space-4); width: 32px; height: 32px; font-size: var(--text-2xl); line-height: 1; color: var(--text-tertiary); border-radius: var(--radius-sm); }
.tour-close:hover { background: var(--surface-raised); }
.tour-step { display: none; }
.tour-step.is-active { display: block; }
.tour-step-index { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); }
.tour-step h3 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: var(--space-2) 0 var(--space-3); }
.tour-step p { color: var(--text-secondary); margin-bottom: var(--space-5); }
.tour-visual { background: var(--surface-sidebar); color: var(--text-sidebar); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-5); }
.tour-row { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.tour-row--total, .tour-row--ok { border-top: 1px solid var(--surface-sidebar-hover); padding-top: var(--space-2); margin-top: var(--space-1); font-weight: var(--weight-semibold); }
.tour-row--ok { color: var(--sage-300); }
.tag-ok { color: var(--sage-300); font-size: var(--text-xs); }
.tag-warn { color: var(--gold-300); font-size: var(--text-xs); }
.tour-nav { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-4); }
.tour-dots { display: flex; gap: var(--space-2); }
.tour-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--border-default); }
.tour-dots span.is-active { background: var(--ocean-500); }

/* ============================================================
   REVEAL SYSTEM — structural stagger
   ============================================================ */
.reveal[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal[data-reveal].is-visible { opacity: 1; transform: none; }
.reveal[data-reveal="heading"] { transition-duration: var(--dur-base); }
.reveal[data-reveal="sub"] { transition-delay: 80ms; }
.reveal[data-reveal="panel"] { transition-delay: 120ms; transition-duration: var(--dur-slower); }
.reveal[data-reveal="tags"] { transition-delay: 160ms; }

/* Section-level reveal — every full section (.reveal with no [data-reveal]
   attribute) rises and settles as a block. Bigger travel + a hair of scale
   reads as considered rather than a default fade; each fires once. */
.reveal:not([data-reveal]) {
  opacity: 0;
  transform: translateY(32px) scale(0.98);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal:not([data-reveal]).is-visible { opacity: 1; transform: none; }

html:not(.js) .reveal[data-reveal] { opacity: 1; transform: none; }
html:not(.js) .reveal:not([data-reveal]) { opacity: 1; transform: none; }
html:not(.js) .pillar .mark { stroke-dashoffset: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .hero-grid, .problem2-grid, .switcher, .final-grid, .proof-grid { grid-template-columns: 1fr; }
  .plans, .audience-list { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  /* ecosystem drops below the copy; give it room but cap it so nodes stay legible */
  .ecosystem { aspect-ratio: 4 / 5; max-width: 520px; margin: var(--space-8) auto 0; width: 100%; }
}
@media (max-width: 560px) {
  /* At phone width the labelled cards are too big for the panel. Shrink the whole
     node — smaller type, tighter padding — so the edge cards fit at their real
     --x/--y (which the JS-drawn wires depend on; overriding positions here would
     detach a card from its wire). The panel's overflow:hidden absorbs the last
     few px of any card that still reaches the wall. */
  .eco-node {
    min-width: 0; padding: 5px 7px; column-gap: 6px;
    font-size: 0; /* collapse whitespace between grid cells */
  }
  .eco-node-icon { width: 20px; height: 20px; font-size: 11px; }
  .eco-node-name { font-size: 11px; }
  .eco-node-status { font-size: 8px; margin-top: 1px; }
  .eco-node-status::before { width: 5px; height: 5px; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: var(--layout-topbar-h);
    left: 0; right: 0;
    background: var(--surface-card);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    gap: 0;
    padding: var(--space-2) var(--space-6) var(--space-6);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-sharp), transform var(--dur-base) var(--ease-sharp);
  }
  .nav-links.is-open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: var(--space-4) 0; font-size: var(--text-md); border-bottom: 1px solid var(--border-subtle); }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  /* Beacon hero on mobile: keep the atmospheric lamp + beam + particles as
     the ambient scene, drop the domain-node constellation (it would overlap
     the copy), and darken the scrim so the headline always reads. */
  .hero--beacon { min-height: auto; }
  /* The labelled nodes and their wiring can't be read at this width — drop them
     and let the scene fall back to the lighthouse itself, which still carries
     the idea. Re-anchoring --lamp-x/--lamp-y moves the tower, the beam, the
     halo, the reflection and the horizon glow together, as one.
     --lamp-y re-derived for the shorter tower: 30% + (0.1625 × 46%) ≈ 37%. */
  .beacon-nodes, .beacon-links { display: none; }
  .beacon-scene { --lamp-x: 80%; --lamp-y: 38%; }
  .beacon-tower { height: 33%; top: 33%; }
  .beacon-scrim { background: linear-gradient(to top, #070d15 6%, rgba(7,13,21,0.72) 40%, rgba(7,13,21,0.45) 100%); }
  .hero-inner { padding: var(--space-16) var(--space-6) var(--space-12); }
  .hero-actions .btn { flex: 1 1 auto; }
  .plans, .audience-list, .footer-inner { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .pillar--feature { grid-template-columns: 1fr; grid-template-rows: auto; padding: var(--space-8); }
  .pillar--feature .pillar-head, .pillar--feature .pillar-desc, .pillar--feature .pillar-schema { grid-column: 1; grid-row: auto; }
  .pillar--feature .pillar-schema { align-content: start; }
  .switcher-controls { width: 100%; }
  .switcher-panel { grid-template-columns: 1fr; }
  .switcher-side { grid-row: auto; flex-direction: row; flex-wrap: wrap; }
  .switcher-panel .console-body { grid-row: auto; }
}

@media (max-width: 360px) {
  .section, .room-inner { padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* ============================================================
   ARABIC / RTL
   Latin numerals, tabular figures, prices and the code-like tokens
   (RADIUS, INV-, API) stay LTR-embedded even in Arabic — only the prose
   direction flips. Most of the layout is flexbox/grid + logical spacing,
   so it mirrors for free; this block handles the few places that don't. */
:root[dir="rtl"] {
  /* Arabic reads better with a hair more line-height and a UI font stack that
     has real Arabic coverage; the display face falls back to the system Arabic. */
  --font-body: "Inter", "Segoe UI", Tahoma, sans-serif;
}
[dir="rtl"] body { font-family: var(--font-body, inherit); }

/* Headings: DM Sans has no Arabic — fall back to a strong system Arabic face so
   Arabic titles don't render in a tofu/void or an unstyled serif. */
[dir="rtl"] .section-title,
[dir="rtl"] .hero-title,
[dir="rtl"] .plan-name,
[dir="rtl"] h3 {
  font-family: "Segoe UI", "Tahoma", system-ui, sans-serif;
  letter-spacing: 0;
}

/* The mono eyebrows/labels: JetBrains Mono also lacks Arabic. Use a clean
   sans in Arabic and drop the wide tracking (which looks wrong in Arabic). */
[dir="rtl"] .eyebrow,
[dir="rtl"] .hero-kicker,
[dir="rtl"] .plan-badge,
[dir="rtl"] .stat-tile-label,
[dir="rtl"] .footer-col-head,
[dir="rtl"] .eco-caption,
[dir="rtl"] .eco-core-label,
[dir="rtl"] .eco-core-state,
[dir="rtl"] .problem2-legend,
[dir="rtl"] .audience-tag {
  font-family: "Segoe UI", Tahoma, system-ui, sans-serif;
  letter-spacing: 0;
}

/* Prices, the ledger amounts, RADIUS counts, invoice ids — keep them LTR so
   "$249/mo" and "INV-2043" don't get visually reversed. */
[dir="rtl"] .plan-price,
[dir="rtl"] .amt,
[dir="rtl"] .tabular,
[dir="rtl"] .stat-tile-value,
[dir="rtl"] .eco-node-status,
[dir="rtl"] .console-value {
  direction: ltr;
  unicode-bidi: isolate;
}

/* The eyebrow's leading rule sits on the correct side automatically because it
   uses ::before with logical flow — but the accent tick in the hero kicker is a
   fixed-width bar; nothing to mirror. The section eyebrow ::before margin: */
[dir="rtl"] .eyebrow::before { margin-right: 0; margin-left: var(--space-3); }

/* Nav: the actions cluster and links mirror via flex, but the CTA arrow glyphs
   in buttons ("→") should point the reading direction. Flip inline arrows. */
[dir="rtl"] .btn-ghost,
[dir="rtl"] .pricing-escape a,
[dir="rtl"] .proof-copy .btn { /* arrows are part of the translated string in AR */ }

/* The BEACON HERO is anchored to the right (lamp at 78%). In RTL the copy moves
   to the right and would collide with the lighthouse. Move the whole light
   system to the LEFT by flipping only the coordinate variables — NOT with
   scaleX, which would mirror the node labels into backwards text. Everything in
   the scene derives from --lamp-x, so overriding it relocates the tower, beam,
   halo, reflection and wires together, upright and readable. */
[dir="rtl"] .beacon-scene { --lamp-x: 22%; }
/* the wires' SVG endpoints are authored at x=78; flip the whole wire layer
   horizontally so they meet the relocated lamp (the lines carry no text) */
[dir="rtl"] .beacon-links { transform: scaleX(-1); }
/* nodes are placed by --x from the left; mirror each one's x so the constellation
   sits on the correct side of the now-left lamp, without flipping the label text */
[dir="rtl"] .bnode { left: auto; right: var(--nx); }
[dir="rtl"] .beacon-scrim { transform: scaleX(-1); }

/* Ecosystem: node cards use a 2-col grid (icon | text). In RTL the icon should
   sit on the right of the label. The grid auto-flips with dir, but the fixed
   grid-template-columns keeps icon first — reorder so icon trails in RTL. */
[dir="rtl"] .eco-node { direction: rtl; }
[dir="rtl"] .eco-node-status { direction: rtl; }

/* Custom-property positioned things (nodes at --x/--y, core at --cx/--cy) are
   absolute % from the left edge; the scaleX flip above already mirrors them as a
   group, so leave their coordinates alone. */

/* Switcher console: sidebar sits on the left in LTR; let it mirror naturally.
   The active-tab accent bar uses logical inset already. */

/* Forms + inputs read RTL naturally; email/URL inputs stay LTR for legibility. */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] #f-count { direction: ltr; text-align: right; }

/* Footer newsletter row + trust band mirror via flex automatically. */

/* Lang toggle: keep its glyphs LTR ("EN / ع") regardless of page dir. */
.lang-toggle { direction: ltr; }
