/* ==========================================================================
   OUTDONE DESIGN SYSTEM — TOKENS & FOUNDATIONS
   Motto: "Consider it Outdone."
   Aesthetics: Swiss Structuralism, Architectural Restraint, High-Precision Telemetry
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* Font Families */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing Scale */
  --space-2xs: 0.125rem; /* 2px */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 0.75rem;   /* 12px */
  --space-base: 1rem;    /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4.5rem;   /* 72px */
  --space-4xl: 6rem;     /* 96px */

  /* Border Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-base: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 320ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1360px;
  --nav-height: 64px;
  --connector-height: 0px;
}

/* ==========================================================================
   THEME PALETTE (LIGHT THEME DEFAULT, OVERRIDDEN BY DARK)
   ========================================================================== */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Backgrounds */
  --bg-canvas: #FFFFFF;
  --bg-surface-0: #FAFAFC;
  --bg-surface-1: #F4F6F9;
  --bg-surface-2: #EAEFF5;
  --bg-surface-3: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-heavy: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #F8FAFC;

  /* Hairline Borders */
  --border-subtle: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-strong: #94A3B8;
  --border-glass: rgba(0, 0, 0, 0.06);

  /* Typography */
  --text-primary: #0F172A;     /* Dark Charcoal Ink */
  --text-secondary: #475569;   /* Slate Neutral */
  --text-muted: #64748B;       /* Subdued Spec */
  --text-ghost: #94A3B8;       /* De-emphasized */
  --text-inverse: #FFFFFF;

  /* Brand Accents */
  --brand-blue: #2563EB;       /* Royal Cobalt */
  --brand-blue-hover: #1D4ED8;
  --brand-blue-subtle: rgba(37, 99, 235, 0.08);
  --brand-blue-glow: rgba(37, 99, 235, 0.18);

  /* Semantic Accents */
  --accent-emerald: #059669;   /* Success / Escrow Released */
  --accent-emerald-subtle: rgba(5, 150, 105, 0.1);
  --accent-amber: #D97706;     /* Warning / Invite-Only / P1 */
  --accent-amber-subtle: rgba(217, 119, 6, 0.1);
  --accent-rose: #DC2626;      /* Danger / P0 Critical */
  --accent-rose-subtle: rgba(220, 38, 38, 0.1);
  --accent-violet: #7C3AED;    /* Concierge / VIP Custom */
  --accent-violet-subtle: rgba(124, 58, 237, 0.1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1);
  --shadow-glow: 0 0 24px rgba(37, 99, 235, 0.16);
}

/* ==========================================================================
   DARK THEME (Obsidian Glass Aesthetic)
   ========================================================================== */

[data-theme="dark"],
:root:has(> head > meta[name="color-scheme"][content="dark"]) {
  color-scheme: dark;

  /* Backgrounds */
  --bg-canvas: #0B0F19;        /* Light-sink Void Obsidian */
  --bg-surface-0: #0E1422;
  --bg-surface-1: #111827;     /* Plate Tier L1 */
  --bg-surface-2: #162032;     /* Elevated Glass Plate L2 */
  --bg-surface-3: #1E293B;     /* Raised Module */
  --bg-glass: rgba(17, 24, 39, 0.72);
  --bg-glass-heavy: rgba(11, 15, 25, 0.90);
  --bg-card-hover: rgba(30, 41, 59, 0.65);

  /* Hairline Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.24);
  --border-glass: rgba(255, 255, 255, 0.07);

  /* Typography */
  --text-primary: #F8FAFC;     /* Crisp Luminescent White */
  --text-secondary: #94A3B8;   /* Muted Slate */
  --text-muted: #64748B;       /* Technical Spec */
  --text-ghost: #475569;       /* Baseline Legend */
  --text-inverse: #0B0F19;

  /* Brand Accents */
  --brand-blue: #3B82F6;       /* Luminous Cobalt Bright */
  --brand-blue-hover: #60A5FA;
  --brand-blue-subtle: rgba(59, 130, 246, 0.12);
  --brand-blue-glow: rgba(59, 130, 246, 0.35);

  /* Semantic Accents */
  --accent-emerald: #10B981;   /* Cyber Emerald */
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-amber: #F59E0B;     /* Kinetic Amber */
  --accent-amber-subtle: rgba(245, 158, 11, 0.12);
  --accent-rose: #EF4444;      /* Cyber Rose / P0 */
  --accent-rose-subtle: rgba(239, 68, 68, 0.14);
  --accent-violet: #A78BFA;    /* Neo Violet */
  --accent-violet-subtle: rgba(167, 139, 250, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.85);
  --shadow-glow: 0 0 32px rgba(59, 130, 246, 0.25);
}

/* Base Reset & Core Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.55;
  transition: background-color var(--transition-base), color var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Architectural Grid & Section Wrappers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-base);
  padding-right: var(--space-base);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

/* Monospaced Precision Elements */
.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum' 1, 'zero' 1;
}

.display-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

/* Subtle Hairline Borders */
.hairline-border {
  border: 1px solid var(--border-subtle);
}

/* Glassmorphism Surface Utility */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
}
