/* AI-GEN TRUNK [2026-05-23] — design system tokens (light default, dark via data-theme) */

:root {
  color-scheme: light;

  /* Neutrals */
  --color-bg: #fafafa;
  --color-bg-elevated: #ffffff;
  --color-fg: #09090b;
  --color-muted: #71717a;
  --color-border: #18181b;
  --color-border-subtle: #e4e4e7;

  /* Accent — subtle indigo pop on links, focus, primary CTA */
  --color-accent: #4f46e5;
  --color-accent-hover: #4338ca;
  --color-accent-subtle: rgba(79, 70, 229, 0.12);
  --color-accent-glow: rgba(79, 70, 229, 0.35);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-shadow: 0 8px 32px rgba(9, 9, 11, 0.08);

  /* Typography — sans only */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: clamp(2rem, 4vw, 3rem);
  --text-4xl: clamp(2.5rem, 5vw, 3.75rem);
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --tracking-tight: -0.025em;
  --tracking-wide: 0.04em;
  --leading-tight: 1.15;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  /* Layout */
  --layout-max: 72rem;
  --measure: 40rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;

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

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-sm: 0 2px 8px rgba(9, 9, 11, 0.06);
  --shadow-md: 0 8px 24px rgba(9, 9, 11, 0.08);
  --shadow-lg: 0 16px 48px rgba(9, 9, 11, 0.1);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;

  /* Focus */
  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
}

[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #09090b;
  --color-bg-elevated: #18181b;
  --color-fg: #fafafa;
  --color-muted: #a1a1aa;
  --color-border: #fafafa;
  --color-border-subtle: #27272a;

  --color-accent: #818cf8;
  --color-accent-hover: #a5b4fc;
  --color-accent-subtle: rgba(129, 140, 248, 0.15);
  --color-accent-glow: rgba(129, 140, 248, 0.4);

  --glass-bg: rgba(24, 24, 27, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);

  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  transition: background-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-sans);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-fg);
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-accent);
}

/* AI-GEN LEAF [2026-05-20] — skip-link utility */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-3) var(--space-4);
  overflow: visible;
  clip: auto;
  white-space: normal;
  background-color: var(--color-fg);
  color: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--focus-ring);
}
