/* ============================================
   TrendRadar — Base Reset + Design Tokens
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* JS handles smooth scroll */
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

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

ul, ol {
  list-style: none;
}

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

/* --- Design Tokens --- */
:root {
  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Type Scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);      /* 12-13px */
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);     /* 13-14px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);        /* 15-16px */
  --text-lg: clamp(1.125rem, 1.05rem + 0.25vw, 1.25rem);       /* 18-20px */
  --text-xl: clamp(1.375rem, 1.2rem + 0.5vw, 1.75rem);         /* 22-28px */
  --text-2xl: clamp(1.75rem, 1.5rem + 0.75vw, 2.25rem);        /* 28-36px */
  --text-3xl: clamp(2.25rem, 1.8rem + 1.2vw, 3rem);            /* 36-48px */
  --text-hero: clamp(2.75rem, 2rem + 2vw, 4rem);               /* 44-64px */

  /* Spacing (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Colors — Light mode only */
  --color-bg: #FFFFFF;
  --color-surface: #F8FAFB;
  --color-surface-raised: #FFFFFF;
  --color-border: #E2E8F0;
  --color-border-subtle: #F1F5F9;

  --color-text: #0F172A;
  --color-text-secondary: #475569;
  --color-text-muted: #94A3B8;

  /* Brand */
  --color-teal: #01696F;
  --color-teal-hover: #015258;
  --color-teal-light: #E6F4F4;
  --color-teal-subtle: #F0F9F9;

  /* Signal type colors */
  --color-hook: #F97316;
  --color-hook-light: #FFF3E8;
  --color-topic: #3B82F6;
  --color-topic-light: #EBF2FF;
  --color-concept: #8B5CF6;
  --color-concept-light: #F1ECFF;

  /* Functional */
  --color-success: #10B981;
  --color-error: #EF4444;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.08), 0 8px 16px rgba(15, 23, 42, 0.04);

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

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

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

/* --- Base Styles --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-hero); font-weight: 800; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); font-weight: 600; }

p {
  line-height: 1.65;
  color: var(--color-text-secondary);
}

strong { font-weight: 600; }

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

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}

/* Section spacing */
.section {
  padding: clamp(var(--space-16), 8vw, var(--space-24)) 0;
}

/* Utility */
.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;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
