/* EndCosmos — Design Tokens & Base */
:root {
  /* Cosmic Color Palette */
  --bg-primary: #0a0a0f;
  --bg-secondary: #0d0d1a;
  --bg-tertiary: #111128;
  --bg-card: rgba(15, 15, 35, 0.6);
  --bg-card-hover: rgba(25, 25, 55, 0.8);

  --text-primary: #e8e6f0;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8a;

  --border-color: rgba(106, 13, 173, 0.25);
  --border-glow: rgba(0, 255, 240, 0.15);

  /* Accent Colors */
  --purple: #6a0dad;
  --purple-light: #9b59b6;
  --purple-glow: rgba(106, 13, 173, 0.4);
  --cyan: #00fff0;
  --cyan-muted: #1abc9c;
  --cyan-glow: rgba(0, 255, 240, 0.3);
  --gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.3);

  /* Glassmorphism */
  --glass-bg: rgba(15, 15, 35, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;

  /* Typography Scale (clamp-based fluid) */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.8rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 0.9rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  --text-xl: clamp(1.3rem, 1.1rem + 1vw, 1.6rem);
  --text-2xl: clamp(1.6rem, 1.3rem + 1.5vw, 2.2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --text-hero: clamp(3rem, 2rem + 5vw, 6rem);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-glow-purple: 0 0 30px var(--purple-glow), 0 0 60px rgba(106, 13, 173, 0.15);
  --shadow-glow-cyan: 0 0 30px var(--cyan-glow), 0 0 60px rgba(0, 255, 240, 0.1);
  --shadow-glow-gold: 0 0 20px var(--gold-glow);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
  --duration-slow: 800ms;

  /* Layout */
  --max-width: 1200px;
  --nav-height: 72px;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-primary: #f0eff5;
  --bg-secondary: #e8e7ef;
  --bg-tertiary: #dddce6;
  --bg-card: rgba(255, 255, 255, 0.7);
  --bg-card-hover: rgba(255, 255, 255, 0.9);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aa0;

  --border-color: rgba(106, 13, 173, 0.15);
  --border-glow: rgba(0, 180, 170, 0.15);

  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(0, 0, 0, 0.08);

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
a:hover {
  color: var(--cyan-muted);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Utility */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.section {
  padding: var(--space-10) 0;
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}
