/* ==========================================================================
   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);
  min-height: var(--header-height);
  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-brand);
  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;
}

/* ==========================================================================
   SunTan Pools — badge-board archetype (brief §3-§5).

   Section headings across the whole page share one size — base.css sets
   family/weight/line-height/letter-spacing for h1-h4 but never a size, so
   every h2/h3 on the page gets its font-size here, once, rather than a
   scattered per-component override (layout-audit's own type-token check).
   ========================================================================== */

main h2 {
  font-size: var(--text-h2);
  margin-block-end: var(--space-sm);
}

main h3 {
  font-size: var(--text-h3);
}

.section-eyebrow {
  font-size: var(--text-small);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-muted);
  margin-block-end: var(--space-sm);
}

/* --- Hero -------------------------------------------------------------
   Archetype badge-board (brief §3): the hero IS the signature moment. DOM
   order is the brief's own stated deviation from house default — eyebrow,
   then the field (the mounted plaque), then h1, then the primary CTA, then
   the lead — computed against itself in brief §3.3's own arithmetic table. */

.hero {
  padding-block-start: var(--space-lg);
  padding-block-end: var(--section-gap);
  background: radial-gradient(120% 100% at 50% -10%, var(--color-atmosphere) 0%, var(--color-bg) 60%);
}

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

.hero-eyebrow {
  font-size: var(--text-small);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink-muted);
  margin-block-end: var(--space-sm);
}

/* The field: a fixed-height box (brief §3.3's own arithmetic depends on this
   exact height never changing — "the field keeps its size; position is what
   yields"). Everything inside is centered within it. */
.sign-post {
  position: relative;
  width: var(--sign-width);
  height: var(--sign-post-height);
  margin-inline: auto;
}

.sign {
  position: relative;
  height: 100%;
  margin-inline: auto;
  width: max-content;
}

/* The board is a fixed, two-nail-mounted plaque — it never swings. The nail
   heads are painted into the generated artwork itself (hero-plaque-board),
   not a separate CSS element. */
.sign__board {
  display: block;
  height: 100%;
  width: auto;
}

/* The vector badge: its own opaque ring + fill, so it reads correctly
   regardless of the photo's exact pixel alignment beneath it. This is the
   one element on the page besides the reveal system that carries real
   motion — the rays reveal once on load, the wave drifts on its own loop. */
.badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--badge-size);
  height: var(--badge-size);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--border-thick) var(--border-style) var(--color-accent);
  background-color: var(--color-bg);
}

.badge svg {
  width: 72%;
  height: 72%;
}

.badge__rays {
  stroke: var(--color-accent);
}

/* The signature move: eight rays reveal in a one-shot staggered sequence on
   load, never repeating — the artwork animates, the board does not (brief
   §5, C2 judgment-gap fix; no swing, no rope, no traveling glint anywhere). */
.ray-line {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: ray-in var(--duration-ray) var(--ease-out) forwards;
}

.ray-line:nth-child(1) { animation-delay: .10s; }
.ray-line:nth-child(2) { animation-delay: .18s; }
.ray-line:nth-child(3) { animation-delay: .26s; }
.ray-line:nth-child(4) { animation-delay: .34s; }
.ray-line:nth-child(5) { animation-delay: .42s; }
.ray-line:nth-child(6) { animation-delay: .50s; }
.ray-line:nth-child(7) { animation-delay: .58s; }
.ray-line:nth-child(8) { animation-delay: .66s; }

@keyframes ray-in {
  0% { opacity: 0; transform: scale(.25); }
  100% { opacity: 1; transform: scale(1); }
}

/* The one vessel anchor in the frame (brief §4.3): a wave/coping line under
   the rays, the sole blue on the page, confined to this one mark. An
   independent, minor ambient satellite — its own non-synced 8s loop. */
.wave {
  stroke: var(--color-pool);
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
  transform-box: fill-box;
  animation: wave-drift var(--duration-wave-drift) var(--ease-in-out) infinite;
}

@keyframes wave-drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(var(--wave-drift-travel)); }
}

.coping {
  fill: var(--color-pool);
  opacity: .55;
}

/* The hook-hung chime: a second, independent ambient satellite beside the
   board, its own non-synced 7.4s sway — never phase-locked with the wave. */
.chime {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-3xs);
  width: var(--chime-width);
  height: auto;
  transform-origin: 50% 0%;
  animation: chime-sway var(--duration-chime-sway) var(--ease-in-out) infinite;
}

.chime line,
.chime circle {
  stroke: var(--color-accent);
}

.chime circle {
  fill: var(--color-accent);
}

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

/* Reduced motion: the still frame is the fully-lit plaque, badge and wave
   line — spectacular on its own, nothing depends on the animation having
   played (brief §5). base.css / tokens.css already collapse the duration
   tokens; these two rules supply the explicit END STATE the collapsed
   animation would otherwise still schedule via its own delay. */
@media (prefers-reduced-motion: reduce) {
  .ray-line,
  .wave,
  .chime {
    animation: none;
  }

  .ray-line {
    opacity: 1;
    transform: scale(1);
  }
}

.hero h1 {
  font-size: var(--text-hero);
  margin-block-start: var(--space-md);
  max-width: var(--hero-title-measure);
}

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

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

/* --- Proof strip ---------------------------------------------------------
   The dossier's single strongest V-tier proof asset, directly under the
   hero, before any service content (brief §3.2 item 3). */

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

.proof-quote {
  margin: 0;
}

.proof-quote p {
  font-size: var(--text-h3);
  color: var(--color-ink);
  line-height: var(--leading-snug);
}

.proof-quote__attribution {
  margin-block-start: var(--space-sm);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  font-style: normal;
}

/* --- Weekly service board -------------------------------------------------
   The dark ink-ground component (brief §2.2's own reciprocal contrast
   table: atmosphere-on-ink 13.83:1 AAA for the heading, bg-on-ink 14.69:1
   AAA for the body). */

.board {
  display: grid;
  gap: var(--space-md);
  margin-block: var(--space-md) var(--space-lg);
  padding: var(--space-lg);
  background-color: var(--color-ink);
  border-radius: var(--radius-md);
}

@media (min-width: 48em) {
  .board {
    grid-template-columns: 1fr 1fr;
  }
}

.board__plan {
  color: var(--color-bg);
}

.board__plan p {
  color: var(--color-bg);
}

.board__tag {
  display: inline-block;
  margin: 0 0 var(--space-2xs);
  padding: var(--space-3xs) var(--space-xs);
  font-size: var(--text-small);
  font-weight: var(--font-weight-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-ink);
  background-color: var(--color-accent);
  border-radius: var(--radius-sm);
}

.board__plan-title {
  color: var(--color-atmosphere);
  margin-block-end: var(--space-2xs);
}

/* Any focusable element inside the dark board ground needs the band-safe
   focus ring (tokens.css) — none exists on this page today, but the rule
   costs nothing and the component stays correct if one is ever added. */
.board :focus-visible {
  outline-color: var(--color-focus-on-band);
}

/* --- What's on every visit -------------------------------------------------
   The unoccupied structure (playbook §2 row 19), the dossier's own tier
   language verbatim (brief §3.2 item 5). */

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

@media (min-width: 48em) {
  .visit-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.visit-list {
  display: grid;
  gap: var(--space-xs);
  margin-block-start: var(--space-md);
}

.visit-list li {
  position: relative;
  padding-inline-start: var(--space-md);
  color: var(--color-ink);
}

.visit-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: var(--space-2xs);
  height: var(--border-thick);
  background-color: var(--color-accent);
}

.visit-grid__image img {
  border-radius: var(--radius-md);
}

/* --- Repairs & equipment index ---------------------------------------- */

.plank-row {
  display: grid;
  gap: var(--space-md);
  margin-block: var(--space-md);
  grid-template-columns: 1fr;
}

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

.plank {
  padding: var(--space-md);
  background-color: var(--color-surface);
  border: var(--border-thick) var(--border-style) var(--color-ink);
  border-radius: var(--radius-sm);
}

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

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

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

.repairs__image img {
  border-radius: var(--radius-md);
  max-width: var(--image-inline-max);
}

/* --- In their words --------------------------------------------------- */

.reviews-rating {
  font-weight: var(--font-weight-body-strong);
  margin-block-end: var(--space-md);
}

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

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

.review {
  margin: 0;
  padding: var(--space-md);
  background-color: var(--color-surface);
  border-radius: var(--radius-sm);
}

.review p {
  color: var(--color-ink);
}

.review footer {
  margin-block-start: var(--space-sm);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
  font-style: normal;
}
