/* ==========================================================================
   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 two escape hatches are
   the house breakpoints and an explicit `@allow-literal: reason` comment on
   the preceding line. Components below realise brief.md's `sidebar-anchor`
   archetype — the skeleton ships none of this shape itself (design-rules §7).
   ========================================================================== */

/* --- 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);
}

/* --- Typographic helpers, used across every section ------------------------
   Eyebrow: uppercase in its markup-natural case, transformed by CSS only
   (spec §8 — assistive tech and copy-out should see "Newman Lake, WA", not
   caps-typed text). Headrule: the season-index/section-level mark (brief
   §5.3) — an unnumbered 2px accent bar with a wheat tick, colour + no
   numeral, distinct from the rail's own label-only tabs and from the plain
   hairline dividers inside a service list (design-rules §5 nested-counter
   rule). Accent-em: the single italic colour-accent word per headline
   (ref-001, brief §0). */

.eyebrow {
  margin-block-end: var(--space-md);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.headrule {
  position: relative;
  margin-block: 0 var(--space-md);
  height: var(--headrule-height);
  border: 0;
  background-color: var(--color-accent);
}

.headrule::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(var(--headrule-height) * -1);
  width: var(--tick-width);
  height: var(--tick-height);
  background-color: var(--color-wheat);
}

/* QA r2 lensD: emphasis only; trade answer is .hero__lead. */
.accent-em {
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-emphasis);
  color: var(--color-accent);
}

.section-cta {
  margin-block-start: var(--space-lg);
  font-size: var(--text-small);
}

.svc-list {
  display: grid;
  gap: 0;
}

.svc-list li {
  padding-block: var(--space-xs);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-hairline);
}

.svc-list li:first-child {
  border-block-start: 0;
}

/* --- Header ----------------------------------------------------------------
   Brief §5.2: "Sticky header (wordmark, primary CTA=call)" is the header's
   entire content — no nav-toggle, no collapsible list, because copy.md gives
   no nav-item labels and there is nothing else in the fixed header to
   collapse. Sticky, stacked below the sticky preview expiry bar (brief §5.1;
   css/preview.css carries the sticky override). Height is fixed from
   --header-height rather than derived from padding + content, so brief §8
   plank 1's fold arithmetic (44 + 56 + 1 = 101px) holds regardless of any
   future content change inside the row. */

.site-header {
  position: sticky;
  inset-block-start: var(--expiry-height, 0px);
  z-index: var(--z-header);
  padding-block: 0;
  min-height: var(--header-height);
  border-bottom: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-bg);
}

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

/* The wordmark carries the single italic-accent-word convention (brief §0's
   ref-001 citation) into the header identity: Petrona italic, accent colour —
   the same device the h1's "season" uses, at header scale. */
.site-header__brand {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-emphasis);
  font-size: var(--text-h3);
  color: var(--color-accent);
  text-decoration: none;
  letter-spacing: var(--tracking-normal);
}

.site-header__phone {
  flex: 0 0 auto;
  padding-inline: var(--space-sm);
  font-size: var(--text-small);
}

/* Anchors targeted by the season rail and repeat CTAs land clear of the
   sticky chrome stack (expiry bar + header) rather than underneath it. */
section[id] {
  scroll-margin-block-start: var(--sticky-offset);
}

/* --- 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 {
  border-color: var(--color-border);
  color: var(--color-ink);
}

/* --- Hero — "The Season Line" (brief §2, §5.3, §7.3) -----------------------
   House DOM order (design-rules §7.2 rule 1): eyebrow → h1 → primary CTA
   (+ secondary) → field → lead, stacked in that order below 64rem; a
   two-column split (copy | field) from 64rem, lead full-width beneath both.
   Never reveal-gated — visible on load (spec §9).

   QA r2 clarity/5s: gaps tightened one step so lead clears the fold. */

.hero {
  padding-block-start: var(--space-md);
  padding-block-end: var(--section-gap);
}

.hero__inner {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

.hero__h1 {
  margin-block-end: var(--space-sm);
  font-size: var(--text-display);
  letter-spacing: var(--tracking-tight);
}

.hero__copy .eyebrow {
  margin-block-end: var(--space-sm);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
}

.hero__lead {
  grid-column: 1 / -1;
  margin-block-start: var(--space-sm);
  font-size: var(--text-lead);
  color: var(--color-ink-muted);
}

/* The living-hero field. The generated Season Arc image (slot 1, brief §6)
   is the field's static artwork — dial arc, sprinkler riser and turf sprig
   all baked in; the radial gradient behind it is the required atmosphere
   ground (spec §3) and letterboxes the image while it loads. Only the two
   literally-animated things brief §7.3 names — the marker and three
   droplets — are separate overlay elements, positioned as percentages of
   the field's own box (brief §5.3), never fixed pixels. */
.hero__field {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  background-image: radial-gradient(120% 90% at 30% 15%, var(--color-atmo-1) 0%, var(--color-atmo-3) 100%);
  min-width: var(--hero-field-min);
}

.hero__field picture,
.hero__field img {
  display: block;
  width: 100%;
  height: auto;
}

.hero__signature,
.hero__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Percentage anchor near the artwork's own dial hub. The marker is a short
   accent-coloured tick, the same visual weight as a headrule's wheat tick,
   sweeping once on load and then resting (brief §7.3). */
.dial-marker {
  position: absolute;
  inset-inline-start: 73%;
  inset-block-start: 78%;
  width: var(--space-3xs);
  height: 16%;
  transform-origin: 50% 0%;
  background-color: var(--color-accent);
  border-radius: var(--radius-pill);
  animation: dial-sweep var(--duration-signature) var(--ease-signature) both;
}

@keyframes dial-sweep {
  from { transform: rotate(var(--dial-sweep-start)); }
  to   { transform: rotate(var(--dial-sweep-end)); }
}

.drop {
  position: absolute;
  width: var(--space-2xs);
  height: var(--space-2xs);
  border-radius: var(--radius-pill);
  background-color: var(--color-accent);
  opacity: 0.35;
}

.drop--1 { inset-inline-start: 16%; inset-block-start: 18%; animation: drift-1 var(--duration-drift-1) ease-in-out infinite; }
.drop--2 { inset-inline-start: 32%; inset-block-start: 10%; animation: drift-2 var(--duration-drift-2) ease-in-out infinite; }
.drop--3 { inset-inline-start: 23%; inset-block-start: 32%; animation: drift-3 var(--duration-drift-3) ease-in-out infinite; }

@keyframes drift-1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(var(--drift-amplitude), calc(var(--drift-amplitude) * 1.1)); } }
@keyframes drift-2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(calc(var(--drift-amplitude) * -1), calc(var(--drift-amplitude) * 0.8)); } }
@keyframes drift-3 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(calc(var(--drift-amplitude) * 0.7), calc(var(--drift-amplitude) * -1)); } }

/* Brief §7.4: reduced motion parks every loop at its landed state — the
   still frame is the artwork the animation settles into. base.css's kill
   switch collapses --duration-fast/base/slow; these two are this site's
   own custom durations and are parked here. */
@media (prefers-reduced-motion: reduce) {
  .dial-marker {
    animation: none;
    transform: rotate(var(--dial-sweep-end));
  }

  .drop {
    animation: none;
  }
}

@media (min-width: 64em) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-lg);
  }
}

/* --- Season rail + Trust Strip — the bounded sticky wrapper (brief §5.1) ---
   Below 48em: inline tab strip, no stickiness. 48–64em: a fixed column
   beside the content, still not sticky. ≥64em: `position: sticky`,
   contained by .rail-wrap — spanning EXACTLY the Season Index and Trust
   Strip sections — releasing to normal flow once that box ends, zero JS. */

.rail-wrap {
  display: grid;
  grid-template-columns: 1fr;
}

.season-rail__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border-muted);
}

.season-rail__tabs a {
  flex: 1 1 var(--tab-min-width); /* brief §5.3's repeated-ornament floor */
  min-width: var(--tab-min-width);
  padding: var(--space-sm) var(--space-xs);
  border-inline-start: var(--border-thick) var(--border-style) transparent;
  font-size: var(--text-tab-floor); /* accessible floor, brief §5.3 */
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  color: var(--color-ink-muted);
}

.season-rail__tabs a[aria-current='true'],
.season-rail__tabs a[aria-selected='true'] {
  color: var(--color-accent);
  font-weight: var(--font-weight-display);
  background-color: var(--color-surface);
}

.rail-wrap__content {
  min-width: 0;
}

/* JS-off: every season panel is plain, stacked, readable content — the tabs
   above are ordinary in-page anchor links to each panel's id. Once JS is
   ready, non-active panels hide and the tabs become a real tablist. */
[data-season-ready] [data-season-panel] {
  display: none;
}

[data-season-ready] [data-season-panel][data-season-active] {
  display: block;
}

@media (min-width: 48em) {
  .rail-wrap {
    grid-template-columns: var(--rail-column-width) minmax(0, 1fr);
    align-items: start;
    gap: var(--space-xl);
  }

  .season-rail__tabs {
    flex-direction: column;
    border-block-end: 0;
    border-inline-end: var(--border-hairline) var(--border-style) var(--color-border-muted);
  }

  .season-rail__tabs a {
    border-inline-start: var(--border-thick) var(--border-style) transparent;
    text-align: start;
  }

  .season-rail__tabs a[aria-current='true'],
  .season-rail__tabs a[aria-selected='true'] {
    border-inline-start-color: var(--color-accent);
  }
}

@media (min-width: 64em) {
  .season-rail__tabs {
    position: sticky;
    inset-block-start: var(--sticky-offset);
  }
}

.trust {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

.trust__images {
  display: grid;
  gap: var(--space-sm);
  grid-template-columns: 1fr 1fr;
}

.trust__images picture {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: var(--border-hairline) var(--border-style) var(--color-border);
}

@media (min-width: 48em) {
  .trust {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
  }
}

/* --- Reviews ----------------------------------------------------------- */

.review {
  margin: 0 0 var(--space-md);
  padding-inline-start: var(--space-md);
  border-inline-start: var(--border-thick) var(--border-style) var(--color-border);
}

.review p {
  margin: 0 0 var(--space-2xs);
  font-size: var(--text-lead);
  font-style: italic;
}

.review cite {
  font-size: var(--text-small);
  font-style: normal;
  color: var(--color-ink-muted);
}

/* --- Service Area -------------------------------------------------------- */

.service-area {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
  align-items: center;
}

.service-area__image picture {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: var(--border-hairline) var(--border-style) var(--color-border);
}

@media (min-width: 48em) {
  .service-area {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
}

/* --- Quote form section ---------------------------------------------------- */

.quote {
  display: grid;
  gap: var(--space-lg);
  grid-template-columns: 1fr;
}

.quote__image picture {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: var(--border-hairline) var(--border-style) var(--color-border);
}

@media (min-width: 64em) {
  .quote {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  }

  .quote__image {
    order: 1;
  }
}

.field--checks {
  border: 0;
  padding: 0;
  margin: 0;
}

.field__checks {
  display: grid;
  gap: var(--space-2xs) var(--space-md);
  grid-template-columns: 1fr;
  font-size: var(--text-small);
  font-weight: var(--font-weight-body);
}

/* Each checkbox+label pair is a WCAG touch-target-floor control (spec §8:
   44×44 minimum). A native checkbox at its intrinsic size cannot clear that
   floor, so the input itself IS sized to the tap minimum (appearance: none,
   custom paint) rather than relying on an oversized invisible hit-area
   layered over a small decorative glyph — one element, one accessible
   control, still natively focusable and keyboard-operable. */
.chk {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
}

.field__checks input[type='checkbox'] {
  appearance: none;
  width: var(--layout-tap-min);
  height: var(--layout-tap-min);
  flex: 0 0 auto;
  margin: 0;
  position: relative;
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  cursor: pointer;
}

.field__checks input[type='checkbox']:checked {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
}

.field__checks input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  inset-inline-start: 32%;
  inset-block-start: 12%;
  width: 22%;
  height: 48%;
  border-inline-end: var(--border-thick) var(--border-style) var(--color-accent-ink);
  border-block-end: var(--border-thick) var(--border-style) var(--color-accent-ink);
  transform: rotate(45deg);
}

.field__checks label {
  font-size: var(--text-small);
}

@media (min-width: 40em) {
  .field__checks {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- thanks.html ---------------------------------------------------------
   Brief §8 plank 1: the h1 is set at --text-h2 scale, not --text-display —
   a second spectacular moment here would violate design-rules §0's "one
   hero moment" rule, so this page is deliberately calm. */

.thanks__h1 {
  margin-block: var(--space-md) var(--space-lg);
  font-size: var(--text-h2);
}

/* --- FAQ --------------------------------------------------------------- */

.faq-list {
  display: grid;
  gap: 0;
}

.faq-item {
  padding-block: var(--space-sm);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-hairline);
}

.faq-item:first-child {
  border-block-start: 0;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-h3);
}

.faq-item p {
  margin-block-start: var(--space-sm);
  color: var(--color-ink-muted);
}

/* --- 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;
}

/* Wheat is normal-weight-text-safe against --color-bg (brief §3.4 row 8,
   4.90:1) — the footer never sits on --color-surface, so the hard
   large-text-only constraint (row 9) does not attach here. */
.site-footer__certs {
  color: var(--color-wheat);
}
