/* ==========================================================================
   site.css — per-site layout & components, built FROM tokens.

   HARD RULE (house-tech-spec §3): no raw hex, no px/rem size literals, no
   font-name literals in this file. Tokens only. The Critic greps for it.
   The two escape hatches are the house breakpoints and an explicit
   `@allow-literal: reason` comment on the preceding line.

   WHAT THE SKELETON SHIPS HERE, AND WHY IT SHIPS SO LITTLE
   --------------------------------------------------------
   Only the shell: header/nav, the section rhythm hook, buttons, the form, the
   footer. That is everything a site needs structurally and nothing that
   decides how it looks.

   The skeleton deliberately ships NO hero, NO card grid, NO feature row, NO
   testimonial block and NO section-heading pattern. Those come from the
   approved brief's layout archetype (design-rules §7) and are written per
   site. A skeleton that shipped them would hand every business the same page
   with different colours — which is the exact failure the DNA registry
   exists to prevent, and it would collide head-on with the banned-defaults
   list (design-rules §4: three-card grids, four-stat rows, centred hero with
   two pill buttons, every section the same padding with a centred heading).

   And when a brief's archetype numbers its sections, its sub-lists take a
   visibly different mark — different numeral system, face and colour role —
   or no mark at all (design-rules §4, "two counters in one costume").

   Builder: extend this file with the brief's components. Do not "fill in" a
   hero here from memory — the brief is law (spec §12).
   ========================================================================== */

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

.container {
  width: 100%;
  max-width: var(--layout-container);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

/* Vertical rhythm hook. --section-gap is the only inter-section spacing value
   on a site (design-rules §7.1); the brief picks which scale step it is. */
.section {
  padding-block: var(--section-gap);
}

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

/* --- Header & navigation --------------------------------------------------
   Progressive enhancement: with JS off the nav list is a plain, always-visible
   list of links and the toggle stays [hidden] (it ships hidden in the HTML;
   main.js reveals it). With JS on, narrow viewports collapse the list behind
   the toggle. Nothing about navigation depends on JavaScript.              */

.site-header {
  position: relative;
  z-index: var(--z-header);
  padding-block: var(--space-sm);
  border-bottom: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-bg);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.site-header__brand {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-display);
  text-decoration: none;
  letter-spacing: var(--tracking-tight);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-xs);
  /* The nav-toggle's only shape is this hairline, so it is a CONTROL boundary
     (WCAG 1.4.11, >= 3:1), not a decorative one — use --color-border-strong. */
  border: var(--border-hairline) var(--border-style) var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

/* QA r3 FIX perf/cls (this skeleton-level defect was confirmed present,
   verbatim, on every site built from it -- see
   runs/3-elements-landscaping-asheville-nc/qa/critic-round-2.md): the
   collapsed state used to apply only once a deferred `type="module"`
   script called `initNav()` and set `[data-nav-ready]`, so the full nav
   list rendered open at first paint and then collapsed into the hamburger
   AFTER first contentful paint -- a timing race with no fixed outcome that
   shifted the whole header (and everything below it) and scored CLS
   0.066-0.094 in the majority of Lighthouse runs. Inverting the default
   removes the race entirely: closed is now the plain CSS default below
   48em, with no JS gate, so there is nothing left to collapse post-paint.
   The one visitor this would otherwise strand -- JS off, so
   `[data-nav-ready]` never lands -- gets the nav back via the <noscript>
   stylesheet override in `@shared:head-boilerplate` (index.html/buy.html/
   thanks.html), which ships last in source order and wins the
   display:block/display:none tie on cascade order alone, no
   `!important`. The nav-toggle button already ships `hidden` in the HTML
   and only JS ever clears that, so JS-off visitors never see a dead
   control -- nothing to change there. */
.site-nav {
  display: none;
}

[data-nav-ready] .site-nav[data-nav-open='true'] {
  display: block;
  flex-basis: 100%;
}

@media (min-width: 48em) {
  .site-nav {
    display: block;
  }

  [data-nav-ready] .nav-toggle {
    display: none;
  }
}

/* --- Buttons --------------------------------------------------------------
   Two roles, no more. Radius, weight and colour all come from the brief via
   tokens — including --radius-none, which is a legitimate answer.          */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-md);
  border: var(--border-hairline) var(--border-style) transparent;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-body-strong);
  line-height: var(--leading-snug);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

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

.btn--quiet {
  /* Outline button: the border is the whole control, so it takes the 3:1
     control-boundary token, not the decorative hairline (WCAG 1.4.11). */
  border-color: var(--color-border-strong);
  color: var(--color-ink);
}

/* --- Form -----------------------------------------------------------------
   One form per site (spec §6). POSTs to the endpoint constant in main.js;
   works as a plain HTML POST with JS off; auto-hides when no endpoint is
   configured so a spec site never shows a dead form.                       */

.form {
  display: grid;
  gap: var(--space-md);
  max-width: var(--layout-measure);
}

.field {
  display: grid;
  gap: var(--space-3xs);
}

.field__label {
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
}

.field__control {
  width: 100%;
  min-height: var(--layout-tap-min);
  padding: var(--space-2xs) var(--space-xs);
  background-color: var(--color-surface);
  color: var(--color-ink);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
}

textarea.field__control {
  min-height: var(--space-3xl);
  resize: vertical;
}

.field__hint {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

/* Honeypot: present in the DOM for bots, unreachable for humans and assistive
   tech. Not display:none — some bots skip those. */
.form__trap {
  position: absolute;
  /* @allow-literal: off-canvas parking position, not a design value */
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.form__status {
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.form__status[data-state='error'] {
  color: var(--color-ink);
  font-weight: var(--font-weight-body-strong);
}

/* --- Footer ---------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-xl);
  border-top: var(--border-hairline) var(--border-style) var(--color-border);
  font-size: var(--text-small);
}

.site-footer a {
  text-underline-offset: var(--space-3xs);
}

.site-footer__nap {
  font-style: normal;
}

.site-footer__license,
.site-footer__social {
  margin-block-start: var(--space-2xs);
}

/* ============================================================================
   BRIEF COMPONENTS — advanced-irrigation-wilmington-nc (brief.md, C3 approved
   2026-09-15). Family retro-local, archetype poster-hero. Everything below
   this line is per-brief; everything above is the house shell.
   ============================================================================ */

/* --- Section heading intro spacing --------------------------------------- */

.section__intro {
  margin-block-start: var(--space-2xs);
}

/* --- Hero (brief §4) -------------------------------------------------------
   DOM order: eyebrow -> h1 -> CTA -> field -> lead -> facts -> anchor image.
   Every inter-element gap below is named against brief §4.2's own arithmetic
   table so it stays traceable to a row rather than a guess.

   Revised 2026-09-15 (brief §4.2 correction): six of the seven internal gap
   tokens step down one rung on the house spacing scale to recover fold
   visibility for the hero-foot anchor image (§5.1) — 44px saved total. The
   eyebrow->H1 gap is the one gap left deliberately untouched (brief §4.2). */

.hero {
  padding-block-start: var(--space-md);   /* 24px — brief §4.2, revised 2026-09-15 (was --space-lg, 40px) */
  padding-block-end: var(--section-gap);  /* 64px — brief §4.2 / §4.4, unchanged */
  background: radial-gradient(120% 90% at 50% 0%, var(--color-bg) 0%, var(--color-hero-atmosphere) 100%);
}

.hero__inner {
  display: flex;
  flex-direction: column;
}

/* Eyebrow — recoloured to ink, never accent, because it sits over the hero
   gradient (brief §2.4 fix 1: row 10 fails at 4.25:1, row 8 passes at
   12.01:1). Real content (business name + service area), not decoration. */
.eyebrow {
  color: var(--color-ink);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  line-height: var(--leading-eyebrow);
  letter-spacing: var(--tracking-wide);
  margin: 0;
}

.hero h1 {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  margin-block-start: var(--space-2xs);   /* 8px — brief §4.2, unchanged (eyebrow->H1 left untouched) */
  margin-block-end: 0;
}

.hero__cta {
  margin-block-start: var(--space-xs);    /* 12px — brief §4.2, revised 2026-09-15 (was --space-sm, 16px) */
  margin-block-end: 0;
}

/* Living-hero field — the enamel ring + spray-arc line (brief §6). Real
   size, never scaled to zero; the arithmetic floor is 110px, reached at and
   below 375px (brief §3.2). */
.hero-field {
  width: 100%;
  height: var(--hero-field-height);
  margin-block-start: var(--space-sm);    /* 16px — brief §4.2, revised 2026-09-15 (was --space-md, 24px) */
}

.hero-field__svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Fixed 3px stroke-width on both the ring and the arc, never a scaled unit
   (brief §3.3) — vector-effect keeps the line weight constant in screen
   pixels regardless of the viewBox's own scale. */
.hero-field__ring {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: var(--border-thick);
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(var(--shadow-sm));  /* the one shadowed element on the page (brief §3.4) */
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-2deg);  /* resting pose — also the reduced-motion still frame (brief §6) */
}

.hero-field__arc {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: var(--border-thick);
  stroke-linecap: round;
  stroke-dasharray: 12 8;
  stroke-dashoffset: 0;  /* fully drawn — also the reduced-motion still frame (brief §6) */
  vector-effect: non-scaling-stroke;
}

/* Two independent, non-synchronised ambient loops (brief §6), gated behind
   prefers-reduced-motion so the un-animated rules above are exactly what
   reduced-motion visitors see — no mid-motion freeze (house-tech-spec §8). */
@media (prefers-reduced-motion: no-preference) {
  .hero-field__ring {
    animation: hero-ring-sway var(--duration-ring-sway) var(--ease-ring-sway) infinite;
  }

  .hero-field__arc {
    animation: hero-arc-sweep var(--duration-arc-sweep) var(--ease-arc-sweep) infinite;
  }
}

@keyframes hero-ring-sway {
  0%, 100% { transform: rotate(-2deg); }
  50%      { transform: rotate(3deg); }
}

@keyframes hero-arc-sweep {
  0%, 100% { stroke-dashoffset: 0; }
  50%      { stroke-dashoffset: 40; }
}

.hero__lead {
  color: var(--color-ink-muted);
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
  max-width: var(--layout-measure);
  margin-block-start: var(--space-xs);    /* 12px — brief §4.2, revised 2026-09-15 (was --space-sm, 16px) */
  margin-block-end: 0;
}

.hero__facts {
  color: var(--color-ink-muted);
  font-size: var(--text-label);
  line-height: var(--leading-eyebrow);
  margin-block-start: var(--space-2xs);   /* 8px — brief §4.2, revised 2026-09-15 (was --space-xs, 12px) */
  margin-block-end: 0;
}

/* Hero-foot anchor image (brief §5.1) — full-bleed, breaks out of .container
   because .hero itself carries no inline padding. No hero text ever sits
   over its pixels. */
.hero__anchor {
  width: 100%;
  margin-block-start: var(--space-2xs);   /* 8px — brief §4.2, revised 2026-09-15 (was --space-sm, 16px) */
}

.hero__anchor img {
  width: 100%;
  height: auto;
}

/* --- Trust plates — "Facts You Can Check" (brief §4.5 row 2) -------------- */

.trust-plates {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-block-start: var(--space-lg);
}

/* Brief §3.3: the mobile 2-column grid engages below 700px. */
@media (max-width: 43.75em) {
  .trust-plates {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Brief §3.3: below 340px (narrower than any target device) the grid drops
   to a single column so the fixed 64px ring never competes for width. */
@media (max-width: 21.25em) {
  .trust-plates {
    grid-template-columns: 1fr;
  }
}

.trust-plate {
  background-color: var(--color-surface);
  border-radius: var(--radius-none);   /* squared — "reads as printed" (brief §3.4) */
  padding: var(--space-md);
  text-align: center;
}

/* Trust-plate ring — fixed 64x64px, independent of viewport (brief §3.3).
   Stroke is accent, a UI-component boundary (WCAG 1.4.11's 3:1 floor,
   brief §2.4 fix 2: 4.69:1 clears with room). */
.trust-plate__ring {
  width: var(--plate-ring-size);
  height: var(--plate-ring-size);
  margin-inline: auto;
  border-radius: var(--radius-pill);
  border: var(--border-thick) solid var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ring caption — ink-muted, never accent (brief §2.4 fix 2: the accent-at-
   11.2px pairing measured 4.69:1 against surface, too tight for 4.5:1 text). */
.trust-plate__ring-caption {
  font-size: var(--text-ring);
  font-weight: var(--font-weight-body-medium);
  color: var(--color-ink-muted);
  line-height: 1;
  text-align: center;
}

.trust-plate__heading {
  margin-block-start: var(--space-sm);
  margin-block-end: var(--space-3xs);
}

.trust-plate__body {
  color: var(--color-ink-muted);
  margin: 0;
}

/* --- Services — numbered index (brief §4.5 row 3, §4.6) ------------------- */

.index-list {
  margin-block-start: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

.index-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

/* Bevan numerals, accent colour — the page's SECTION-level counter (brief
   §4.6). Numeral column reserves a floor so four service names share one
   left edge; below it the name wraps and the numeral stays top-aligned. */
.index-list__num {
  flex: none;
  min-width: var(--index-num-min-width);
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: 1;
  color: var(--color-accent);
}

.index-list__content h3 {
  margin: 0 0 var(--space-3xs);
}

.index-list__content p {
  color: var(--color-ink-muted);
  margin: 0;
}

/* --- Compliance-explainer step list (brief §4.5 row 4, §4.6) --------------
   Barlow numerals, ink-muted colour — visibly distinct from the Services
   numerals on TWO axes (face and colour), satisfying design-rules §5's
   two-of-three distinct-system rule. */

.step-list {
  margin-block-start: var(--space-lg);
  display: grid;
  gap: var(--space-md);
}

.step-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.step-list__num {
  flex: none;
  min-width: var(--index-num-min-width);
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--step-num-size);  /* fixed 1rem (brief §4.6) */
  line-height: 1;
  color: var(--color-ink-muted);
}

.step-list__content h3 {
  margin: 0 0 var(--space-3xs);
}

.step-list__content p {
  color: var(--color-ink-muted);
  margin: 0;
}

.compliance__closing {
  margin-block-start: var(--space-lg);
  font-weight: var(--font-weight-body-strong);
}

/* --- Section accent images (brief §5.2 slots 2 and 3) ---------------------
   Small supporting figures, never full-bleed, never with text over their
   pixels — the same "no text over pixels" rule the brief states for slot 1
   (§5.1), extended here by the Builder rather than inventing a new
   text/bg pairing the brief's §2.3 contrast table does not cover. */

.section-accent-img {
  max-width: var(--accent-img-max-width);
  margin: var(--space-lg) auto 0;
}

.section-accent-img img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-none);
}

.section-accent-img--compliance {
  margin-block-end: var(--space-lg);
}

/* --- Reviews (brief §4.5 row 6) -------------------------------------------- */

.review-themes {
  margin-block-start: var(--space-lg);
  display: grid;
  gap: var(--space-2xl);
}

.review-theme h3 {
  margin-block-end: var(--space-sm);
}

.review-quote {
  margin: 0;
  padding-block: var(--space-sm);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.review-quote blockquote {
  margin: 0;
}

.review-quote figcaption {
  margin-block-start: var(--space-2xs);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}

.review-quote figcaption strong {
  color: var(--color-ink);
}

/* --- Section-boundary hairline (brief §4.6) --------------------------------
   Cheap, consistent signature continuing the trust-plate/ledger convention
   down the page, at the top of every .section after the hero (the hero
   itself carries class "hero", never "section", so this rule never touches
   it). Spans --layout-measure at every width. */

.section::before {
  content: '';
  display: block;
  width: var(--layout-measure);
  max-width: calc(100% - 2 * var(--layout-gutter));
  margin-inline: auto;
  margin-block-end: var(--space-md);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}
