/* ==========================================================================
   site.css — kopp-fencing-cedar-rapids-ia, per-site layout & components.
   Tokens only, no raw hex/px/font literals (house-tech-spec §3).

   Archetype `editorial-stack` (brief §5): one column, nothing overlaps.
   Every section opens with the settled marked-line rule + eyebrow (rule 2).
   One dark zone, the hero (rule 5). No shadow, no radius but square (rule
   4/7). --section-gap is the only inter-section spacing value (rule 6).

   §1 below is the skeleton's own shell, carried forward with brief-required
   overrides flagged inline. §2 is this site's own components.
   ========================================================================== */

/* ==========================================================================
   1. THE SKELETON SHELL
   ========================================================================== */

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

/* --font-weight-display: 400 (Anton has one static cut, brief §2.5); no
   --tracking-tight beyond the token's own neutral no-op (brief §2.5 note). */
.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);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  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 (house-wide, carried from the skeleton): closed is the
   plain CSS default below 48em, no JS gate, so there is nothing to collapse
   post-paint. The one visitor this would otherwise strand — JS off — gets
   the nav back via the <noscript> stylesheet override in
   @shared:head-boilerplate, which ships last in source order. */
.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-none everywhere on this site (brief §3.5) —
   the skeleton's own .btn reads --radius-sm, overridden below rather than by
   repointing the token globally (out of base.css's per-site scope). */

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

/* Primary control geometry: 52px tall, full width <48rem, inline-block
   min 260px ≥48rem (brief §5.6). Fill is --color-accent-strong /
   --color-accent-ink (brief §3.4, §4.1 row F8, 5.93:1) — never the raw
   --color-accent. */
.btn--primary {
  width: 100%;
  min-height: var(--control-height-primary);
  background-color: var(--color-accent-strong);
  color: var(--color-accent-ink);
}

@media (min-width: 48em) {
  .btn--primary {
    width: auto;
    min-width: var(--control-min-width);
  }
}

.btn--quiet {
  border-color: var(--color-border);
  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);
}

/* --radius-none, matching the site-wide square rule (brief §3.5) — the
   skeleton's own rule reads --radius-sm. */
.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-none);
}

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

/* base.css's .skip-link reads --color-accent as its fill (the house
   default), but this site's --color-accent is device/display-scale only
   (brief §3.4) and fails AA at text scale by design (brief §4.1 row F5,
   3.10:1). --color-accent-strong is the token that does every other
   body-scale accent job, including this one — overridden here rather than
   in base.css, which is house-level and out of per-site scope. */
.skip-link {
  background-color: var(--color-accent-strong);
  color: var(--color-accent-ink);
}

/* ==========================================================================
   2. THIS SITE'S OWN COMPONENTS — the brief's section plan
   ========================================================================== */

/* --- Shared content column ------------------------------------------------
   Every section's content — hero, index, lists, prose, form, FAQ — shares
   ONE column width: full container <48rem, capped at --h1-max (672px)
   ≥48rem (brief §5.2: "the hero and body content column is capped... rather
   than stretching to the full 1152px container — an editorial measure, not
   a second column", §5.1 rule 1). */
.wrap {
  max-width: var(--h1-max);
  margin-inline: auto;
}

/* --- Eyebrow ---------------------------------------------------------------
   Natural case in the HTML, uppercased here (house-tech-spec §8). Used by
   the hero and every section-head. */
.eyebrow {
  margin: 0;
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  line-height: var(--leading-caps);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

/* Alternating ground — §II, §IV, §VI sit on --color-surface; §I, §III, §V,
   and the footer stay on --color-bg (brief §5.7's table). */
.section--surface {
  background-color: var(--color-surface);
}

/* --- Section-head device ---------------------------------------------------
   "The settled marked-line stroke becomes the static head-rule reused at the
   top of every section below" (brief §1, §5.1 rule 2). A 2px
   --color-accent-strong rule (never the raw --color-accent — brief §3.4)
   with a short tracked eyebrow label. NEVER animates a second time (brief
   §7.2). One radius value on this site: square. */
.section__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-block-end: var(--space-md);
}

.section__head .eyebrow {
  flex: 0 0 auto;
  color: var(--color-accent-strong);
}

.section__head::after {
  content: '';
  flex: 1 1 auto;
  min-width: var(--space-lg);
  align-self: center;
  border-block-start: var(--border-thick) var(--border-style) var(--color-accent-strong);
}

.section__title {
  margin: 0 0 var(--space-lg);
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
}

.section__intro {
  margin: 0 0 var(--space-lg);
  max-width: var(--layout-measure);
  color: var(--color-ink-muted);
}

/* --- Section header illustrations (§II, §III) ------------------------------
   Full column width, no card, no shadow, no radius — a flat graphic band
   sitting directly in the reading order (brief §6.2). */
.section__figure {
  margin: 0 0 var(--space-lg);
}

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

/* §III's repair-detail study is a portrait-ish 4:3 close study, not a wide
   band like §II's — capped narrower so it reads as a detail, not a banner. */
.section__figure--narrow {
  max-width: 50%;
}

/* --- Hero — "the line gets marked" -----------------------------------------
   The ONE dark zone on the site (brief §5.1 rule 5). Atmosphere gradient:
   dark stop → glow stop, where glow stop = --color-accent-strong, NEVER the
   raw --color-accent (brief §3.4, §4.3 — the substitution that keeps every
   hero-text contrast row passing). Every hero text block ships in
   --color-accent-ink uniformly; no word carries --color-accent-tint (brief
   §5.6, §4.3). */
.hero {
  /* Solid background-color alongside the gradient image: computed-style
     contrast tools read backgroundColor separately from a gradient-only
     `background` shorthand and see transparent without it. */
  background-color: var(--color-hero-dark);
  background-image: radial-gradient(
    135% 100% at 8% 0%,
    var(--color-hero-dark) 0%,
    var(--color-hero-dark) 46%,
    var(--color-hero-glow) 100%
  );
  color: var(--color-accent-ink);
  padding-block-start: var(--space-xs);
  padding-block-end: var(--section-gap);
}

.hero .eyebrow {
  color: var(--color-accent-ink);
  margin-block-end: var(--space-sm);
}

.hero__title {
  margin: 0 0 var(--space-md);
  color: var(--color-accent-ink);
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
}

.hero__cta-wrap {
  margin: 0 0 var(--space-lg);
}

/* The primary CTA's own fill (--color-accent-strong) measures 2.71:1
   against the hero's dark stop directly behind it — under WCAG 1.4.11's
   3:1 non-text-contrast floor, the same failure mode N3/N4 (brief §4.2)
   already named for the focus ring on this exact ground. Not a new
   aesthetic decision: --color-accent-ink is the token already proven
   against the hero's dark stop at 16.09:1 (brief §4.3 G1/G2), reused here
   as the button's own edge rather than inventing a new pairing. */
.hero .btn--primary {
  border-color: var(--color-accent-ink);
}

.hero__field {
  position: relative;
  aspect-ratio: var(--hero-field-ratio);
  border: var(--border-hairline) var(--border-style) var(--color-rule);
  margin-block-end: var(--space-lg);
  overflow: hidden;
}

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

/* The marked-line device — inline SVG, aria-hidden, overlaid on the
   generated backdrop. Positioned to sit across the field's own foot strip,
   the brief's own term (front-matter `signature`) — a distinct band near
   the bottom edge, separate from whatever the generated frame itself
   depicts higher in the composition. */
.hero__device {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  width: 100%;
  height: 20%;
  pointer-events: none;
}

.hero__device-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* The drawn marking line: draws in once per loop (5.8s), holds, restarts.
   NEVER the raw accent for anything else on the site — this IS the device
   (brief §3.4(a)). */
.hero__mark-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: mark-draw var(--orbit-mark-draw) var(--ease-in-out) infinite;
}

@keyframes mark-draw {
  0%   { stroke-dashoffset: 400; }
  55%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* Locate-flag stakes: two independently-timed, non-synchronised sway loops
   (brief §7.2 — ref-001's satellite-float physics, adapted). Rotation about
   each stake's own base. */
.hero__flag {
  /* Local (0,0): each flag's own line starts there by construction. */
  transform-origin: 0px 0px;
}

.hero__flag--a {
  animation: flag-sway var(--orbit-flag-a) var(--ease-in-out) infinite;
}

.hero__flag--b {
  animation: flag-sway var(--orbit-flag-b) var(--ease-in-out) infinite;
  animation-delay: calc(var(--orbit-flag-b-offset) * -1);
}

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

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

.hero__secondary {
  margin: 0;
}

.hero__secondary a {
  color: var(--color-accent-ink);
  font-size: var(--text-small);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

/* The hero's primary CTA sits on the gradient, so it needs the hero-safe
   focus ring — --color-focus fails 3:1 on the hero's dark stop (brief §4.2
   N3/N4). Scoped to the hero only; every other control on the page uses the
   house --color-focus from base.css. */
.hero :focus-visible {
  outline-color: var(--color-focus-on-hero);
}

/* --- §I — The Full-Service Line: index band --------------------------------
   Anton tabular numerals, --color-accent-strong, fixed --index-numeral-col
   column (brief §5.1 rule 3, §3.5). The page's ONE numeral system. */
.index-list {
  margin: 0;
  padding: 0;
}

.index-row {
  display: grid;
  grid-template-columns: var(--index-numeral-col) 1fr;
  gap: var(--space-sm);
  align-items: baseline;
  padding-block: var(--space-md);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-rule);
}

.index-row:first-child {
  border-block-start: none;
  padding-block-start: 0;
}

.index-row__num {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-index-num);
  font-variant-numeric: tabular-nums;
  color: var(--color-accent-strong);
}

.index-row__body {
  min-width: 0;
}

.index-row__name {
  margin: 0 0 var(--space-3xs);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-body);
}

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

/* --- §II / §III — unranked lists, em-dash marker ---------------------------
   No counter — an unranked sub-list does not wear the section's numeral
   costume (design-rules §5, brief §5.1 rule 3). The dash is a CSS-drawn
   glyph, never typed into a copy string (copy.md's own builder note). */
.dash-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dash-list__item {
  display: flex;
  gap: var(--space-xs);
  padding-block: var(--space-sm);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-rule);
}

.dash-list__item:first-child {
  border-block-start: none;
  padding-block-start: 0;
}

.dash-list__item::before {
  content: '\2014';
  flex: 0 0 auto;
  color: var(--color-accent-strong);
  font-weight: var(--font-weight-body-strong);
}

.dash-list__item p {
  margin: 0;
}

/* --- §IV — Why Full-Service: plain prose ----------------------------------- */
.prose {
  max-width: var(--layout-measure);
}

.prose p {
  margin: 0 0 var(--space-md);
}

.prose p:last-child {
  margin-block-end: 0;
}

/* --- §V — Estimate: service-area line, co-primary phone, form -------------- */
.estimate__area {
  margin: 0 0 var(--space-lg);
  padding-block-start: var(--space-md);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-rule);
  color: var(--color-ink-muted);
}

.estimate__phone {
  margin: 0 0 var(--space-xl);
}

/* --- §VI — FAQ: rule-topped questions, no numeral --------------------------
   "A rule-topped question is its own ornament" (brief §5.1 rule 3) — no
   disclosure widget, no counter. */
.faq-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq-item {
  padding-block: var(--space-lg);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-rule);
}

.faq-item:first-child {
  border-block-start: none;
  padding-block-start: 0;
}

.faq-item__q {
  margin: 0 0 var(--space-2xs);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-body);
}

.faq-item__a {
  margin: 0;
  color: var(--color-ink-muted);
}

/* --- Footer extensions ------------------------------------------------------
   The skeleton's own .site-footer/.site-footer__nap carry NAP + hours +
   rights; this site adds a Facebook link and the point-of-contact line
   (brief §5.7's named allowance, copy.md footer). */
.site-footer__links {
  margin: var(--space-sm) 0 0;
}

.site-footer__contact {
  margin: var(--space-sm) 0 0;
  color: var(--color-ink-muted);
}

/* --- Reduced motion: the signature device's own kill switch ----------------
   base.css's global kill switch collapses --duration-* to ~0 (spec §8), but
   the marked-line device runs on its own named tokens (--orbit-*), which
   are not in that list. Brief §7.3: "the still frame is the composed
   picture" — the marking line rests fully drawn, both flag stakes rest at
   their default angle. Explicit rather than relying on the token collapse,
   since --orbit-* durations are never zeroed elsewhere. */
@media (prefers-reduced-motion: reduce) {
  .hero__mark-line {
    animation: none;
    stroke-dashoffset: 0;
  }

  .hero__flag--a,
  .hero__flag--b {
    animation: none;
    transform: rotate(0deg);
  }
}
