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

/* ==========================================================================
   calwater-drilling-company-turlock-ca — brief components (editorial-stack,
   editorial-modern). Every component below is built from tokens only, per
   the brief's section plan (runs/calwater-drilling-company-turlock-ca/
   brief.md §5) and tiles/tile-c.html's own reference treatment.
   ========================================================================== */

/* --- Eyebrow ----------------------------------------------------------------
   Authored in natural case in the HTML (house-tech-spec §8); this is what
   uppercases it. G2 (brief §2): this exact size (--text-eyebrow, 10.88px) is
   what the eyebrow-on-gradient contrast figure (4.52:1) was computed against. */

.eyebrow {
  font-size: var(--text-eyebrow);
  line-height: var(--leading-snug);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-block-end: var(--space-2xs);
}

/* --- Hero ---------------------------------------------------------------
   Brief §5.0/§5.1. DOM order (a stated departure, §7.2 rule 1): eyebrow ->
   h1 -> lede -> primary CTA -> field. At >=64em the field moves beside the
   text via grid-template-areas only — DOM order never changes. */

.hero {
  background: linear-gradient(180deg,
    var(--color-halo-light) 0%,
    var(--color-halo-mid) 55%,
    var(--color-halo-deep) 100%);
  padding-block-start: var(--space-hero-top);
}

.hero__grid {
  display: grid;
  grid-template-areas: 'top' 'field';
  row-gap: 0;
}

.hero__top { grid-area: top; }
.hero__field { grid-area: field; }

/* Brief §5.0: the mobile hero's min-height (560px) lets `margin-top: auto`
   push the field flush to the box's bottom edge. */
@media (max-width: 47.99em) {
  .hero__grid {
    min-block-size: var(--layout-hero-min-block);
  }

  .hero__field {
    margin-block-start: auto;
  }
}

.hero__title {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  max-inline-size: var(--layout-hero-title-measure);
  margin-block-end: var(--space-xs);
}

.hero__title em {
  font-style: italic;
  font-family: var(--font-display-italic);
  font-weight: var(--font-weight-display-italic);
  color: var(--color-accent);
}

/* G3 fix (brief §2): ships in --color-ink, not --color-ink-muted — at the
   gradient's darkest stop, ink-muted measures 4.48:1, short of AA's 4.5:1. */
.hero__lede {
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
  color: var(--color-ink);
  max-inline-size: var(--layout-hero-lede-measure);
  margin-block-end: var(--space-sm);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
}

/* Field: fixed height at mobile (brief §5.0 — 270px, above the 375x667
   fold). Free-flowing (aspect-ratio) from >=48em. */
.hero__field {
  position: relative;
  overflow: hidden;
  block-size: var(--layout-hero-field-block);
}

.hero__img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center;
}

.process-line {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

@media (min-width: 48em) {
  .hero__field {
    block-size: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (min-width: 64em) {
  .hero__grid {
    grid-template-columns: 42fr 58fr;
    grid-template-areas: 'top field';
    column-gap: var(--space-lg);
    align-items: center;
  }

  .hero__field {
    margin-block-start: 0;
  }
}

/* --- Living-hero signature (brief §7). Line draws via transform: scaleY()
   from its own top point (index.html explains why, not clip-path/mask). Six
   nodes pulse in sequence, staggered 0.6s over a 5.4s loop. One flow-line
   drifts on an independent 4s loop. Casing rect/ground band stay static. */

.process-line__line {
  transform-origin: var(--layout-line-draw-origin);
  animation: calwater-line-draw var(--duration-line-draw) var(--ease-out) forwards;
}

@keyframes calwater-line-draw {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

.process-line__node {
  animation: calwater-node-pulse var(--duration-node-pulse) var(--ease-in-out) infinite;
}

.process-line__node:nth-child(2) { animation-delay: calc(var(--duration-node-stagger) * 1); }
.process-line__node:nth-child(3) { animation-delay: calc(var(--duration-node-stagger) * 2); }
.process-line__node:nth-child(4) { animation-delay: calc(var(--duration-node-stagger) * 3); }
.process-line__node:nth-child(5) { animation-delay: calc(var(--duration-node-stagger) * 4); }
.process-line__node:nth-child(6) { animation-delay: calc(var(--duration-node-stagger) * 5); }

@keyframes calwater-node-pulse {
  0%, 80%, 100% { opacity: 0.55; }
  40% { opacity: 1; }
}

.process-line__flow {
  animation: calwater-flow-drift var(--duration-flow-drift) var(--ease-in-out) infinite;
}

@keyframes calwater-flow-drift {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(var(--motion-flow-shift)); }
}

/* Reduced motion: brief §7's rest state — line fully drawn, nodes at pulse
   peak (.85), flow-line static at .7. Frozen here; base.css covers reveals. */
@media (prefers-reduced-motion: reduce) {
  .process-line__line {
    animation: none;
    transform: none;
  }

  .process-line__node {
    animation: none;
    opacity: 0.85;
  }

  .process-line__flow {
    animation: none;
    opacity: 0.7;
    transform: none;
  }
}

/* --- Trust strip (brief §5.2, §0.2) — the proof-priority ruled index list
   (ref-011's rule/value rhythm), unnumbered — only the process index below
   carries a numeral column (design-rules §4, "two counters in one costume"). */

.trust {
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.trust__row {
  padding-block: var(--space-sm);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
  font-weight: var(--font-weight-body-strong);
}

/* Brief §6.2 slot 4 (material detail) sits beside the trust strip's ruled
   list — stacked at mobile, a supporting side column from >=48em. */
.trust__grid {
  display: grid;
  gap: var(--space-md);
}

.trust__img-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.trust__img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  object-fit: cover;
}

@media (min-width: 48em) {
  .trust__grid {
    grid-template-columns: 2fr 1fr;
    align-items: center;
    column-gap: var(--space-lg);
  }
}

/* --- Services — unnumbered ruled list (brief §5.3; no second counter beside
   the process index's, design-rules §4). --------------------------------- */

.services__list {
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.service {
  padding-block: var(--space-md);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
}

.service__heading {
  font-size: var(--text-h3);
  margin-block-end: var(--space-2xs);
}

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

/* --- Process — "From Permit to Water" (brief §5.4, §0.1). Numeral column
   fixed at --layout-numeral-col, set in --font-display-italic at
   --text-step-numeral (F6's large-text floor). Step 06 ships in the SAME
   markup, grid and numeral treatment as steps 1-5 (brief §0.1, binding). */

.process {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--layout-gutter);
}

.process__heading {
  font-size: var(--text-h3);
  margin-block-end: var(--space-md);
}

.steps {
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.step {
  display: grid;
  grid-template-columns: var(--layout-numeral-col) 1fr;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
}

.step__n {
  font-family: var(--font-display-italic);
  font-style: italic;
  font-weight: var(--font-weight-display-italic);
  font-size: var(--text-step-numeral);
  color: var(--color-accent);
  line-height: 1;
}

.step__name {
  font-size: var(--text-h3);
  margin-block-end: var(--space-3xs);
}

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

/* Brief §6.2 slot 2, sits beside step 04 (Casing & Sealing). */
.step__img {
  margin-block-start: var(--space-sm);
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-sm);
}

/* Brief §6.2 slot 3 (water-once) — the payoff image after all six steps. */
.process__flow-img {
  margin-block-start: var(--space-lg);
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-md);
}

/* --- Service area (brief §5.5) --------------------------------------------- */

.area__body {
  color: var(--color-ink-muted);
  font-size: var(--text-lede);
  max-width: var(--layout-measure);
}

/* Brief §6.2 slot 5 — subordinate texture, reduced height and opacity, below
   the section's text rather than behind it (brief §2: no text on this page
   sits over a non-flat ground besides the hero). */
.area__img {
  margin-block-start: var(--space-md);
  inline-size: 100%;
  max-block-size: var(--space-3xl);
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-md);
  opacity: 0.6;
}

/* --- Reviews (brief §5.6) — no numbering. Ruled blockquotes, pull-quote idiom. */

.reviews__stat {
  color: var(--color-ink-muted);
  margin-block-end: var(--space-lg);
}

.reviews__list {
  display: grid;
  gap: var(--space-lg);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.review {
  padding-block: var(--space-md);
  padding-inline-start: var(--space-md);
  border-inline-start: var(--border-thick) var(--border-style) var(--color-accent);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
  display: grid;
  gap: var(--space-2xs);
}

.review__quote {
  margin: 0;
  font-family: var(--font-display);
  font-style: normal;
}

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

/* --- Financing (brief §5.7) — a real, rare differentiator, its own section. */

.financing__intro {
  max-width: var(--layout-measure);
  margin-block-end: var(--space-md);
}

.financing__list {
  display: grid;
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
  padding-inline-start: var(--space-md);
}

.financing__note {
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  max-width: var(--layout-measure);
}
