/*
 * base.css  —  Glassmorphism Design System
 * Palette: Deep Cosmic Navy → Indigo → Teal
 * Style: Glassmorphism + motion-first
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ─── Cosmic Palette ─────────────────── */
  --col-void:       #04050f;     /* deep space black */
  --col-navy:       #080d1e;     /* midnight navy */
  --col-indigo:     #0f1535;     /* dark indigo */
  --col-deep:       #131a3d;     /* deep blue-indigo */

  /* Glass surfaces */
  --glass-1:        rgba(255,255,255,0.04);
  --glass-2:        rgba(255,255,255,0.07);
  --glass-3:        rgba(255,255,255,0.10);
  --glass-4:        rgba(255,255,255,0.14);

  /* Glass borders */
  --glass-border:   rgba(255,255,255,0.09);
  --glass-border-2: rgba(255,255,255,0.15);
  --glass-border-3: rgba(255,255,255,0.22);

  /* ─── Accent Palette ─────────────────── */
  --accent-cyan:    #38bdf8;       /* sky blue */
  --accent-violet:  #818cf8;       /* indigo-violet */
  --accent-teal:    #2dd4bf;       /* teal */
  --accent-emerald: #34d399;       /* emerald */
  --accent-rose:    #fb7185;       /* rose pink */
  --accent-amber:   #fbbf24;       /* amber */
  --accent-purple:  #a78bfa;       /* purple */

  /* Glow versions */
  --glow-cyan:      rgba(56,189,248,0.25);
  --glow-violet:    rgba(129,140,248,0.25);
  --glow-teal:      rgba(45,212,191,0.25);
  --glow-rose:      rgba(251,113,133,0.25);
  --glow-purple:    rgba(167,139,250,0.25);
  --glow-emerald:   rgba(52,211,153,0.25);

  /* ─── Text ───────────────────────────── */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255,255,255,0.90);
  --text-muted:     rgba(255,255,255,0.58);
  --text-dim:       rgba(255,255,255,0.30);

  /* ─── Structure ──────────────────────── */
  --nav-h:          86px;

  /* ─── Typography ─────────────────────── */
  --font-display:   'Space Grotesk', 'Inter', sans-serif;
  --font-body:      'Inter', sans-serif;

  /* ─── Radius ─────────────────────────── */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  18px;
  --r-xl:  24px;
  --r-2xl: 32px;

  /* ─── Motion ─────────────────────────── */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:  0.15s;
  --t-base:  0.25s;
  --t-slow:  0.45s;
  --t-xslow: 0.7s;
}

html, body {
  height: 100%;
  background: var(--col-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Animated Cosmic Background ────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,   rgba(56,189,248,0.07)  0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 100%, rgba(167,139,250,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%,  rgba(45,212,191,0.04)  0%, transparent 70%),
    linear-gradient(145deg, #04050f 0%, #080d1e 40%, #080a18 70%, #050810 100%);
}

/* Starfield texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(1px 1px at 15% 20%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 70%, rgba(255,255,255,0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 55%, rgba(255,255,255,0.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 85%, rgba(255,255,255,0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 35%, rgba(255,255,255,0.17) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 78%, rgba(255,255,255,0.20) 0%, transparent 100%),
    radial-gradient(2px 2px at 8%  45%, rgba(56,189,248,0.35)  0%, transparent 100%),
    radial-gradient(2px 2px at 65% 90%, rgba(167,139,250,0.3)  0%, transparent 100%),
    radial-gradient(2px 2px at 38% 10%, rgba(45,212,191,0.28)  0%, transparent 100%);
  pointer-events: none;
}

/* ─── Scrollbar ──────────────────────────── */
::-webkit-scrollbar            { width: 4px; height: 4px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(56,189,248,0.4); }

/* ─── Glassmorphism Mixin Class ──────────── */
.glass {
  background: var(--glass-2);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
}

.glass-sm {
  background: var(--glass-1);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}

/* ─── Utility ────────────────────────────── */
.hidden { display: none !important; }

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ─── Floating Orbs (background decoration) ─ */
.orb {
  position: fixed;
  border-radius: 50%;
  /* 80px → 56px. The orbs are very faint (0.07–0.13 alpha radial gradients),
     so this softer blur is visually indistinguishable but cheaper to rasterise
     and re-composite as they drift behind the glass. */
  filter: blur(56px);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}

.orb-1 {
  width: 540px; height: 540px;
  background: radial-gradient(circle, rgba(56,189,248,0.13) 0%, transparent 70%);
  top: -120px; left: -160px;
  animation: orb-drift-1 20s ease-in-out infinite alternate;
}

.orb-2 {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(167,139,250,0.11) 0%, transparent 70%);
  bottom: -160px; right: -110px;
  animation: orb-drift-2 26s ease-in-out infinite alternate;
}

.orb-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(45,212,191,0.09) 0%, transparent 70%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-drift-3 17s ease-in-out infinite alternate;
}

.orb-4 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(251,113,133,0.07) 0%, transparent 70%);
  top: 20%; right: -80px;
  animation: orb-drift-4 14s ease-in-out infinite alternate;
}

/* Multi-waypoint drift — more organic than simple A→B.
   PERF: scale() was removed from these keyframes. The orbs sit behind ~200
   backdrop-filter glass panels; scaling a 540–640px blurred element every frame
   forced every overlapping glass surface to re-sample + re-blur its backdrop
   (the dominant cause of dashboard jank). translate() pans the orb without
   changing its rasterised size, so the look is virtually identical but the
   per-frame backdrop invalidation is far cheaper. opacity kept (compositor-cheap). */
@keyframes orb-drift-1 {
  0%   { transform: translate(0,    0); }
  30%  { transform: translate(55px, 75px); }
  65%  { transform: translate(85px, 25px); }
  100% { transform: translate(50px, 65px); }
}

@keyframes orb-drift-2 {
  0%   { transform: translate(0,     0); }
  35%  { transform: translate(-45px,-55px); }
  70%  { transform: translate(-75px,-20px); }
  100% { transform: translate(-55px,-70px); }
}

@keyframes orb-drift-3 {
  0%   { transform: translate(-50%,-50%); opacity: 0.55; }
  40%  { transform: translate(-52%,-47%); opacity: 0.85; }
  75%  { transform: translate(-47%,-54%); opacity: 0.70; }
  100% { transform: translate(-50%,-50%); opacity: 1.00; }
}

@keyframes orb-drift-4 {
  0%   { transform: translate(0,    0); opacity: 0.6; }
  45%  { transform: translate(-25px,55px); opacity: 0.9; }
  100% { transform: translate(-50px,20px); opacity: 0.7; }
}

/* ══════════════════════════════════════════
   LIGHT MODE — Tableau Liquid Glass Palette
══════════════════════════════════════════ */

[data-theme="light"] {
  /* Base background colour (used by html,body rule) */
  --col-void:       #dde4f6;

  /* Glass surfaces — frosted white */
  --glass-1:        rgba(255,255,255,0.52);
  --glass-2:        rgba(255,255,255,0.68);
  --glass-3:        rgba(255,255,255,0.80);
  --glass-4:        rgba(255,255,255,0.92);

  /* Glass borders — soft purple tint */
  --glass-border:   rgba(130,100,200,0.18);
  --glass-border-2: rgba(130,100,200,0.32);
  --glass-border-3: rgba(130,100,200,0.48);

  /* Accents — darkened for light-bg contrast */
  --accent-cyan:    #0284c7;
  --accent-violet:  #4f46e5;
  --accent-teal:    #0d9488;
  --accent-emerald: #059669;
  --accent-rose:    #e11d48;
  --accent-amber:   #d97706;
  --accent-purple:  #7c3aed;

  /* Glows */
  --glow-cyan:      rgba(2,132,199,0.20);
  --glow-violet:    rgba(79,70,229,0.20);
  --glow-teal:      rgba(13,148,136,0.20);
  --glow-rose:      rgba(225,29,72,0.20);
  --glow-purple:    rgba(124,58,237,0.20);
  --glow-emerald:   rgba(5,150,105,0.20);

  /* Text — deep purple-navy */
  --text-primary:   #13103a;
  --text-secondary: rgba(19,16,58,0.74);
  --text-muted:     rgba(19,16,58,0.50);
  --text-dim:       rgba(19,16,58,0.28);
}

/* Background: soft lavender gradient instead of cosmic dark */
/* Direct body override ensures the base colour changes even if ::before z-index is tricky */
html[data-theme="light"],
html[data-theme="light"] body {
  background: #dde4f6;
}

html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%,   rgba(56,189,248,0.18)  0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 100%, rgba(167,139,250,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%,  rgba(45,212,191,0.10)  0%, transparent 70%),
    linear-gradient(145deg, #dde4f6 0%, #e9dff8 40%, #d9e5f8 70%, #e4daf6 100%) !important;
}

/* Remove starfield in light mode */
html[data-theme="light"] body::after { opacity: 0; }

/* Orbs — slightly more visible on light background */
html[data-theme="light"] .orb-1 {
  background: radial-gradient(circle, rgba(56,189,248,0.28) 0%, transparent 70%);
}
html[data-theme="light"] .orb-2 {
  background: radial-gradient(circle, rgba(167,139,250,0.22) 0%, transparent 70%);
}
html[data-theme="light"] .orb-3 {
  background: radial-gradient(circle, rgba(45,212,191,0.18) 0%, transparent 70%);
}

/* Scrollbars */
html[data-theme="light"] ::-webkit-scrollbar-thumb       { background: rgba(130,100,200,0.22); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(2,132,199,0.45); }

/* ── Under-development placeholder (shared by all WIP tabs) ─── */
.wip-wrap {
  position: relative;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
}

.wip-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(72px, 16vw, 190px);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(56,189,248,0.04);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

html[data-theme="light"] .wip-bg-text {
  color: rgba(56,189,248,0.08);
}

.wip-card {
  position: relative;
  z-index: 1;
  background: var(--glass-2);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 56px 72px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
}

html[data-theme="light"] .wip-card {
  background: rgba(255,255,255,0.55);
  border-color: rgba(100,120,200,0.18);
  box-shadow: 0 24px 64px rgba(80,90,160,0.14);
}

.wip-icon-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* color overridden per-tab */
}

.wip-eyebrow {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.26em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.wip-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 22px;
  line-height: 1;
}

.wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 100px;
  padding: 6px 18px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 26px;
  /* color overridden per-tab */
}

.wip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: wip-pulse 2s ease-in-out infinite;
}

@keyframes wip-pulse {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: 0.3; transform: scale(0.75); }
}

.wip-body {
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: 0.025em;
  color: var(--text-muted);
}
