/* EnterSense brand tokens — single source of truth.
   Dark-first ("Abyss"); light variant is "Eosin" (H&E slide).
   Interface colours use deep clinical neutrals with a glacier signal.
   Natural skin, hair, steel, blood and physical light-colour tokens are explicit
   exceptions to the historical hue restriction; they represent physical materials
   and lamps, never UI accents.
   Every EnterSense surface (site, brand system, product UI) copies this block verbatim. */

:root {
  --es-entry-mark-center-y: 40%;
  --es-entry-mark-opacity: 0.9;
  color-scheme: dark;
  /* Ground & ink */
  --es-ground: #070b14; /* precise blue-black chamber */
  --es-surface: #101722;
  --es-surface-2: #1a2331;
  --es-line: #303c4e;
  --es-ink: #f3f6fa;
  --es-muted: #aab5c4;
  /* Signature accent: the human/interface aperture. */
  --es-pore: #78e8dc;
  --es-pore-ink: #061817;
  /* Sense spectrum: one hue per product */
  --es-smell: #c994ff;
  --es-taste: #ff5c6e;
  --es-view: #5ce1ff;
  --es-move: #a8f06a;
  --es-touch: #5e86ff;
  --es-hear: #3dedb0;
  /* Consent states (semantic, never decorative) */
  --es-private: #9c98b8;
  --es-summary: #5e86ff; /* cobalt */
  --es-open: #3dedb0; /* teal */
  /* Iridescence: the six senses fused, used on the mark and key rules only */
  --es-iris: conic-gradient(
    from 200deg,
    var(--es-taste),
    var(--es-smell),
    var(--es-view),
    var(--es-move),
    var(--es-hear),
    var(--es-touch),
    var(--es-taste)
  );

  /* Specimen light (decorative) */
  --es-abyss: #03030e; /* canvas clear colour, vignette floor */
  --es-ground-lift: #0b333f;
  --es-pore-hi: #d5fff8;
  --es-pore-deep: #1d8f9a;
  --es-pearl: #fff4fc; /* specular dot on the Sense pearl */
  --es-glow: color-mix(in oklab, var(--es-pore) 42%, transparent);
  --es-glow-soft: color-mix(in oklab, var(--es-pore) 14%, transparent);
  --es-corona: color-mix(in oklab, var(--es-pore-deep) 22%, transparent);
  --es-glass: color-mix(in oklab, var(--es-surface) 70%, transparent);
  --es-glass-line: color-mix(in oklab, var(--es-ink) 10%, transparent);
  /* fMRI / deep-scan ramp (monotonic OKLab L) */
  --es-heat-0: var(--es-ground);
  --es-heat-1: #3d0e82;
  --es-heat-2: #ac20a6;
  --es-heat-3: var(--es-pore);
  --es-heat-4: var(--es-pore-hi);
  --es-heat-5: #fef3fa;
  --es-heat: linear-gradient(
    90deg in oklab,
    var(--es-heat-1),
    var(--es-heat-2),
    var(--es-heat-3),
    var(--es-heat-4),
    var(--es-heat-5)
  );
  /* Runtime knobs, read by hero JS via getComputedStyle */
  --es-grain-opacity: 0.05;
  --es-grain-blend: overlay;
  --es-field-blend: lighter;
  --es-bloom-strength: 0.55;
  --es-copy-glow-max: 0.12;
  --es-orbit-period: 96s;
  --es-scan-period: 12s;
  --es-mark-spin: 40s;
  --es-zoom-dur: 3.4s;
  --es-protocol-stage: 3s;
  --es-ap-echo: 120ms;

  /* Type */
  --es-font-display: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --es-font-body: "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --es-font-data: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;
  --es-text-small: 0.875rem;
  --es-text-body: 1rem;
  --es-line-body: 1.6;
  --es-bottom-clearance: 5.5rem;
  --es-step--1: var(--es-text-small);
  --es-step-0: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --es-step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --es-step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.3rem);
  --es-step-3: clamp(2.2rem, 1.6rem + 3vw, 4rem);
  --es-step-4: clamp(2.8rem, 1.6rem + 6vw, 6.6rem);

  /* Space, radius, motion */
  --es-space-1: 0.25rem;
  --es-space-2: 0.5rem;
  --es-space-3: 1rem;
  --es-space-4: 1.5rem;
  --es-space-5: 2.5rem;
  --es-space-6: 4rem;
  --es-space-7: 7rem;
  --es-radius-s: 6px;
  --es-radius-m: 14px;
  --es-radius-pill: 999px;
  --es-ease-breath: cubic-bezier(
    0.37,
    0,
    0.18,
    1
  ); /* slow inhale, soft exhale */
  --es-dur-pulse: 4.2s; /* one resting breath */
  --es-dur-ui: 240ms;
}

@supports (background: conic-gradient(in oklab, red, blue)) {
  :root {
    --es-iris: conic-gradient(
      from 200deg in oklab,
      var(--es-taste),
      var(--es-smell),
      var(--es-view),
      var(--es-move),
      var(--es-hear),
      var(--es-touch),
      var(--es-taste)
    );
  }
}
@supports not (background: linear-gradient(in oklab, red, blue)) {
  :root {
    --es-heat: linear-gradient(
      90deg,
      var(--es-heat-1),
      var(--es-heat-2),
      var(--es-heat-3),
      var(--es-heat-4),
      var(--es-heat-5)
    );
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --es-ground: #faf1f7;
    --es-surface: #ffffff;
    --es-surface-2: #f5eaf2;
    --es-line: #e6d2e0;
    --es-ink: #160f26;
    --es-muted: #574e72;
    --es-pore: #c0158a;
    --es-pore-ink: #ffffff;
    --es-smell: #9038e0;
    --es-taste: #c41f3a;
    --es-view: #0070a3;
    --es-move: #327716;
    --es-touch: #1e3bb5;
    --es-hear: #00766e;
    --es-private: #574e72;
    --es-summary: #1e3bb5;
    --es-open: #00766e;
    --es-abyss: #f3e4ef;
    --es-ground-lift: #ffe3f2;
    --es-pore-hi: #ff4fc0;
    --es-pore-deep: #6a1fb8;
    --es-pearl: #ffffff;
    --es-glow: color-mix(in oklab, var(--es-pore) 22%, transparent);
    --es-glow-soft: color-mix(in oklab, var(--es-pore) 8%, transparent);
    --es-corona: color-mix(in oklab, var(--es-ground-lift) 70%, transparent);
    --es-glass: color-mix(in oklab, var(--es-surface) 78%, transparent);
    --es-glass-line: color-mix(in oklab, var(--es-ink) 12%, transparent);
    --es-heat-0: var(--es-ground);
    --es-heat-1: #f4c4e0;
    --es-heat-2: #df5ba1;
    --es-heat-3: var(--es-pore);
    --es-heat-4: #632895;
    --es-heat-5: var(--es-ink);
    --es-grain-opacity: 0.025;
    --es-grain-blend: multiply;
    --es-field-blend: source-over;
    --es-bloom-strength: 0;
    --es-copy-glow-max: 0.08;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --es-ground: #faf1f7;
  --es-surface: #ffffff;
  --es-surface-2: #f5eaf2;
  --es-line: #e6d2e0;
  --es-ink: #160f26;
  --es-muted: #574e72;
  --es-pore: #c0158a;
  --es-pore-ink: #ffffff;
  --es-smell: #9038e0;
  --es-taste: #c41f3a;
  --es-view: #0070a3;
  --es-move: #327716;
  --es-touch: #1e3bb5;
  --es-hear: #00766e;
  --es-private: #574e72;
  --es-summary: #1e3bb5;
  --es-open: #00766e;
  --es-abyss: #f3e4ef;
  --es-ground-lift: #ffe3f2;
  --es-pore-hi: #ff4fc0;
  --es-pore-deep: #6a1fb8;
  --es-pearl: #ffffff;
  --es-glow: color-mix(in oklab, var(--es-pore) 22%, transparent);
  --es-glow-soft: color-mix(in oklab, var(--es-pore) 8%, transparent);
  --es-corona: color-mix(in oklab, var(--es-ground-lift) 70%, transparent);
  --es-glass: color-mix(in oklab, var(--es-surface) 78%, transparent);
  --es-glass-line: color-mix(in oklab, var(--es-ink) 12%, transparent);
  --es-heat-0: var(--es-ground);
  --es-heat-1: #f4c4e0;
  --es-heat-2: #df5ba1;
  --es-heat-3: var(--es-pore);
  --es-heat-4: #632895;
  --es-heat-5: var(--es-ink);
  --es-grain-opacity: 0.025;
  --es-grain-blend: multiply;
  --es-field-blend: source-over;
  --es-bloom-strength: 0;
  --es-copy-glow-max: 0.08;
}

::selection {
  background: var(--es-pore);
  color: var(--es-pore-ink);
}

/* Clinical material palette: physical rendering, not interface highlights. */
:root {
  --es-skin: #cda38d;
  --es-skin-shadow: #8b6254;
  --es-steel: #a6adb8;
  --es-bed: #d9dce1;
  --es-blood: #790b25;
  --es-blood-hi: #d82a46;
  --es-circuit: var(--es-pore);
  --es-panel: color-mix(in srgb, var(--es-ground) 95%, transparent);
}
:root[data-theme="light"] {
  --es-ground: #f2f3f6;
  --es-surface: #fafbfd;
  --es-surface-2: #e9ecf0;
  --es-line: #d1d6de;
  --es-ink: #151a22;
  --es-muted: #545e6c;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --es-ground: #f2f3f6;
    --es-surface: #fafbfd;
    --es-surface-2: #e9ecf0;
    --es-line: #d1d6de;
    --es-ink: #151a22;
    --es-muted: #545e6c;
  }
}

/* Physical material aliases: neutral light, structural metal, neural indicator. */
:root {
  --es-clinical: var(--es-bed);
  /* Physical light colours (material exception): warm key, cool fill, rear kicker. */
  --es-light-key: #fff2e6;
  --es-light-fill: #d9e5ff;
  --es-light-kicker: #eaf1ff;
  --es-shadow-map: 2048;
  --es-dark-metal: #202630;
  --es-coolant: var(--es-circuit);
}

/* Guided room journey: consumed by scene configuration, never fixed in UI code. */
:root {
  --es-room-orbit-period: 150s;
  /* Desktop overview hero: minimum distance, frame fraction and elevation (rad). */
  --es-hero-distance: 3;
  --es-hero-fraction: 0.62;
  --es-hero-fraction-y: 0.95;
  --es-hero-elevation: 0.6;
  --es-chapter-hold: 11s;
  --es-intro-hold: 6s;
  --es-telemetry-period: 3.2s;
  --es-telemetry-clearance: 8px;
  /* Focused readings float over the real room, never an opaque panel. */
  --es-mobile-metric-lane: 140px;
  --es-reading-tint: 52%;
  --es-reading-edge-tint: 24%;
  --es-reading-softness: 1rem;
  --es-metric-tint: 46%;
  --es-connector-opacity: 0.55;
  --es-display-weight: 300;
  --es-wordmark-weight: 500;
  --es-header-mark-size: 1.65em;
}

/* Texture multipliers: material controls preserve anatomical skin detail. */
:root {
  --es-skin-natural: #ffffff;
  --es-skin-sand: #edc5a6;
  --es-skin-honey: #dca06b;
  --es-skin-bronze: #b57e5a;
  --es-skin-umber: #926347;
  --es-skin-deep: #63463b;
  --es-render-dpr: 2.5;
  /* Software rasterizers (no GPU) keep the scene, at lighter internal cost. */
  --es-render-dpr-software: 1;
  --es-shadow-map-software: 1024;
}

:root {
  --es-human-roughness: 0.72;
  --es-human-normal-strength: 0.19;
  --es-human-clearcoat: 0.055;
  --es-human-specular: 0.34;
  --es-human-rim-strength: 0.045;
  /* Illustrative resting breath: ~3mm chest, ~2.6mm belly, one per --es-dur-pulse. */
  --es-human-breath-amplitude: 0.0032;
  --es-human-belly-amplitude: 0.0026;
  --es-human-breath-rate: 1.5;
  --es-skin-rim: #ffd2b5;
  --es-field-radius: 0.065;
  --es-field-height: 0.11;
}

/* Fine material detail and batched field quality. */
:root {
  --es-human-micro-scale: 1600;
  --es-human-micro-strength: 0.045;
  --es-human-eye-recess: 0.0008;
  --es-human-hair: #241d19;
  --es-human-hair-highlight: #5a4635;
  --es-human-cloth: #efeee7;
  --es-human-hair-lift: 0.007;
  --es-human-hair-width: 0.00048;
  --es-human-hair-roughness: 0.72;
  --es-human-hair-anisotropy: 0.45;
  --es-human-hair-specular: 0.4;
  --es-human-lid-crease: 0.00016;
  --es-human-cloth-half-width: 0.21;
  --es-human-cloth-length: 0.36;
  /* Skin light transport approximations (not a tissue model). */
  --es-human-sheen: 0.2;
  --es-human-scatter-strength: 0.3;
  --es-human-scatter-wrap: 0.5;
  --es-human-flush-strength: 0.5;
  --es-human-cavity: 0.05;
  --es-skin-scatter: #ff6a4d;
  --es-skin-flush: #ffc4bb;
  --es-human-brow: #2e231c;
  --es-human-lash: #1f1713;
  --es-field-particles: 960;
}

:root {
  --es-field-quality: 1;
}
@media (max-width: 600px) {
  :root {
    --es-field-quality: 0.45;
    --es-shadow-map: 1024;
  }
}

/* Glacier is the current identity; the former signal stays an optional atmosphere. */
:root[data-palette="fuchsia"] {
  --es-pore: #ff3ec8;
  --es-pore-hi: #ffa8ec;
  --es-pore-deep: #7b1fd1;
  --es-pore-ink: #16031c;
  --es-ground-lift: #2d024b;
}
:root[data-palette="cyan"] {
  --es-pore: #78e8dc;
  --es-pore-hi: #d5fff8;
  --es-pore-deep: #1d8f9a;
  --es-pore-ink: #061817;
  --es-ground-lift: #0b333f;
}
:root[data-palette="amber"] {
  --es-pore: #ffba67;
  --es-pore-hi: #ffe0b2;
  --es-pore-deep: #b76d15;
  --es-pore-ink: #211407;
}
:root[data-palette="violet"] {
  --es-pore: #b9a2ff;
  --es-pore-hi: #e4d8ff;
  --es-pore-deep: #7149da;
  --es-pore-ink: #161023;
}
:root[data-theme="light"][data-palette="cyan"] {
  --es-pore: #087a79;
  --es-pore-hi: #18ada9;
  --es-pore-deep: #075d64;
  --es-pore-ink: #ffffff;
  --es-ground-lift: #d4f0ed;
}
