/* =========================
   base.css
   ========================= */

/* Web fonts (Option B) */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:wght@400;600;700&family=Manrope:wght@400;500;700&display=swap');

:root {
  /* Color system: warm neutral + charcoal + muted sage accent */
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-soft: #f1ede6;
  --text: #1b1d1f;
  --muted: #5f6468;
  --border: #ded8ce;
  --border-strong: #cfc7bb;

  --accent: #5f7a6b;
  --accent-hover: #4f6659;
  --accent-soft: #e7eee9;
  --accent-contrast: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(20, 22, 24, 0.04);
  --shadow-md: 0 10px 28px rgba(20, 22, 24, 0.08);

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

  --container: 72rem; /* readability-first */
  --reading: 68ch;

  --font-serif: "Crimson Pro", Georgia, Cambria, "Times New Roman", serif;
  --font-sans: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, #fdf8ef 0%, transparent 35%),
    radial-gradient(circle at 88% 0%, #f4efe6 0%, transparent 30%),
    var(--bg);
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
}

h3,
h4 {
  font-family: var(--font-sans);
  font-weight: 700;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.35rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 2.05rem); }
h3 { font-size: 1.08rem; }
h4 { font-size: 0.96rem; }

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

small,
.text-muted {
  color: var(--muted);
}

ul,
ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.64rem 1rem;
  font-weight: 700;
  font-size: 0.93rem;
  letter-spacing: 0.01em;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-contrast);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
