/* ============================================================
   BURSAEDGE - SHARED THEME SYSTEM
   Token-based light/dark theming. Dark is the first-visit default
   (set by ThemeInit, one-time reset); light stays available via the toggle.
   Flip via [data-theme] on <html>.
   Used by both bursaedge.com and wait.bursaedge.com
   ============================================================ */
@import url("/brand/palette.css");

/* ---------- ACCENT TOKENS (shared across themes) ---------- */
:root {
  --blue: #6C9BFF;
  --blue-deep: #4F83F4;
  --gold: var(--be-color-primary);
  --gold-bright: var(--be-color-primary);
  --gold-mark: var(--be-color-primary);
  --font-display: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Liberation Sans', Arial, sans-serif;
  --font-mono: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Liberation Sans', Arial, sans-serif;
  --font: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Liberation Sans', Arial, sans-serif;
  --radius-card: 12px;
  --radius-btn: 10px;
  --radius-chip: 6px;
  --maxw: 1200px;

  /* motion */
  --dur-fast: 120ms;
  --dur-base: 160ms;
  --dur-slow: 240ms;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
}

/* ---------- DARK THEME (the ledger) ---------- */
:root,
[data-theme="dark"] {
  --bg: #0C0B09;
  --bg-page: #0C0B09;
  --bg-alt: #14120E;
  --bg-gradient: none;
  --bg-gradient-soft: none;
  --marquee-bg: #14120E;

  --surface: #14120E;
  --surface-solid: #14120E;
  --surface-2: #1B1813;
  --surface-hover: rgba(255,255,255,0.04);

  --border: #2E2820;
  --border-soft: #221E17;
  --border-strong: #40382D;

  --text-1: #F2EDE3;
  --text-2: #A79D8B;
  --text-3: #827866;
  --text-4: #6B6355;
  --text: var(--text-1);
  --eyebrow: var(--text-2);

  --blue-ink: #6C9BFF;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue-ink);

  --green: #33C27D;
  --red: #E8505B;
  --amber: #D9A93F;
  --green-text: #33C27D;

  --card-shadow: none;
  --orb-opacity: 0.6;
  --grid-opacity: 0.03;
  --grid-color: rgba(255,255,255,0.5);

  --input-bg: rgba(255,255,255,0.06);
  --input-bg-focus: rgba(255,255,255,0.09);
  --input-border: #2E2820;

  --header-bg: rgba(12,11,9,.9);
  --btn-sec-border: #2E2820;
  --btn-sec-text: #F2EDE3;
  --btn-sec-hover-bg: rgba(255,255,255,0.04);

  --eyebrow-bg: var(--surface-2);
  --eyebrow-border: var(--border-soft);
}

/* ---------- LIGHT THEME (toggle-selected) ----------
   Contrast pass (2026-06-15) kept: every muted tier is AA on white.
   Surfaces are flat white with a visible hairline; elevation comes from
   the line ladder, not shadow. */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-page: #ffffff;
  --bg-alt: #F2F4F7;                 /* perceptible band so white cards/sections separate */
  --bg-gradient: none;
  --bg-gradient-soft: none;
  --marquee-bg: #FAFAFB;

  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #F2F4F7;
  --surface-hover: rgba(16,24,40,0.04);

  --border: #E4E7EC;        /* default hairline */
  --border-soft: #EEF0F3;   /* inner hairlines, subordinate to --border */
  --border-strong: #D0D5DD; /* emphasised rules */

  --text-1: #101828;        /* approx 16:1  headings / primary */
  --text-2: #475467;        /* approx 7:1   body */
  --text-3: #667085;        /* approx 4.8:1 muted - AA */
  --text-4: #6B7280;        /* approx 4.5:1 faintest readable tier - AA on white */
  --text: var(--text-1);
  --eyebrow: var(--text-2);

  --blue-ink: #1D4ED8;
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue-ink);

  --green: #12B76A;
  --red: #B42318;
  --amber: #DC6803;
  --green-text: #0A7A47;    /* approx 5:1 status label on the pale-green badge */

  --card-shadow: 0 1px 2px rgba(16,24,40,0.04);
  --orb-opacity: 0.4;
  --grid-opacity: 0.05;
  --grid-color: rgba(16,24,40,0.4);

  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --input-border: #D0D5DD;

  --header-bg: rgba(255,255,255,0.85);
  --btn-sec-border: #D0D5DD;
  --btn-sec-text: #101828;
  --btn-sec-hover-bg: #F2F4F7;       /* clearer secondary-button hover */

  --eyebrow-bg: var(--surface-2);
  --eyebrow-border: var(--border-soft);
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font);
  color: var(--text-1);
  background: var(--bg-page);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background var(--dur-slow) var(--ease-out), color var(--dur-slow) var(--ease-out);
}
a { text-decoration: none; color: inherit; }
input, button, textarea, select { font-family: var(--font); }
p { text-wrap: pretty; }
h1, h2, h3, h4 { color: var(--text-1); }
:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 2px; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.be-container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.be-section { padding: 120px 32px; position: relative; overflow: hidden; }
.be-section[id] { scroll-margin-top: 88px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.3;
  color: var(--eyebrow); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--radius-chip);
  background: var(--eyebrow-bg); border: 1px solid var(--eyebrow-border);
}
.h1 { font-size: clamp(32px, 3.6vw, 48px); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.h2 { font-size: 40px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.lead { font-size: 21px; font-weight: 400; color: var(--text-2); line-height: 1.5; }
.body { font-size: 17px; color: var(--text-2); line-height: 1.65; }
.tnum { font-variant-numeric: tabular-nums; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-glow {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 14px 28px;
  background: var(--blue);
  color: #101828; border: none; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 16px; cursor: pointer; white-space: nowrap;
  box-shadow: none;
  position: relative;
  transition: background var(--dur-base) var(--ease-out);
}
.btn-glow:hover { background: var(--blue-deep); }

.btn-glow-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 8px 18px;
  background: var(--blue);
  color: #101828; border: none; border-radius: var(--radius-btn);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  box-shadow: none;
  transition: background var(--dur-base) var(--ease-out);
}
.btn-glow-sm:hover { background: var(--blue-deep); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 14px 24px;
  background: transparent; color: var(--btn-sec-text);
  border: 1px solid var(--btn-sec-border); border-radius: var(--radius-btn);
  font-weight: 500; font-size: 16px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.btn-secondary-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 8px 16px;
  background: transparent; color: var(--btn-sec-text);
  border: 1px solid var(--btn-sec-border); border-radius: var(--radius-btn);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.btn-secondary-sm:hover { background: var(--surface-hover); border-color: var(--border-strong); }

.nav-link {
  font-size: 15px; font-weight: 500; color: var(--text-2);
  transition: color var(--dur-base) var(--ease-out); cursor: pointer;
}
.nav-link:hover { color: var(--text-1); }

/* ============================================================
   CARDS
   ============================================================ */
.be-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
}

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes orbFloat0 {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  33% { transform: translate(-50%, -50%) translate(34px, -44px); }
  66% { transform: translate(-50%, -50%) translate(-22px, 22px); }
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  33% { transform: translate(-50%, -50%) translate(-44px, 32px); }
  66% { transform: translate(-50%, -50%) translate(26px, -16px); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  33% { transform: translate(-50%, -50%) translate(22px, 38px); }
  66% { transform: translate(-50%, -50%) translate(-38px, -26px); }
}
@keyframes glowRingPulse {
  0%, 100% { transform: scale(1); opacity: 0.25; }
  50% { transform: scale(1.7); opacity: 0; }
}
@keyframes cursorBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes revealUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes typingCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.marquee-track {
  display: flex; align-items: center;
  animation: marquee-scroll 32s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }

/* ============================================================
   SC REGULATORY FOOTER (small, muted)
   ============================================================ */
.sc-footer {
  font-size: 13px; color: var(--text-2); line-height: 1.65;
  text-align: center; max-width: 820px; margin: 0 auto;
}
.sc-footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }
.sc-footer a:hover { color: var(--blue-ink); }

/* ============================================================
   EFFECTS
   ============================================================ */
/* Progressive enhancement: content stays visible until effects.js has its observer ready. */
.reveal-el {
  transition: opacity 0.42s cubic-bezier(0.16,1,0.3,1), transform 0.42s cubic-bezier(0.16,1,0.3,1);
}
.effects-ready .reveal-el {
  opacity: 0;
  transform: translateY(12px);
}
.effects-ready .reveal-el.is-visible {
  opacity: 1;
  transform: none;
}
.tilt-card {
  transition: transform 0.2s ease-out;
  position: relative;
  overflow: hidden;
}
.tilt-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  transition: background 0.15s ease;
  border-radius: inherit;
}
.tilt-content {
  position: relative;
  z-index: 2;
}

.floating-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  opacity: var(--orb-opacity);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(44px);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  opacity: var(--grid-opacity);
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(var(--grid-color) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

/* header scroll state */
header.scrolled {
  background: var(--header-bg) !important;
  backdrop-filter: blur(16px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.3) !important;
  border-bottom-color: var(--border) !important;
}

/* hide on mobile */
.hide-mobile { display: flex; }
@media (max-width: 860px) { .hide-mobile { display: none !important; } }

/* FAQ rows */
.faq-item {
  padding-bottom: 26px;
  margin-bottom: 26px;
  transition: background var(--dur-base) var(--ease-out);
}
.faq-item:hover { background: var(--surface-hover); }
.faq-item:not(:last-child) { border-bottom: 1px solid var(--border); }

/* theme toggle button */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--btn-sec-border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
  padding: 0;
}
.theme-toggle:hover { background: var(--surface-hover); border-color: var(--border-strong); color: var(--text-1); }

/* pillar bars */
.pillar-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--blue);
  box-shadow: none;
  width: 0;
  transition: width 1s cubic-bezier(0.16,1,0.3,1);
}
.pillar-bars-visible .pillar-bar-fill { }

/* glow dot */
.glow-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.glow-dot-ring1 {
  position: absolute;
  border-radius: 50%;
  animation: glowRingPulse 2s ease-in-out infinite;
  opacity: 0.18;
}
.glow-dot-ring2 {
  position: absolute;
  border-radius: 50%;
  animation: glowRingPulse 2s ease-in-out 0.3s infinite;
  opacity: 0.28;
}
.glow-dot-core {
  border-radius: 50%;
  position: relative;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .be-section { padding: 72px 20px; }
  .be-container { padding: 0 20px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .h2 { font-size: 30px; }
  .lead { font-size: 18px; }
}
@media (max-width: 480px) {
  .h2 { font-size: 26px; }
  .be-section { padding: 56px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .marquee-track { animation: none !important; }
  .reveal-el { opacity: 1 !important; transform: none !important; transition: none !important; }
  .pillar-bar-fill { transition: none !important; }
}

/* Ledger composition: Instrument Sans for all text (display = h1/h2),
   quiet surfaces, semantic data colour (green/red = market only). */
h1, h2, .h1, .h2 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.025em;
}
h3, h4, .h3 {
  font-family: var(--font);
  font-weight: 600;
}
.tnum, .data-value, .price, .metric {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.gold-accent, .premium-accent { color: var(--gold-bright); }
