/* ==========================================================================
   ViaSerenity — base.css
   Design tokens, reset, typography, utilities.
   ========================================================================== */

:root {
  /* ---- Brand palette ---- */
  --c-navy: #102A43;
  --c-green: #2F7D68;          /* fills: white text on green = 4.9:1 */
  --c-green-ink: #256554;      /* green used AS text on light bgs = 6.3:1 on ivory */
  --c-green-deep: #235F4F;     /* primary button hover */
  --c-sage: #A8C7B8;           /* accents / backgrounds only — never body text on ivory */
  --c-teal: #3C9A9A;           /* accents / backgrounds only — never body text on ivory */
  --c-ivory: #F7F5EF;
  --c-white: #FFFFFF;
  --c-text: #243447;
  --c-muted: #5A6878;          /* AA-adjusted muted text: 5.2:1 on ivory, 5.7:1 on white */
  --c-muted-decor: #687787;    /* brand muted — decorative use only (4.2:1 on ivory fails AA for text) */
  --c-gold: #B8914F;           /* from the logo ring — decorative only */

  /* ---- Derived tints ---- */
  --c-ivory-deep: #EFEBE1;
  --c-sage-mist: #EDF3EF;
  --c-sage-soft: #DCE8E1;
  --c-teal-mist: #E4F0EF;
  --c-line: rgba(16, 42, 67, 0.12);
  --c-line-strong: rgba(16, 42, 67, 0.22);
  --c-on-dark: #F7F5EF;
  --c-on-dark-muted: rgba(247, 245, 239, 0.8);
  --c-error: #A3312B;          /* 6.2:1 on white */
  --c-error-bg: #FBEFEE;

  /* ---- Typography ---- */
  --font-serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: "Manrope", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  --fs-display: clamp(2.5rem, 1.55rem + 3.9vw, 5.25rem);
  --fs-h1: clamp(2.5rem, 1.75rem + 3vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.5rem + 2.1vw, 3.375rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --fs-h4: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
  --fs-lead: clamp(1.0625rem, 0.99rem + 0.35vw, 1.3125rem);
  --fs-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --fs-sm: 0.9375rem;
  --fs-xs: 0.8125rem;

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.7;

  /* ---- Spacing ---- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);
  --space-l: clamp(1.75rem, 1.4rem + 1.4vw, 2.75rem);
  --space-xl: clamp(2.5rem, 1.9rem + 2.6vw, 4.5rem);
  --space-2xl: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --section-y: clamp(4.5rem, 3rem + 6vw, 9rem);
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --container: 80rem;
  --container-narrow: 46rem;

  /* ---- Shape ---- */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 28px;
  --r-pill: 999px;
  --r-arch: 999px 999px var(--r-lg) var(--r-lg);
  --r-organic: 58% 42% 46% 54% / 48% 55% 45% 52%;

  /* ---- Elevation ---- */
  --shadow-xs: 0 1px 2px rgba(16, 42, 67, 0.05);
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.04), 0 6px 16px -8px rgba(16, 42, 67, 0.12);
  --shadow-md: 0 2px 4px rgba(16, 42, 67, 0.04), 0 18px 40px -18px rgba(16, 42, 67, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(16, 42, 67, 0.32);

  /* ---- Motion ---- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 700ms;

  /* ---- Layout helpers ---- */
  --header-h: 4.5rem;
  --focus: var(--c-navy);

  color-scheme: light;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  background: var(--c-ivory);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
p, h1, h2, h3, h4, h5, h6, li, dd, dt, blockquote { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--lh-tight);
  color: var(--c-navy);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
h4 {
  font-family: var(--font-sans);
  font-size: var(--fs-h4);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}
h1 em, h2 em, h3 em { font-style: italic; color: var(--c-green-ink); }

p { text-wrap: pretty; }
strong, b { font-weight: 600; color: var(--c-navy); }

a {
  color: var(--c-green-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) ease;
}
a:hover { color: var(--c-navy); }

::selection { background: var(--c-sage-soft); color: var(--c-navy); }

/* ---- Focus ---- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-green-ink);
  margin-bottom: var(--space-s);
}
.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: var(--c-text);
}
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }

.flow > * + * { margin-top: var(--flow-space, 1em); }

/* Placeholder highlight: bracketed content still awaiting real practice info */
.ph {
  background: rgba(184, 145, 79, 0.14);
  box-shadow: inset 0 -1px 0 rgba(184, 145, 79, 0.55);
  border-radius: 3px;
  padding: 0 0.15em;
  color: inherit;
}
.on-dark .ph { background: rgba(247, 245, 239, 0.14); box-shadow: inset 0 -1px 0 rgba(247, 245, 239, 0.5); }
