/* =====================================================================
   BASE — reset, typography, layout primitives, responsive grid.
   Mobile-first: base rules are the 360px layout; min-width queries at
   600 / 900 / 1200px add columns. Values come from tokens.css only.
   Components (hero, cards, CTA, FAQ…) live in components.css (docs/COMPONENTS.md);
   header, nav, footer, crisis box + WhatsApp button live in site-shell.css.
   ===================================================================== */

/* ---- 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) + var(--space-s));
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, li, h1, h2, h3, h4, blockquote { overflow-wrap: break-word; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  color: var(--color-heading);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-heading);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); }
h2 { font-size: var(--step-4); line-height: var(--leading-tight); }
h3 { font-size: var(--step-2); font-weight: var(--weight-medium); letter-spacing: 0; }
h4 { font-family: var(--font-body); font-size: var(--step-1); font-weight: var(--weight-semi); letter-spacing: 0; }
.h2-sm { font-size: var(--step-3); }

/* Accent: an <em> inside a heading goes italic + brand green
   (mockup: "Room to think <em>clearly.</em>"). */
h1 em, h2 em, h3 em, .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: var(--weight-heading);
}
h1 em, h2 em { color: var(--color-primary); }

p, li { text-wrap: pretty; }
strong { font-weight: var(--weight-semi); }
small, .small { font-size: var(--step--1); }

a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }   /* transition: animations.css · hover: interactions.css */

:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 2px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step--1);
  line-height: 1.4;
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
}
/* The mockup's 32 × 2px rule before every eyebrow */
.eyebrow::before { content: ""; flex: none; width: 32px; height: 2px; background: currentColor; }
.section-head--center .eyebrow, .text-center .eyebrow { justify-content: center; }

/* Text link with the mockup's generous underline ("How therapy works") */
.text-link { font-weight: var(--weight-medium); color: var(--color-primary); text-underline-offset: 6px; }
.lede { font-size: var(--step-1); color: var(--color-text-muted); max-width: var(--measure); }
.muted { color: var(--color-text-muted); }
.pull {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-2);
  line-height: 1.35;
  color: var(--color-heading);
}

/* Long-form copy block (page bodies written in markdown) */
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--flow); }
.prose h2 { font-size: var(--step-3); margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--color-accent); }
.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-m);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-1);
}

/* ---- Layout primitives ---- */

/* Container: centred, capped, side padding from --gutter */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container--wide   { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }

/* Section: vertical rhythm + background bands */
.section { padding-block: var(--section-y); }
.section--tight { padding-block: calc(var(--section-y) * 0.6); }
.section--flush-top { padding-top: 0; }
.section--alt   { background: var(--color-surface-alt); }
.section--quiet { background: var(--color-surface-quiet); }
/* Sage band: muted grey (3.7:1) and terracotta fail AA on sage, so text goes ink
   and the eyebrow + its rule go deep green (as the mockup does). The muted token
   is re-pointed rather than patched selector by selector, so anything using
   --color-text-muted is safe on every sage surface (#1001672). */
:is(.section--quiet, .cta--quiet, .hero__quote) { --color-text-muted: var(--color-text); }
.section--quiet .eyebrow { color: var(--color-text); }
.section--quiet .eyebrow::before { background: var(--green-900); }
.section--paper { background: var(--color-surface); }
.section--dark  { background: var(--color-dark-bg); color: var(--color-dark-text); }
.section--dark :is(h1, h2, h3, h4, h1 em, h2 em) { color: var(--color-dark-text); }
.section--dark :is(.lede, .muted) { color: var(--color-dark-muted); }
.section--dark .eyebrow { color: var(--color-dark-muted); }
.section--dark a { color: var(--color-dark-text); }
.section--dark { --color-focus: var(--green-300); }

/* Section heading block */
.section-head { max-width: 720px; margin-bottom: var(--space-xl); }
.section-head > * + * { margin-top: var(--space-m); }
@media (min-width: 900px) { .section-head { margin-bottom: var(--space-2xl); } }
/* Mockup "Who I work with": heading left, a short note bottom-right */
.section-head--row { max-width: none; display: grid; gap: var(--space-m); }
.section-head--row > * + * { margin-top: 0; }
.section-head--row .section-head__main > * + * { margin-top: var(--space-m); }
.section-head--row .section-head__main { max-width: 640px; }
.section-head--row .section-head__aside { max-width: 420px; color: var(--color-text-muted); }
@media (min-width: 900px) {
  .section-head--row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-2xl); }
}
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lede { margin-inline: auto; }

/* Stack: vertical spacing between children */
.stack > * + * { margin-top: var(--stack-gap, var(--space-m)); }
.stack--s > * + * { --stack-gap: var(--space-s); }
.stack--l > * + * { --stack-gap: var(--space-xl); }
/* faqs.njk safety band (#1001718): was falling back to --space-m, so the
   fit panel hugged the FAQ split above it */
.stack--xl > * + * { --stack-gap: var(--space-2xl); }

/* Cluster: wrapping inline row (buttons, chips) */
.cluster { display: flex; flex-wrap: wrap; gap: var(--cluster-gap, var(--space-s)); align-items: center; }

/* ---- Responsive grid ----
   .grid alone = single column on mobile.
   .grid--2 / --3 / --4 add columns at 600px and 900px.
   .grid--auto fits as many --grid-min wide columns as the space allows. */
.grid { display: grid; gap: var(--grid-gap); grid-template-columns: minmax(0, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 280px)), 1fr)); }

@media (min-width: 600px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Split: two-column text + media. Stacks on mobile, side by side from 900px.
   --reverse puts the media first on desktop; source order stays text-first. */
.split { display: grid; gap: var(--space-xl); align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-2xl); }
  .split--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--reverse > :first-child { order: 2; }
}

/* Split head: an H2 beside its prose from 900px (homepage "Hello" /
   "How I work", service-page sections). Stacks on mobile. */
.split-head { display: grid; gap: var(--space-m); }
.split-head__title { font-size: var(--step-4); max-width: 16ch; }
@media (min-width: 900px) {
  .split-head { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-2xl); align-items: start; }
}

/* 12-column grid for the rare layout that needs finer control.
   Children span all 12 on mobile; use .md-span-* from 900px. */
.grid-12 { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.grid-12 > * { grid-column: span 12; }
@media (min-width: 900px) {
  .grid-12 > .md-span-3  { grid-column: span 3; }
  .grid-12 > .md-span-4  { grid-column: span 4; }
  .grid-12 > .md-span-5  { grid-column: span 5; }
  .grid-12 > .md-span-6  { grid-column: span 6; }
  .grid-12 > .md-span-7  { grid-column: span 7; }
  .grid-12 > .md-span-8  { grid-column: span 8; }
  .grid-12 > .md-span-9  { grid-column: span 9; }
}

/* ---- Media ---- */
.media { border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-alt); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--landscape { aspect-ratio: 3 / 2; }

/* ---- Buttons (sizes in components.css, dark-band variants in site-shell.css)
   Mockup: 13px uppercase, 0.08em tracking, 10px radius, 56px tall. ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 48px;               /* comfortable touch target */
  padding: 0 var(--space-m);
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--step--1);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Hover / focus / press states: interactions.css (#1001688) */
.btn--primary { background: var(--color-primary); color: var(--color-on-primary); }
.btn--secondary { background: transparent; border-color: var(--color-decor); color: var(--color-heading); }
/* Arrow after the label (mockup primary buttons) */
.btn--arrow::after {
  content: ""; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m13 6 6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur-fast) var(--ease);
}

/* ---- Card surface (base only) ---- */
.surface {
  background: var(--color-surface);
  border: var(--border-w) solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-m);
}
@media (min-width: 600px) { .surface { padding: var(--space-l); } }
@media (min-width: 900px) { .surface { padding: 2.25rem; } }   /* 36px — mockup cards */

/* Icon disc: 48px circle holding a 22px line icon (mockup cards) */
.icon-disc {
  flex: none; display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: var(--radius-pill);
  background: var(--color-surface-quiet); color: var(--green-900);
}
.icon-disc svg { width: 22px; height: 22px; }
.icon-disc--sand { background: var(--color-surface-alt); color: var(--color-text); }
.icon-disc--terra { background: var(--color-accent-wash); color: var(--color-accent); }

/* Concentric arcs — the mockup's decorative motif (partials/arcs.njk) */
.arcs { position: absolute; pointer-events: none; }
.arcs circle { fill: none; stroke: currentColor; }

/* ---- Utilities ---- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-l { margin-top: var(--space-l); }
