/* ==========================================================================
   Calming Corner Parent Coaching — Design Tokens (tokens.css)
   Warm Pacific Northwest Botanical & Editorial Palette (WCAG AA/AAA Verified)
   ========================================================================== */

:root {
  /* Surface Palette — Evolved from brand sage, sand & warm peach DNA */
  --bg-canvas: #FAF7F2;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F3EDE4;
  --bg-sage-tint: #E8F1EC;
  --bg-peach-tint: #FBF0EA;
  --bg-lavender-tint: #F1EFF8;
  --bg-forest-deep: #1B382F;
  --bg-forest-card: #23473C;

  /* Ink & Text Colors — All body pairings >= 4.5:1 WCAG AA (primary > 13:1 AAA) */
  --ink-primary: #1B2A25;
  --ink-secondary: #3D514A;
  --ink-muted: #546861;
  --ink-on-dark: #FAF7F2;
  --ink-on-dark-muted: #D5E4DD;

  /* Brand & Accent Colors */
  --brand-primary: #245748;        /* 8.1:1 with #FFFFFF */
  --brand-primary-hover: #1A4236;  /* 10.7:1 with #FFFFFF */
  --brand-primary-soft: #DCEBE4;
  --brand-sage: #789C8B;
  --brand-sage-border: #C4D8CE;

  --brand-terracotta: #A34227;     /* 6.1:1 with #FFFFFF & #FAF7F2 */
  --brand-terracotta-hover: #87341D;
  --brand-terracotta-soft: #F7E3DB;
  --brand-terracotta-border: #E7BFB0;

  --brand-plum: #483868;           /* 9.8:1 with #FFFFFF */
  --brand-plum-soft: #ECE8F6;
  --brand-plum-border: #CFC6E8;

  /* Borders & Dividers */
  --border-subtle: #E3DDD3;
  --border-strong: #787268;        /* >= 4.0:1 WCAG 2.1 AA SC 1.4.11 non-text contrast */
  --border-on-dark: rgba(250, 247, 242, 0.18);

  /* Semantic Status & Form Validation */
  --status-success: #1C5E46;
  --status-success-bg: #EAF6F0;
  --status-success-border: #A7D7C5;
  --status-error: #B42318;
  --status-error-bg: #FEF3F2;
  --status-error-border: #FECDCA;
  --focus-ring: #245748;
  --focus-ring-on-dark: #F7E3DB;

  /* Typography Families */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Fluid Type Scale — Accessible clamp() ratios (max <= 2.5x min for WCAG zoom) */
  --text-xs: 0.8125rem;                                      /* 13px */
  --text-sm: 0.9375rem;                                      /* 15px */
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);       /* 16px -> 18px */
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);   /* 18px -> 21px */
  --text-xl: clamp(1.25rem, 1.14rem + 0.5vw, 1.5625rem);     /* 20px -> 25px */
  --text-2xl: clamp(1.45rem, 1.25rem + 0.95vw, 2.05rem);     /* 23px -> 33px */
  --text-3xl: clamp(1.8rem, 1.5rem + 1.4vw, 2.65rem);        /* 29px -> 42px */
  --text-display: clamp(2.1rem, 1.65rem + 2.1vw, 3.35rem);   /* 33.6px -> 53.6px */

  /* Line Heights & Measure */
  --leading-tight: 1.18;
  --leading-snug: 1.32;
  --leading-normal: 1.65;
  --leading-relaxed: 1.75;
  --measure-prose: 65ch;
  --measure-narrow: 52ch;

  /* Spacing Rhythm */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --section-pad-y: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  --section-pad-y-tight: clamp(2.5rem, 2rem + 2.5vw, 4rem);

  /* Layout Dimensions */
  --container-max: 74rem;         /* 1184px */
  --container-narrow: 54rem;      /* 864px */
  --container-pad-x: clamp(1.125rem, 4vw, 2.5rem);
  --header-height: 4.75rem;       /* 76px */

  /* Radii */
  --radius-sm: 0.5rem;            /* 8px */
  --radius-md: 0.875rem;          /* 14px */
  --radius-lg: 1.25rem;           /* 20px */
  --radius-xl: 1.75rem;           /* 28px */
  --radius-pill: 9999px;

  /* Elevation & Shadows — Warm subtle botanical shadows */
  --shadow-xs: 0 1px 3px rgba(27, 42, 37, 0.05);
  --shadow-sm: 0 4px 14px rgba(27, 42, 37, 0.06), 0 1px 3px rgba(27, 42, 37, 0.04);
  --shadow-md: 0 12px 30px rgba(27, 42, 37, 0.08), 0 3px 8px rgba(27, 42, 37, 0.04);
  --shadow-lg: 0 20px 44px rgba(27, 42, 37, 0.12), 0 4px 12px rgba(27, 42, 37, 0.05);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 160ms;
  --duration-normal: 260ms;
}

/* Base Reset & Accessible Document Defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-6));
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink-primary);
  background-color: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

main {
  flex: 1 0 auto;
}

img,
svg,
picture,
video {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

h1,
h2,
h3,
h4 {
  margin-block: 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--ink-primary);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-display);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

h4 {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: -0.005em;
}

p {
  margin-block: 0 var(--space-4);
  max-inline-size: var(--measure-prose);
}

p:last-child {
  margin-block-end: 0;
}

ul,
ol {
  margin-block: 0 var(--space-4);
  padding-inline-start: var(--space-6);
}

li + li {
  margin-block-start: var(--space-2);
}

a {
  color: var(--brand-primary);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-primary-hover);
}

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

.section-forest :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--focus-ring-on-dark);
}

/* Screen-Reader Only Utility (Canonical clip-path recipe) */
.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* Skip to Main Content Link */
.skip-link {
  position: fixed;
  inset-block-start: var(--space-3);
  inset-inline-start: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  background-color: var(--bg-forest-deep);
  color: var(--ink-on-dark);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--ink-on-dark);
}
