/* ═══════════════════════════════════════════════════════════════════
   DataAgent — PREMIUM DARK LAYER  (v1)
   Loads AFTER style.css + pro.css and re-skins the whole site:
   deep-space surfaces · glass panels · aurora ambience · WebGL stage
   Motion primitives for js/fx-core.js + js/fx-webgl.js
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ─────────────────────────────────────────────────── */

/* ── 2. Base + ambience ────────────────────────────────────────── */
html {
  scrollbar-color: var(--primary) var(--surface-deep);
  background: var(--surface-deep);
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--surface-deep); }
::-webkit-scrollbar-thumb {
  background: var(--grad-brand);
  border-radius: 6px;
  border: 2px solid var(--surface-deep);
}

body {
  background: var(--surface-deep);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: rgba(157, 157, 157, 0.35); color: var(--text); }



/* Layered aurora field — sits under the WebGL canvas */
.bg-grid {
  background-image: var(--grad-grid) !important;
  background-size: 64px 64px;
  mask-image: var(--grad-mask);
  -webkit-mask-image: var(--grad-mask);
}

.bg-orbs { z-index: 0; }
.bg-orbs::before,
.bg-orbs::after { filter: blur(140px); opacity: 0.9; }
.bg-orbs::before {
  width: 820px; height: 820px;
  --orb-tint: rgba(123, 123, 123, 0.5);
  background: var(--grad-orb);
  animation: px-mesh-a 34s var(--ease-out-organic) infinite alternate !important;
}
.bg-orbs::after {
  width: 700px; height: 700px;
  --orb-tint: rgba(189, 189, 189, 0.24);
  background: var(--grad-orb);
  animation: px-mesh-b 44s var(--ease-out-organic) infinite alternate !important;
}
@keyframes px-mesh-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-7%, 5%, 0) scale(1.12); }
  100% { transform: translate3d(4%, -4%, 0) scale(0.96); }
}
@keyframes px-mesh-b {
  0%   { transform: translate3d(0, 0, 0) scale(0.96); }
  50%  { transform: translate3d(6%, -6%, 0) scale(1.1); }
  100% { transform: translate3d(-4%, 3%, 0) scale(1.02); }
}

/* Film grain + vignette on top of everything but the UI */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* ── 3. WebGL stage ────────────────────────────────────────────── */
/* Stacking: .main-content is z-index 1, so the stage and its scrim sit at 0
   — above .bg-grid/.bg-orbs, below every band of content. */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s var(--ease-soft);
  will-change: opacity;
}
#fx-canvas.is-live { opacity: 1; }

/* Keep the CSS aurora atmospheric, never loud — the lattice is the star */
.hero::before { opacity: 0.46 !important; }
.bg-orbs::before, .bg-orbs::after { opacity: 0.42 !important; }

/* Sections sit above the stage with translucent scrims so the 3D
   world keeps glowing through as you scroll. */
.band {
  position: relative;
  z-index: 2;
  backdrop-filter: blur(2px);
}
/* Translucent scrims keep the WebGL world visible as you scroll */
.band-ink    { background: rgba(5, 5, 5, 0.34) !important; color: var(--text); }
.band-navy   { background: rgba(4, 4, 4, 0.72) !important; color: var(--text); }
.band-cream  { background: rgba(7, 7, 7, 0.62) !important; color: var(--text); }
.band-cream2 { background: rgba(10, 10, 10, 0.66) !important; color: var(--text); }
.band-violet {
  --orb-tint: rgba(123, 123, 123, 0.22);
  background: var(--grad-orb), rgba(13, 13, 13, 0.6) !important;
  color: var(--text);
}
.band-mint {
  --orb-tint: rgba(188, 188, 188, 0.16);
  background: var(--grad-orb), rgba(18, 18, 18, 0.6) !important;
  color: var(--text);
}
.band-peach {
  --orb-tint: rgba(163, 163, 163, 0.16);
  background: var(--grad-orb), rgba(15, 15, 15, 0.6) !important;
  color: var(--text);
}

/* Readability scrim: sits above the WebGL stage, below the content, and
   keeps copy crisp while the 3D world stays visible around it. */
.fx-scrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--grad-scrim);
}

/* ── 4. Typography ─────────────────────────────────────────────── */
.display,
.hero-title,
.section-title,
.page-header h1,
h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: -0.028em;
  color: var(--text);
}
.display-xl { font-size: clamp(3.2rem, 9vw, 7.4rem); line-height: 0.94; }
.display-lg { font-size: clamp(2.5rem, 5.6vw, 4.6rem); line-height: 0.98; }
.section-subtitle, .page-header p, .hero-desc { color: var(--text-2); }

.display-ink { color: var(--text) !important; }

/* Quotes: the article markup carries an inline dark ink colour */
blockquote {
  color: var(--text) !important;
  border-left-color: var(--primary-hi) !important;
  --tint: rgba(123, 123, 123, 0.14);
  background: var(--grad-surface) !important;
}

/* Content headings and emphasis that pro.css points at dark ink */
.docs-content h2, .docs-content h3, .docs-content h4,
.docs-content strong, .docs-content li strong,
.blog-content h2, .blog-content h3, .blog-content strong,
.faq-group-title, .arch-card h4, .timeline-title, .timeline-summary,
.contact-card h3, .check-list li, .learn-panel h3 {
  color: var(--text) !important;
}

/* Superseded by the global .fx-progress bar at the top of the viewport */
.read-progress { display: none !important; }

/* Catch-all: body copy inside the page is always light on dark. Component
   rules with higher specificity still win where they set their own colour. */
.main-content p,
.main-content li,
.main-content dd,
.main-content dt,
.main-content label {
  color: var(--text-2);
}
.main-content h1,
.main-content h2,
.main-content h3,
.main-content h4 {
  color: var(--text);
}

/* Gradient text is reserved for the one heading word that earns it.
   Everything else uses a solid brand colour. */
.gradient-text {
  color: var(--primary-hi);
}
.hero-title .accent {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: px-shift 9s ease-in-out infinite alternate;
}
@keyframes px-shift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.section-badge {
  background: var(--glass) !important;
  border: 1px solid var(--line) !important;
  color: var(--text-2) !important;
  backdrop-filter: blur(10px);
  box-shadow: var(--inset-top);
  border-radius: 999px;
}
.section-badge .dot,
.hero-badge .dot {
  background: var(--success);
  box-shadow: 0 0 12px rgba(161, 195, 167, 0.8);
  animation: px-pulse 2.6s ease-in-out infinite;
}
@keyframes px-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.82); }
}

/* ── 5. Navigation ─────────────────────────────────────────────── */
.navbar {
  background: rgba(5, 5, 5, 0.55) !important;
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  transition: background var(--dur-med) ease, border-color var(--dur-med) ease,
              padding var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.navbar.is-stuck {
  background: rgba(5, 5, 5, 0.82) !important;
  border-bottom-color: var(--line);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.9);
}
.nav-links a {
  color: var(--text-2);
  position: relative;
  transition: color var(--dur-fast) ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 1px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 420ms var(--ease-out);
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-logo-icon {
  background: var(--grad-brand);
  box-shadow: var(--glow-primary);
  border-radius: 12px;
}
.nav-cta {
  border: 1px solid var(--primary-hi) !important;
  color: var(--text-inverse) !important;
  border-radius: 999px !important;
}
.nav-cta:hover { box-shadow: var(--glow-primary); }

/* ── 6. Buttons ────────────────────────────────────────────────── */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
}
.btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 45%;
  background: var(--grad-sheen);
  transform: skewX(-18deg);
  opacity: 0;
  transition: none;
}
.btn:hover::after { animation: px-sheen 900ms var(--ease-out) forwards; }
@keyframes px-sheen {
  0%   { left: -60%; opacity: 0.9; }
  100% { left: 130%; opacity: 0; }
}
/* The button fills live in style.css. This layer only owns the
   hover sheen and the icon treatment. */
.btn-icon { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35)); }

/* ── 7. Surfaces: cards, tiles, panels ─────────────────────────── */
.card,
.stat-panel,
.plan-card,
.contact-link-card,
.tech-badge,
.pill-tabs,
.download-card,
.highlight-box,
.docs-sidebar,
.comparison-wrapper,
.form-input,
.form-textarea,
.key-input,
.plan-badge,
.arch-card,
.learn-panel,
.blog-card,
.req-card,
.faq-item,
.rail-card,
.showcase-col .card {
  position: relative;
  background: var(--glass) !important;
  border: 1px solid var(--line) !important;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--shadow-card), var(--inset-top) !important;
  color: var(--text);
  border-radius: var(--radius-md);
}

.card:hover,
.contact-link-card:hover,
.plan-card:hover,
.download-card:hover,
.blog-card:hover,
.req-card:hover,
.faq-item:hover {
  border-color: var(--line-glow) !important;
  background: var(--glass-2) !important;
}

/* Gradient hairline border that lights up on hover */
.card::after,
.plan-card::after,
.download-card::after,
.blog-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-accent);
  -webkit-mask: var(--grad-mask-line) content-box, var(--grad-mask-line);
  -webkit-mask-composite: xor;
  mask: var(--grad-mask-line) content-box, var(--grad-mask-line);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 520ms var(--ease-out);
  pointer-events: none;
}
.card:hover::after,
.plan-card:hover::after,
.download-card:hover::after,
.blog-card:hover::after { opacity: 1; }

/* Pointer-tracked spotlight inside cards */
.fx-spot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
  --spot-size: 260px;
  --spot-alpha: 0.16;
  background: var(--grad-spot);
}
.fx-spot:hover::before { opacity: 1; }

/* ── 7b. Dark text normalisation ───────────────────────────────────
   pro.css carries light-theme assumptions (coloured tiles + :has() icon
   variants) that leave dark ink on dark glass. Everything that reads as
   surface copy is normalised to the dark palette here. */
.card, .card.tile-violet, .card.tile-ink, .card.tile-navy, .card.tile-pink,
.card.tile-orange, .card.tile-cyan, .card.tile-mint, .card.tile-peach {
  color: var(--text) !important;
}
.card-text,
.rail-card .card-text,
.card:has(.card-icon.purple) .card-text,
.card:has(.card-icon.blue) .card-text,
.card:has(.card-icon.green) .card-text,
.card:has(.card-icon.pink) .card-text,
.card:has(.card-icon.amber) .card-text,
.card.tile-violet .card-text, .card.tile-ink .card-text, .card.tile-navy .card-text,
.card.tile-pink .card-text, .card.tile-orange .card-text, .card.tile-cyan .card-text,
.card.tile-mint .card-text, .card.tile-peach .card-text {
  color: var(--text-2) !important;
  opacity: 1 !important;
}

/* ── 7c. Auto-tile neutralisation ─────────────────────────────────
   pro.css colours cards from their icon class with :has(...) rules at
   specificity (0,3,0) + !important. These overrides match that weight and
   load later, converting bright pastel tiles into accent-tinted glass. */
.card:has(.card-icon),
.card:has(.card-icon.purple),
.card:has(.card-icon.blue),
.card:has(.card-icon.green),
.card:has(.card-icon.pink),
.card:has(.card-icon.amber) {
  background: var(--glass) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.card:has(.card-icon.purple) { --tint: rgba(123, 123, 123, 0.20); background: var(--grad-surface) !important; }
.card:has(.card-icon.blue)   { --tint: rgba(188, 188, 188, 0.16); background: var(--grad-surface) !important; }
.card:has(.card-icon.green)  { --tint: rgba(155, 191, 161, 0.16); background: var(--grad-surface) !important; }
.card:has(.card-icon.pink)   { --tint: rgba(156, 156, 156, 0.18); background: var(--grad-surface) !important; }
.card:has(.card-icon.amber)  { --tint: rgba(164, 164, 164, 0.18); background: var(--grad-surface) !important; }

/* Explicit tile classes keep their colour story the same way */
.card.card.tile-violet { --tint: rgba(123, 123, 123, 0.22); background: var(--grad-surface) !important; }
.card.card.tile-pink   { --tint: rgba(156, 156, 156, 0.20); background: var(--grad-surface) !important; }
.card.card.tile-mint   { --tint: rgba(156, 191, 162, 0.18); background: var(--grad-surface) !important; }
.card.card.tile-cyan   { --tint: rgba(188, 188, 188, 0.18); background: var(--grad-surface) !important; }
.card.card.tile-peach,
.card.card.tile-orange { --tint: rgba(164, 164, 164, 0.20); background: var(--grad-surface) !important; }
.card.card.tile-ink,
.card.card.tile-navy   { --tint: rgba(255, 255, 255, 0.075); background: var(--grad-surface) !important; }

/* Headlines, icon chips and tags stay light on every variant */
.card .card-title,
.card:has(.card-icon) .card-title,
.card:has(.card-icon.blue) .card-title,
.card:has(.card-icon.green) .card-title,
.card:has(.card-icon.amber) .card-title,
.card.tile-violet .card-title, .card.tile-ink .card-title, .card.tile-navy .card-title,
.card.tile-pink .card-title, .card.tile-orange .card-title, .card.tile-cyan .card-title,
.card.tile-mint .card-title, .card.tile-peach .card-title {
  color: var(--text) !important;
}
.card .card-icon,
.card:has(.card-icon) .card-icon,
.card.tile-violet .card-icon, .card.tile-ink .card-icon, .card.tile-navy .card-icon,
.card.tile-pink .card-icon, .card.tile-orange .card-icon, .card.tile-cyan .card-icon,
.card.tile-mint .card-icon, .card.tile-peach .card-icon {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: var(--text) !important;
}
.card .feature-tag,
.card:has(.card-icon) .feature-tag,
.card:has(.card-icon.blue) .feature-tag,
.card:has(.card-icon.green) .feature-tag,
.card:has(.card-icon.amber) .feature-tag,
.card.tile-violet .feature-tag, .card.tile-ink .feature-tag, .card.tile-navy .feature-tag,
.card.tile-pink .feature-tag, .card.tile-orange .feature-tag, .card.tile-cyan .feature-tag,
.card.tile-mint .feature-tag, .card.tile-peach .feature-tag {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: var(--text) !important;
}

.card-title, .plan-name, .download-title { color: var(--text); }
.card-text, .plan-features li, .faq-a, .req-value { color: var(--text-2); }
.card-icon {
  background: var(--glass-2) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--inset-top);
}

.stat-panel { text-align: center; }
.stat-panel span[data-count] {
  color: var(--primary-hi);
  font-family: var(--font-display);
  letter-spacing: -0.04em;
}
.stat-label { color: var(--text-muted); }

.highlight-box {
  --tint: rgba(123, 123, 123, 0.14);
  background: var(--grad-surface) !important;
  border-color: var(--line-2) !important;
}
.highlight-box h3 { color: var(--primary-hi); }

.docs-sidebar { border-radius: var(--radius-lg); }
.docs-nav a { color: var(--text-2); }
.docs-nav a.active,
.docs-nav a:hover { color: var(--text); background: var(--glass-2); }

.comparison-wrapper { border-radius: var(--radius-lg); overflow: hidden; }
.comparison-table thead { background: rgba(255, 255, 255, 0.05) !important; }
.comparison-table th { color: var(--text-2) !important; }
.comparison-table td { color: var(--text-2) !important; border-bottom-color: var(--line) !important; }
.comparison-table td:first-child { color: var(--text) !important; }
.comparison-table th.highlight {
  color: var(--primary-hi) !important;
  background: rgba(123, 123, 123, 0.16) !important;
}
.comparison-table td.highlight { background: rgba(123, 123, 123, 0.1) !important; }

.form-input, .form-textarea, .key-input {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--primary-hi) !important;
  box-shadow: 0 0 0 4px rgba(123, 123, 123, 0.16) !important;
}
.form-label { color: var(--text-2) !important; }
.price-tag { color: var(--text-muted) !important; }

.code-block {
  background: rgba(4, 4, 4, 0.72) !important;
  border-color: var(--line) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 20px 50px -30px rgba(0, 0, 0, 1);
  color: rgba(224, 224, 224, 0.86) !important;
}
.code-block .comment { color: rgba(177, 177, 177, 0.6) !important; }
.code-block .string  { color: #c1d7c4 !important; }
.code-block .command { color: #c3c3c3 !important; }
.code-block .number  { color: #c8c8c8 !important; }
.code-block .keyword { color: #c3c3c3 !important; }
.code-inline {
  background: rgba(123, 123, 123, 0.16) !important;
  border-color: rgba(157, 157, 157, 0.28) !important;
  color: #dbdbdb !important;
}

/* ── 8. Hero: 3D stage ─────────────────────────────────────────── */
.hero { min-height: min(100vh, 940px); display: flex; align-items: center; }
.hero-grid { perspective: var(--persp); }
.hero-badge { background: var(--glass) !important; border-color: var(--line) !important; }
.hero-pills li {
  background: var(--glass) !important;
  border-color: var(--line) !important;
  color: var(--text-2) !important;
  backdrop-filter: blur(8px);
}
.hero-stage { transform-style: preserve-3d; }
.hero-stage-glow {
  --orb-tint: rgba(123, 123, 123, 0.45);
  background: var(--grad-orb) !important;
  filter: blur(60px);
}
.hero-stack { transform-style: preserve-3d; }
.hero-panel {
  background: rgba(13, 13, 13, 0.62) !important;
  border: 1px solid var(--line-2) !important;
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 60px 120px -50px rgba(0, 0, 0, 1), var(--inset-top) !important;
  transform-style: preserve-3d;
}
.hero-float {
  background: rgba(14, 14, 14, 0.72) !important;
  border: 1px solid var(--line-2) !important;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card), var(--inset-top) !important;
}
.hf-value { color: var(--text); }
.hf-label { color: var(--text-muted); }
.hp-bar em { color: var(--text-muted); }
.hp-bubble.user { background: var(--glass-2); color: var(--text); }
.hp-bubble.ai {
  --tint: rgba(123, 123, 123, 0.30);
  background: var(--grad-surface);
  color: var(--text);
  border: 1px solid var(--line-2);
}
.hp-chart span { background: var(--grad-brand); box-shadow: 0 0 18px -4px rgba(123, 123, 123, 0.9); }

/* ── 9. Marquee / rails / showcase ─────────────────────────────── */
.marquee {
  background: transparent !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.marquee span { color: var(--text-2); }
.marquee .vio { color: var(--primary-hi); }
.marquee .alt { color: var(--emphasis); }
.marquee-dot { background: var(--line-2); }

.rail-card {
  background: var(--glass) !important;
  border-color: var(--line) !important;
}
.rail-num {
  color: transparent;
  -webkit-text-stroke: 1px var(--line-2);
  font-family: var(--font-display);
}
.tile-art svg { opacity: 0.7; }

/* ── 10. Footer / CTA ──────────────────────────────────────────── */
.footer {
  background: rgba(4, 4, 4, 0.94) !important;
  border-top: 1px solid var(--line);
}
.footer-bottom { color: var(--text-muted); border-top-color: var(--line); }
.footer-col h2 { color: var(--text-muted); }
.footer-col a { color: var(--text-2); }
.footer-col a:hover { color: var(--link-hover); }
.footer-brand p { color: var(--text-muted); }

.cta-band {
  --orb-tint: rgba(123, 123, 123, 0.28);
  background: var(--grad-orb), rgba(6, 6, 6, 0.88) !important;
}
.cta-sub { color: var(--text-2); }

.toast {
  background: rgba(13, 13, 13, 0.9) !important;
  border: 1px solid var(--line-2) !important;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-lift);
  color: var(--text);
}
.scroll-top {
  background: var(--glass-2) !important;
  border: 1px solid var(--line-2) !important;
  color: var(--text) !important;
  backdrop-filter: blur(12px);
}

/* ── 11. Motion primitives (driven by fx-core.js) ──────────────── */
/* The new engine owns scroll reveales — retire the legacy fade-up so the
   two systems never animate the same element twice. */
.animate-on-scroll,
.animate-delay-1, .animate-delay-2, .animate-delay-3, .animate-delay-4 {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* Existing hero markup supplies its own lines */
.hero-title .line { display: block; }

/* No-WebGL fallback keeps the aurora rich.
   The canvas is an *enhancement*: the CSS aurora is the base layer and is
   always painted. When the stage is off (no WebGL, GPU blocklisted, lost
   context or prefers-reduced-motion) the aurora is promoted to full
   strength and the technical grid is brought up, so the hero reads as an
   intentional blueprint rather than a hole where the render should be.
   These need !important: the ambient rules above set opacity with it too,
   and without it the old rules here were dead. */
body.fx-no-webgl .bg-orbs::before,
body.fx-no-webgl .bg-orbs::after { opacity: 0.95 !important; }
body.fx-no-webgl .hero::before { opacity: 0.78 !important; }
body.fx-no-webgl .bg-grid {
  background-image:
    var(--grad-grid) !important;
}
body.fx-no-webgl #fx-canvas { display: none !important; }

/* ── Scroll-linked ambient drift ────────────────────────────────────
   fx-core.js publishes the scroll progress as --fx-scroll on :root
   (throttled to ~8 Hz). Only `transform` is animated, so the drift stays
   on the compositor and never triggers a layout pass. */
.hero-stage-glow {
  transform: translate3d(0, calc(var(--fx-scroll, 0) * -9vh), 0);
}

/* Editorial hairline under the section headers — a short accent rule
   that draws itself as the header reveals. Added by fx-core.js. */
.fx-rule { position: relative; }
.fx-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 76px;
  height: 2px;
  margin-left: -38px;
  border-radius: 2px;
  background: var(--grad-accent);
  opacity: 0;
  transform: scaleX(0);
  transition: transform 900ms var(--ease-out) 140ms, opacity 520ms var(--ease-out) 140ms;
  pointer-events: none;
}
.fx-rule.is-in::after { transform: scaleX(1); opacity: 0.85; }

html.fx-ready .fx-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 900ms var(--ease-out), transform 1050ms var(--ease-out);
  transition-delay: var(--fx-delay, 0ms);
}
/* will-change only while the element is still hidden — a permanent
   will-change on a hundred cards is a hundred composited layers. */
html.fx-ready .fx-reveal:not(.is-in) { will-change: opacity, transform; }
html.fx-ready .fx-reveal.is-in { opacity: 1; transform: none; }

.fx-lines .fx-line { display: block; overflow: hidden; }
html.fx-ready .fx-lines .fx-line > span {
  display: block;
  transform: translate3d(0, 105%, 0);
  transition: transform 1100ms var(--ease-out);
  transition-delay: var(--fx-delay, 0ms);
}
html.fx-ready .fx-lines.is-in .fx-line > span { transform: none; }

html.fx-ready .fx-zoom { opacity: 0; transform: scale(1.06); transition: opacity 1s var(--ease-out), transform 1.4s var(--ease-out); }
html.fx-ready .fx-zoom.is-in { opacity: 1; transform: none; }

.fx-tilt { transform-style: preserve-3d; will-change: transform; }
.fx-tilt-inner { transform: translateZ(28px); transform-style: preserve-3d; }
.fx-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms var(--ease-out);
  --spot-size: 320px;
  --spot-alpha: 0.13;
  background: var(--grad-spot);
}
.fx-tilt:hover .fx-glare { opacity: 1; }

.fx-parallax { will-change: transform; }
.fx-floaty { animation: px-floaty 7s ease-in-out infinite; }
.fx-floaty[data-float="2"] { animation-duration: 9s; animation-delay: -2s; }
.fx-floaty[data-float="3"] { animation-duration: 11s; animation-delay: -4s; }
@keyframes px-floaty {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -12px, 0); }
}

/* Scroll progress */
.fx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--grad-accent);
  z-index: 60;
  box-shadow: 0 0 18px rgba(157, 157, 157, 0.75);
  pointer-events: none;
}

/* Custom cursor */
.fx-cursor, .fx-cursor-dot {
  position: fixed;
  top: 0; left: 0;
  z-index: 9998;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 300ms ease;
}
.fx-cursor {
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1px solid rgba(157, 157, 157, 0.7);
  transition: opacity 300ms ease, width 300ms var(--ease-out), height 300ms var(--ease-out),
              margin 300ms var(--ease-out), background 300ms var(--ease-out), border-color 300ms ease;
}
.fx-cursor-dot {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--text);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
}
body.fx-cursor-on .fx-cursor,
body.fx-cursor-on .fx-cursor-dot { opacity: 1; }
.fx-cursor.is-hover {
  width: 62px; height: 62px;
  margin: -31px 0 0 -31px;
  background: rgba(158, 158, 158, 0.13);
  border-color: rgba(159, 159, 159, 0.8);
}
.fx-cursor.is-down { background: rgba(255, 255, 255, 0.9); }

/* Intro curtain + page transitions */
.fx-preloader, .fx-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--surface-deep);
}
.fx-preloader { transition: opacity 700ms var(--ease-out), visibility 700ms; }
.fx-preloader.is-done { opacity: 0; visibility: hidden; }
.fx-preloader-mark {
  display: grid;
  gap: 18px;
  justify-items: center;
  font-family: var(--font-display);
  letter-spacing: 0.42em;
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--text-muted);
}
.fx-preloader-orbit {
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(157, 157, 157, 0.28);
  border-top-color: var(--pink);
  animation: px-spin 1.1s linear infinite;
  box-shadow: var(--glow-primary);
}
@keyframes px-spin { to { transform: rotate(360deg); } }

.fx-transition {
  opacity: 0;
  visibility: hidden;
  transition: opacity 520ms var(--ease-out), visibility 520ms;
}
.fx-transition.is-active { opacity: 1; visibility: visible; }
.fx-transition-bar {
  width: min(420px, 62vw);
  height: 2px;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  animation: px-load 900ms var(--ease-out) infinite;
}
@keyframes px-load {
  0%   { transform: scaleX(0); opacity: 1; }
  70%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* Scroll-velocity skew (the "liquid scroll" feel) */
.fx-skew { transition: transform 120ms linear; }

/* ── 12. Accessibility & fallbacks ─────────────────────────────── */
/* ── Static mode ─────────────────────────────────────────────────────
   Set by fx-core.js for prefers-reduced-motion *and* for ?fx=off (the
   media query cannot see the query flag). Nothing moves: the reveals are
   already resolved, the transitions are switched off, the ambient drift
   is parked. */
html.fx-reduced .fx-reveal,
html.fx-reduced .fx-lines .fx-line > span,
html.fx-reduced .fx-zoom,
html.fx-reduced .fx-rule::after { transition: none !important; }
html.fx-reduced .bg-grid,
html.fx-reduced .hero-stage-glow { transform: none !important; }
html.fx-reduced .fx-rule::after { transform: scaleX(1) !important; opacity: 0.85 !important; }
html.fx-reduced .fx-preloader { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html.fx-ready .fx-reveal,
  html.fx-ready .fx-lines .fx-line > span,
  html.fx-ready .fx-zoom { opacity: 1 !important; transform: none !important; }
  .fx-floaty, .bg-orbs::before, .bg-orbs::after, .gradient-text,
  .hero-title .accent, .section-badge .dot { animation: none !important; }
  /* The canvas, cursor and progress bar are created by JS, which already
     respects this preference — so they are not hidden again here. That way
     ?fx=full can still demo the full experience. */
  /* The ambient drift and the editorial rule are motion too: park them. */
  .bg-grid, .hero-stage-glow { transform: none !important; }
  .fx-rule::after {
    transform: scaleX(1) !important;
    opacity: 0.85 !important;
    transition: none !important;
  }
  /* The curtain and the page-transition veil are pure motion. */
  .fx-preloader, .fx-transition { transition: none !important; }
  .fx-preloader { display: none !important; }
}

@media (hover: none), (pointer: coarse) {
  .fx-cursor, .fx-cursor-dot { display: none; }
}

/* Editorial left alignment for the hero (the bands centre their headers) */
.hero, .hero-grid, .hero-content, .hero-desc { text-align: left; }

/* Keep the floating hero chips inside the frame instead of clipping */
.hero-float-a { top: 5% !important; right: -4% !important; }
.hero-float-b { bottom: 13% !important; left: -14% !important; }

@media (max-width: 900px) {
  body::after { opacity: 0.35; }
  #fx-canvas { opacity: 0; }
  #fx-canvas.is-live { opacity: 0.6; }
  .band { backdrop-filter: none; }
  .card, .stat-panel, .plan-card { backdrop-filter: blur(8px); }
}
