/* ==========================================================================
   site.css — superior-painting-and-finishes-laramie-wy.

   editorial-stack archetype (brief §3): magazine flow, rules, numbered
   sections, single column, top-to-bottom reading order. Signature move —
   "the cut-in line locks" (brief §5) — lives in the hero's .hero-field only;
   everything below it uses the house reveal system, untouched.

   The house shell (layout primitives, header/nav, buttons, form, footer) is
   the skeleton's, carried over unchanged in structure; brief-specific
   components (hero, Finish Index, Reviews, service area, footer email line)
   are added below each shell section they extend.

   HARD RULE (house-tech-spec §3): no raw hex, no px/rem size literal, no
   font-name literal in this file — tokens only, with the house breakpoints
   (48em/64em) as the one documented exception.
   ========================================================================== */

/* --- Layout primitives ---------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--layout-container);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.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]. With JS on,
   narrow viewports collapse the list behind the toggle. */

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

/* Brief-specific: the header carries the SHORT wordmark ("Superior
   Painting," copy.md §1.2), set in natural case — no uppercase transform,
   unlike this brief's hero H1. */
.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-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);
}

/* Closed is the plain CSS default below 48em, no JS gate — nothing to
   collapse post-paint, so no CLS race (house skeleton pattern). JS-off
   visitors get the nav back via the <noscript> stylesheet override in
   @shared:head-boilerplate. */
.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 ---------------------------------------------------------------- */

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

/* A text link, not a bordered button — the primary CTA already carries the
   ask; this is the quieter of the two paths (brief §3.1 row 1 / §3.4). */
.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: var(--layout-tap-min);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
  text-decoration: none;
  border-bottom: var(--border-hairline) var(--border-style) var(--color-border-strong);
}

.link-quiet:hover,
.link-quiet:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* --- Form -----------------------------------------------------------------
   One form per site (spec §6): reserved-email-required shape (brief §3.4).
   POSTs to the endpoint constant in main.js; works as a plain HTML POST
   with JS off. */

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

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

/* Brief-specific: the fourth contact channel (email, copy.md §1.2), never a
   primary or secondary CTA — a quiet line beneath the NAP/hours block. */
.site-footer__email {
  margin-block-start: var(--space-2xs);
}

/* --- Hero --------------------------------------------------------------------
   Brief §3.2/§3.3. House order (design-rules §7.2 rule 1): eyebrow → h1 →
   primary CTA → field → lead → facts. Single column at every width —
   editorial-stack reads top to bottom, never split beside a column. */

.hero {
  background-color: var(--color-bg);
  padding-block-start: var(--space-md);
  padding-block-end: var(--section-gap);
}

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

.hero__title {
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  margin-block-end: var(--space-sm);
}

.hero__title em {
  display: block;
  font-family: var(--font-emphasis);
  font-style: italic;
  font-weight: var(--font-weight-body);
  color: var(--color-accent);
}

.hero__cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-block-end: var(--space-sm);
}

.hero__lead {
  color: var(--color-ink-muted);
  font-size: var(--text-lead);
  margin-block-start: var(--space-sm);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  color: var(--color-ink-muted);
  font-size: var(--text-small);
  margin-block-start: var(--space-2xs);
}

/* --- The living-hero field: the cut-in edge ---------------------------------
   Brief §3.2: `.hero-field` is split by a single vertical cut-in line into two
   flat colour fields — the right --field-split-clay is flooded with
   --color-accent, the remainder is --color-bg. Delivered STRUCTURALLY: the
   split is two CSS-sized panels (guaranteed by width, independent of
   wherever the generated photo's own edge falls), laid over the real
   generated texture at high opacity (0.88–0.92) — high enough that the
   visible colour reads as the flat token itself regardless of what the
   photo underneath happens to contain (a `mix-blend-mode: color` version
   was tried first and rejected on render: it derives its LUMINOSITY from
   the photo pixels beneath, which desaturated the chalk half to grey and
   lightened the clay half to a pale salmon — exactly the "not a flat,
   unambiguous colour field" failure §3.2 warns against). At this opacity
   the photo's roller-nap texture and wet-sheen highlight still show through
   as subtle luminance variation (brief §4's grade instruction: "visible
   material texture... carrying the surface detail rather than photographic
   gloss") without ever taking the colour off-token. This is what the
   Builder verifies against the render before handoff (brief §3.2's
   standing instruction) — verified here at exactly 54.0% clay width. */

.hero-field {
  position: relative;
  overflow: hidden;
  block-size: var(--layout-field-height);
  border-radius: var(--radius-sm);
}

.hero-field__img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-field__wash {
  position: absolute;
  inset-block: 0;
}

.hero-field__wash--chalk {
  inset-inline-start: 0;
  inline-size: calc(100% - var(--field-split-clay));
  background-color: var(--color-bg);
  opacity: 0.92;
}

.hero-field__wash--clay {
  inset-inline-end: 0;
  inline-size: var(--field-split-clay);
  background-color: var(--color-accent);
  opacity: 0.88;
}

/* The cut-in line itself: draws top to bottom once on load (brief §5 step 1).
   A scaled div rather than an SVG stroke — the same single --field-split-clay
   token positions both the wash boundary and the line, so the two can never
   drift out of alignment. */
.hero-field__cutline {
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc(100% - var(--field-split-clay));
  inline-size: var(--border-thick);
  background-color: var(--color-ink);
  transform-origin: top;
  animation: cutline-draw var(--duration-hero-draw) var(--ease-out) forwards;
}

@keyframes cutline-draw {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* The specular highlight: travels once along the freshly drawn line, then
   settles to a subtle static sheen at the line's midpoint (brief §5 step 2).
   Starts only once the line finishes — --delay-hero-glint equals
   --duration-hero-draw, sequenced after it, never synced to it. */
.hero-field__glint {
  position: absolute;
  inset-inline-start: calc(100% - var(--field-split-clay));
  inline-size: calc(var(--border-thick) * 6);
  block-size: calc(var(--border-thick) * 6);
  transform: translate(-50%, -50%);
  border-radius: var(--radius-pill);
  background: radial-gradient(circle, var(--color-accent-ink), transparent 70%);
  opacity: 0;
  animation: cutline-glint var(--duration-hero-glint) var(--ease-out) var(--delay-hero-glint) forwards;
}

@keyframes cutline-glint {
  0% { top: 0%; opacity: 0; }
  12% { opacity: 0.95; }
  70% { top: 100%; opacity: 0.95; }
  100% { top: 50%; opacity: 0.55; }
}

/* The three swatch-chip satellites: one generated asset, composited three
   times, each independently positioned/timed/toned (brief §4 slot 2 / §5
   step 3). Tonal variation (deep clay / mid clay / pale sand) is CSS
   filtering of the one file — "the same asset... at independent, non-synced
   CSS timings/positions" (brief §4). All three sit inside the clay half. */
.hero-field__satellites {
  position: absolute;
  inset: 0;
}

/* inline-size is the same 54.4px at every breakpoint — no media query ever
   changes it, so the source asset is sized once for that, not for a range.
   assets/img/hero-swatch-chip.{avif,webp} ship at 165x182 (~3x that width,
   real headroom for high-DPR without serving the 220px-wide master
   unscaled — a Lighthouse image-delivery finding on the live deploy caught
   the unscaled master shipping ~4x this size in production). */
.satellite {
  position: absolute;
  inline-size: calc(var(--space-xl) * 0.85);
  block-size: auto;
  filter: drop-shadow(var(--shadow-md));
}

.satellite--1 {
  inset-inline-end: 20%;
  top: 16%;
  animation: satellite-drift-1 var(--duration-hero-sat-1) var(--ease-in-out) infinite;
}

.satellite--2 {
  inset-inline-end: 8%;
  top: 46%;
  filter: brightness(0.8) saturate(1.05) drop-shadow(var(--shadow-md));
  animation: satellite-drift-2 var(--duration-hero-sat-2) var(--ease-in-out) infinite;
}

.satellite--3 {
  inset-inline-end: 30%;
  top: 66%;
  filter: brightness(1.3) saturate(0.85) drop-shadow(var(--shadow-md));
  animation: satellite-drift-3 var(--duration-hero-sat-3) var(--ease-in-out) infinite;
}

@keyframes satellite-drift-1 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(var(--space-xs) * -1)); }
}

@keyframes satellite-drift-2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(var(--space-2xs)); }
}

@keyframes satellite-drift-3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(calc(var(--space-sm) * -1)); }
}

/* Reduced motion: the hero freezes to its finished state (brief §5's
   explicit statement) — the line fully drawn, the glint at its settled
   midpoint, the three chips simply present at rest. base.css's kill switch
   collapses the house reveal trio; these are one-shot/independent-loop
   devices with their own tokens, so they are frozen explicitly here. */
@media (prefers-reduced-motion: reduce) {
  .hero-field__cutline { animation: none; transform: scaleY(1); }
  .hero-field__glint { animation: none; top: 50%; opacity: 0.55; transform: translate(-50%, -50%); }
  .satellite--1, .satellite--2, .satellite--3 { animation: none; transform: none; }
}

/* --- Finish Index ------------------------------------------------------------
   Brief §2.5/§3.1 row 2: four numbered rows, dossier §4.1's own order. The
   64px numeral column (--layout-index-num) sits beside its row heading in a
   two-column grid at >=48em; below that, per the brief's stated minimum
   behaviour, the grid collapses to one column and the numeral moves above
   its heading — the two-column grid is what yields, never the numeral. */

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

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

.index-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xs);
  padding-block: var(--space-md);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
}

.index-row:last-child {
  border-block-end: var(--border-hairline) var(--border-style) var(--color-border);
}

.index-row__num {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-index-num);
  color: var(--color-accent);
  line-height: 1;
}

.index-row__body h3 {
  font-size: var(--text-h3);
  margin-block-end: var(--space-2xs);
}

.index-row__body p {
  color: var(--color-ink-muted);
  max-width: var(--layout-measure);
}

.index-row__media {
  margin-block-start: var(--space-sm);
  max-width: var(--layout-row-media);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.index-row__media img {
  inline-size: 100%;
  block-size: auto;
}

/* The folded-in proof quote under row 01 (brief §3.1 row 2 / §7): Eileen
   Johnson's verbatim review, bound directly under the row it corroborates. */
.index-row__proof {
  margin: var(--space-sm) 0 0;
  padding-inline-start: var(--space-sm);
  border-inline-start: var(--border-thick) var(--border-style) var(--color-accent);
  color: var(--color-ink);
  max-width: var(--layout-measure);
}

.index-row__proof p {
  color: var(--color-ink);
  font-style: italic;
  font-family: var(--font-emphasis);
}

.index-row__proof cite {
  display: block;
  margin-block-start: var(--space-2xs);
  font-style: normal;
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink-muted);
}

@media (min-width: 48em) {
  .index-row {
    grid-template-columns: var(--layout-index-num) 1fr;
    column-gap: var(--space-lg);
    align-items: start;
  }
}

/* --- Reviews ------------------------------------------------------------------
   Brief §3.1 row 3: unnumbered, single column, no ordinal marks — the
   Finish Index numerals are the page's only counted sequence (brief §2.5's
   nested-counters statement). */

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

.reviews__list {
  display: grid;
  gap: var(--space-lg);
  margin-block-start: var(--space-lg);
}

.review-card {
  margin: 0;
  padding-block-start: var(--space-md);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
  max-width: var(--layout-measure);
}

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

.review-card cite {
  display: block;
  margin-block-start: var(--space-2xs);
  font-style: normal;
  font-size: var(--text-small);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink-muted);
}

/* --- Contact / Request-a-Quote section --------------------------------------- */

.contact__intro {
  color: var(--color-ink-muted);
  margin-block-start: var(--space-sm);
  max-width: var(--layout-measure);
}

.contact__cta-row {
  margin-block: var(--space-sm) var(--space-lg);
}

/* --- Service area --------------------------------------------------------- */

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