/* ============== TOKENS ============== */
:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(3rem, 0.5rem + 7vw, 8rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.75rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-default: 1180px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Clash Display', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;

  /* Brand accents (per product) */
  --accent-loo: #fbbf24;     /* amber — LoologiX */
  --accent-dump: #ff7a3d;    /* utility orange — DumpsterLogix */
  --accent-pool: #4cc9f0;    /* pool cyan — PoolLogix */
}

/* ============== DARK (DEFAULT) ============== */
:root,
[data-theme='dark'] {
  --color-bg: #0a0c0b;
  --color-surface: #111413;
  --color-surface-2: #161a18;
  --color-surface-offset: #1c211e;
  --color-border: #232825;
  --color-border-strong: #303530;
  --color-divider: #1c1f1d;

  --color-text: #ecefe9;
  --color-text-muted: #8a918a;
  --color-text-faint: #5a615b;
  --color-text-inverse: #0a0c0b;

  --color-primary: #a855f7;
  --color-primary-hover: #c084fc;
  --color-primary-soft: rgba(168, 85, 247, 0.12);

  --gradient-brand: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 60px rgba(168, 85, 247, 0.2);
}

/* ============== LIGHT ============== */
[data-theme='light'] {
  --color-bg: #f5f6f2;
  --color-surface: #ffffff;
  --color-surface-2: #fafbf6;
  --color-surface-offset: #eef0e8;
  --color-border: #d8dcd2;
  --color-border-strong: #b9bfb1;
  --color-divider: #e6e8e0;

  --color-text: #0e110f;
  --color-text-muted: #595e57;
  --color-text-faint: #9ba096;
  --color-text-inverse: #fafbf6;

  --color-primary: #7c3aed;
  --color-primary-hover: #6d28d9;
  --color-primary-soft: rgba(124, 58, 237, 0.1);

  --shadow-sm: 0 1px 2px rgba(20, 30, 20, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 30, 20, 0.08);
  --shadow-lg: 0 24px 60px rgba(20, 30, 20, 0.1);
  --shadow-glow: 0 0 60px rgba(124, 58, 237, 0.12);
}

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

html {
  -webkit-text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
}

body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: var(--text-base);
  word-spacing: 0.05em;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
ul[role='list'] {
  list-style: none;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}
p {
  text-wrap: pretty;
  max-width: 64ch;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

a,
button,
[role='button'] {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}
