/* ==========================================================================
   AIBuzzBuilders design tokens — "Coral & Charcoal"
   Source: design.md (§ numbers below refer to its sections).
   Colour channels are stored as HSL triplets exactly as §2 defines them;
   the *-color aliases wrap them for direct use.
   Tokens marked [ADDED] are not in design.md; the reason is given.
   ========================================================================== */

:root {
  /* §2 Light mode channels */
  --background: 0 0% 100%;
  --foreground: 240 3% 11%;
  --card: 30 20% 98%;
  --card-foreground: 240 3% 11%;
  --surface-alt: 30 15% 97%;
  --popover: 0 0% 100%;
  --primary: 11 100% 64%;
  --primary-foreground: 240 6% 8%;
  --secondary: 240 3% 95%;
  --secondary-foreground: 240 3% 11%;
  --muted: 30 15% 96%;
  --muted-foreground: 240 3% 40%;
  --accent: 11 100% 68%;
  --accent-foreground: 240 6% 8%;
  --destructive: 0 72% 50%;
  --border: 240 3% 88%;
  --input: 240 3% 88%;
  --ring: 11 100% 64%;

  /* [ADDED] Darker coral for small coral TEXT. §2 coral on white is about
     2.8:1, below the WCAG AA 4.5:1 minimum. Fills still use --primary. */
  --primary-text: 11 75% 41%;

  /* Semantic aliases (§2 token table) */
  --primary-color: hsl(var(--primary));        /* §2 --primary: CTAs, accents */
  --secondary-color: hsl(var(--secondary));    /* §2 --secondary: pill fills */
  --accent-color: hsl(var(--accent));          /* §2 --accent: gradient partner */
  --background-color: hsl(var(--background));  /* §2 --background: canvas */
  --surface-color: hsl(var(--card));           /* §2 --card: warm off-white */
  --surface-alt-color: hsl(var(--surface-alt));/* §2 --surface-alt: bands */
  --muted-color: hsl(var(--muted));            /* §2 --muted */
  --text-color: hsl(var(--foreground));        /* §2 --foreground */
  --text-muted-color: hsl(var(--muted-foreground)); /* §2 captions, lead copy */
  --heading-color: hsl(var(--foreground));     /* §2 headings share foreground */
  --border-color: hsl(var(--border));          /* §2 hairline borders */
  --on-primary-color: hsl(var(--primary-foreground));
  --link-color: hsl(var(--primary-text));      /* [ADDED] see above */
  --focus-color: hsl(var(--primary-text));     /* [ADDED] §2 ring is coral; darkened
                                                  to reach 3:1 on light surfaces */

  /* §2 Semantic category accents (Tailwind values for the named classes) */
  --amber: 38 92% 50%;    --amber-text: 26 90% 37%;
  --blue: 217 91% 60%;    --blue-text: 221 83% 53%;
  --emerald: 160 84% 39%; --emerald-text: 163 94% 24%;
  --violet: 258 90% 66%;  --violet-text: 262 83% 58%;

  /* §1 Wordmark (amber-600, amber-500, orange-600, amber-800) */
  --wordmark-main: #020617;
  --wordmark-buzz: linear-gradient(90deg, #d97706, #f59e0b, #ea580c);
  --wordmark-tagline: #92400e;

  /* §3 Font families */
  --font-primary: "Manrope", "Inter Fallback", system-ui, -apple-system, sans-serif;
  --font-heading: var(--font-primary);          /* §3 display and body share Manrope */
  --font-script: "Caveat", cursive;             /* wordmark "Buzz" only */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", monospace;

  /* §3 Type scale */
  --text-h1: clamp(2.5rem, 5vw, 4rem);
  --text-h2: clamp(1.75rem, 3vw, 2.25rem);
  --text-eyebrow: 0.8125rem;
  --text-prose: 1.125rem;
  --text-sm: 0.875rem;
  --text-xs: 0.75rem;

  /* §4 / §5 Spacing (Tailwind 4px scale as used in the class recipes) */
  --spacing-xs: 0.5rem;   /* gap-2 */
  --spacing-sm: 0.75rem;  /* pt-3 */
  --spacing-md: 1.25rem;  /* p-5, gap-5, px-5 */
  --spacing-lg: 2rem;     /* sm:px-8 */
  --spacing-xl: 3rem;     /* py-12 */
  --section-compact: 2.5rem;  /* §4 py-10 */
  --section-feature: 3rem;    /* §4 py-12 */
  --gutter: var(--spacing-md);

  /* §4 / §5 Sizing */
  --content-max: 72rem;   /* 1152px */
  --article-max: 42rem;   /* 672px */
  --header-height: 4rem;  /* h-16 */
  --icon-box: 2.75rem;    /* h-11 w-11 */

  /* §4 Border radius */
  --radius-sm: 0.375rem;  /* §5 rounded-md: header CTA */
  --radius-md: 0.5rem;    /* §4 base: buttons */
  --radius-lg: 0.75rem;   /* §4 rounded-xl: cards, icon boxes */
  --radius-xl: 1rem;      /* §4 rounded-2xl: CTA banner */
  --radius-pill: 999px;   /* [ADDED] status badges */

  /* §4 / §5 Shadows (Tailwind equivalents of shadow-xs/md/lg) */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* §6 Motion */
  --transition-theme: background-color 0.3s ease, color 0.3s ease;
  --transition-card: 0.2s ease;

  color-scheme: light;
}

/* §2 Dark mode. Tokens design.md omits for dark are derived and marked. */
:root.dark {
  --background: 240 6% 8%;
  --foreground: 30 10% 92%;
  --card: 240 6% 11%;
  --card-foreground: 30 10% 92%;      /* [ADDED] = dark foreground */
  --surface-alt: 240 6% 10%;
  --popover: 240 6% 11%;              /* [ADDED] = dark card */
  --primary: 11 100% 66%;
  --primary-foreground: 240 6% 8%;
  --secondary: 240 5% 18%;
  --secondary-foreground: 30 10% 92%; /* [ADDED] = dark foreground */
  --muted: 240 5% 16%;
  --muted-foreground: 30 5% 72%;
  --accent: 11 100% 70%;
  --border: 240 5% 24%;
  --input: 240 5% 24%;                /* [ADDED] = dark border */
  --ring: 11 100% 66%;
  --primary-text: 11 100% 70%;        /* [ADDED] coral passes AA on charcoal */

  --amber-text: 46 97% 65%;
  --blue-text: 213 94% 68%;
  --emerald-text: 158 64% 52%;
  --violet-text: 255 92% 76%;

  --wordmark-main: #f1f5f9;
  --wordmark-buzz: linear-gradient(90deg, #fbbf24, #fbbf24, #fb923c);
  --wordmark-tagline: #fbbf24;

  color-scheme: dark;
}

/* §4 Container gutter: px-5 sm:px-8 */
@media (min-width: 640px) {
  :root { --gutter: var(--spacing-lg); --section-compact: 3.5rem; --section-feature: 4rem; }
}
@media (min-width: 1024px) {
  :root { --section-feature: 5rem; }
}
/* Breakpoints used throughout (§4/§5 sm, md, lg): 640px, 768px, 1024px.
   CSS custom properties cannot be used inside media queries. */
