/* ==========================================================================
   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.              */

/* Sticky beneath the expiry bar (brief §3.2/preview.css's own documented
   override path). --header-height is this site's own flow height, measured
   against the real render (README.md), not assumed. */
.site-header {
  position: sticky;
  inset-block-start: var(--expiry-height);
  z-index: var(--z-header);
  padding-block: var(--space-2xs);
  border-bottom: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-bg);
}

/* Anchor targets need clearance for the sticky expiry+header stack. */
[id] {
  scroll-margin-block-start: calc(var(--expiry-height) + var(--header-height));
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs);
}

/* Two-way split (brand | controls) — keeps the always-on call CTA next to the
   nav toggle rather than a three-way space-between floating it mid-row.

   QA self-check FIX (perf/cls): `flex-basis: 100%` below 48em forces controls
   onto their own row UNCONDITIONALLY (matches `.site-nav`'s own pattern
   below). Without this, brand+call fit one row at ~391-443px until
   `initNav()` clears the toggle's `hidden` attribute, which then doesn't fit
   — a measured post-paint reflow (Playwright layout-shift trace), not a
   font-swap artifact. Same row split whether the toggle is present or not
   removes the shift. Full derivation: README.md "Build notes." */
.site-header__controls {
  display: flex;
  flex-wrap: wrap;
  flex-basis: 100%;
  align-items: center;
  gap: var(--space-2xs);
}

@media (min-width: 48em) {
  .site-header__controls {
    flex-basis: auto;
  }
}

.site-header__brand {
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: var(--font-weight-display);
  text-decoration: none;
  letter-spacing: var(--tracking-tight);
}

/* Always-on header phone CTA (copy.md §3: "every scroll depth per playbook
   §5") — kept OUTSIDE the collapsible <nav> so it survives the collapse below
   48em, on the established house pattern for this same rule. Compact padding
   keeps a single-line header plausible at 375px next to the wordmark. */
.btn.site-header__call {
  padding-inline: var(--space-xs);
  font-size: var(--text-small);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--layout-tap-min);
  padding: var(--space-2xs);
  /* 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);
}

.nav-toggle__icon {
  width: var(--space-md);
  height: var(--space-sm);
  fill: var(--color-ink);
}

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

/* ==========================================================================
   doctor-fix-it-omaha-omaha-ne — brief.md components, archetype `poster-hero`.
   ========================================================================== */

/* --- Running section eyebrow -----------------------------------------------
   ink-muted, never accent — accent is reserved for the H1's own accent word
   is not used here (no split-colour H1 in this brief); kept ink-muted for a
   consistent 4.5:1+ body-text pairing on every section. */
.eyebrow {
  margin: 0;
  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);
}

.eyebrow + h2,
.eyebrow + h1 {
  margin-block-start: var(--space-2xs);
}

/* --- Section-boundary hairline: 1px dotted, spans --layout-measure, top of
   every .section after the hero (.hero is a different class). */
.section > .container {
  position: relative;
}

.section > .container::before {
  content: '';
  display: block;
  max-width: var(--layout-measure);
  margin-inline: auto;
  margin-block-end: var(--space-lg);
  border-top: var(--border-hairline) dotted var(--color-border);
}

/* --- Hero (archetype poster-hero, brief §3.4) ------------------------------
   DOM order per brief §3.4, a stated deviation from the house default:
   eyebrow -> field (sign-device) -> h1 -> primary+secondary CTA -> lead.
   LCP-critical; never carries data-reveal (spec §7). */

.hero {
  position: relative;
  padding-block-start: var(--space-sm);
  /* --section-gap here, per brief §3.1: consumed only by .section's
     padding-block and the hero's own padding-block-end. */
  padding-block-end: var(--section-gap);
  /* Atmosphere (brief §2.2/§6): one radial wash, strongest near the top
     centre where the eyebrow and H1 sit. */
  background-image: radial-gradient(130% 90% at 50% -10%, var(--color-accent-wash), transparent 55%);
  background-color: var(--color-bg);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__eyebrow {
  margin: 0;
  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);
}

/* --- The sign-device: hanging shop shingle (brief §4.1, imagery slot 1) +
   weathervane finial (brief §5, inline SVG, not a generated asset). --- */

.hero__sign {
  position: relative;
  width: var(--sign-width);
  height: var(--sign-height);
  margin-block-start: var(--space-sm);
}

.hero__sign-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
  /* Swings from a fixed pivot at the top of the frame, where the bracket's
     own chain reads as mounted (brief §5: "-3deg to +3deg, 9s ease-in-out"). */
  transform-origin: 50% 0%;
  animation: sign-swing var(--duration-sign-swing) var(--ease-sign-swing) infinite;
}

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

/* Weathervane finial — a small forged wrench-and-arrow ornament perched at
   the sign's own mounting point, oscillating independently of the shingle's
   own sway (brief §5: two coprime periods, never synchronised). */
.hero__vane {
  position: absolute;
  top: 0;
  right: calc(-1 * var(--space-xs));
  width: var(--vane-size);
  height: var(--vane-size);
  transform-origin: 50% 15%;
  animation: vane-turn var(--duration-vane-turn) var(--ease-vane-turn) infinite;
}

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

.hero__vane-post {
  stroke: var(--color-ink-muted);
  stroke-width: 2;
}

.hero__vane-arrow {
  fill: var(--color-accent);
}

.hero__vane-ball {
  fill: var(--color-ink-muted);
}

/* Reduced motion (brief §5, spec §8 — no exceptions): shingle holds its
   settled sign-rest pose (-1deg), vane holds level (0deg). base.css only
   collapses the house --duration-* tokens; this site's own custom durations
   need their own rule. */
@media (prefers-reduced-motion: reduce) {
  .hero__sign-img {
    animation: none;
    transform: rotate(-1deg);
  }

  .hero__vane {
    animation: none;
    transform: rotate(0deg);
  }
}

.hero h1 {
  margin: 0;
  margin-block-start: var(--space-sm);
  font-size: var(--text-h1);
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  margin: 0;
  margin-block-start: var(--space-sm);
}

.hero__cta-secondary {
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

.hero__lead {
  margin: 0;
  margin-block-start: var(--space-sm);
  max-width: var(--layout-measure);
  font-size: var(--text-lead);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

/* --- Services / What We Fix (brief §3.2 row 2, load-bearing) ---------------
   Bordered rows echo ref-010's letterpress product-card craft (brief §1). */

.services__band {
  margin-block: var(--space-md);
  max-width: var(--layout-measure);
  margin-inline: auto;
}

.services__band img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.job-list {
  display: grid;
  gap: var(--space-sm);
  margin-block-start: var(--space-md);
  padding: 0;
}

.job-list__row {
  padding: var(--space-sm);
  border: var(--border-hairline) var(--border-style) var(--color-border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
}

.job-list__name {
  display: block;
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
}

.job-list__note {
  display: block;
  margin-block-start: var(--space-3xs);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}

.services__exclusion {
  margin-block-start: var(--space-md);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  font-style: italic;
}

/* --- Trust strip / The Same Guy, Every Time (brief §3.2 row 3, substitutes
   the market's gallery slot, brief §3.3) ------------------------------------ */

.trust__proof {
  margin-block-start: var(--space-md);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
}

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

.trust__accent img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.review-list {
  display: grid;
  margin-block-start: var(--space-md);
  padding: 0;
}

.review-list__row {
  padding-block: var(--space-md);
  border-top: var(--border-hairline) dotted var(--color-border);
}

.review-list__row:first-child {
  border-top: 0;
  padding-block-start: 0;
}

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

.review-list__row blockquote p {
  margin: 0;
}

.review-list__attr {
  margin: 0;
  margin-block-start: var(--space-2xs);
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink-muted);
}

/* --- Free estimate (brief §3.2 row 4, load-bearing, the form section) ----- */

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

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

.estimate__accent img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* --- Hours & contact (brief §3.2 row 6, flavor) ---------------------------- */

.hours__block {
  margin-block-start: var(--space-md);
}

.hours__block p {
  margin: 0;
  margin-block-start: var(--space-2xs);
}

.hours__block p:first-child {
  margin-block-start: 0;
}

/* --- FAQ (brief §3.2 row 7, flavor, <=4 items) ----------------------------- */

.faq-list {
  display: grid;
  margin-block-start: var(--space-md);
  padding: 0;
}

.faq-list__row {
  padding-block: var(--space-md);
  border-top: var(--border-hairline) dotted var(--color-border);
}

.faq-list__row:first-child {
  border-top: 0;
  padding-block-start: 0;
}

.faq-list__row h3 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-body);
  text-transform: none;
}

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