/* ============================================================
   Anazao Solutions — Design Tokens
   Charcoal + warm cream + deep amber/ochre. Editorial gravity.
   ============================================================ */

:root,
[data-theme="light"] {
  /* Surfaces — warm cream */
  --color-bg: #f5f1ea;
  --color-surface: #faf6ef;
  --color-surface-2: #fffaf2;
  --color-surface-offset: #ebe5d9;
  --color-surface-offset-2: #ddd5c6;
  --color-surface-dynamic: #e3dcce;
  --color-divider: #d6cebd;
  --color-border: #c3b89f;

  /* Text — charcoal */
  --color-text: #1a1a1a;
  --color-text-muted: #5a5650;
  --color-text-faint: #8d877d;
  --color-text-inverse: #f5f1ea;

  /* Primary accent — deep amber / ochre */
  --color-primary: #b8741a;
  --color-primary-hover: #99601a;
  --color-primary-active: #794b15;
  --color-primary-highlight: #ead7b8;

  /* Subtle support colors */
  --color-success: #3f6b3f;
  --color-warning: #b8741a;

  /* 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 (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 — minimal, editorial */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 12px;
  --radius-full: 9999px;

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

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 4px 14px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 18px 40px rgba(26, 26, 26, 0.12);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1040px;
  --content-wide: 1280px;
  --content-full: 100%;
  --content-prose: 65ch;

  /* Fonts */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Dark mode — true charcoal */
[data-theme="dark"] {
  --color-bg: #121110;
  --color-surface: #1a1a1a;
  --color-surface-2: #1f1e1c;
  --color-surface-offset: #242220;
  --color-surface-offset-2: #2c2a27;
  --color-surface-dynamic: #34322e;
  --color-divider: #2c2a27;
  --color-border: #3c3934;

  --color-text: #ece6da;
  --color-text-muted: #9b9489;
  --color-text-faint: #6a655c;
  --color-text-inverse: #1a1a1a;

  --color-primary: #d49744;
  --color-primary-hover: #e2a958;
  --color-primary-active: #efb96d;
  --color-primary-highlight: #4a3a1e;

  --color-success: #6b9b6b;
  --color-warning: #d49744;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* System preference fallback */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #121110;
    --color-surface: #1a1a1a;
    --color-surface-2: #1f1e1c;
    --color-surface-offset: #242220;
    --color-surface-offset-2: #2c2a27;
    --color-surface-dynamic: #34322e;
    --color-divider: #2c2a27;
    --color-border: #3c3934;
    --color-text: #ece6da;
    --color-text-muted: #9b9489;
    --color-text-faint: #6a655c;
    --color-text-inverse: #1a1a1a;
    --color-primary: #d49744;
    --color-primary-hover: #e2a958;
    --color-primary-active: #efb96d;
    --color-primary-highlight: #4a3a1e;
  }
}

/* ============================================================
   Base reset
   ============================================================ */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  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.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 300ms ease, color 300ms ease;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.1;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
}

p, li, figcaption {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: 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;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
