/* base.css — design tokens + reset for Danang Chiropractic Clinic */

:root {
  /* Type scale (fluid) */
  --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.0625rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.3rem + 2.2vw, 3.25rem);

  /* Spacing — 4px base, 8px grid */
  --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;

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

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

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 960px;
  --content-wide: 1200px;

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

/* ---------- LIGHT (primary) ---------- */
:root,
[data-theme='light'] {
  --color-bg: #f8f5ee;
  --color-surface: #fffdf8;
  --color-surface-2: #fbf8f1;
  --color-surface-offset: #f0ebe0;
  --color-surface-deep: #0f3f3c;

  --color-divider: #e6e0d3;
  --color-border: #d8d1c1;

  --color-text: #1e2a28;
  --color-text-muted: #5c6763;
  --color-text-faint: #8a938f;
  --color-text-inverse: #f8f5ee;

  --color-primary: #0f4f4a;
  --color-primary-hover: #0b3e3a;
  --color-primary-soft: #e3ece9;

  --color-accent: #b0512f;
  --color-accent-hover: #93401f;
  --color-accent-soft: #f7e7df;

  --color-success: #3d7a3f;
  --color-warning: #96591b;

  --shadow-sm: 0 1px 2px rgba(30, 42, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(30, 42, 40, 0.08);
  --shadow-lg: 0 14px 36px rgba(30, 42, 40, 0.12);
}

/* ---------- DARK ---------- */
[data-theme='dark'] {
  --color-bg: #101413;
  --color-surface: #161c1b;
  --color-surface-2: #1b2221;
  --color-surface-offset: #1f2726;
  --color-surface-deep: #0b1413;

  --color-divider: #232b2a;
  --color-border: #33403e;

  --color-text: #dbdfdc;
  --color-text-muted: #99a3a0;
  --color-text-faint: #6d7775;
  --color-text-inverse: #101413;

  --color-primary: #6db3a8;
  --color-primary-hover: #8ccbc0;
  --color-primary-soft: #1d2d2b;

  --color-accent: #e08a63;
  --color-accent-hover: #eda67f;
  --color-accent-soft: #2c211c;

  --color-success: #7fb27f;
  --color-warning: #d19a5c;

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

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

html {
  -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: 5.5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.62;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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.18;
  font-weight: 600;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 70ch;
}

a {
  color: inherit;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

a,
button,
[role='button'],
[role='tab'],
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);
}

@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;
  }
}

.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;
}
