/* BlinkEx static — base design tokens & global styles */

/* ─────────────────────────────────────────────────────────────────────────
   Cascade layer order (Task-117).

   This file is linked from index.html BEFORE Vite injects the Tailwind
   stylesheet, so it is the document's first chance to declare layer order —
   and layer order is fixed by first declaration, not by file order. Naming the
   full Tailwind ladder here guarantees `utilities` always sorts last, so no
   base or component rule added below can silently outrank a Tailwind utility
   the later marketing tasks rely on.

   Rules that existed before this task remain unlayered and therefore still
   outrank every layer; that is deliberate, so this change alters nothing
   visually. All NEW base/component rules in this file go inside a layer.
   ───────────────────────────────────────────────────────────────────────── */
@layer theme, base, components, utilities;

:root {
  --bg: #0D141B;
  --bg-elev: #131C25;
  --bg-card: #131C25;
  --fg: #ffffff;
  --fg-dim: rgba(255, 255, 255, 0.65);
  --fg-mute: rgba(255, 255, 255, 0.45);
  --fg-faint: rgba(255, 255, 255, 0.30);
  --border: rgba(233, 223, 198, 0.10);
  --border-strong: rgba(233, 223, 198, 0.15);
  --primary: #C8A45D;
  --primary-foreground: #0A1016;
  --danger: #E0675C;
  --success: #34d399;

  /* Accent discipline (Task-117) — mirrors the @theme tokens in
     src/index.css. Three sanctioned jobs, one named token each. Decoration is
     not one of them: the former --primary-glow token has been removed and the
     depth ramp below replaces it. */
  --accent-action: #C8A45D;
  --accent-action-foreground: #0A1016;
  --accent-live: #4FB88A;
  --accent-nav: #E6DCC3;

  /* Depth = tonal layers + hairlines, never accent light. */
  --surface-base: #0D141B;
  --surface-raised: #131C25;
  --surface-overlay: #1A2530;
  --surface-sunken: #091017;
  --surface-elevated: #223040;
  --legal-paper: #F1EDE3;
  --ink: #0A1016;
  --hairline: rgba(233, 223, 198, 0.10);
  --hairline-strong: rgba(233, 223, 198, 0.15);
  --hairline-bright: rgba(233, 223, 198, 0.24);

  /* Focus floor. */
  --focus-ring: #E6DCC3;
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  --font-sans: 'Manrope Variable', 'Manrope', system-ui, -apple-system, sans-serif;
  /* Task-117: a real numeric monospace. `font-mono` no longer aliases the body
     face, so prices, percentages, market figures and eyebrow labels render in
     a typeface with tabular figures. */
  --font-mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale (Task-117) — seven steps, one role each. Kept byte-identical to
     the @theme scale in src/index.css so the two stylesheets cannot drift.
       display  page hero H1 (fluid)      title    section heading (fluid)
       heading  card / subsection heading lead     hero subcopy & section lede
       body     reading copy              meta     dense market data, captions
       micro    eyebrow labels, badges, ticker tags, fine print               */
  --text-display: clamp(2.75rem, 1.45rem + 5.8vw, 6rem);
  --text-title: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --text-heading: 1.375rem;
  --text-lead: 1.125rem;
  --text-body: 0.9375rem;
  --text-meta: 0.8125rem;
  --text-micro: 0.6875rem;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

* {
  border-color: var(--border);
}

html {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection { background: var(--primary); color: var(--primary-foreground); }

a { text-decoration: none; }
@layer base {
  a { color: inherit; }
  button, input, select, textarea { font: inherit; }
  button, input, select, textarea { color: inherit; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* Depth wash — the neutral replacement for the former .bg-radial-primary
   chartreuse glow (Task-117). Mirrors .surface-veil in src/index.css. */
@layer components {
  .surface-veil {
    background-image: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(255,255,255,0.055), rgba(255,255,255,0.018) 45%, transparent 75%);
  }
  .surface-veil-bottom {
    background-image: radial-gradient(ellipse 70% 55% at 50% 100%, rgba(255,255,255,0.055), rgba(255,255,255,0.018) 45%, transparent 75%);
  }
}

/* Lucide icon defaults */
[data-lucide] { width: 1em; height: 1em; stroke-width: 1.75; }

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.pulse-soft { animation: pulse-soft 2.4s ease-in-out infinite; }

@keyframes ping-soft {
  75%, 100% { transform: scale(2); opacity: 0; }
}
.animate-ping-soft { animation: ping-soft 1.6s cubic-bezier(0,0,0.2,1) infinite; }

@keyframes float-mascot {
  0%, 100% { transform: translateY(-15px) rotate(-3deg); }
  50%       { transform: translateY(15px)  rotate(3deg); }
}
.float-mascot { animation: float-mascot 6s ease-in-out infinite; }

@keyframes press-marquee {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.press-marquee-track { animation: press-marquee 55s linear infinite; }
.press-marquee-wrap:hover .press-marquee-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .press-marquee-track { animation: none; } }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ticker-track {
  display: inline-flex;
  gap: 48px;
  animation: ticker-scroll 80s linear infinite;
  white-space: nowrap;
}

/* Card base */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card-hover { transition: border-color .2s, transform .2s; }
.card-hover:hover { border-color: var(--border-strong); }

/* Button base (utility classes layered on top of Tailwind) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  height: 44px;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: #D6B676; }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { background: rgba(255,255,255,0.04); }
.btn-ghost { background: transparent; color: var(--fg-dim); }
.btn-ghost:hover { color: var(--fg); background: rgba(255,255,255,0.04); }

/* Eyebrow / label-mono — the `micro` step of the type scale, in the mono face. */
.label-mono {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(200, 164, 93, 0.85);
}
.label-mute {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
}

/* Section divider */
.section-divider { border-top: 1px solid rgba(255,255,255,0.05); }

/* Mobile menu — slide-in drawer + overlay fade, mirroring framer-motion. */
.mobile-menu {
  pointer-events: none;
  visibility: hidden;
}
.mobile-menu.is-open {
  pointer-events: auto;
  visibility: visible;
}
.mobile-menu [data-mobile-overlay] {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.mobile-menu.is-open [data-mobile-overlay] { opacity: 1; }
.mobile-menu [data-mobile-panel] {
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.mobile-menu.is-open [data-mobile-panel] { transform: translateX(0); }
@media (min-width: 1024px) { .mobile-menu { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .mobile-menu [data-mobile-overlay],
  .mobile-menu [data-mobile-panel] { transition: none; }
}

/* Utility for hidden until JS-loaded */
[data-i18n][data-i18n-loading] { opacity: 0.6; }

/* No CSS guard for [data-reveal] — opacity is managed entirely by GSAP in
   home.js. If JS fails to run, sections must remain fully visible. */

/* ═════════════════════════════════════════════════════════════════════════
   Legal prose (Task-121)

   The three legal documents are the only long-form reading surface on the
   site, so they get a reading measure (`Container width="prose"`) and the
   shared type scale rather than the px ladder (22/16/15px) that existed only
   here. Steps used: `heading` for h2, `lead` for h3, `body` for copy — the
   same three steps a card uses, so a legal page is not its own typographic
   dialect.

   The bullet marker and inline links were chartreuse. A bullet is decoration
   and body copy is not one of the accent's three jobs, so both resolve onto
   the neutral ramp; links stay unmistakable through a permanent underline,
   which also survives a colour-blind reading.

   This block is duplicated verbatim in the other stylesheet — both ship on the
   same document and the unlayered one would otherwise win. Change both.
   ═════════════════════════════════════════════════════════════════════════ */
.legal-prose h2 {
  font-size: var(--text-heading);
  line-height: var(--text-heading--line-height);
  letter-spacing: var(--text-heading--letter-spacing);
  font-weight: var(--text-heading--font-weight);
  color: #fff;
  margin-top: 2.5rem;
  margin-bottom: 0.875rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.legal-prose h2:first-child { margin-top: 0; }
.legal-prose h3 {
  font-size: var(--text-lead);
  line-height: var(--text-lead--line-height);
  font-weight: 600;
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.legal-prose p {
  font-size: var(--text-body);
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  margin-bottom: 0.875rem;
}
.legal-prose ul { list-style: none; padding-left: 0; margin-bottom: 1rem; }
.legal-prose ul li {
  position: relative;
  padding-left: 1.375rem;
  margin-bottom: 0.625rem;
  font-size: var(--text-body);
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
}
.legal-prose ul li::before {
  content: ""; position: absolute; left: 4px; top: 0.7em; width: 5px; height: 5px;
  border-radius: 999px; background: rgba(255,255,255,0.32);
}
.legal-prose strong { color: #fff; font-weight: 600; }
.legal-prose a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
  text-underline-offset: 2px;
}
.legal-prose a:hover { text-decoration-color: rgba(255,255,255,0.85); }
.legal-prose .clause-num {
  color: rgba(255,255,255,0.55); font-family: var(--font-mono); font-weight: 700; margin-right: 8px;
}

/* ═════════════════════════════════════════════════════════════════════════
   Motion floor (Task-117)

   Companion to the block in src/index.css. Both stylesheets ship on the same
   document, so both need to honour the preference or the surface is only half
   calm: this file owns the ticker, the press marquee, the mascot float, the
   fade-up reveal and the soft pulse/ping loops, plus `scroll-behavior: smooth`
   on <html>.

   Entrance animations are collapsed rather than removed — .fade-up fills
   `both` from `opacity: 0`, so `animation: none` would leave content invisible
   — while continuous transports are stopped outright.
   ═════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .ticker-track,
  .press-marquee-track,
  .float-mascot,
  .pulse-soft,
  .animate-ping-soft {
    animation: none !important;
  }
}

/* ═════════════════════════════════════════════════════════════════════════
   Focus floor (Task-117)

   src/index.css owns the single focus-visible treatment for the SPA. This file
   loads first and its unlayered rules would otherwise outrank it, so the same
   treatment is restated here inside @layer base — layered rules never beat the
   Tailwind `utilities` layer, so the SPA rule stays authoritative and this one
   only covers the window before the bundle's CSS is applied.
   ═════════════════════════════════════════════════════════════════════════ */
@layer base {
  :focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
  }
}

/* ───── Vault Ledger: legal paper ────────────────────────────────────────
   Long-form legal copy reads on a neutral paper sheet with ink text —
   a reading surface, not a dark card. Duplicated in both public stylesheets. */
.legal-prose {
  background: #F1EDE3;
  color: #0A1016;
  border-radius: 28px;
  padding: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  border-top: 1px solid #C8A45D;
}
.legal-prose h2 { color: #0A1016; border-bottom: 2px solid rgba(10, 16, 22, 0.12); }
.legal-prose h3, .legal-prose strong { color: #0A1016; }
.legal-prose p, .legal-prose ul li { color: rgba(10, 16, 22, 0.82); }
.legal-prose ul li::before { background: #C8A45D; }
.legal-prose a { color: #0D141B; text-decoration-color: rgba(13, 20, 27, 0.5); }
.legal-prose a:hover { text-decoration-color: #0D141B; }
.legal-prose .clause-num { color: #0D141B; }
.legal-prose table, .legal-prose td, .legal-prose th { color: #0A1016; border-color: rgba(10, 16, 22, 0.15) !important; }
