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

/* Grid, not flex (site override): the long wordmark wraps two lines on
   its own at mobile widths; flex-wrap dropped the nav-toggle to a whole
   new row once JS revealed it (+57.6px post-paint, same CLS class as the
   QA r3 FIX below). Grid's `auto` column never wraps a sibling row. */
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  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;
  /* Full-width own row at mobile; shares the toggle's (empty) column
     beside brand at >=48em. */
  grid-column: 1 / -1;
}

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

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

  [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;
}

/* ==========================================================================
   BRIEF COMPONENTS — brief.md (C3 APPROVED 2026-09-14), family retro-local,
   archetype split-hero, signature "the sign holds true". Section order
   (brief §4): hero+lead-row -> services -> season -> trust -> reviews ->
   process -> service area -> FAQ -> contact. Gallery RESERVED, not built.
   ========================================================================== */

/* Hero (brief §4.1, §6). Non-sticky header. `.hero`'s own padding-block-end
   is `--section-gap` (§7.1); the 667px floor and padding live on
   `.hero__inner` so the two don't fight (README "Builder execution
   fills"). `.lead-row` nests inside, flush, as the C2 tile built it. */

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

.hero__inner {
  display: flex;
  flex-direction: column;
  padding: var(--hero-pad-top) var(--space-md) 0;
  min-height: var(--hero-min-height);
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  line-height: var(--leading-eyebrow);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-block-end: var(--hero-gap-eyebrow);
}

.hero__inner h1 {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  color: var(--color-ink);
  margin-block-end: var(--hero-gap-h1);
}

.hero__cta {
  align-self: flex-start;
  margin-block-end: var(--hero-gap-cta);
}

/* Living-hero field: generated backdrop (brief §5) behind the CSS/SVG
   sign, post and vane (brief §6) — the image IS the §6.1 anchor. */
.hero__field {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.hero__field picture,
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
}

/* Wood post prop, Builder execution fill, see README. */
.post {
  position: absolute;
  left: 50%;
  bottom: 38%;
  width: var(--post-width);
  height: var(--post-height);
  margin-inline-start: calc(var(--post-width) / -2);
  background-color: var(--color-post);
}

/* The yard sign (brief §6). Base = upright, `transform: none` (= rotate(0)),
   zero motion CSS outside the media query below; defined at its finished
   value and animated away from and back to it (brief's anti-zero-state rule). */
.sign {
  position: absolute;
  left: 50%;
  bottom: calc(38% + var(--post-height));
  width: var(--sign-width);
  height: var(--sign-height);
  margin-inline-start: calc(var(--sign-width) / -2);
  background-color: var(--color-bg);
  border: var(--border-thick) var(--border-style) var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-object);
  transform-origin: top center;
}

/* Weather-vane — MANDATORY inline SVG (brief §6/C2: never `content:"..."`,
   never a text glyph). Base = natural static orientation; keyframes rotate it. */
.vane {
  position: absolute;
  left: calc(50% + (var(--sign-width) / 2) - (var(--vane-size) / 2));
  bottom: calc(38% + var(--post-height) + var(--sign-height) - (var(--vane-size) / 2));
  width: var(--vane-size);
  height: var(--vane-size);
}

.vane svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .sign {
    animation: sign-swing var(--duration-swing) var(--ease-swing) infinite;
  }

  .vane svg {
    animation: vane-turn var(--duration-turn) var(--ease-turn) infinite;
  }
}

@keyframes sign-swing {
  0%, 100% { transform: rotate(-3deg); }
  50%      { transform: rotate(3deg); }
}

@keyframes vane-turn {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}

/* Split-hero: two-up at >=40em, the brief's collapse point. The 667px
   floor no longer applies; the field uses the asset's own aspect ratio. */
@media (min-width: 40em) {
  .hero__inner {
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-xl);
    min-height: 0;
  }

  /* --hero-copy-min floors the column so it stays wide enough for the H1
     (Critic round-1 measured wrap ~640-870px); wider viewports keep the
     40%/60% field-dominant split unchanged (tokens.css). */
  .hero__copy {
    flex: 0 0 max(40%, var(--hero-copy-min));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .hero__field {
    flex: 1;
    aspect-ratio: 1376 / 768;
  }
}

/* --- Lead row (brief §4 row 2, hero-quote pattern). Flush against the
   field, zero gap: reads as the close of the hero moment. */
.lead-row {
  background-color: var(--color-surface);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.lead-row__lead {
  font-size: var(--text-body);
  color: var(--color-ink);
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-sm);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.facts li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.facts li + li::before {
  content: "";
  display: inline-block;
  width: var(--border-hairline);
  height: var(--space-sm);
  background-color: var(--color-ink-muted);
}

/* The recurring sign mark (brief §6): still silhouette atop every
   subsequent section, sized as a fraction of the hero sign's own tokens. */
.section-mark {
  width: calc(var(--sign-width) / 4);
  height: calc(var(--sign-height) / 4);
  margin-inline: auto;
  margin-block-end: var(--space-sm);
  background-color: var(--color-bg);
  border: var(--border-hairline) var(--border-style) var(--color-ink);
  border-radius: var(--radius-sm);
  position: relative;
}

.section-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: var(--border-hairline);
  height: calc(var(--post-height) / 6);
  background-color: var(--color-ink);
  transform: translateX(-50%);
}

/* Section heading register, shared. */

.section__head {
  text-align: center;
  margin-block-end: var(--space-lg);
}

.section__head h2 {
  font-size: var(--text-h2);
  color: var(--color-ink);
}

.section__intro {
  max-width: var(--layout-measure);
  margin-inline: auto;
  margin-block-start: var(--space-2xs);
  color: var(--color-ink-muted);
  text-align: center;
}

/* --- Services — painted boards (brief §4 row 3, ref-008's device). --- */

.services__frame {
  position: relative;
}

.services__texture {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
}

.services__texture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.services__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--grid-gap-services);
  align-items: start;
}

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

.board-list {
  display: grid;
  gap: var(--space-sm);
}

.board {
  background-color: var(--color-bg);
  border: var(--border-board) var(--border-style) var(--color-ink);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xs) var(--space-sm);
}

.board-name {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: var(--leading-snug);
  color: var(--color-ink);
}

.board-tag {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-small);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-muted);
  align-self: center;
}

.board-desc {
  flex-basis: 100%;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

/* Porch-ceiling swatch — decorative, no text (C2 tile's device). */
.porch-swatch {
  border-radius: var(--radius-lg);
  min-height: var(--space-2xl);
  background-image: repeating-linear-gradient(
    180deg,
    var(--color-accent-pale) 0,
    var(--color-accent-pale) var(--space-lg),
    var(--color-accent) var(--space-lg),
    var(--color-accent) calc(var(--space-lg) + var(--border-hairline))
  );
}

/* Season strip (brief §4 row 4, copy.md §4). */

.season-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 40em) {
  .season-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.season-card {
  background-color: var(--color-bg);
  border: var(--border-board) var(--border-style) var(--color-ink);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
}

.season-card__window {
  display: block;
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-block-end: var(--space-3xs);
}

.season-card h3 {
  font-size: var(--text-h3);
  color: var(--color-ink);
  margin-block-end: var(--space-2xs);
}

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

/* Trust-strip (brief §4 row 5) — plain statements, no counter. */

.trust-list {
  display: grid;
  gap: var(--space-md);
  max-width: var(--layout-measure);
  margin-inline: auto;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-body);
  color: var(--color-ink);
}

.trust-list li::before {
  content: "";
  flex: 0 0 auto;
  width: var(--space-md);
  height: var(--border-hairline);
  background-color: var(--color-accent);
}

/* Full-width texture divider (imagery slot 3, brief §5). */
.divider-band {
  width: 100%;
  aspect-ratio: 21 / 4;
  overflow: hidden;
}

.divider-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Reviews (brief §4 row 6, ref-010's card craft). */

.review-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 48em) {
  .review-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.review-card {
  background-color: var(--color-surface);
  border: var(--border-hairline) var(--border-style) var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.review-card blockquote {
  margin: 0;
  color: var(--color-ink);
}

.review-card cite {
  display: block;
  margin-block-start: var(--space-sm);
  font-family: var(--font-emphasis);
  font-style: italic;
  font-size: var(--text-small);
  color: var(--color-accent);
}

.review-card__reply {
  margin-block-start: var(--space-sm);
  padding-inline-start: var(--space-sm);
  border-inline-start: var(--border-board) var(--border-style) var(--color-accent-pale);
}

.review-card__reply p {
  margin: 0;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

.review-card__reply cite {
  color: var(--color-ink-muted);
}

/* Process (brief §4 row 7) — the site's only counter, no clash (§4). */

.process-list {
  display: grid;
  gap: var(--space-md);
  counter-reset: process;
}

.process-step {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  counter-increment: process;
}

.process-step::before {
  content: counter(process);
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-h2);
  color: var(--color-accent);
  line-height: 1;
}

.process-step h3 {
  font-size: var(--text-h3);
  color: var(--color-ink);
  margin-block-end: var(--space-3xs);
}

.process-step p {
  color: var(--color-ink-muted);
}

.process__accent {
  width: 50%;
  margin-inline: auto;
  margin-block-start: var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

/* Service area. */

.service-area p {
  max-width: var(--layout-measure);
  margin-inline: auto;
  text-align: center;
  font-size: var(--text-body);
  color: var(--color-ink);
}

/* FAQ — native <details>, no JS required. */

.faq-list {
  display: grid;
  gap: var(--space-sm);
  max-width: var(--layout-measure);
  margin-inline: auto;
}

.faq-item {
  border: var(--border-hairline) var(--border-style) var(--color-line);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
}

.faq-item summary {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
  cursor: pointer;
}

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

/* Contact / final CTA. */

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