/* ==========================================================================
   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);
  /* A control's own boundary (WCAG 1.4.11) — --color-border-strong, not the
     decorative --color-border a plain divider takes. */
  border: var(--border-hairline) var(--border-style) var(--color-border-strong);
  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;
}

/* --- Eyebrow — running kicker label. Authored in natural case, uppercased
   with text-transform, never typed in caps (house-tech-spec §8). --------- */

.eyebrow {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-eyebrow);
  line-height: var(--leading-eyebrow);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
}

/* --- Hero (split-hero archetype, brief §3) ---------------------------------
   Below 48em: single-column stack, house order eyebrow -> h1 -> primary CTA
   -> field -> lead -> facts (brief §3.2). At/above 48em: two-column split,
   text column ~42% / field ~58% (brief §3.1), align-items: start. The field
   carries the site's one living-hero moment: two independent ambient loops
   (brief §5), never a third, never a one-shot draw. No text ever sits over
   the field's own image (brief §2.3 — nothing to measure). ---------------- */

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

.hero__eyebrow {
  margin-block-end: var(--space-xs);
}

.hero__title {
  margin: 0;
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  color: var(--color-ink);
  /* Critic round 1 FIX (render/wordwrap): overflow-wrap:anywhere is removed —
     it prevented the overlap but did so by breaking mid-letter ("Someth" /
     "ng's"), which is a legibility defect, not a fix. The real fix is the
     tightened --text-hero slope above (tokens.css), which keeps every word
     inside its column at every width; this pair is a defensive fallback
     only, never expected to fire: `hyphens: auto` breaks at a real syllable
     boundary if a word ever comes within a hair of its column (lang="en" is
     set on <html>, which hyphenation needs), and `overflow-wrap: break-word`
     — never `anywhere` — only breaks a word at all when there is truly no
     other option, rather than breaking words that already fit. */
  hyphens: auto;
  overflow-wrap: break-word;
}

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

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

.hero__field {
  position: relative;
  isolation: isolate;
  overflow: clip;
  /* Brief §3.2's target table: the field row is "padding-top 24px + content
     >= 220px" = 244px total below 48em. --field-height is the content-only
     figure; the extra 24px is this element's own padding-block-start, which
     border-box subtracts from the fixed total height below. */
  height: calc(var(--field-height) + var(--space-md));
  padding-block-start: var(--space-md);
  margin-block-start: var(--space-md);
}

.hero__field picture,
.hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ambient loop 1: the weld-bead glint — a soft highlight sweeping along the
   fillet weld's bead, 5.2s, independent of loop 2 (brief §5). Rest state
   under reduced motion: held at a fixed partial position, never invisible
   and never mid-sweep (house pattern). */
.hero__glint {
  position: absolute;
  inset-block-start: 54%;
  inset-inline-start: -22%;
  z-index: 1;
  width: 26%;
  height: 11%;
  background: linear-gradient(90deg,
    transparent 0%, var(--color-accent-ink) 50%, transparent 100%);
  opacity: var(--glint-rest-opacity);
  transform: var(--glint-rest-transform);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__glint {
    animation: glint-sweep var(--loop-glint) ease-in-out infinite;
  }
}

@keyframes glint-sweep {
  0%   { transform: translateX(0%);   opacity: 0; }
  15%  { opacity: 0.75; }
  50%  { transform: translateX(220%); opacity: 0.75; }
  85%  { opacity: 0.75; }
  100% { transform: translateX(340%); opacity: 0; }
}

/* Ambient loop 2: the job tag — the small hand-lettered tag hanging from the
   vise sways, 4.4s, independent of loop 1 (brief §5). Reduced motion: "the
   job tag sits at a fixed, level position rather than mid-sway" — the base
   rule below IS that level rest state; the animation only runs when motion
   is welcome. */
.hero__job-tag {
  position: absolute;
  inset-block-start: 8%;
  inset-inline-end: 14%;
  z-index: 2;
  width: var(--job-tag-mark-size);
  height: auto;
  color: var(--color-accent);
  transform-origin: 50% 0%;
  transform: var(--job-tag-rest-transform);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__job-tag {
    animation: job-tag-sway var(--loop-job-tag) ease-in-out infinite;
  }
}

@keyframes job-tag-sway {
  0%   { transform: rotate(-6deg); }
  50%  { transform: rotate(6deg); }
  100% { transform: rotate(-6deg); }
}

.hero__lead {
  margin: 0;
  margin-block-start: var(--space-md);
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
  color: var(--color-ink-muted);
}

.hero__facts {
  margin: 0;
  margin-block-start: var(--space-sm);
  font-size: var(--text-small);
  line-height: var(--leading-facts);
  color: var(--color-ink-muted);
}

@media (min-width: 48em) {
  .hero__grid {
    display: grid;
    /* ~42% text column / ~58% field column, per ref-008's oversized-
       wordmark-over-image weighting (brief §3.1). minmax(0, …fr), not bare
       fr: a bare fr track's auto minimum is its content's min-content size,
       and the field's nested image and the text column's nowrap CTA both
       carry a large one — measured forcing 333px/171px against an intended
       42/58 split before this fix. minmax(0, …) removes the auto-minimum
       so the fr ratio is the only thing sizing the tracks. */
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 0.58fr);
    grid-template-rows: repeat(5, auto);
    align-items: start;
    column-gap: var(--space-xl);
  }

  .hero__eyebrow,
  .hero__title,
  .hero__cta-row,
  .hero__lead,
  .hero__facts {
    grid-column: 1;
  }

  .hero__field {
    grid-column: 2;
    grid-row: 1 / -1;
    height: var(--field-height-md);
    padding-block-start: 0;
    margin-block-start: 0;
  }
}

/* --- Services — deliberately thin, no object list (brief §3.1 row 2). ----- */

.services__body {
  margin-block-start: var(--space-sm);
}

/* --- Section divider — imagery slots 2 and 3 (brief §4): a small
   decorative image ahead of the trust-strip and process sections. Not a
   hero, not load-bearing — a modest fixed width, left-aligned. ----------- */

.section-divider {
  margin: 0;
  margin-block-end: var(--space-md);
  width: var(--divider-img-width);
}

.section-divider img {
  width: 100%;
  height: auto;
}

/* --- Trust strip — id="trust" (brief §3.1 row 3). A rule-separated,
   unranked list of exactly three facts, each headed by the job-tag
   silhouette as a small static corner mark — not a card grid, not a
   four-stat counter row (design-rules §4 banned-pattern note). ------------ */

.trust__intro {
  margin-block-start: var(--space-sm);
}

.trust__list {
  margin: 0;
  margin-block-start: var(--space-lg);
  display: grid;
  gap: var(--space-lg);
  list-style: none;
  padding: 0;
}

.trust__row {
  padding-block-start: var(--space-md);
  /* The trust-strip's own top-border rule — brief §2.3: accent on the page's
     own bg ground, non-text decorative use. */
  border-block-start: var(--border-thick) var(--border-style) var(--color-accent);
}

.job-tag-mark {
  display: block;
  width: var(--job-tag-mark-size);
  height: auto;
  color: var(--color-accent);
  margin-block-end: var(--space-xs);
}

.trust__label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-h3);
  color: var(--color-ink);
}

.trust__label + p {
  margin: 0;
  margin-block-start: var(--space-2xs);
  color: var(--color-ink-muted);
}

/* --- Process — three numbered steps (brief §3.1 row 4), immediately before
   the contact block. The one true counter on the page (brief §2.5's
   nested-counters check): numerals in --color-ink-muted, --font-emphasis
   italic — never the section heading's own treatment, so the two counters
   in this page are visually distinct systems by construction (there is
   only one). ---------------------------------------------------------------- */

.process__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-lg);
}

.process__step {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-sm);
  align-items: baseline;
}

.process__num {
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-display);
  font-size: var(--text-h3);
  color: var(--color-ink-muted);
}

.process__step p {
  margin: 0;
  color: var(--color-ink);
}

/* --- Contact — the mailto photo path, outside the <form> entirely. ------- */

.link-quiet {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
  font-weight: var(--font-weight-body-strong);
}

.contact__mailto {
  margin-block-start: var(--space-md);
  color: var(--color-ink-muted);
}
