/* ===================================================================
   The Neighborhood Collaborative
   Site styles. Extends the palette and type stacks established on the
   splash page (styles.css), which is left untouched.

   Contents
     1.  Tokens
     2.  Colour themes
     3.  Reset and base
     4.  Layout: container, grid, section
     5.  Typography
     6.  Buttons
     7.  Logo and leaf animation
     8.  Header and navigation
     9.  Hero
     10. Cards and panels
     11. Forms
     12. Footer
     13. Reveal animation
     14. Motion, print, forced colours
   =================================================================== */


/* --- 1. Tokens -------------------------------------------------- */

:root {
  /* Brand palette, sampled from the identity swatches */
  --teal: #43626B;
  --forest: #2E3419;
  --plum: #6B566F;
  --sage: #7D8462;
  --terracotta: #BE7050;
  --orange: #C4763C;

  /* Neutrals, warmed slightly so they sit with the palette */
  --white: #FFFFFF;
  --paper: #FBFAF7;
  --paper-deep: #F4F2EC;
  --hairline: #E2E0D6;
  --ink: #2E3419;
  --ink-soft: #4A5340;
  --ink-mute: #6E7565;

  /* Applied roles. Overridden per theme in section 2. */
  --accent: var(--forest);
  --accent-ink: var(--white);
  --accent-wash: rgba(46, 52, 25, 0.06);
  --accent-line: rgba(46, 52, 25, 0.22);

  /* Type stacks: the real brand face first, embeddable fallback second */
  --font-display: Palatino, "Palatino Linotype", "Book Antiqua", Gelasio, Georgia, serif;
  --font-body: "Avenir Next", Avenir, "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-script: "Spanish Signature", Parisienne, cursive;

  /* Fluid type scale */
  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3: clamp(1.75rem, 1.5rem + 1.25vw, 2.6rem);
  --step-4: clamp(2.1rem, 1.7rem + 2vw, 3.4rem);

  /* Spacing */
  --space-2xs: 0.375rem;
  --space-xs: 0.625rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5.5rem;

  --radius: 0.5rem;
  --radius-lg: 1rem;
  --shadow-sm: 0 1px 2px rgba(46, 52, 25, 0.06), 0 4px 12px rgba(46, 52, 25, 0.05);
  --shadow-md: 0 2px 6px rgba(46, 52, 25, 0.07), 0 14px 34px rgba(46, 52, 25, 0.08);

  --measure: 66ch;
  --container: 72rem;
  /*
     Header heights. The logo sets the header's height, so both are derived
     from the logo's width (the artwork is 792 x 612) plus the header's
     padding and border. Change the logo widths, never these.

     --header-full  The header at rest. Reserved as padding above the page,
                    since the header is fixed and out of the page flow.
     --header-h     What in-page anchors clear. Any jump far enough to land
                    on an anchor compacts the header, so this is the compact
                    height — or the full one without JS, where it never shrinks.
  */
  --logo-full: clamp(12rem, 55vw, 15rem);
  --logo-compact: 8.5rem;
  --logo-anchor: var(--logo-full);
  --header-full: calc(var(--logo-full) * 612 / 792 + 1.5rem + 1px);
  --header-h: calc(var(--logo-anchor) * 612 / 792 + 1.5rem + 1px);
}


.js {
  --logo-anchor: var(--logo-compact);
}


/* --- 2. Colour themes ------------------------------------------- */
/*
   Applied with data-theme on <body> for a whole page, or on any element
   to theme just that block. Service pages get theirs from SERVICES in
   includes/config.php — changing a colour there is a one-word edit.
*/

[data-theme="teal"] {
  --accent: var(--teal);
  --accent-ink: var(--white);
  --accent-wash: rgba(67, 98, 107, 0.08);
  --accent-line: rgba(67, 98, 107, 0.28);
}

[data-theme="plum"] {
  --accent: var(--plum);
  --accent-ink: var(--white);
  --accent-wash: rgba(107, 86, 111, 0.08);
  --accent-line: rgba(107, 86, 111, 0.28);
}

[data-theme="sage"] {
  --accent: #656B4C; /* darkened from #7D8462 to clear 4.5:1 on paper */
  --accent-ink: var(--white);
  --accent-wash: rgba(125, 132, 98, 0.10);
  --accent-line: rgba(125, 132, 98, 0.32);
}

[data-theme="terracotta"] {
  --accent: #A65B3D; /* darkened from #BE7050 to clear 4.5:1 on paper */
  --accent-ink: var(--white);
  --accent-wash: rgba(190, 112, 80, 0.09);
  --accent-line: rgba(190, 112, 80, 0.30);
}

[data-theme="orange"] {
  --accent: #A05E2C; /* darkened from #C4763C to clear 4.5:1 on paper */
  --accent-ink: var(--white);
  --accent-wash: rgba(196, 118, 60, 0.09);
  --accent-line: rgba(196, 118, 60, 0.30);
}

[data-theme="forest"] {
  --accent: var(--forest);
  --accent-ink: var(--white);
  --accent-wash: rgba(46, 52, 25, 0.06);
  --accent-line: rgba(46, 52, 25, 0.22);
}


/* --- 3. Reset and base ------------------------------------------ */

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

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

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;

  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  padding-top: var(--header-full);

  color: var(--ink);
  background: var(--white);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 0;
  left: 50%;
  transform: translate(-50%, -110%);

  padding: 0.75rem 1.25rem;

  color: var(--accent-ink);
  background: var(--forest);
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;

  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

main {
  flex: 1;
}


/* --- 4. Layout --------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.container--narrow {
  max-width: 52rem;
}

.section {
  padding-block: var(--space-xl);
}

@media (min-width: 48rem) {
  .section {
    padding-block: var(--space-2xl);
  }
}

.section--wash {
  background: var(--paper);
  border-block: 1px solid var(--hairline);
}

.section--accent-wash {
  background: var(--accent-wash);
}

/*
   Responsive grid with no breakpoints needed: tracks wrap themselves once
   they cannot hold --min. The min() guard stops overflow on narrow phones.
*/
.grid {
  --min: 16rem;
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fit, minmax(min(var(--min), 100%), 1fr));
}

.grid--wide {
  --min: 22rem;
}

.grid--narrow {
  --min: 12rem;
}

.grid--gap-l {
  gap: var(--space-l);
}

/* Asymmetric two-column split for text beside a supporting block. */
.split {
  display: grid;
  gap: var(--space-l);
  align-items: start;
}

@media (min-width: 56rem) {
  .split {
    grid-template-columns: 1.25fr 1fr;
    gap: var(--space-xl);
  }

  .split--even {
    grid-template-columns: 1fr 1fr;
  }

  .split--reverse > :first-child {
    order: 2;
  }
}

.stack > * + * {
  margin-top: var(--space-s);
}

.stack--l > * + * {
  margin-top: var(--space-l);
}

.center {
  text-align: center;
}


/* --- 5. Typography ----------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
  color: var(--forest);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  letter-spacing: 0.01em;
}

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

h3 {
  font-size: var(--step-1);
}

p {
  margin: 0;
  text-wrap: pretty;
}

.lede {
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.eyebrow {
  display: block;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

.script {
  font-family: var(--font-script);
  font-size: var(--step-2);
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-s);
}

.prose h2,
.prose h3 {
  margin-top: var(--space-l);
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
}

.prose li + li {
  margin-top: var(--space-2xs);
}

.rule {
  width: 3.5rem;
  height: 1px;
  margin: var(--space-m) 0;
  border: 0;
  background: var(--accent);
}

.rule--center {
  margin-inline: auto;
}

/* Marks copy that still needs real content from the client. */
.todo {
  padding: 0.15em 0.45em;
  border-radius: 3px;
  background: rgba(196, 118, 60, 0.16);
  box-shadow: inset 0 0 0 1px rgba(160, 94, 44, 0.35);
  font-size: 0.95em;

  /* Keeps the highlight a clean shape when it wraps across lines. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}


/* --- 6. Buttons -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;

  padding: 0.8em 1.6em;
  border: 1px solid transparent;
  border-radius: 999px;

  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;

  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
              border-color 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

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

.btn--primary:hover {
  background: var(--forest);
}

.btn--ghost {
  color: var(--accent);
  background: transparent;
  border-color: var(--accent-line);
}

.btn--ghost:hover {
  background: var(--accent-wash);
  border-color: var(--accent);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
}

.btn-row--center {
  justify-content: center;
}


/* --- 7. Logo and leaf animation ---------------------------------- */

.logo {
  position: relative;
  display: block;
  width: 100%;
}

.logo__base {
  display: block;
  width: 100%;
  height: auto;
}

.logo__canopy {
  position: absolute;
  inset: 0;
  /* Rotate about the base of the trunk so a gust reads as physical. */
  transform-origin: 23% 73%;
}

.logo__leaf {
  position: absolute;
  height: auto;
  transform-origin: 50% 50%;
}

/*
   Mobile gets a generous mark on first load — it is the brand moment, and it
   gives the canopy enough room for the leaf drop to actually read. Once the
   page scrolls, .is-compact shrinks it so the sticky header stays out of the way.
*/
.logo--header {
  width: var(--logo-full);
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.is-compact .logo--header {
  width: var(--logo-compact);
}

/* A gust: the canopy sways, then one leaf lets go. */
.logo__canopy.is-shaking {
  animation: canopy-sway 780ms ease-in-out;
}

@keyframes canopy-sway {
  0%   { transform: rotate(0deg); }
  18%  { transform: rotate(0.9deg); }
  40%  { transform: rotate(-0.7deg); }
  62%  { transform: rotate(0.45deg); }
  82%  { transform: rotate(-0.25deg); }
  100% { transform: rotate(0deg); }
}

/*
   Distances are percentages of the leaf's own box, so the fall scales with
   whatever size the logo is rendered at. JS supplies the random values.
*/
.logo__leaf.is-falling {
  animation: leaf-fall var(--fall-duration, 2.8s) cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

@keyframes leaf-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }

  12% {
    transform: translate(calc(var(--drift) * 0.10), calc(var(--fall) * 0.08)) rotate(calc(var(--spin) * 0.12));
    opacity: 1;
  }

  38% {
    transform: translate(calc(var(--drift) * 0.62), calc(var(--fall) * 0.34)) rotate(calc(var(--spin) * 0.42));
    opacity: 1;
  }

  64% {
    transform: translate(calc(var(--drift) * 0.18), calc(var(--fall) * 0.62)) rotate(calc(var(--spin) * 0.70));
    opacity: 0.92;
  }

  86% {
    transform: translate(calc(var(--drift) * 0.78), calc(var(--fall) * 0.86)) rotate(calc(var(--spin) * 0.90));
    opacity: 0.45;
  }

  100% {
    transform: translate(var(--drift), var(--fall)) rotate(var(--spin));
    opacity: 0;
  }
}


/* --- 7b. The tree mark (inline SVG) ------------------------------- */
/*
   The artwork keeps every leaf as its own <path>, so each one is animated
   directly. Three layered behaviours:
     1. it grows in when scrolled into view, trunk first, leaves outward
     2. it breathes afterwards, each leaf on its own offset
     3. it lets a leaf go now and then, echoing the header logo
*/

.tree-figure {
  width: 100%;
  margin: 0;
}

.tree-mark {
  display: block;
  width: 100%;
  height: auto;
  /* Lets a falling leaf drift past the artwork bounds without clipping. */
  overflow: visible;
}

/*
   Mirrors the mark so the canopy leans back over the page instead of away
   from it — the tree then frames content sitting to its left.
*/
.tree-figure--mirrored .tree-mark {
  transform: scaleX(-1);
}

.tree__leaf,
.tree__trunk {
  transform-box: fill-box;
}

.tree__leaf {
  transform-origin: 50% 50%;
}

/*
   Leaves are pickable. The hover cue uses filter rather than transform,
   because the breeze and gust animations already own transform on this
   element and would simply overwrite it.
*/
.js .tree-figure[data-tree] .tree__leaf {
  cursor: pointer;
  transition: filter 0.18s ease;
}

.js .tree-figure[data-tree] .tree__leaf:hover {
  filter: brightness(1.14) drop-shadow(0 2px 3px rgba(46, 52, 25, 0.28));
}

/* A leaf on its way down should not invite another click. */
.tree__leaf.is-falling {
  cursor: default;
  pointer-events: none;
}

.tree__trunk {
  /* Grows up out of the ground rather than scaling from its middle. */
  transform-origin: 50% 100%;
}

/* Starting state, only while JS is available to finish the job. */
.js .tree-figure[data-tree] .tree__leaf {
  opacity: 0;
  transform: scale(0.3) rotate(-14deg);
}

.js .tree-figure[data-tree] .tree__trunk {
  opacity: 0;
  transform: scaleY(0.86);
}

.js .tree-figure.is-grown .tree__trunk {
  opacity: 1;
  transform: none;
  transition: transform 0.85s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.5s ease;
}

.js .tree-figure.is-grown .tree__leaf {
  opacity: 1;
  transform: none;
  /* Slight overshoot so each leaf springs open. */
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.22, 0.9, 0.3, 1.35);
  transition-delay: calc(220ms + var(--leaf-i, 0) * 52ms);
}

/* Ambient sway, switched on by JS once the growth has finished. */
.tree-figure.is-breezy .tree__leaf {
  animation: leaf-breeze var(--breeze-duration, 6s) ease-in-out infinite;
  animation-delay: calc(var(--leaf-i, 0) * -370ms);
}

@keyframes leaf-breeze {
  0%,
  100% { transform: rotate(0deg) translate(0, 0); }
  35%  { transform: rotate(2.4deg) translate(1.5%, -1.5%); }
  70%  { transform: rotate(-1.9deg) translate(-1.5%, 1%); }
}

/*
   A gust crossing the canopy. Every leaf runs the same tilt, staggered by
   its horizontal position, so the movement reads as one wave passing
   through rather than each leaf acting alone. Nothing detaches.
*/
.tree-figure .tree__leaf.is-gusting {
  animation: leaf-gust 1s ease-in-out;
  animation-delay: calc(var(--ripple-i, 0) * 42ms);
}

@keyframes leaf-gust {
  0%,
  100% { transform: rotate(0deg) translate(0, 0); }
  30%  { transform: rotate(7deg) translate(2%, -3%); }
  55%  { transform: rotate(-4deg) translate(-1%, 1%); }
  78%  { transform: rotate(2deg) translate(0, 0); }
}

/*
   New growth: a leaf springs open as though it just unfurled. The opposite
   reading to a leaf dropping, and a better fit for a paediatric practice.
*/
.tree-figure .tree__leaf.is-sprouting {
  animation: leaf-sprout 1.5s cubic-bezier(0.22, 0.9, 0.3, 1.3);
}

/*
   Starts and ends at full size. An earlier version snapped down to a quarter
   scale first, which on an already-full tree read as a flicker rather than
   growth — the leaf appeared to vanish and pop back.
*/
@keyframes leaf-sprout {
  0%   { transform: scale(1) rotate(0deg); }
  22%  { transform: scale(0.9) rotate(-6deg); }
  58%  { transform: scale(1.18) rotate(5deg); }
  80%  { transform: scale(0.97) rotate(-1.5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Outranks the breeze, which is also an animation on the same element. */
.tree-figure.is-grown .tree__leaf.is-falling {
  animation: tree-leaf-fall var(--fall-duration, 3.2s) cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
  animation-delay: 0s;
}

@keyframes tree-leaf-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }

  40% {
    transform: translate(calc(var(--drift) * 0.55), calc(var(--fall) * 0.36)) rotate(calc(var(--spin) * 0.45));
    opacity: 1;
  }

  72% {
    transform: translate(calc(var(--drift) * 0.15), calc(var(--fall) * 0.68)) rotate(calc(var(--spin) * 0.74));
    opacity: 0.85;
  }

  100% {
    transform: translate(var(--drift), var(--fall)) rotate(var(--spin));
    opacity: 0;
  }
}


/* --- 8. Header and navigation ------------------------------------ */

/*
   Fixed rather than sticky, with its height reserved by body's padding.
   A sticky header sits in the page flow, so compacting it would shift the
   whole page up mid-scroll — and land in-page anchors short in browsers
   that do not compensate for that shift.
*/
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
  padding-block: 0.75rem;
}

.site-header__brand {
  display: block;
  flex: 0 0 auto;
  text-decoration: none;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;

  padding: 0.55rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;

  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

/* Narrow phones: drop the word so the bigger logo still fits on one line. */
@media (max-width: 30rem) {
  .nav-toggle {
    padding: 0.7rem;
  }

  .nav-toggle__label {
    display: none;
  }
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__bars {
  position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after  { top: 6px; }

[aria-expanded="true"] .nav-toggle__bars {
  background: transparent;
}

[aria-expanded="true"] .nav-toggle__bars::before {
  transform: translateY(6px) rotate(45deg);
}

[aria-expanded="true"] .nav-toggle__bars::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile: the nav is a panel toggled by the button. */
.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;

  padding: var(--space-s) clamp(1.25rem, 4vw, 2.5rem) var(--space-m);

  background: var(--white);
  border-bottom: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
}

.site-nav.is-open {
  display: block;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__item {
  border-bottom: 1px solid var(--hairline);
}

.site-nav__item:last-child {
  border-bottom: 0;
}

.site-nav__item--parent {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.site-nav__link {
  display: block;
  padding: 0.85rem 0;

  font-size: var(--step-0);
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--accent);
}

.site-nav__link[aria-current="page"] {
  font-weight: 600;
}

.site-nav__disclosure {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 2.75rem;
  height: 2.75rem;
  padding: 0;

  color: var(--ink-soft);
  background: none;
  border: 0;
  cursor: pointer;
}

.site-nav__disclosure svg {
  width: 0.7rem;
  transition: transform 0.2s ease;
}

.site-nav__disclosure[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  grid-column: 1 / -1;
  list-style: none;
  margin: 0 0 var(--space-s);
  padding: 0 0 0 var(--space-s);
  border-left: 2px solid var(--accent-line);
}

.submenu.is-open {
  display: block;
}

.submenu__link {
  display: block;
  padding: 0.6rem 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
  text-decoration: none;
}

.submenu__link:hover,
.submenu__link[aria-current="page"] {
  color: var(--accent);
}

/* Desktop: horizontal nav with a hover/focus dropdown. */
@media (min-width: 60rem) {
  :root {
    --logo-full: 13rem;
    --logo-compact: 10.5rem;
  }

  .nav-toggle {
    display: none;
  }

  /* Desktop keeps the original proportions; the compact step is subtler
     (both widths are set on :root above). */

  .site-nav {
    display: block;
    position: static;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-m);
  }

  .site-nav__item {
    border: 0;
  }

  .site-nav__item--parent {
    position: relative;
    display: flex;
    gap: 0.15rem;
  }

  .site-nav__link {
    padding: 0.5rem 0;
  }

  .site-nav__disclosure {
    width: 1.5rem;
    height: 1.5rem;
  }

  .submenu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);

    min-width: 15rem;
    margin: 0;
    padding: 0.5rem;

    background: var(--white);
    border: 1px solid var(--hairline);
    border-left: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
  }

  .site-nav__item--parent:hover .submenu,
  .site-nav__item--parent:focus-within .submenu {
    display: block;
  }

  .submenu__link {
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
  }

  .submenu__link:hover {
    background: var(--accent-wash);
  }
}


/* --- 9. Hero ------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-xl) var(--space-xl);
  background: linear-gradient(180deg, var(--accent-wash), transparent 70%);
}

@media (min-width: 48rem) {
  .hero {
    padding-block: var(--space-2xl);
  }
}

.hero__inner {
  display: grid;
  gap: var(--space-l);
  align-items: center;
}

@media (min-width: 56rem) {
  .hero__inner {
    grid-template-columns: 1.15fr 0.85fr;
    gap: var(--space-xl);
  }
}

.hero__title {
  font-size: var(--step-4);
}

.hero__art {
  position: relative;
  justify-self: center;
  width: min(24rem, 100%);
}

.hero__art img {
  width: 100%;
}

/* Page banner for interior pages. */
.page-head {
  padding-block: var(--space-xl);
  background: var(--accent-wash);
  border-bottom: 1px solid var(--hairline);
}

.page-head__title {
  font-size: var(--step-3);
}

.page-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
}

/* The page's own leaf, sitting beside the title. */
.page-head__leaf {
  flex: 0 0 auto;
  width: clamp(2.5rem, 7vw, 4.5rem);
  opacity: 0.9;
  rotate: -8deg;
}

/* A page's own mark in place of the leaf: upright, and large enough to read. */
.page-head__leaf--mark {
  width: clamp(6rem, 16vw, 10rem);
  rotate: none;
}

@media (max-width: 40rem) {
  .page-head__leaf {
    display: none;
  }
}

.breadcrumb {
  margin-bottom: var(--space-m);
  font-size: var(--step--1);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--ink-mute);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: var(--ink-mute);
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--ink);
}


/* --- 10. Cards and panels ---------------------------------------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);

  padding: var(--space-m);

  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);

  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-line);
}

.card__bar {
  width: 2.5rem;
  height: 3px;
  margin-bottom: var(--space-2xs);
  background: var(--accent);
  border-radius: 2px;
}

.card__title {
  font-size: var(--step-1);
}

.card__title a {
  color: inherit;
  text-decoration: none;
}

/* Makes the whole card clickable while keeping one real link for a11y. */
.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card__text {
  color: var(--ink-soft);
  font-size: var(--step-0);
}

.card__more {
  display: flex;
  align-items: center;
  gap: 0.45em;

  margin-top: auto;
  padding-top: var(--space-s);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Arrow on links that leave the site. */
.card__external {
  width: 0.7em;
}

/*
   Artwork band across the top of a card. Images sit centred on a wash of
   the card's colour, so icons with different shapes and built-in padding
   still line up card to card. Height matches the source files (140 x 75)
   so they are never stretched past their own resolution.
*/
.card__media {
  display: grid;
  place-items: center;
  height: 7rem;
  margin: calc(var(--space-m) * -1) calc(var(--space-m) * -1) var(--space-2xs);
  background: var(--accent-wash);
  border-bottom: 1px solid var(--hairline);
  /* Inside the card's 1px border, so one pixel tighter than its corners. */
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.card__media img {
  width: auto;
  max-width: 100%;
  height: 75px;
  object-fit: contain;
  /* White fills in the artwork take on the wash instead of showing as boxes. */
  mix-blend-mode: multiply;
}

.panel {
  padding: var(--space-l);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}

.panel--accent {
  background: var(--accent-wash);
  border-color: var(--accent-line);
}

/* Numbered steps. */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.25rem;
}

.steps > li + li {
  margin-top: var(--space-m);
}

.steps > li::before {
  content: counter(step);

  position: absolute;
  left: 0;
  top: 0;

  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;

  font-family: var(--font-display);
  font-size: var(--step-0);
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
}

.steps h3 {
  margin-bottom: var(--space-2xs);
}

/* Definition-style list for facts (hours, coverage). */
.facts {
  margin: 0;
}

.facts > div {
  display: grid;
  gap: 0.15rem;
  padding-block: var(--space-xs);
  border-bottom: 1px solid var(--hairline);
}

@media (min-width: 34rem) {
  .facts > div {
    grid-template-columns: 10rem 1fr;
    gap: var(--space-s);
  }
}

.facts dt {
  font-weight: 600;
  color: var(--ink);
}

.facts dd {
  margin: 0;
  color: var(--ink-soft);
}

.callout {
  padding: var(--space-m);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-wash);
}

.callout--urgent {
  border-left-color: #A3341F;
  background: rgba(163, 52, 31, 0.07);
}


/* --- 10b. Team profiles -------------------------------------------- */
/*
   Portrait beside name and bio. Phones get a small portrait next to the
   name, so the bio starts on the first screen rather than after a
   full-width photo. Wider screens give the portrait its own column and
   alternate sides, which keeps three long bios from reading as a form.
*/

.profiles {
  margin-top: var(--space-xl);
}

.profile {
  --frame-offset: 0.35rem;

  display: grid;
  grid-template-columns: 6.5rem 1fr;
  grid-template-areas:
    "photo header"
    "bio   bio";
  gap: var(--space-m);
  align-items: center;
}

.profile + .profile {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--hairline);
}

.profile__photo {
  grid-area: photo;
  position: relative;
  align-self: start;
}

/* A thin offset frame in the page colour, so portraits feel placed. */
.profile__photo::before {
  content: "";
  position: absolute;
  inset: 0;
  translate: var(--frame-offset) var(--frame-offset);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
}

.profile__photo img,
.profile__monogram {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
}

.profile__photo img {
  object-fit: cover;
  /* Headshots usually sit high in the frame; per-photo override in team.php. */
  object-position: 50% 30%;
  background: var(--paper-deep);
}

/* Stands in until the photo file exists. */
.profile__monogram {
  display: grid;
  place-items: center;

  font-family: var(--font-display);
  font-size: var(--step-2);
  letter-spacing: 0.04em;
  color: var(--accent);
  /* Opaque, unlike --accent-wash, so the frame behind does not show through. */
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
}

.profile__header {
  grid-area: header;
}

.profile__header .eyebrow {
  margin-bottom: var(--space-2xs);
}

.profile__name {
  font-size: var(--step-2);
}

.profile__credentials {
  font-size: 0.72em;
  color: var(--ink-mute);
}

.profile__meta {
  margin-top: var(--space-2xs);
  font-size: var(--step--1);
  color: var(--ink-mute);
}

.profile__bio {
  grid-area: bio;
}

@media (min-width: 48rem) {
  .profile {
    --frame-offset: 0.7rem;

    grid-template-columns: minmax(12rem, 17rem) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "photo header"
      "photo bio";
    column-gap: var(--space-xl);
    row-gap: var(--space-s);
    align-items: start;
  }

  .profile:nth-child(even) {
    grid-template-columns: 1fr minmax(12rem, 17rem);
    grid-template-areas:
      "header photo"
      "bio    photo";
  }

  /* Frame trails away from the text on whichever side the photo sits. */
  .profile:nth-child(even) .profile__photo::before {
    translate: calc(var(--frame-offset) * -1) var(--frame-offset);
  }

  .profile__header {
    padding-top: var(--space-s);
  }

  .profile__monogram {
    font-size: var(--step-4);
  }
}


/* --- 11. Forms ---------------------------------------------------- */

.form {
  display: grid;
  gap: var(--space-m);
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.field .hint {
  font-size: var(--step--1);
  color: var(--ink-mute);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;

  font-family: inherit;
  font-size: var(--step-0);
  color: var(--ink);

  background: var(--white);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field--required label::after {
  content: " *";
  color: var(--terracotta);
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: #A3341F;
}

.field__error {
  font-size: var(--step--1);
  font-weight: 600;
  color: #A3341F;
}

.form-status {
  padding: var(--space-m);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-wash);
}

.form-status:focus {
  outline: none;
}

.form-status--error {
  border-left-color: #A3341F;
  background: rgba(163, 52, 31, 0.07);
}

/* Honeypot. Off-screen rather than display:none, which some bots skip. */
.form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* --- 12. Footer ---------------------------------------------------- */

.site-footer {
  padding-block: var(--space-xl) var(--space-m);
  margin-top: var(--space-2xl);
  color: var(--ink-soft);
  background: var(--paper);
  border-top: 1px solid var(--hairline);
  font-size: var(--step--1);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-l);
}

@media (min-width: 48rem) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--space-xl);
  }
}

.site-footer__mark {
  width: 3.25rem;
  margin-bottom: var(--space-xs);
}

.site-footer__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--forest);
}

.site-footer__tagline {
  margin-top: 0.15rem;
}

.site-footer__heading {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--space-xs);
}

.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__list li + li {
  margin-top: 0.4rem;
}

.site-footer__list a {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-footer__list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer__sub {
  padding-left: var(--space-s);
}

.site-footer__address {
  margin-top: var(--space-s);
  font-style: normal;
  line-height: 1.5;
}

.site-footer__urgent {
  margin-top: var(--space-l);
  padding: var(--space-s) var(--space-m);
  background: rgba(163, 52, 31, 0.07);
  border-left: 3px solid #A3341F;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-m);
  align-items: center;
  justify-content: space-between;

  margin-top: var(--space-l);
  padding-top: var(--space-m);
  border-top: 1px solid var(--hairline);
}

.site-footer__legal p {
  margin: 0;
}

.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__legal-links a {
  color: var(--ink-soft);
}


/* --- 13. Reveal animation ------------------------------------------ */
/*
   Only hides content when JS is running, so the page is fully readable
   if the script fails or is blocked.
*/

.js .reveal {
  opacity: 0;
  transform: translateY(0.9rem);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.js .reveal:nth-child(2) { transition-delay: 0.07s; }
.js .reveal:nth-child(3) { transition-delay: 0.14s; }
.js .reveal:nth-child(4) { transition-delay: 0.21s; }


/* --- 14. Motion, print, forced colours ------------------------------ */

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  /* The tree stands still and fully drawn. */
  .js .tree-figure[data-tree] .tree__leaf,
  .js .tree-figure[data-tree] .tree__trunk {
    opacity: 1;
    transform: none;
  }

  .tree-figure.is-breezy .tree__leaf,
  .tree-figure.is-grown .tree__leaf.is-falling,
  .tree-figure .tree__leaf.is-gusting,
  .tree-figure .tree__leaf.is-sprouting {
    animation: none;
  }
}

@media print {
  .site-header,
  .site-footer__legal-links,
  .nav-toggle,
  .skip-link {
    display: none;
  }

  body {
    padding-top: 0;
    color: #000;
    background: #fff;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

@media (forced-colors: active) {
  .card,
  .panel,
  .submenu {
    border: 1px solid CanvasText;
  }
}
