/* ═══════════════════════════════════════════════════════════
   MEZE NETWORK — tokens.css  v2
   Brand tokens + base styles for meze.network
   ═══════════════════════════════════════════════════════════ */

/* ─── GOOGLE FONTS ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Space+Mono:wght@400;700&display=swap');

/* ─── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ─── BRAND TOKENS ──────────────────────────────────────── */
:root {
  /* -- Primary Brand Colors -- */
  --m:        #CC007A;
  --mp:       #E8008A;
  --md:       #72004A;
  --mlight:   #FF4DB2;

  /* -- Avalanche Colors -- */
  --ar:       #E84142;

  /* -- Background Scale -- */
  --bg:       #06030D;
  --bg1:      #0A0518;
  --bg2:      #0F0820;
  --bg3:      #140B28;

  /* -- Card Surfaces -- */
  --card:     rgba(255, 255, 255, 0.035);
  --cardb:    rgba(255, 255, 255, 0.07);

  /* -- Glass (glassmorphism) -- */
  --glass:    rgba(255, 255, 255, 0.05);
  --glass-b:  rgba(255, 255, 255, 0.11);

  /* -- Text Scale -- */
  --text:     #FFFFFF;
  --t2:       rgba(255, 255, 255, 0.65);
  --t3:       rgba(255, 255, 255, 0.38);
  --t4:       rgba(255, 255, 255, 0.18);

  /* -- Glow Colors -- */
  --gm:       rgba(204, 0, 122, 0.35);
  --gm2:      rgba(232, 0, 138, 0.18);
  --ga:       rgba(232, 65, 66, 0.3);

  /* -- Layout -- */
  --r:        16px;
  --r-sm:     8px;
  --r-lg:     24px;
  --container: 1120px;

  /* -- Typography -- */
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;

  /* -- Transitions -- */
  --transition:      all 0.25s ease;
  --transition-slow: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── BASE ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain overlay — barely visible texture that adds depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

img     { display: block; max-width: 100%; }
a       { text-decoration: none; color: inherit; }
button  { cursor: pointer; font-family: inherit; }

/* ─── CANVAS BACKGROUND ──────────────────────────────────── */
#bgc {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
  pointer-events: none;
}

/* ─── SHARED LAYOUT ─────────────────────────────────────── */
section {
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
}

/* ─── SHARED TYPOGRAPHY ──────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mp);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.section-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--t2);
  line-height: 1.8;
  max-width: 600px;
}

/* ─── GRADIENT TEXT ──────────────────────────────────────── */
.grad-text {
  background: linear-gradient(135deg, var(--mp) 0%, #FF6EC7 50%, var(--ar) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── SHARED BUTTONS ─────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: var(--mp);
  color: #fff;
  border: none;
  padding: 14px 30px;
  border-radius: var(--r-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--mlight);
  box-shadow: 0 0 32px var(--gm), 0 4px 20px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.btn-disabled,
.btn-primary.btn-disabled {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
  pointer-events: none;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
}
[data-theme="day"] .btn-disabled {
  background: rgba(64, 37, 132, 0.06);
  color: rgba(42, 34, 24, 0.45);
  border-color: rgba(42, 34, 24, 0.12);
}

.btn-secondary {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--t2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 14px 30px;
  border-radius: var(--r-sm);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

/* ─── SCROLL REVEAL ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
  opacity: 1;
  transform: none;
}

/* Stagger delays for grid children */
.pcard.reveal:nth-child(2)     { transition-delay: 0.12s; }
.pcard.reveal:nth-child(3)     { transition-delay: 0.24s; }
.principle.reveal:nth-child(2) { transition-delay: 0.08s; }
.principle.reveal:nth-child(3) { transition-delay: 0.16s; }
.principle.reveal:nth-child(4) { transition-delay: 0.24s; }
.principle.reveal:nth-child(5) { transition-delay: 0.32s; }
.mcard.reveal:nth-child(2)     { transition-delay: 0.10s; }
.mcard.reveal:nth-child(3)     { transition-delay: 0.20s; }
.mcard.reveal:nth-child(4)     { transition-delay: 0.30s; }
.tstat.reveal:nth-child(2)     { transition-delay: 0.10s; }
.tstat.reveal:nth-child(3)     { transition-delay: 0.20s; }
.tstat.reveal:nth-child(4)     { transition-delay: 0.30s; }
.eco-card.reveal:nth-child(2)  { transition-delay: 0.12s; }
.eco-card.reveal:nth-child(3)  { transition-delay: 0.24s; }
.eco-card.reveal:nth-child(4)  { transition-delay: 0.36s; }
.ms.reveal:nth-child(2)        { transition-delay: 0.08s; }
.ms.reveal:nth-child(3)        { transition-delay: 0.16s; }
.ms.reveal:nth-child(4)        { transition-delay: 0.24s; }
.hstat.reveal:nth-child(2)     { transition-delay: 0.10s; }
.hstat.reveal:nth-child(3)     { transition-delay: 0.20s; }

/* ─── SHARED ANIMATIONS ─────────────────────────────────── */
@keyframes pdot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.75); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(0.5deg); }
  66%       { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1);    opacity: 0.7; }
  50%       { transform: scale(1.18); opacity: 0.35; }
}

@keyframes ringExpand {
  0%   { opacity: 0.7; transform: scale(0.94); }
  100% { opacity: 0;   transform: scale(1.08); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes hlbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,0,138,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(232,0,138,0); }
}

/* ─── DAY MODE — warm paper white ─────────────────────── */
[data-theme="day"] {
  /* Warm paper white — subtle warm undertone, not yellow cream */
  --bg:    #F5F2EE;
  --bg1:   #EFEBE5;
  --bg2:   #E9E4DC;
  --bg3:   #E0DAD0;

  /* Cards: soft blush — pulled from the magenta brand, distinct from page bg */
  --card:  #FBF1F6;
  --cardb: rgba(204, 0, 122, 0.14);

  --glass:   rgba(252, 244, 248, 0.92);
  --glass-b: rgba(204, 0, 122, 0.16);

  /* Body text: warm dark — never pure black, never harsh */
  --text: #2A2218;
  --t2:   rgba(42, 34, 24, 0.66);
  --t3:   rgba(42, 34, 24, 0.42);
  --t4:   rgba(42, 34, 24, 0.20);

  --gm:   rgba(204, 0, 122, 0.16);
  --gm2:  rgba(232, 0, 138, 0.10);
  --ga:   rgba(232, 65, 66, 0.16);

  /* Day-mode accent — indigo pulled from the wordmark */
  --amber:      #402584;
  --amber-glow: rgba(64, 37, 132, 0.22);
}

/* Day-mode body: gentle warm wash — paper with soft brand glow */
[data-theme="day"] body {
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 0, 138, 0.06),  transparent 50%),
    radial-gradient(circle at 82% 78%, rgba(64, 37, 132, 0.06), transparent 50%),
    var(--bg);
}

/* Soften the grain overlay in day mode (less visible on cream) */
[data-theme="day"] body::before {
  opacity: 0.045;
  mix-blend-mode: multiply;
}

/* Smooth transition when switching themes */
body,
header,
footer,
nav a,
.pcard, .principle, .mcard, .tstat, .eco-card,
.partner-card, .mev-tracker, .formula-card,
.avax-inner, .contact-strip, .ms,
.hero-live-badge, .hero-tag, .nav-cta,
.btn-primary, .btn-secondary,
.theme-toggle {
  transition:
    background-color 0.45s ease,
    border-color     0.45s ease,
    color            0.45s ease,
    box-shadow       0.45s ease;
}

/* ─── THEME TOGGLE BUTTON ────────────────────────────────── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t2);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.13);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Night → show sun icon (click to go day) */
.icon-sun  { display: block; }
.icon-moon { display: none;  }

/* Day → show moon icon (click to go night) */
[data-theme="day"] .icon-sun  { display: none;  }
[data-theme="day"] .icon-moon { display: block; }

[data-theme="day"] .theme-toggle {
  background: rgba(28, 18, 8, 0.06);
  border-color: rgba(28, 18, 8, 0.14);
  color: var(--t2);
}

[data-theme="day"] .theme-toggle:hover {
  background: rgba(28, 18, 8, 0.10);
  color: var(--text);
  border-color: rgba(28, 18, 8, 0.22);
}

/* ─── SOCIAL LINKS ──────────────────────────────────────── */
.social-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--t2);
  flex-shrink: 0;
}

.social-link:hover {
  background: rgba(204, 0, 122, 0.14);
  border-color: rgba(204, 0, 122, 0.4);
  color: var(--mp);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--gm);
}

.social-link svg { display: block; pointer-events: none; }
