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

/* ==========================================================================
   texas-pool-fort-worth-tx — brief §4's `instrument-column` archetype.

   IMAGERY NOTE (Builder self-check, flagged for the record): no image-
   generation tool was available this build session. Every imagery slot the
   brief specifies (hero cross-section, pad object-study, bucket-test
   object-study) is built here as inline SVG/CSS rather than a generated
   raster asset — never an empty <img>. Each carries `role="img"` and an
   `aria-label` set to the Copywriter's exact alt text (copy.md §5), and each
   is styled toward the brief's style recipe (muted instrument-slate palette,
   pool-teal confined to water, soft upper-left highlight). This keeps the
   hero as a zero-network-weight LCP candidate, which is a genuine perf win,
   but it is a substitution the Art Director should see, not a Builder
   design choice — flagged in the handoff report.
   ========================================================================== */

/* --- Recurring ornament (brief §6): the hero's coping/waterline edge,
   flattened to a static hairline, reused atop every section below the hero.
   Structure only — "you are starting a new instrument reading." */
.section-rule {
  border: 0;
  border-block-start: var(--border-thick) var(--border-style) var(--color-accent);
  margin-block-end: var(--space-md);
}

.section h2 {
  font-size: var(--text-h2);
  margin-block-end: var(--space-sm);
}

/* --- Hero (brief §4, §5, §6) -----------------------------------------------
   DOM order fixed by brief: eyebrow -> h1 -> primary CTA -> hero-field ->
   hero-sub. Never reveal-gated (house rule); the hero-field is the LCP
   candidate slot and ships with no lazy-loading. */

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

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

.hero h1 {
  font-size: var(--text-hero);
  text-transform: uppercase;
}

.hero__cta-line {
  margin-block-start: var(--space-sm);
  margin-block-end: 0;
}

.hero__sub {
  font-size: var(--text-small);
  line-height: var(--leading-snug);
  color: var(--color-ink-muted);
  margin-block-start: var(--space-2xs);
}

/* --- The cross-section device (brief §5 slot 1, §6 signature move) --------
   A fixed-height, non-reflowing box. `.hero-field__frame` is what actually
   carries the generated illustration's own 21:9 aspect ratio (the widest the
   image tool supports) and the CSS/SVG overlay together, as ONE unit, so the
   overlay's percentage positions always register against the image itself —
   never against the outer box, which is a different, WIDER aspect once the
   content column passes the box's fixed 220px height times 21:9 (roughly
   560px). Below that width the frame fills the box exactly (verified by
   render at 375px: no letterbox, full sky-to-wall composition edge to edge).
   Above it, the frame is capped to its own true aspect ratio and centred —
   what the brief's own §2 language already describes for this box ("a
   contained dark plate inside the field") — rather than a full-bleed crop
   that would cut the sky or the wall away; --color-hero-plate (the box's own
   background) is the letterbox tone either side of the frame, never a
   fabricated fill. Percentages below are positions within the frame, never a
   raw px literal (spec §3). */

.hero-field {
  position: relative;
  margin-block-start: var(--space-sm);
  block-size: var(--hero-field-height);
  overflow: hidden;
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-hero-plate);
}

.hero-field__frame {
  position: relative;
  block-size: 100%;
  aspect-ratio: 21 / 9;
  max-inline-size: 100%;
  margin-inline: auto;
}

.hero-field__img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* The dive-light beam: one-shot sweep, settles, never repeats. */
.hero-field__beam {
  position: absolute;
  inset-inline-start: 8%;
  inset-block-start: 18%;
  inline-size: 45%;
  block-size: 30%;
  transform-origin: 0% 0%;
  background-image: conic-gradient(from -8deg at 0% 0%, var(--color-beam-glow), transparent 26deg);
  animation: hero-beam-sweep var(--duration-beam-sweep) var(--ease-beam-sweep) both;
}

@keyframes hero-beam-sweep {
  from { transform: rotate(38deg); }
  to   { transform: rotate(6deg); }
}

/* The crack: fades in once the beam has settled on it. */
.hero-field__crack {
  position: absolute;
  inset-inline-start: 54%;
  inset-block-start: 63%;
  inline-size: 14%;
  block-size: 1%;
  background-color: var(--color-hero-sky-top);
  opacity: 0;
  animation: hero-crack-reveal var(--duration-crack-reveal) var(--ease-out) var(--delay-crack-reveal) forwards;
}

@keyframes hero-crack-reveal {
  to { opacity: 1; }
}

/* Three bubbles, each on its own independent, non-synchronised loop. */
.hero-field__bubble {
  position: absolute;
  inline-size: var(--space-2xs);
  block-size: var(--space-2xs);
  border-radius: var(--radius-pill);
  background-color: var(--color-bubble);
  inset-inline-start: 18%;
  inset-block-end: 4%;
  animation: hero-bubble-rise var(--duration-bubble-1) ease-in var(--delay-bubble-1) infinite;
}

.hero-field__bubble--2 {
  inset-inline-start: 24%;
  animation-duration: var(--duration-bubble-2);
  animation-delay: var(--delay-bubble-2);
}

.hero-field__bubble--3 {
  inset-inline-start: 14%;
  animation-duration: var(--duration-bubble-3);
  animation-delay: var(--delay-bubble-3);
}

@keyframes hero-bubble-rise {
  0%   { transform: translateY(0); opacity: 0.7; }
  100% { transform: translateY(-620%); opacity: 0; }
}

/* The pressure gauge: a continuous needle sweep, never one-shot. */
.hero-field__gauge {
  position: absolute;
  inset-inline-end: var(--space-2xs);
  inset-block-start: var(--space-2xs);
  inline-size: var(--space-2xl);
  block-size: var(--space-2xl);
}

.hero-field__gauge-needle {
  transform-origin: 50% 50%;
  animation: hero-gauge-sweep var(--duration-gauge-sweep) var(--ease-in-out) infinite;
}

@keyframes hero-gauge-sweep {
  0%   { transform: rotate(-32deg); }
  50%  { transform: rotate(18deg); }
  100% { transform: rotate(-32deg); }
}

/* Reduced motion (brief §6, house-tech-spec §8): the still frame reads as a
   complete, legible instrument panel, not merely "impressive while it moves". */
@media (prefers-reduced-motion: reduce) {
  .hero-field__beam {
    animation: none;
    transform: rotate(6deg);
  }
  .hero-field__crack {
    animation: none;
    opacity: 1;
  }
  .hero-field__bubble,
  .hero-field__bubble--2,
  .hero-field__bubble--3 {
    animation: none;
    opacity: 0;
  }
  .hero-field__gauge-needle {
    animation: none;
    transform: rotate(-14deg);
  }
}

/* --- Inline-SVG fill/stroke tokens (house-tech-spec §3: tokens only, no
   raw colour literal outside tokens.css — SVG presentation attributes are
   not exempt, so every fill/stroke used by an inline illustration is a class
   bound to a var(), never a hex attribute). Used by the hero gauge inset and
   the two object-study illustrations (brief §5 slots 1-3). */
.ill-plate    { fill: var(--color-hero-plate); }
.ill-accent-stroke { stroke: var(--color-accent); }
.ill-marker-stroke { stroke: var(--color-accent); }
.ill-bg-stroke { stroke: var(--color-bg); }

/* --- Section-opening numeral (brief §6): used only where a section has no
   natural list of its own to carry item-level numerals ("Run the Bucket Test
   Yourself") — never doubled up with a list that already carries its own
   numerals ("What Gets Tested", the FAQ), which is the "two counters, one
   costume" pattern design-rules §5 bans. */
.section-open {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-block-end: var(--space-sm);
}

.section-open__num {
  font-family: var(--font-display);
  font-size: var(--text-numeral);
  line-height: 1;
  color: var(--color-accent);
}

/* --- Index rows (brief §1, §6: ref-011's numbered-index typography) -------
   Used for "What Gets Tested"'s three rows and the FAQ's four rows. Each row
   is a bordered instrument plate (ref-008); the numeral is Anton at
   --text-numeral (28px) — large text by WCAG's own definition, which is why
   accent-on-surface is permitted here without the seam brief §2 closes
   (4.48:1, AA-large-only, and 28px clears the floor with margin). */
.index-list {
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.index-row {
  display: flex;
  gap: var(--space-md);
  align-items: baseline;
  padding-block: var(--space-sm);
  padding-inline: var(--space-md);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-surface);
}

/* The FAQ variant (`.index-row` as a `<dl>`'s direct child, holding `<dt>`
   then `<dd>`): stack rather than sit side by side — the flex row lives on
   the `<dt>` itself (below), not on this outer row. */
dl.index-list > .index-row {
  display: block;
}

.index-row__num {
  flex: none;
  inline-size: var(--space-lg);
  font-family: var(--font-display);
  font-size: var(--text-numeral);
  line-height: 1;
  color: var(--color-accent);
}

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

/* The FAQ variant: `.index-row` is a `<dl>`'s direct child `<div>`, which per
   the HTML content model must contain `<dt>`/`<dd>` directly (house-tech-spec
   §8 accessibility floor — a `<dl>` that doesn't validate is an Accessibility
   audit FIX, caught by Lighthouse's definition-list/dlitem audits). The
   numeral lives inside the `<dt>`, prefixing the question; the flex row is
   the `<dt>` itself, and the `<dd>` sits full-width below it, indented to
   align under the question text. */
.index-row dt {
  display: flex;
  gap: var(--space-md);
  align-items: baseline;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
}

.index-row dd {
  margin: 0;
  margin-block-start: var(--space-2xs);
  padding-inline-start: calc(var(--space-lg) + var(--space-md));
  color: var(--color-ink-muted);
}

/* --- Object-study illustrations (brief §5 slots 2-3) — generated per the
   style recipe (gemini-3-pro-image; runs/{id}/images.jsonl), lazy-loaded,
   below the fold. Fixed aspect via width/height attrs on the <img> itself
   (CLS-safe without a wrapping intrinsic-size hack). */
.figure {
  margin: 0;
  margin-block-start: var(--space-lg);
}

.figure img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border: var(--border-hairline) var(--border-style) var(--color-border);
}

/* --- The Warranty (brief §4 row 4) — the verbatim commercial term as a
   bordered instrument plate, never styled as an outcome promise. */
.warranty-plate {
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-inline-start: var(--border-thick) var(--border-style) var(--color-accent);
  background-color: var(--color-surface);
  padding: var(--space-md);
  margin: 0;
  margin-block-start: var(--space-sm);
}

.warranty-plate p {
  margin: 0;
}

.warranty-plate p + p {
  margin-block-start: var(--space-sm);
}

.warranty-plate cite {
  display: block;
  font-style: normal;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  margin-block-start: var(--space-2xs);
}

/* --- Proof (brief §4 row 5) — two verbatim review quotes, attributed
   exactly as displayed (house-tech-spec §8's uppercase/casing rule). */
.review-list {
  display: grid;
  gap: var(--space-md);
  margin: 0;
  margin-block-start: var(--space-md);
  padding: 0;
  list-style: none;
}

.review {
  border: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-surface);
  padding: var(--space-md);
  margin: 0;
}

.review p {
  margin: 0;
}

.review cite {
  display: block;
  font-style: normal;
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink-muted);
  margin-block-start: var(--space-xs);
}

/* --- Where We Work (brief §4 row 6) — a continuous readout, never a card
   grid (design-rules §4 bans a three-across treatment here). */
.service-area__landmark {
  font-weight: var(--font-weight-body-strong);
}
