/* site.css: per-site layout, from tokens (house-tech-spec §3: no raw
   hex/px/rem/font literals, except the house breakpoint escape hatch and an
   explicit @allow-literal comment). Archetype: split-hero (brief §4).
   Signature: the ember settles (brief §7). */

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

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

/* --section-gap is the only inter-section spacing value (brief §4). */
.section {
  padding-block: var(--section-gap);
}

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

/* Flow spacing for stacked bare elements inside .measure (base.css zeroes
   block margins) — thanks.html's eyebrow/h1/body/CTA stack relies on it. */
.measure > * + * {
  margin-block-start: var(--space-sm);
}

/* The settled ember-glow's colour, echoed as a static head-rule at the top
   of every section boundary below the hero (brief §3, §7). Never renders
   shorter than 3rem. */
.section-rule {
  display: block;
  width: 100%;
  min-width: var(--rule-min-width);
  height: var(--rule-height);
  margin-block-end: var(--space-lg);
  background-color: var(--color-accent);
  border: 0;
}

.section__head {
  display: grid;
  gap: var(--space-xs);
  margin-block-end: var(--space-lg);
}

.section h1,
.section h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  font-weight: var(--font-weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

.section__label {
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
}

/* --- Header & navigation ---------------------------------------------
   Brief §4/§5: 56px + 1px border, sticky below the expiry bar (sticky
   pairing lives in css/preview.css). tel: sits outside the collapsible
   nav so it stays reachable at 375px without opening it (brief §1).
   Collapse point below 48em is a Builder execution choice — the house
   breakpoint, a media-query literal escape hatch (base.css banner). */

.site-header {
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  min-block-size: calc(var(--layout-header-height) + var(--border-hairline));
  padding-block: 0;
  border-bottom: var(--border-hairline) var(--border-style) var(--color-border);
  background-color: var(--color-bg);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  flex-wrap: nowrap;
  width: 100%;
}

.site-header__brand {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: var(--font-weight-display);
  text-decoration: none;
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  white-space: nowrap;
}

.site-header__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs);
}

.site-header__tel {
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  text-decoration: none;
  color: var(--color-ink);
  white-space: nowrap;
}

@media (min-width: 48em) {
  .site-header__tel {
    font-size: var(--text-body);
  }
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-3xs) var(--space-2xs);
  border: var(--border-hairline) var(--border-style) var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
}

.site-nav {
  order: 1;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 47.99em) {
  [data-nav-ready] .site-nav {
    flex-basis: 100%;
    padding: var(--space-md) var(--layout-gutter);
    background-color: var(--color-bg);
    border-bottom: var(--border-hairline) var(--border-style) var(--color-border);
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
  }

  [data-nav-ready] .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
  }
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-weight-body-strong);
  color: var(--color-ink);
}

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

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

@media (min-width: 48em) {
  .site-nav {
    position: static;
    order: 0;
    flex-basis: auto;
    padding: 0;
    border-bottom: 0;
    background-color: transparent;
  }

  .site-nav__list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
  }

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

  [data-nav-ready] .nav-toggle {
    display: none;
  }
}

/* --- Buttons -------------------------------------------------------------
   One filled role. The hero and every CTA sit on --color-bg (the hero
   atmosphere is bounded to .field only, brief §2), so no outline variant is
   needed the way a dark full-bleed hero would require one. Brief §5: the
   primary CTA is 52px tall at every breakpoint. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: var(--layout-tap-min);
  padding: var(--space-xs) var(--space-md);
  border: var(--border-hairline) var(--border-style) transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  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 {
  min-height: var(--control-height-primary);
  background-color: var(--color-accent);
  color: var(--color-accent-ink);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--color-ink);
}

.btn--quiet {
  border-color: var(--color-border);
  color: var(--color-ink);
}

/* --- Hero (split-hero, brief §4/§5/§7) ------------------------------------
   DOM order (house order): eyebrow → h1 → primary CTA → field → lead →
   facts, unchanged at every breakpoint. Below 900px (56.25em — the
   archetype's own computed switch point, brief §4/§5; a media-query
   literal, the house's one unavoidable escape hatch) everything stacks in a
   single column in that order. At ≥900px, CSS Grid places the field beside
   the text column via named areas — visual placement only, DOM order is
   untouched (brief §4's own binding note). The three DOM children below —
   .hero__text (eyebrow, h1, cta), .hero__field, .hero__tail (lead, facts) —
   preserve that exact six-element order as three grouped siblings. */

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

@media (min-width: 56.25em) {
  .hero {
    padding-block-start: var(--space-2xl);
  }
}

.hero__inner {
  display: block;
}

@media (min-width: 56.25em) {
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'text field' 'tail field';
    column-gap: var(--hero-grid-gap);
    align-items: start;
  }
}

.hero__eyebrow {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: var(--font-weight-body-strong);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--color-ink);
}

.hero__title {
  max-width: var(--hero-h1-max-mobile);
  margin: 0;
  margin-block-start: var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--font-weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

/* The H1's differentiator word — colour only, upright, no font-style
   (brief §3). 4.81:1 on --color-bg (contrast table row 6). */
.hero__title .hot {
  color: var(--color-accent);
}

@media (min-width: 56.25em) {
  .hero__title {
    max-width: var(--hero-h1-max-desktop);
    margin-block-start: var(--space-sm);
  }
}

.hero__cta {
  margin: 0;
  margin-block-start: var(--space-md);
}

@media (min-width: 56.25em) {
  .hero__cta {
    margin-block-start: var(--space-lg);
  }
}

.hero__text {
  grid-area: text;
}

.hero__tail {
  grid-area: tail;
  margin-block-start: var(--space-sm);
}

@media (min-width: 56.25em) {
  .hero__tail {
    margin-block-start: var(--space-lg);
  }
}

.hero__lead {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-lead);
  font-weight: var(--font-weight-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs) var(--space-sm);
  margin: 0;
  margin-block-start: var(--space-xs);
  padding: 0;
  list-style: none;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-ink-muted);
}

@media (min-width: 56.25em) {
  .hero__facts {
    margin-block-start: var(--space-sm);
  }
}

.hero__facts li {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
}

.hero__facts li::before {
  content: '';
  flex: 0 0 auto;
  inline-size: var(--space-3xs);
  block-size: var(--space-3xs);
  border-radius: var(--radius-pill);
  background-color: var(--color-accent);
}

/* --- Hero field: the living-hero image + the ember-settle device ----------
   The LCP element. Never lazy, never reveal-gated, fetchpriority="high".
   Fixed height per breakpoint (brief §5: 340px / 520px) — the field is
   deliberately taller than the text column at desktop, the literal
   expression of split-hero's "asymmetric weight" (brief §4). Carries ZERO
   text nodes (brief §2's binding rule) — the ember/turf devices below are
   aria-hidden decoration, never content. */

.hero__field {
  grid-area: field;
  position: relative;
  margin: 0;
  margin-block-start: var(--space-md);
  block-size: var(--hero-field-height-mobile);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--color-hero-atmo-3);
  background-image: radial-gradient(120% 90% at 32% 22%,
    var(--color-hero-atmo-1) 0%, var(--color-hero-atmo-3) 100%);
}

@media (min-width: 56.25em) {
  .hero__field {
    margin-block-start: 0;
    block-size: var(--hero-field-height-desktop);
  }
}

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

/* The settled glow — the signature move's still point. One-shot 1400ms
   ease-out settle on load; its colour is --color-accent, later reused as
   the static .section-rule everywhere below the hero (brief §7). */
.field__glow {
  position: absolute;
  z-index: var(--z-hero-field-embers);
  inset-inline-start: 58%;
  inset-block-end: 24%;
  inline-size: var(--field-glow-size);
  block-size: var(--field-glow-size);
  border-radius: var(--radius-pill);
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  opacity: var(--ember-glow-rest-opacity);
  animation: ember-glow-settle var(--duration-ember-settle) var(--ease-out) both;
  pointer-events: none;
}

@keyframes ember-glow-settle {
  from { opacity: 0; transform: scale(0.45); }
  to   { opacity: var(--ember-glow-rest-opacity); transform: none; }
}

/* Three embers, drifting on independent, non-synchronised loops. */
.field__ember {
  position: absolute;
  z-index: var(--z-hero-field-embers);
  inline-size: var(--field-ember-size);
  block-size: var(--field-ember-size);
  border-radius: var(--radius-pill);
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 75%);
  opacity: 0.55;
  pointer-events: none;
}

.field__ember--1 {
  inset-inline-start: 56%;
  inset-block-end: 36%;
  animation: ember-drift var(--duration-ember-drift-1) var(--ease-in-out) infinite alternate;
}

.field__ember--2 {
  inset-inline-start: 64%;
  inset-block-end: 42%;
  animation: ember-drift var(--duration-ember-drift-2) var(--ease-in-out) infinite alternate;
}

.field__ember--3 {
  inset-inline-start: 60%;
  inset-block-end: 50%;
  animation: ember-drift var(--duration-ember-drift-3) var(--ease-in-out) infinite alternate;
}

@keyframes ember-drift {
  from { transform: translateY(0) scale(1); opacity: 0.35; }
  to   { transform: translateY(calc(var(--field-ember-drift-distance) * -1)) scale(1.2); opacity: 0.8; }
}

/* Two turf blades, swaying on independent loops. Foreground of the frame. */
.field__turf {
  position: absolute;
  inset-block-end: 4%;
  inline-size: var(--field-turf-width);
  block-size: var(--field-turf-height);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  background-color: var(--color-turf);
  transform-origin: bottom center;
  transform: rotate(0deg);
  pointer-events: none;
}

.field__turf--1 {
  inset-inline-start: 9%;
  animation: turf-sway var(--duration-turf-sway-1) var(--ease-in-out) infinite alternate;
}

.field__turf--2 {
  inset-inline-end: 11%;
  animation: turf-sway var(--duration-turf-sway-2) var(--ease-in-out) infinite alternate;
}

@keyframes turf-sway {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .field__glow,
  .field__ember,
  .field__turf {
    animation: none;
  }
}

/* --- Services ("What We Build") -------------------------------------------
   Brief §4: all 11 services, single flowing numbered list, --color-bg (not
   --color-surface, per the binding rule at contrast table row 6), a
   low-opacity paver/stone texture image behind it (§6 slot 2). */

.services {
  position: relative;
  isolation: isolate;
  background-color: var(--color-bg);
}

.services__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  opacity: 0.18;
}

.services__bg img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.services__content {
  position: relative;
  z-index: var(--z-hero-field-atmo);
}

.services__list {
  counter-reset: services;
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.services__item {
  counter-increment: services;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-sm);
}

.services__num {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
  font-size: var(--text-lead);
  line-height: var(--leading-tight);
  color: var(--color-accent);
}

.services__num::before {
  content: counter(services, decimal-leading-zero);
}

.services__text {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

.services__name {
  font-weight: var(--font-weight-body-strong);
}

/* --- Trust (the honest strip + reserved-reviews notice) -------------------
   Brief §4: three real V-tier rows, no icons, on --color-surface (the
   raised plate). A small ember/glow accent image sits beside it (§6 slot 3). */

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

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

@media (min-width: 48em) {
  .trust__grid {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }
}

.trust__list {
  display: grid;
  gap: var(--gap-honest-strip);
  margin: 0;
  padding: 0;
  list-style: none;
}

.trust__item {
  padding-block-start: var(--gap-honest-strip);
  border-block-start: var(--border-hairline) var(--border-style) var(--color-border);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink);
}

.trust__item:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

.trust__accent {
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.trust__accent img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* The reserved-reviews notice: dashed border, no colour role spent (brief
   §4/§9 — never accent, never a fabricated number). */
.trust__reserved {
  margin: 0;
  margin-block-start: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  border: var(--border-hairline) dashed var(--color-ink-muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-ink-muted);
}

/* --- Process ("How It Works") ---------------------------------------------
   Brief §3: plain decimal (1–3), Hanken Grotesk 700, --color-ink-muted —
   distinct from the services index on both face and colour. */

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

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

.process__step {
  counter-increment: process;
  display: grid;
  gap: var(--space-2xs);
}

.process__num {
  font-family: var(--font-body);
  font-weight: 700;
  font-style: normal;
  font-size: var(--text-lead);
  line-height: var(--leading-tight);
  color: var(--color-ink-muted);
}

.process__num::before {
  content: counter(process);
}

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

.process__lead {
  font-weight: var(--font-weight-body-strong);
}

/* --- Final CTA / contact --------------------------------------------------- */

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

.contact__tel {
  font-family: var(--font-body);
  font-weight: var(--font-weight-body-strong);
  text-decoration: underline;
  text-underline-offset: var(--space-3xs);
  color: var(--color-ink);
}

/* --- Form (spec §6): POSTs to main.js's endpoint; plain POST w/ JS off;
   auto-hides when no endpoint is configured. -------------------------------- */

.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-size: var(--text-body);
  font-weight: var(--font-weight-body-strong);
}

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

.field__control:focus-visible {
  background-color: var(--color-surface);
}

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

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

/* Honeypot: in the DOM for bots, unreachable for humans/AT. Not
   display:none — some bots skip that. */
.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-eyebrow);
  color: var(--color-ink-muted);
}

.form__status[data-state='error'] {
  color: var(--color-ink);
  font-weight: var(--font-weight-body-strong);
}

/* --- Footer ----------------------------------------------------------------
   NAP + service area + copyright. A low-opacity graded-soil/berm texture
   band sits behind it (§6 slot 4). */

.site-footer {
  position: relative;
  isolation: isolate;
  padding-block: var(--space-xl);
  border-top: var(--border-hairline) var(--border-style) var(--color-border);
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-ink-muted);
}

.site-footer__bg {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  opacity: 0.16;
}

.site-footer__bg img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.site-footer__content {
  position: relative;
  z-index: var(--z-hero-field-atmo);
}

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

.site-footer__nap {
  font-style: normal;
  color: var(--color-ink);
}

.site-footer__nap strong {
  font-family: var(--font-display);
  font-weight: var(--font-weight-display);
}

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

.site-footer small {
  font-size: var(--text-micro);
}
