/* ============================================================
   CWP — base.css
   Reset + Design Tokens
   ============================================================ */

/* --- Reset ------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}
input,
button,
textarea,
select {
  font: inherit;
}
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}
a {
  color: inherit;
  text-decoration: none;
}
ul,
ol {
  list-style: none;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Design Tokens ----------------------------------------- */
:root {
  /* Colors — Primary */
  --color-primary: #16375e;
  --color-primary-hover: #112c4b;
  --color-primary-active: #0c1f35;
  --color-gold: #b5870a;
  --color-gold-hover: #9a7008;

  /* Colors — Light Surfaces */
  --color-bg: #f0ede6;
  --color-surface: #f5f3ee;
  --color-surface-2: #fafaf8;
  --color-surface-offset: #e8e4db;
  --color-divider: #d9d5cc;
  --color-border: #ccc8bf;

  /* Colors — Text */
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-text-inverse: #f5f3ee;

  /* Colors — Dark Surfaces */
  --color-bg-dark: #16375e;
  --color-surface-dark: #1a2e47;

  /* Typography — Font Family */
  --font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Typography — Sizes */
  --text-hero: clamp(2.5rem, 5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 4vw, 5rem);
  --text-2xl: clamp(2rem, 2.5vw, 3.5rem);
  --text-xl: clamp(1.5rem, 1.25vw, 2.25rem);
  --text-lg: clamp(1.125rem, 0.75vw, 1.5rem);
  --text-base: clamp(1rem, 0.25vw, 1.125rem);
  --text-sm: clamp(0.875rem, 0.35vw, 1rem);
  --text-xs: clamp(0.75rem, 0.25vw, 0.875rem);

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 4px 16px rgba(17, 24, 39, 0.1);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.14);
  --shadow-gold: 0 4px 16px rgba(181, 135, 10, 0.18);

  /* Spacing Scale */
  --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;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
}

/* --- Base Styles ------------------------------------------- */
body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
}

h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.15;
}
h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.2;
}
h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}
h4 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
}

p {
  max-width: 65ch;
  line-height: 1.7;
}
p + p {
  margin-top: var(--space-4);
}

/* --- Utility ----------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

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

/* --- Section Spacing --------------------------------------- */
.section {
  padding-block: var(--space-24);
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
}

.section--primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.section--surface {
  background: var(--color-surface);
}

/* --- Scroll Reveal ----------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
[data-reveal].visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Focus ------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Selection --------------------------------------------- */
::selection {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}
