/* ==========================================================================
   Mulish — self-hosted (GDPR-friendly, no Google Fonts CDN)
   Single variable font file covers weights 300–800 (latin subset).
   ========================================================================== */
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/mulish/mulish-latin-var.woff2') format('woff2');
}

/* ==========================================================================
   Design tokens

   Names describe the role, not the colour, so a palette change stays a
   one-line edit here. The page is a calm cream canvas; content sits on it as
   rounded white panels (see .box-section/.box-panel in boxes.css).

   Three rules hold the system together and must not be worked around with
   literal values further down or in boxes.css:
     Type    — every font-size comes from the --fs-* ladder below.
     Shape   — every corner is --radius, --radius-sm or --radius-round.
     Colour  — green carries everything interactive and nothing else.
   ========================================================================== */
:root {
  /* Surfaces */
  --color-page: #F7F5F0;
  --color-surface: #fff;
  --color-tint: #EEF5E2;
  --color-hairline: #E5E1D8;

  /* Type */
  --color-text: #6C6F66;
  --color-heading: #4F5348;
  --color-nav: #6C6F66;
  --color-footer-text: #6C6F66;

  /* Accents — green is the only accent that appears in content.
     Rule: green marks what is interactive (links, buttons, focus, active nav).
     It never decorates. Amber is deliberately unused in the theme right now —
     the token stays so the second logo colour can be reintroduced without
     re-deriving it, and because it fails AA as text and needs a dark
     foreground wherever it is used as a fill. */
  --color-green: #94C943;
  --color-amber: #F9B02D;

  /* Accent roles that carry text or a border need AA contrast, which the raw
     brand tones miss (green on white is 1.96:1). Two derived roles fix that
     without changing the brand hue on filled surfaces:
       --color-green-text  5.1:1 on white, 4.7:1 on cream
       --color-on-accent   5.2:1 on green, 5.5:1 on amber */
  --color-green-text: #4A7A17;
  --color-on-accent: #3E4239;

  /* Dark panel (contact section, dark quote card).
     Same value as --color-heading today but a separate role on purpose: the
     heading grey is still up for discussion with the client and must be able
     to change without dragging the dark panel along. */
  --color-panel-dark: #4F5348;
  --color-panel-darker: #3E4239;
  --color-on-dark: #fff;
  --color-on-dark-muted: #CDD0C8;
  --color-on-dark-accent: #A8D45E;
  --color-on-dark-surface: rgba(255, 255, 255, .08);

  /* Type ladder — rem so the browser's base font size keeps working (WCAG 1.4.4).
     Deliberately tight: h1 is 2.0× the body copy, h2 1.65×, h3 1.3×. */
  --fs-sm: 0.9375rem;                             /* 15px — footer, secondary copy, roles, periods */
  --fs-base: 1.0625rem;                           /* 17px — body copy */
  --fs-md: 1.1875rem;                             /* 19px — lead, card titles, h4 */
  --fs-lg: 1.375rem;                              /* 22px — h3 */
  --fs-xl: clamp(1.5rem, 2vw, 1.75rem);           /* 24–28px — h2 */
  --fs-2xl: clamp(1.75rem, 2.6vw, 2.125rem);      /* 28–34px — h1 */

  --lh-text: 1.7;
  --lh-heading: 1.25;

  /* Spacing scale — heading→text is --space-s, text→list --space-m,
     grid gaps --space-m, block→block --space-l, everywhere. */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-s: 16px;
  --space-m: 24px;
  --space-l: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;

  /* Metrics */
  --container: 1180px;
  --page-gutter: clamp(16px, 3.5vw, 32px);
  --section-gap: clamp(40px, 5vw, 86px);
  --hero-gap: clamp(12px, 2vw, 24px);
  --panel-pad: clamp(28px, 3.4vw, 52px);
  --card-pad: clamp(22px, 2.4vw, 32px);
  --measure: 660px;

  /* Measured in scripts.js — anchor targets clear the sticky header at any
     zoom level and any header height. The literal is only the no-JS fallback. */
  --header-height: 96px;

  /* Shape — one rule for every surface, one for every control. */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-round: 50%;
  /* Not part of the surface/control scale above — rounds the ends of the
     2px-thick menu-icon bar into a pill, not a card or button corner. */
  --radius-hairline: 2px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Mulish', Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--color-page);
  color: var(--color-text);
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  font-weight: 400;
  min-height: 100vh;
}

/* Trailing space below the last box, since boxes only carry a top gap. */
main {
  padding-bottom: var(--section-gap);
}

/* ==========================================================================
   Accessibility — skip link, focus ring, reduced motion

   One focus rule for the whole theme instead of a per-component afterthought.
   --color-green-text clears 3:1 against both page surfaces (WCAG 1.4.11),
   which the brand green (1.96:1) does not.
   ========================================================================== */
.skip-link {
  position: absolute;
  left: var(--page-gutter);
  top: 0;
  z-index: 100;
  transform: translateY(-140%);
  background: var(--color-surface);
  color: var(--color-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  padding: var(--space-xs) var(--space-s);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform .15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--color-green-text);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Header — sticky bar with logo, appointment CTA and the menu toggle
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 245, 240, .95);
  backdrop-filter: blur(8px);
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-s) var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.site-header__logo {
  height: clamp(42px, 5vw, 52px);
  width: auto;
  display: block;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  flex: 0 1 auto;
  min-width: 0;
}

.site-header__cta {
  flex: 0 1 auto;
  min-width: 0;
  text-align: center;
}

/* Free up vertical space for the open menu panel. */
.site-header--menu-open .site-header__cta {
  display: none;
}

/* Hamburger toggle — always visible, replaces inline nav links at every width */
.site-header__menu-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.site-header__menu-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-heading);
  border-radius: var(--radius-hairline);
  transition: transform .2s ease, opacity .2s ease;
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header__menu-toggle[aria-expanded="true"] .site-header__menu-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Menu panel — hidden by default, toggled open via JS */
.site-menu {
  max-height: 0;
  overflow: hidden;
  background: var(--color-surface);
  border-top: 1px solid var(--color-hairline);
  transition: max-height .25s ease;
}

.site-menu.is-open {
  /* --menu-max-height is set from JS to the space actually left below the
     header bar, since that bar's height varies. The dvh fallback covers no-JS. */
  max-height: var(--menu-max-height, calc(100dvh - var(--header-height)));
  overflow-y: auto;
}

.site-menu__list {
  list-style: none;
  margin: 0 auto;
  padding: var(--space-xs) var(--page-gutter) var(--space-m);
  max-width: var(--container);
}

.site-menu__item {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-hairline);
}

.site-menu__item:last-child {
  border-bottom: none;
}

.site-menu__link {
  display: block;
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--color-heading);
  text-decoration: none;
  transition: color .2s ease;
}

.site-menu__link:hover,
.site-menu__item.is-active > .site-menu__link {
  color: var(--color-green-text);
}

/* No opacity here — a dimmed label drops to ~1.9:1. */
.site-menu__link--disabled {
  color: var(--color-nav);
  cursor: default;
}

.site-menu__sublist {
  list-style: none;
  margin: var(--space-2xs) 0 0;
  padding: 0;
}

.site-menu__subitem {
  padding: 6px 0 6px 22px;
}

.site-menu__sublink {
  display: block;
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--color-nav);
  text-decoration: none;
  transition: color .2s ease;
}

.site-menu__sublink:hover,
.site-menu__subitem.is-active .site-menu__sublink {
  color: var(--color-green-text);
}

.site-menu__sublink--disabled {
  cursor: default;
}

/* ==========================================================================
   Footer — copyright and legal links on a hairline rule
   ========================================================================== */
.site-footer {
  padding-bottom: 30px;
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}

.site-footer__inner {
  max-width: calc(var(--container) - 2 * var(--page-gutter));
  margin: 0 auto;
  border-top: 1px solid var(--color-hairline);
  padding-top: var(--space-m);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs) var(--space-m);
  font-size: var(--fs-sm);
  color: var(--color-footer-text);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.footer-link {
  color: var(--color-footer-text);
  text-decoration: none;
  transition: color .2s ease;
}

.footer-link:hover {
  color: var(--color-green-text);
}

/* ==========================================================================
   Responsive — shrink logo and CTA on narrow screens
   ========================================================================== */
@media (max-width: 900px) {
  .site-header__inner {
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-s);
  }

  .site-header__logo {
    height: 38px;
  }

  .site-header__cta {
    font-size: var(--fs-sm);
    padding: var(--space-xs) var(--space-s);
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    justify-content: space-between;
  }

  .site-header__actions {
    gap: 10px;
  }
}
