/* ==========================================================================
   site.css — tokens only, no raw literals (spec §3). ARCHETYPE split-hero
   (brief §5): single column below 64rem, two-column hero (1.3fr/1fr) at
   64rem+. Breakpoints: 48rem + hero-specific 64rem (brief §2.6). ONE
   GRADIENT, the hero atmosphere (brief §4.3).
   ========================================================================== */

/* base.css's skip-link pairs --color-accent/--color-accent-ink; raw ember
   accent is decorative-scale only (brief §4.1, 3.61:1, fails 4.5:1 body).
   Repointed at the body-safe pair (accent-strong/accent-ink, 6.10:1). */
.skip-link {
  background-color: var(--color-accent-strong);
  color: var(--color-accent-ink);
}

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

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

/* The ONE inter-section value and its two call sites (brief §5.3). No band
   sets its own vertical rhythm. */
.section {
  padding-block: var(--section-gap);
}

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

/* Anchor targets need clearance for the sticky 101px stack (brief §5.4:
   expiry 44 + header 56 + 1px border). --expiry-height is declared once, in
   css/preview.css; it stops existing at purchase alongside the bar it
   describes, which is the one moment this calc is allowed to stop mattering. */
[id] {
  scroll-margin-block-start: calc(var(--expiry-height) + var(--header-height) + var(--border-hairline));
}

/* --- Band grounds — bg / surface alternate below the dark Capability band
   (brief §5.7's own ground column: hero atmosphere, ink, bg, surface, bg,
   surface, bg). --- */

.band--bg {
  background-color: var(--color-bg);
}

.band--surface {
  background-color: var(--color-surface);
}

/* §I Capability — the one dark, reversed-text band (brief §5.7 §I). */
.band--ink {
  background-color: var(--color-ink);
  color: var(--color-accent-ink);
}

/* base.css's :focus-visible ring is invisible on this dark band —
   re-pointed at the dark-band-safe token. */
.band--ink :focus-visible {
  outline-color: var(--color-focus-on-band);
}

/* --- Type roles (brief §2.5). Weight is font-weight/font-stretch only. --- */

h2 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display-head);
  font-stretch: var(--font-stretch-display);
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-ink);
}

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

/* Every caps label — eyebrows, control labels (brief §2.5), natural case, uppercased here (spec §8). */
.caps-label {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-caps);
  line-height: var(--leading-caps);
  text-transform: uppercase;
}

/* --- Header. Sticky beneath the expiry bar; 56px + 1px border (brief §5.4). --- */

.site-header {
  position: sticky;
  inset-block-start: var(--expiry-height);
  z-index: var(--z-header);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-rule);
  background-color: var(--color-bg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: var(--header-height);
}

.site-header__brand {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display-head);
  font-stretch: var(--font-stretch-display);
  font-size: var(--text-small);
  color: var(--color-ink);
  text-decoration: none;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* The tel: alone below 48rem; in-page links join at 48rem+ (brief §9). */
.site-header__link {
  display: none;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-small);
  color: var(--color-ink);
  text-decoration: none;
}

.site-header__link:hover,
.site-header__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

@media (min-width: 48rem) {
  .site-header__link {
    display: inline-flex;
    align-items: center;
  }
}

.site-header__tel {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-small);
  color: var(--color-accent-strong);
  text-decoration: none;
  white-space: nowrap;
}

.site-header__tel:hover,
.site-header__tel:focus-visible {
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
}

/* --- Buttons (brief §5.7 hero slot ③): accent-strong fill, accent-ink label. Full width <64rem; min 260px at >=64rem; 52px tall. --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding-inline: var(--space-md);
  border: var(--border-hairline) var(--border-style) transparent;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-none);
  font-family: var(--font-display);
  font-weight: var(--font-weight-display-head);
  font-stretch: var(--font-stretch-display);
  font-size: var(--text-body);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.btn--primary {
  width: 100%;
  min-height: var(--control-height);
  /* Accent-strong fill against a dark ground (hero/Capability band) reads
     2.2-2.4:1 against its own background, under WCAG 1.4.11's 3:1 UI-
     boundary floor with no border to rescue it (base .btn's border is
     transparent). A cream border gives the control a real, always-visible
     edge — 15.85:1+ against every dark ground this button sits on, and no
     regression on light grounds where the fill already clears 3:1 alone. */
  border-color: var(--color-accent-ink);
  background-color: var(--color-accent-strong);
  color: var(--color-accent-ink);
}

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

/* The secondary CTA — a text link, never a second button shape (brief §5.7
   hero "Secondary CTA"). Cream on the gradient (brief §4.4 correction). */
.btn--text {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body);
  font-size: var(--text-small);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
  text-transform: none;
}

/* --- Hero — "fuel breaks clear" (brief §5.7). DOM order: eyebrow -> h1 ->
   primary CTA -> secondary CTA -> field -> lead -> facts. Single column
   below 64rem; a 1.3fr/1fr split at 64rem+ via CSS Grid row placement, so
   markup order IS visual order at every width (brief §5.1 rules 1-2). --- */

.hero {
  padding-block-start: var(--space-xs);
  padding-block-end: var(--section-gap);
  /* background-color set explicitly (not left to the `background` shorthand,
     which resets it to transparent when unnamed) so nothing that walks the
     DOM for the nearest opaque ground falls through to the light page bg. */
  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);
}

@media (min-width: 64rem) {
  .hero {
    padding-block-start: var(--space-xl);
  }
}

.hero__grid {
  display: block;
}

@media (min-width: 64rem) {
  .hero__grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    column-gap: var(--space-lg);
    align-items: start;
  }

  .hero__text {
    grid-column: 1;
    grid-row: 1;
  }

  .hero__field {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .hero__text-tail {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Slot ① — trade + place, max 2 lines at 375 (brief §5.7 hero, §5.4). Cream
   per the §4.4 correction — the tile's own lighter eyebrow tint was never
   computed against the gradient's stops. */
.hero__eyebrow {
  margin-block-end: var(--space-sm);
  font-size: var(--text-eyebrow);
  color: var(--color-accent-ink);
}

/* Slot ② — the h1. One word ("reduced") carries --color-accent-tint,
   display-scale only (brief §5.7 hero H1, §4.4). Capped at --h1-max so the
   display column stacks rather than running the full measure. */
.hero h1 {
  max-width: var(--h1-max);
  margin-block-end: var(--space-sm);
  font-family: var(--font-display);
  font-weight: var(--font-weight-display-h1);
  font-stretch: var(--font-stretch-display);
  font-size: var(--text-h1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--color-accent-ink);
  text-transform: uppercase;
}

.hero h1 .accent {
  color: var(--color-accent-tint);
}

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

.hero__secondary {
  margin-block-end: var(--space-sm);
}

@media (min-width: 64rem) {
  .hero__secondary {
    margin-block-end: 0;
  }
}

/* The living field — image slot 1 plus the inline-SVG ember mark and two
   canopy-sway accents (brief §5.7 hero slot ④). Fixed 16:9 at every width
   (brief §5.1 rule 5). */
.hero__field {
  position: relative;
  overflow: hidden;
  margin-block-start: var(--space-sm);
  aspect-ratio: var(--hero-field-ratio);
  border: var(--border-frame) var(--border-style) var(--color-ink);
  border-radius: var(--radius-sm);
  background-color: var(--color-hero-dark);
}

@media (min-width: 64rem) {
  .hero__field {
    margin-block-start: 0;
  }
}

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

/* --- The signature — "fuel breaks clear" (brief §7.2): a decorative,
   aria-hidden SVG overlay — a settled ember-glow mark (never active flame)
   pulsing at a fixed low intensity, and two canopy elements swaying on
   independently-timed loops. --- */

.hero__field-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.canopy-elem {
  fill: var(--color-ink);
  fill-opacity: 0.5;
}

.ember-elem {
  fill: var(--color-accent);
}

.ember-ring {
  fill: none;
  stroke: var(--color-accent-strong);
  stroke-width: 2;
  opacity: 0.6;
}

@media (prefers-reduced-motion: no-preference) {
  .canopy1-elem {
    animation: canopy-sway var(--duration-canopy1) ease-in-out infinite;
    transform-origin: bottom center;
  }

  .canopy2-elem {
    animation: canopy-sway var(--duration-canopy2) ease-in-out infinite;
    animation-delay: var(--delay-canopy2);
    transform-origin: bottom center;
  }

  .ember-elem {
    animation: ember-glow var(--duration-ember) ease-in-out infinite;
  }
}

@keyframes canopy-sway {
  0%, 100% { transform: rotate(-2.6deg); }
  50%      { transform: rotate(2.4deg); }
}

@keyframes ember-glow {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 0.85; }
}

/* Reduced motion: the still frame is the composed picture (brief §7.3) —
   ember rests at mid-intensity; canopy accents rest at their drawn angle. */
@media (prefers-reduced-motion: reduce) {
  .canopy1-elem,
  .canopy2-elem {
    animation: none;
    transform: rotate(0deg);
  }

  .ember-elem {
    animation: none;
    opacity: 0.7;
  }
}

.hero__lead {
  margin-block-start: var(--space-md);
  font-size: var(--text-lead);
  line-height: var(--leading-snug);
  max-width: var(--layout-measure);
  color: var(--color-accent-ink);
}

/* Facts line — brief §5.7 provisionally names --color-tint-on-dark
   (#C9BBAA), pending the Builder's own check against the gradient extremes
   (§11 item 6). Computed: #C9BBAA is 9.56:1 on the dark stop but 3.97:1 on
   the glow stop — fails 4.5:1. Substituted with cream (--color-accent-ink,
   15.85:1 / 6.57:1 on both stops, §4.3), per §11 item 6's own instruction;
   see README. */
.hero__facts {
  margin-block-start: var(--space-md);
  padding-block-start: var(--space-xs);
  border-block-start: var(--border-hairline) var(--border-style) color-mix(in srgb, var(--color-accent-ink) 20%, transparent);
  color: var(--color-accent-ink);
  font-size: var(--text-small);
}

/* --- The band-head object, repeated at the top of every band below the hero
   (brief §5.1 rule 3, §5.7): a caps eyebrow, an h2 in --font-display, and the
   ember mark's settled, static, opaque-fill silhouette as a corner mark. --- */

.band-head {
  position: relative;
  margin-block-end: var(--space-md);
  padding-inline-end: calc(var(--mark-size) + var(--space-sm));
}

.band-head__eyebrow {
  margin-block-end: var(--space-xs);
  font-size: var(--text-eyebrow);
  color: var(--color-accent-strong);
}

.band--ink .band-head__eyebrow {
  color: var(--color-accent-tint);
}

.band-head__title {
  margin: 0;
}

/* The settled ember mark — a filled dot + ring, at rest. Never animates:
   the hero's own live moment is the site's one spectacular moment (§7.2). */
.band-head__mark {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: var(--mark-size);
  block-size: var(--mark-size);
}

.band-head__mark .mark-dot {
  fill: var(--color-accent-strong);
}

.band-head__mark .mark-ring {
  fill: none;
  stroke: var(--color-accent-strong);
  stroke-width: 2;
}

.band--ink .band-head__mark .mark-dot,
.band--ink .band-head__mark .mark-ring {
  fill: var(--color-accent-tint);
  stroke: var(--color-accent-tint);
}

/* --- §I Capability — an unranked em-dash index, never a chip grid or a
   numbered list (brief §5.7 §I, ref-011's adaptation, §1). --- */

.section__intro {
  margin-block-end: var(--space-md);
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
  color: var(--color-tint-on-dark);
}

.index {
  border-block-start: var(--border-hairline) var(--border-style) color-mix(in srgb, var(--color-accent-ink) 14%, transparent);
}

.index__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding-block: var(--space-sm);
  border-block-end: var(--border-hairline) var(--border-style) color-mix(in srgb, var(--color-accent-ink) 14%, transparent);
}

/* The marker glyph is CSS generated content, not literal HTML text — the
   span stays aria-hidden/empty in markup (same em-dash device, brief §5.7
   §I; qa-DoD §5b's em-dash rule reads markup text, not painted pixels). */
.index__mark {
  flex: 0 0 auto;
  font-family: var(--font-display);
  font-weight: var(--font-weight-display-h1);
  color: var(--color-accent-tint);
}

.index__mark::before {
  content: '\2014';
}

.index__name {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body);
  font-size: var(--text-body);
  color: var(--color-accent-ink);
}

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

/* On light bands (§III Field Notes reuses .index for its own list) the
   hairlines and text return to the page's own light-ground pairing. */
.band--bg .index,
.band--surface .index,
.band--bg .index__row,
.band--surface .index__row {
  border-color: var(--color-rule);
}

.band--bg .index__name,
.band--surface .index__name {
  color: var(--color-ink);
}

.band--bg .index__mark,
.band--surface .index__mark {
  color: var(--color-accent-strong);
}

.band--bg .section__intro,
.band--surface .section__intro {
  color: var(--color-ink-muted);
}

/* --- §II Trust — facts band, no CTA (brief §5.7 §II). --- */

.trust__body {
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
}

.trust__body p + p {
  margin-block-start: var(--space-sm);
}

/* --- §III Field Notes — the craft/education throughline, required (brief
   §5.7 §III). Owner line, then the two illustrated studies at the band's
   foot. --- */

.field-notes__owner {
  margin-block-start: var(--space-md);
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

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

@media (min-width: 48rem) {
  .section-figures {
    grid-template-columns: 1fr 1fr;
  }
}

.section-figure img {
  width: 100%;
  height: auto;
  border: var(--border-hairline) var(--border-style) var(--color-rule);
  border-radius: var(--radius-sm);
}

.section-figure figcaption {
  margin-block-start: var(--space-2xs);
  font-size: var(--text-small);
  color: var(--color-ink-muted);
}

/* --- §IV "What Boulder Neighbors Say" — three verbatim quotes, required
   (brief §5.7 §IV, ref-011's pull-quote adaptation, §2.2's dropped-italic
   substitute: upright Barlow with a left rule signals quotation instead of a
   synthetic font-style: italic). --- */

.voices {
  list-style: none;
  margin: 0;
  padding: 0;
  border-block-start: var(--border-hairline) var(--border-style) var(--color-rule);
}

.voices__row {
  padding-block: var(--space-md);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-rule);
}

.voices__quote {
  margin: 0;
  padding-inline-start: var(--space-md);
  max-width: var(--layout-measure);
  border-inline-start: var(--border-frame) var(--border-style) var(--color-accent-strong);
}

.voices__quote p {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

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

/* --- §V Estimate — the free-assessment/free-estimate block (brief §5.7 §V,
   house-tech-spec §6). --- */

.estimate__body {
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
}

.estimate__body p + p {
  margin-block-start: var(--space-sm);
}

.estimate__area {
  margin-block-start: var(--space-sm);
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

.contact__ask {
  margin-block-start: var(--space-lg);
  margin-block-end: var(--space-md);
}

.contact__phone {
  margin-block-start: var(--space-md);
  max-width: var(--layout-measure);
  line-height: var(--leading-body);
}

.contact__phone a {
  text-underline-offset: var(--space-3xs);
}

.form {
  display: grid;
  gap: var(--space-md);
  max-width: var(--layout-measure);
}

.field {
  display: grid;
  gap: var(--space-3xs);
}

.field__label {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-small);
}

.field__control {
  width: 100%;
  min-height: var(--layout-tap-min);
  padding: var(--space-2xs) var(--space-xs);
  background-color: var(--color-bg);
  color: var(--color-ink);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
}

textarea.field__control {
  min-height: var(--space-3xl);
  resize: vertical;
}

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

/* Honeypot: in the DOM for bots, unreachable otherwise. Not display:none. */
.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-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
}

/* --- §VI FAQ — three Q&As, no numeral system (brief §5.7 §VI). --- */

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

.faq__row {
  padding-block: var(--space-md);
  border-block-end: var(--border-hairline) var(--border-style) var(--color-rule);
}

.faq__q {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  font-size: var(--text-body);
  color: var(--color-ink);
}

.faq__a {
  margin: 0;
  max-width: var(--layout-measure);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

/* --- Footer — NAP, hours, Facebook link (house-tech-spec §4/§6). --- */

.site-footer {
  padding-block: var(--section-gap);
  font-size: var(--text-small);
}

.site-footer > .container > * + * {
  margin-block-start: var(--space-sm);
}

.site-footer__nap {
  font-style: normal;
  line-height: var(--leading-body);
}

.site-footer__nap a {
  text-underline-offset: var(--space-3xs);
}

.site-footer__nap a[href^='tel'],
.site-footer__nap a[href^='mailto'] {
  display: inline-flex;
  align-items: center;
  min-height: var(--layout-tap-min);
}

.site-footer__social a {
  text-underline-offset: var(--space-3xs);
}

/* --- thanks.html: no field, no atmosphere, flat --color-bg. The h2 stands
   in as the page's display headline; the primary action is the phone (brief
   §5.6). --- */

.thanks__eyebrow {
  margin-block-end: var(--space-xs);
  color: var(--color-ink-muted);
  font-size: var(--text-eyebrow);
}

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

.thanks__lead {
  margin-block-end: var(--space-md);
  max-width: var(--layout-measure);
  font-size: var(--text-lead);
  line-height: var(--leading-body);
}

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