/* ==========================================================================
   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;
  line-height: var(--leading-body);
}

.site-footer__email {
  display: inline-block;
}


/* ============================================================================
   ALVAREZ PAINTING — brief.md components, archetype `poster-hero`. Tokens
   only, no raw hex/px/font literals (house-tech-spec §3). The section rule
   below is the ONE repeated ornament (brief §2.4/§5): a 3px claret line
   heading every section after the hero, the living hero's motion "stilled…
   as structure" (brief §5 point 3).
   ============================================================================ */

.section--services,
.section--index,
.section--contact {
  border-block-start: var(--border-thick) var(--border-style) var(--color-accent);
}


/* --- Hero — poster-hero archetype (brief §3.2, §5). Single column, type
   carries the first screen. House order: eyebrow -> h1 -> primary CTA ->
   field -> lead -> facts (brief §3.2 rule 1). The field is the living-hero
   image plus its CSS atmosphere; the h1 is the actual LCP element on this
   archetype (brief §4), so the field carries no [data-reveal] and loads
   eager/fetchpriority high purely because it dominates the first screen. -- */

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

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

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

.hero__headline {
  margin: 0;
  max-inline-size: var(--hero-title-measure);
  font-size: var(--text-hero);
  font-weight: var(--font-weight-display);
}

.hero__cta-row {
  margin: 0;
}

.hero__field {
  position: relative;
  height: var(--hero-field-height);
  overflow: hidden;
  border-radius: var(--radius-none);
}

.hero__field-picture,
.hero__field-img {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__field-img {
  object-fit: cover;
  object-position: top center;
}

/* The one-shot "first coat" overlay (brief §5 point 1) — an uneven, mottled
   claret wash that plays ONCE on load and fades to nothing, reading as a
   single pass evening the coat down to the still photograph underneath.
   Composited from the brief's own gradient roles (--color-accent-hi/-lo),
   never a new hue. Rest state (no animation / reduced-motion): fully
   resolved, i.e. invisible — matching brief §5's "the first-coat overlay is
   already at opacity: 0". */
.hero__field-pass {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 45% at 20% 30%, var(--color-accent-lo) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 75% 65%, var(--color-accent-hi) 0%, transparent 70%),
    linear-gradient(115deg, var(--color-accent-lo) 0%, var(--color-accent) 50%, var(--color-accent-hi) 100%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  animation: hero-pass var(--duration-pass) var(--ease-out) 1 forwards;
}

@keyframes hero-pass {
  0%   { opacity: 0.9; transform: translateX(-4%) scale(1.02); }
  70%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateX(3%) scale(1); }
}

/* Ambient satellite 1 — a wet-sheen drift, continuous, independent period
   (brief §5 point 2). transform-only (translateX), never a layout property,
   so the loop cannot read as a Cumulative Layout Shift even though nothing
   visible reflows (the element is absolutely positioned and clipped by the
   field's own overflow:hidden). Rest state: held at mid-position (brief §5's
   reduced-motion statement). */
.hero__field-sheen {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--hero-sheen-width);
  background: linear-gradient(115deg, transparent 0%, var(--color-accent-ink) 45%, transparent 65%);
  opacity: 0.16;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: hero-sheen var(--duration-sheen) var(--ease-in-out) infinite;
}

@keyframes hero-sheen {
  0%   { transform: translateX(-40%); }
  50%  { transform: translateX(120%); }
  100% { transform: translateX(-40%); }
}

/* Ambient satellite 2 — a roller-nap stipple, opacity-only pulse, continuous,
   a different independent period from the sheen so the two never lock into
   a visible combined cycle (brief §5 point 2 / §0). Rest state: static at
   0.28 opacity (brief §5's own stated number). */
.hero__field-nap {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--color-accent-lo) var(--hero-nap-dot), transparent var(--hero-nap-dot-edge));
  background-size: var(--hero-nap-cell) var(--hero-nap-cell);
  opacity: 0.28;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: hero-nap var(--duration-nap) var(--ease-in-out) infinite;
}

@keyframes hero-nap {
  0%, 100% { opacity: 0.18; }
  50%      { opacity: 0.38; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__field-pass {
    animation: none;
    opacity: 0;
  }

  .hero__field-sheen {
    animation: none;
    transform: translateX(40%);
  }

  .hero__field-nap {
    animation: none;
    opacity: 0.28;
  }
}

.hero__lead {
  margin: 0;
  max-width: var(--layout-measure);
  font-size: var(--text-lead);
  line-height: var(--leading-body);
}

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

@media (min-width: 64em) {
  .hero__field {
    height: var(--hero-field-height-lg);
  }
}


/* --- Services (brief §3.1 row 3, §3.3) — plain, hairline-divided rows, no
   counter of any kind (the Index of 85 is the page's only numbered list).
   The background macro (imagery slot 2) sits behind the content at low
   opacity; text is always measured against the flat --color-bg/-surface
   tokens underneath it, never against the image directly (brief §4). ------ */

.services__inner {
  position: relative;
}

.services__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  opacity: 0.1;
  pointer-events: none;
}

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

.services__content {
  position: relative;
  z-index: 1;
}

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

.services__row {
  padding-block: var(--space-sm);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
  max-width: var(--layout-measure);
}

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


/* --- The Index of 85 (brief §3.1 row 8, §3.4) — the site's flagship
   section and its only counted sequence (design-rules §5). The numeral
   borrows the hero's own 3px claret rule as its mark, never a card or icon
   (registry row's signature description). --------------------------------- */

.index__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--space-md);
  row-gap: var(--space-sm);
}

.index__tally {
  grid-row: 1 / 3;
  margin: 0;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--text-tally);
  font-weight: var(--font-weight-display-num);
  line-height: 1;
}

.index__head-text {
  grid-column: 2;
}

.index__head-text h2 {
  margin: 0;
}

.index__caption {
  margin: var(--space-3xs) 0 0;
  color: var(--color-ink-muted);
  font-size: var(--text-small);
}

.index__swatch {
  grid-column: 1 / 3;
  display: block;
  inline-size: 30%;
  max-inline-size: var(--space-3xl);
  margin-block-start: var(--space-sm);
}

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

.index__rows {
  margin-block-start: var(--space-2xl);
  display: grid;
  gap: var(--space-xl);
}

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

.index__num {
  margin: 0 0 var(--space-3xs);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-size: var(--text-index);
  font-weight: var(--font-weight-display-num);
  line-height: 1;
}

.index__num::after {
  content: '';
  display: block;
  margin-block-start: var(--space-2xs);
  inline-size: var(--index-num-rule-length);
  block-size: var(--border-thick);
  background-color: var(--color-accent);
}

.index__row-heading {
  margin: var(--space-sm) 0 var(--space-xs);
  font-size: var(--text-h2);
}

.index__quote {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-lead);
  line-height: var(--leading-body);
}

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


/* --- Quote CTA repeat (brief §3.1 row 5) — second conversion point. Same
   low-opacity background-image treatment as Services; the CTA and form sit
   on the flat --color-accent/--color-bg tokens, never on the image (brief
   §4). ---------------------------------------------------------------------- */

.contact__inner {
  position: relative;
}

.contact__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  opacity: 0.08;
  pointer-events: none;
}

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

.contact__content {
  position: relative;
  z-index: 1;
}

.contact__content form {
  margin-block-start: var(--space-lg);
}
