/* site.css — per-site layout & components, built FROM tokens (brief
   §3, §4). HARD RULE (house-tech-spec §3): no raw hex/px/rem/font literals
   — tokens only, except the house breakpoints and an explicit
   `@allow-literal: reason` comment. Components below (hero, services,
   process, reviews, FAQ, CTA band) come from the approved brief's
   band-rhythm archetype, not from memory (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);
}

/* base.css's skip-link uses --color-accent/--color-accent-ink, which is
   correct for the house default but fails here: --color-accent is this
   brief's bright, LARGE-TEXT-ONLY tidewater-clay (brief §2.2 Correction),
   and 16px/700 body text does not clear the large-text bold floor. Reuses
   the brief's already-validated 6.60:1 white-on-accent-deep pair instead. */
.skip-link {
  background-color: var(--color-accent-deep);
  color: var(--color-accent-ink);
}

/* --- 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);
  column-gap: var(--space-xs);
}

.site-header__brand {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--text-body);
  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;
  flex-basis: 100%;
  order: 1;
}

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

/* The header call control (W65): (0,2,0) beats .btn (0,1,0) wherever declared;
   this base rule stays BEFORE the 48em block, which restores padding at equal
   specificity by source order. */
.site-header .site-header__call {
  flex: none;
  padding: 0;
  min-inline-size: var(--layout-tap-min);
}

@media (min-width: 48em) {
  .site-header__inner {
    column-gap: var(--space-sm);
  }

  .site-nav {
    display: block;
    flex-basis: auto;
    order: 0;
    margin-inline-start: auto;
  }

  .site-header__brand {
    flex: none;
    font-size: var(--text-h3);
  }

  .site-header .site-header__call {
    padding: var(--space-xs) var(--space-md);
  }

  .site-header__call .visually-hidden:not(:focus):not(:active) {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  [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 {
  /* --color-accent-deep, never the bright --color-accent: the brief's own
     CTA-button row (§2.2) is white on accent-deep (6.60:1) — the bright
     accent is large-text/decorative only and fails AA at button-text size. */
  background-color: var(--color-accent-deep);
  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);
}

/* The CTA band (brief §4.6) is a flat --color-accent-deep fill, so
   .btn--primary there would be invisible. Inverts the brief-validated pair
   instead: --color-bg fill, --color-accent-deep text (6.04:1, brief §2.2) —
   same relationship as the preview bar's own .btn--buy. Focus ring is
   INSET so it never lands on the unvalidated band colour. */
.btn--on-band {
  background-color: var(--color-bg);
  color: var(--color-accent-deep);
}

.btn--on-band:focus-visible {
  outline-color: var(--color-accent-deep);
  outline-offset: calc(var(--space-3xs) * -1);
}

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

.site-footer__license {
  margin-block-start: var(--space-sm);
  color: var(--color-ink-muted);
}

.site-footer p {
  margin-block-start: var(--space-sm);
}

/* HERO — band-rhythm (brief §4.1). Atmosphere: two radial gradients over
   --color-bg (brief §2.2's worst-case-ground). Living-hero field: generated
   raster + inline SVG overlay (hook sway, glint pulse, two steam loops,
   brief §6). DOM order per §3.1 rule 1. */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 140% 90% at 70% 15%, var(--color-hero-halo-a), transparent 60%),
    radial-gradient(ellipse 120% 80% at 20% 100%, var(--color-hero-halo-b), transparent 65%),
    var(--color-bg);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  padding-block-start: var(--space-md);
  padding-block-end: var(--section-gap);
}

.hero__copy {
  display: flex;
  flex-direction: column;
}

.hero__rule {
  display: block;
  inline-size: var(--space-lg);
  block-size: var(--border-thick);
  background-color: var(--color-accent-deep);
}

.hero__eyebrow {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-eyebrow);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  /* Correction 1 (brief §2.2): --color-ink, not --color-accent-deep, against
     the hero's worst-case stacked atmosphere (10.00:1 vs 4.33:1). */
  color: var(--color-ink);
  margin: var(--space-sm) 0 var(--space-2xs);
}

.hero__heading {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--font-weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  margin: 0;
  text-wrap: balance;
}

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

.hero__field {
  position: relative;
  block-size: var(--layout-hero-field-height);
  margin-block-start: var(--space-md);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.hero__field-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.hero__field-media picture,
.hero__field-media img {
  display: block;
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
}

/* Hook: pivots at its own attachment point, so reduced motion shows it
   exactly as drawn — the rest angle (brief §6). */
.hero__hook path {
  fill: none;
  stroke: var(--color-ink);
  stroke-width: var(--border-thick);
  stroke-linecap: round;
}

.hero__hook {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: hook-sway var(--loop-hook-sway) var(--ease-in-out) infinite;
}

@keyframes hook-sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

/* Glint: base opacity IS the brief's reduced-motion rest state (0.6). */
.hero__glint {
  fill: var(--color-bg);
  opacity: 0.6;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: glint-pulse var(--loop-lid-glint) var(--ease-in-out) infinite;
}

@keyframes glint-pulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.85; }
}

/* Two independent steam loops (brief §6: 4.2s/5.6s, 1.1s offset). Removed
   entirely under reduced motion, not frozen mid-fade. */
.hero__steam {
  fill: var(--color-bg);
  opacity: 0.5;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.hero__steam--1 {
  animation: steam-rise var(--loop-steam-1) var(--ease-out) infinite;
}

.hero__steam--2 {
  animation: steam-rise var(--loop-steam-2) var(--ease-out) infinite;
  animation-delay: var(--loop-steam-2-delay);
}

@keyframes steam-rise {
  0%   { transform: translateY(0) scale(1); opacity: 0.5; }
  100% { transform: translateY(calc(var(--loop-steam-rise) * -1)) scale(1.35); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__hook,
  .hero__glint {
    animation: none;
  }

  .hero__steam {
    display: none;
  }
}

.hero__lead {
  font-family: var(--font-body);
  font-size: var(--text-lead);
  color: var(--color-ink-muted);
  margin: var(--space-sm) 0 0;
  max-width: var(--measure-lead);
}

.hero__facts {
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  margin: var(--space-2xs) 0 0;
}

@media (min-width: 64em) {
  .hero__inner {
    display: grid;
    grid-template-columns: var(--layout-hero-copy-width) minmax(0, 1fr);
    grid-template-areas: "copy field" "lead field" "facts field";
    align-items: center;
    column-gap: var(--layout-hero-gap);
    row-gap: 0;
    padding-block: var(--layout-hero-pad-y);
    min-block-size: var(--layout-hero-min-height);
  }

  .hero__copy {
    grid-area: copy;
  }

  .hero__lead {
    grid-area: lead;
    margin-block-start: var(--space-md);
  }

  .hero__facts {
    grid-area: facts;
    margin-block-start: var(--space-lg);
  }

  .hero__field {
    grid-area: field;
    justify-self: end;
    inline-size: 100%;
    max-inline-size: var(--layout-hero-field-max);
    block-size: auto;
    aspect-ratio: 760 / 480;
    margin-block-start: 0;
  }
}

/* SERVICES — "What Rillco Does" (brief §4.2). 240px rail beside the card
   list, stacked at 375. Numerals: Correction 2, --color-accent-deep only. */

.services-layout {
  display: grid;
  gap: var(--space-lg);
}

.trust-ticket {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  align-self: start;
}

.trust-ticket__row {
  display: grid;
  gap: var(--space-3xs);
  margin: 0;
}

.trust-ticket__label {
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink-muted);
}

.trust-ticket__value {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-display);
  color: var(--color-ink);
}

.section-head {
  margin-block-end: var(--space-lg);
}

.section-head--center {
  text-align: center;
}

.service-cards {
  display: grid;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-card {
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
}

.service-card__num {
  display: block;
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-emphasis);
  font-size: var(--text-lead);
  color: var(--color-accent-deep);
  margin-block-end: var(--space-2xs);
}

.service-card h3 {
  font-size: var(--text-h3);
  margin: 0 0 var(--space-2xs);
}

.service-card p {
  margin: 0;
  color: var(--color-ink-muted);
  max-width: var(--measure-card);
}

.services-note {
  font-family: var(--font-body);
  font-style: italic;
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  margin: var(--space-lg) 0 0;
}

@media (min-width: 64em) {
  .services-layout {
    grid-template-columns: var(--layout-services-rail) minmax(0, 1fr);
    align-items: start;
  }

  .service-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap-cards);
  }
}

/* HOW IT WORKS (brief §4.3) — 420px image column beside 4 steps at 64em,
   steps first below it. STEP markers: uppercase Karla 700, tracked, never
   italic Fraunces — a different costume from the service-card numerals. */

.process-layout {
  display: grid;
  gap: var(--space-xl);
}

.process-figure {
  margin: 0;
}

.process-figure img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-md);
}

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

.process-step__marker {
  display: block;
  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-accent-deep);
  margin-block-end: var(--space-2xs);
}

/* brief §2.3 names the italic face for "process-step emphasis". */
.process-step h3 {
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-emphasis);
  font-size: var(--text-h3);
  margin: 0 0 var(--space-2xs);
}

.process-step p {
  margin: 0;
  color: var(--color-ink-muted);
  max-width: var(--measure-step);
}

@media (min-width: 64em) {
  .process-layout {
    grid-template-columns: var(--layout-process-image) minmax(0, 1fr);
    align-items: start;
  }

  .process-figure {
    order: 0;
  }

  .process-main {
    order: 1;
  }
}

/* REVIEWS (brief §4.4) — centered 960px, two columns with a dashed divider
   carrying the continuity label; stacked at 375. */

#reviews .container {
  max-width: calc(var(--layout-reviews-width) + 2 * var(--layout-gutter));
}

.reviews-grid {
  display: grid;
  gap: var(--space-lg);
  align-items: start;
}

.review-card blockquote {
  margin: 0 0 var(--space-sm);
}

.review-card p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-lead);
  line-height: var(--leading-body);
  color: var(--color-ink);
  max-width: var(--measure-review);
}

.review-card cite {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

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

.reviews-divider__line {
  flex: 1 1 auto;
  block-size: var(--border-hairline);
  border-block-start: var(--border-hairline) dashed var(--color-border-strong);
}

.reviews-divider__label {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-small);
  text-align: center;
  color: var(--color-ink-muted);
}

@media (min-width: 64em) {
  .reviews-grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: var(--gap-reviews);
  }

  .reviews-divider {
    flex-direction: column;
    align-self: stretch;
  }

  .reviews-divider__line {
    border-block-start: none;
    border-inline-start: var(--border-hairline) dashed var(--color-border-strong);
    inline-size: var(--border-hairline);
  }
}

/* FAQ (brief §4.5). Native details/summary, 2+2 grid from 64em. */

.faq {
  display: grid;
  gap: 0;
  margin: 0;
  max-width: var(--layout-measure);
}

.faq__item {
  padding-block: var(--space-sm);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
}

.faq__item:first-child {
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.faq__item summary {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-display);
  color: var(--color-ink);
  cursor: pointer;
}

.faq__item p {
  margin: var(--space-sm) 0 0;
  color: var(--color-ink-muted);
  max-width: var(--measure-faq);
}

@media (min-width: 64em) {
  .faq {
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-xl);
    row-gap: 0;
  }
}

/* CTA BAND (brief §4.6) — centered 640px, flat accent-deep fill, white
   text. Detail-crop image beside the copy at 64em, below it at 375. */

.cta-band {
  background-color: var(--color-accent-deep);
  color: var(--color-accent-ink);
}

.cta-band :focus-visible {
  outline-color: var(--color-focus-on-band);
}

.cta-band__inner {
  max-width: calc(var(--layout-cta-width) + 2 * var(--layout-gutter));
}

.cta-band__copy h2 {
  color: var(--color-accent-ink);
}

.cta-band__copy p {
  color: var(--color-accent-ink);
}

.cta-band__copy .field__label,
.cta-band__copy .field__hint,
.cta-band__copy .form__status {
  color: var(--color-accent-ink);
}

.cta-band__copy .field__control {
  color: var(--color-ink);
}

.cta-band__copy .checkbox-list {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
}

.checkbox-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: var(--layout-tap-min);
  font-size: var(--text-small);
}

.checkbox-list__item input {
  width: var(--layout-tap-min);
  height: var(--layout-tap-min);
  accent-color: var(--color-accent-deep);
}

.field-group {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  border: 0;
}

.cta-band__figure {
  margin: var(--space-lg) 0 0;
}

.cta-band__figure img {
  display: block;
  inline-size: 100%;
  max-inline-size: var(--layout-process-image);
  block-size: auto;
  margin-inline: auto;
  border-radius: var(--radius-md);
}

@media (min-width: 64em) {
  /* brief §4.6: "a 1fr auto split WITHIN the 640px column's containing
     band" — the split stays inside the centered column, it does not widen
     to the full 1312px container. */
  .cta-band__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-lg);
  }

  .cta-band__figure {
    margin-block-start: 0;
  }

  .cta-band__figure img {
    max-inline-size: var(--layout-services-rail);
  }
}
