/* === Design 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(2.75rem, 0.5rem + 7vw, 7rem);

  /* Spacing 4px base */
  --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 / shadow */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1.25rem;
  --radius-2xl: 1.75rem;
  --radius-full: 9999px;

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1240px;

  /* Font families */
  --font-display: 'Cabinet Grotesk', 'General Sans', system-ui, sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;
}

/* === Tamil sun palette — light === */
:root,
[data-theme='light'] {
  /* Surfaces */
  --color-bg: #fbf7f0; /* Ven — morning haze */
  --color-surface: #ffffff;
  --color-surface-2: #f5ede0;
  --color-surface-offset: #efe4d3;
  --color-border: #e7d9c3;
  --color-divider: #eee4d2;

  /* Text */
  --color-text: #1c1a16; /* Mann — earth */
  --color-text-muted: #6e6458;
  --color-text-faint: #a89d8a;
  --color-text-inverse: #fbf7f0;

  /* Primary — Arunai (first ray) */
  --color-primary: #c2410c;
  --color-primary-hover: #9a320a;
  --color-primary-active: #7a2608;
  --color-primary-highlight: #f6dccb;

  /* Accent — Kadhir gold */
  --color-accent: #d4a537;
  --color-accent-hover: #b18720;
  --color-accent-highlight: #f4e4bd;

  /* Deep — Sudar flame */
  --color-deep: #7a2e0e;

  /* Life — Uyir green */
  --color-life: #2d5a3f;

  --shadow-sm: 0 1px 2px rgba(28, 26, 22, 0.06);
  --shadow-md: 0 6px 20px rgba(122, 46, 14, 0.1);
  --shadow-lg: 0 24px 60px rgba(122, 46, 14, 0.16);
}

/* === Dark === */
[data-theme='dark'] {
  --color-bg: #14110d;
  --color-surface: #1b1713;
  --color-surface-2: #221c16;
  --color-surface-offset: #2a2219;
  --color-border: #3a2e20;
  --color-divider: #2e251b;

  --color-text: #f2e9d8;
  --color-text-muted: #a89d8a;
  --color-text-faint: #6e6458;
  --color-text-inverse: #14110d;

  --color-primary: #e85a28;
  --color-primary-hover: #ff7a45;
  --color-primary-active: #ff946b;
  --color-primary-highlight: #3a1c10;

  --color-accent: #e8ba4a;
  --color-accent-hover: #f3ca66;
  --color-accent-highlight: #3a2e12;

  --color-deep: #c0552a;
  --color-life: #5e9d6e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* === Base 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: 72px;
}
body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-feature-settings: 'ss01', 'ss02';
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
ul,
ol {
  list-style: none;
}
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: none;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
  letter-spacing: -0.015em;
}
p {
  text-wrap: pretty;
  max-width: 62ch;
}
::selection {
  background: var(--color-primary-highlight);
  color: var(--color-deep);
}
: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,
input,
textarea,
select,
[role='button'] {
  transition:
    color var(--transition),
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition),
    transform var(--transition);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
