/* ============================================================
   Impresa Edile Carrucese — style.css
   Mobile-first, no JavaScript.
   Tokens and rules from "Identità V1" (26.08.2026):
   no rounded corners, thick rules instead of shadows,
   left-aligned text, red as a signal (actions + one full-bleed
   surface per page), Archivo 800 for titles / 400 for body.
   ============================================================ */

/* ---------- Font (self-hosted, variable weight) ---------- */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --red: #ec3013;          /* Rosso Carrucese */
  --red-on-dark: #f4563d;  /* lighter tint for small red text on ink */
  --ink: #201e1d;          /* Inchiostro */
  --cement: #f3f2f2;       /* Cemento chiaro */
  --surface: #eae9e9;      /* Superficie */
  --muted: #6f6c6b;        /* secondary text, AA on cement */
  --rule: #cfcdcc;
  --rule-strong: #a9a6a5;
  --white: #ffffff;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter: 16px;
  --dock-h: 56px;
  --measure: 62ch;
  --section: clamp(3rem, 8vw, 6rem);
  --block: clamp(2rem, 5vw, 3.5rem);

  /* motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.2s;
  --t-base: 0.35s;
  --t-slow: 0.7s;

  color-scheme: light;
}

@media (min-width: 640px)  { :root { --gutter: 24px; } }
@media (min-width: 960px)  { :root { --gutter: 40px; } }

/* ---------- Reset (minimal) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cement);
  /* room for the fixed bottom dock on phones */
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
}
h1, h2, h3, h4, p, figure, dl, dd, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--red); text-underline-offset: 0.15em; }
a:hover { color: var(--red); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section + .section, .section--ruled { border-top: 2px solid var(--rule-strong); }
.grid { display: grid; gap: var(--block); }
@media (min-width: 960px) {
  .grid { gap: 3rem 4rem; align-items: start; }
  .grid--4-8 { grid-template-columns: 4fr 8fr; }
  .grid--5-7 { grid-template-columns: 5fr 7fr; }
  .grid--7-5 { grid-template-columns: 7fr 5fr; }
  .grid--6-6 { grid-template-columns: 1fr 1fr; }
}
.measure { max-width: var(--measure); }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  padding: 0.5rem 0.75rem; background: var(--ink); color: var(--cement);
  z-index: 200;
}
.skip:focus { top: 8px; }

/* ---------- Typography ---------- */
.eyebrow {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}
.band--dark .eyebrow { color: var(--red-on-dark); }
.band--red .eyebrow { color: var(--cement); opacity: 0.85; }

.h1, .h2, .h3 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.h1 { font-size: clamp(2.25rem, 5vw + 1rem, 4.25rem); }
.h2 { font-size: clamp(1.75rem, 3vw + 0.75rem, 2.75rem); }
.h3 { font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.2; }

.lead {
  margin-top: 1.25rem;
  font-size: clamp(1.0625rem, 0.5vw + 0.95rem, 1.25rem);
  line-height: 1.55;
  max-width: var(--measure);
}
.copy { margin-top: 1rem; max-width: var(--measure); }
.copy--muted { color: var(--muted); }
.copy--flush { margin-top: 0; }

.label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.band--dark .label { color: #b9b6b5; }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-block;
  flex: 1 1 auto;
  padding: 0.9375rem 1.25rem;
  border: 1px solid var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
/* hover fill sweeps in from the left: a signal, not a glow */
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--red);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease);
}
.btn:hover { color: var(--white); border-color: var(--red); }
.btn:hover::before { transform: scaleX(1); }
.btn:active { transform: translateY(1px); }
.btn--primary { border-color: var(--red); background: var(--red); color: var(--white); }
.btn--primary::before { background: #c4270f; }
.btn--primary:hover { border-color: #c4270f; }
.btn--light { border-color: var(--cement); color: var(--cement); }
.btn--light::before { background: var(--cement); }
.btn--light:hover { color: var(--ink); border-color: var(--cement); }
.band--red .btn--light:hover { color: var(--red); }
@media (min-width: 640px) { .btn { flex: 0 0 auto; } }

/* ---------- Header ---------- */
.site-header { position: relative; z-index: 120; border-bottom: 1px solid var(--rule-strong); background: var(--cement); }
.site-header__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 32px; height: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; text-transform: uppercase; }
.brand__tag { margin-top: 0.2rem; font-size: 0.5625rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.brand--footer .brand__mark { width: 44px; }
.brand--footer .brand__name { font-size: 1.125rem; }

/* Menu toggle: a visually hidden checkbox drives the overlay via :checked. */
.menu-toggle {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.menu-btn {
  position: relative; z-index: 130;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--ink);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  cursor: pointer; user-select: none;
  transition: color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.menu-btn__close { display: none; }
.menu-toggle:focus-visible + .menu-btn { outline: 2px solid var(--red); outline-offset: 2px; }
.menu-toggle:checked + .menu-btn { border-color: var(--cement); color: var(--cement); }
.menu-toggle:checked + .menu-btn .menu-btn__open { display: none; }
.menu-toggle:checked + .menu-btn .menu-btn__close { display: inline; }

/* Scrim behind the drawer: it is a <label for="menu">, so a tap closes the menu. */
.scrim {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(32, 30, 29, 0.55);
  opacity: 0; visibility: hidden;
  transition: opacity var(--t-base) var(--ease), visibility 0s linear var(--t-base);
}
.menu-toggle:checked ~ .scrim { opacity: 1; visibility: visible; transition-delay: 0s; }

/* Side drawer (phones and tablets) */
.nav {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 110;
  width: min(84vw, 360px);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(64px + 1rem) var(--gutter) calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--cement);
  overflow-y: auto;
  transform: translateX(100%); visibility: hidden;
  transition: transform 0.5s var(--ease), visibility 0s linear 0.5s;
}
.menu-toggle:checked ~ .nav { transform: none; visibility: visible; transition-delay: 0s; }
body:has(.menu-toggle:checked) { overflow: hidden; }
.nav__list { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: auto; }
.nav__list li, .nav__cta, .nav__contact {
  opacity: 0; transform: translateX(24px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.nav__list li:nth-child(1) { --i: 0; } .nav__list li:nth-child(2) { --i: 1; } .nav__list li:nth-child(3) { --i: 2; }
.nav__cta { --i: 3; } .nav__contact { --i: 4; }
.menu-toggle:checked ~ .nav :is(.nav__list li, .nav__cta, .nav__contact) {
  opacity: 1; transform: none;
  transition-delay: calc(0.15s + var(--i) * 0.06s);
}
.nav__list a {
  display: block; padding: 0.75rem 0;
  border-bottom: 1px solid rgba(243, 242, 242, 0.18);
  font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  text-decoration: none; color: var(--cement);
  transition: color var(--t-fast) var(--ease), padding-left var(--t-base) var(--ease);
}
.nav__list a:hover, .nav__list a[aria-current="page"] { color: var(--red-on-dark); }
.nav__list a:hover { padding-left: 0.5rem; }
.nav__cta { margin-top: 2rem; }
.nav__contact { margin-top: 1.5rem; display: grid; gap: 0.25rem; font-size: 0.9375rem; }
.nav__contact a { text-decoration-color: var(--red-on-dark); }
.nav__contact a:hover { color: var(--red-on-dark); }

@media (min-width: 960px) {
  .site-header { position: sticky; top: 0; }
  .site-header__row { min-height: 76px; }
  .menu-btn, .scrim { display: none; }
  .nav {
    position: static; width: auto; transform: none; visibility: visible; transition: none;
    flex-direction: row; align-items: center;
    padding: 0; background: transparent; color: inherit; overflow: visible;
  }
  .nav__list li, .nav__cta, .nav__contact { opacity: 1; transform: none; transition: none; }
  .nav__list { flex-direction: row; gap: 2rem; margin: 0 2rem 0 0; }
  .nav__list a {
    position: relative; padding: 0.25rem 0; border: 0;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink);
  }
  .nav__list a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
    background: var(--red);
    transform: scaleX(0); transform-origin: left;
    transition: transform var(--t-base) var(--ease);
  }
  .nav__list a:hover { padding-left: 0; color: var(--ink); }
  .nav__list a[aria-current="page"] { color: var(--red); }
  .nav__list a:hover::after, .nav__list a[aria-current="page"]::after { transform: scaleX(1); }
  .nav__cta { margin: 0; }
  .nav__cta .btn { padding: 0.75rem 1rem; }
  .nav__contact { display: none; }
}

/* ---------- Bottom dock (phones and tablets) ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--ink);
  background: var(--cement);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.dock a {
  display: flex; align-items: center; justify-content: center; min-height: var(--dock-h);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none;
}
.dock a + a { border-left: 1px solid var(--rule-strong); color: var(--red); }
@media (min-width: 960px) {
  .dock { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- Hero ---------- */
.hero { padding-block: var(--block) var(--section); }
.hero .h1 { margin-top: 0; }
@media (min-width: 960px) {
  .hero { padding-block: var(--section); }
}

/* ---------- Photos ----------
   Site photos are delivered already in black and white (identity manual);
   the figure fixes the ratio so nothing shifts while the image loads. */
.ph {
  position: relative;
  margin: 0;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  overflow: hidden;
}
.ph--4x5  { aspect-ratio: 4 / 5; }
.ph--3x2  { aspect-ratio: 3 / 2; }
.ph--16x10 { aspect-ratio: 16 / 10; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero .ph { margin-top: 2.5rem; }
@media (min-width: 960px) { .hero .ph { margin-top: 0; } }

/* ---------- Stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.75rem 1rem;
  padding-block: 2rem;
  border-top: 2px solid var(--rule-strong);
}
.stats dt { order: 2; }
.stat { display: flex; flex-direction: column; }
.stat__value {
  font-size: clamp(2rem, 4vw + 0.5rem, 2.75rem); font-weight: 800; line-height: 1;
  letter-spacing: -0.02em; color: var(--red);
}
.stat__label { margin-top: 0.5rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); padding-block: 2.5rem; } }

/* ---------- Numbered list (services on home) ---------- */
.numlist { border-top: 1px solid var(--rule-strong); }
.numlist__item {
  display: grid; grid-template-columns: 2.5rem 1fr; gap: 0 0.5rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.numlist__item:last-child { border-bottom-color: var(--rule-strong); }
.numlist__num { font-size: 0.75rem; font-weight: 700; color: var(--red); padding-top: 0.35rem; }
.numlist__item p { grid-column: 2; margin-top: 0.5rem; color: var(--muted); }
@media (min-width: 640px) {
  .numlist__item { grid-template-columns: 4rem 1fr; padding-block: 2rem; }
  .numlist__num { padding-top: 0.45rem; }
}

/* ---------- Bands ---------- */
.band--dark { background: var(--ink); color: var(--cement); }
.band--dark a:hover { color: var(--red-on-dark); }
.band--dark .btn { border-color: var(--red); background: var(--red); color: var(--white); }
.band--red { background: var(--red); color: var(--cement); }
.band--red .h2 { color: var(--white); font-size: clamp(2rem, 4vw + 0.75rem, 3.5rem); }
.band--red a:hover { color: var(--white); }

/* ---------- Key / value list ---------- */
.kv { border-top: 1px solid var(--rule-strong); }
.kv > div {
  display: grid; gap: 0.25rem 1rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--rule);
}
.kv dd { font-size: 0.9375rem; }
.band--dark .kv { border-top-color: rgba(243, 242, 242, 0.45); }
.band--dark .kv > div { border-bottom-color: rgba(243, 242, 242, 0.18); }
@media (min-width: 640px) {
  .kv > div { grid-template-columns: minmax(9rem, 1fr) 2fr; align-items: baseline; }
}
.kv--compact > div { grid-template-columns: 6rem 1fr; padding-block: 0.375rem; border-bottom: 0; }
.kv--compact { border-top: 0; }
.kv--compact dd { font-size: 0.875rem; }
.kv--compact dt { font-size: 0.625rem; }

/* ---------- Work cards ---------- */
.cards { display: grid; gap: 2rem; }
.h2 + .cards, .lead + .cards { margin-top: 2.5rem; }
.card { display: flex; flex-direction: column; }
.card .ph { width: 100%; transition: border-color var(--t-base) var(--ease); }
/* hover: the card lifts and a red rule draws under the title (no shadows) */
.card__title { position: relative; padding-bottom: 0.5rem; }
.card__title::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 2.5rem; height: 2px;
  background: var(--red);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-base) var(--ease);
}
@media (hover: hover) {
  .card { transition: transform var(--t-base) var(--ease); }
  .card:hover { transform: translateY(-4px); }
  .card:hover .ph { border-color: var(--ink); }
  .card:hover .card__title::after { transform: scaleX(1); }
}
.card__title { margin-top: 1rem; font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.card__desc { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--muted); }
.card .kv--compact { margin-top: 0.75rem; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 2.5rem 2rem; } }

/* Horizontal scroller on small screens (home, recent works) */
@media (max-width: 959.98px) {
  .cards--scroll {
    display: flex; gap: 1rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cards--scroll::-webkit-scrollbar { display: none; }
  .cards--scroll .card { flex: 0 0 min(78vw, 22rem); scroll-snap-align: start; }
}
/* Progress rule under the scroller, driven by the scroll position itself
   (no JavaScript). Hidden where scroll-driven animations are unsupported. */
.cards__progress { display: none; }
@supports (animation-timeline: scroll()) {
  @media (max-width: 959.98px) {
    .cards-scope { timeline-scope: --works; }
    .cards--scroll { scroll-timeline: --works inline; }
    .cards__progress {
      display: block; position: relative; height: 2px; margin-top: 1.5rem;
      background: var(--rule); overflow: hidden;
    }
    .cards__progress::before {
      content: ""; position: absolute; inset: 0; width: 34%;
      background: var(--red);
      animation: progress-slide linear both;
      animation-timeline: --works;
    }
  }
}
@keyframes progress-slide { from { translate: 0; } to { translate: 194%; } }

/* ---------- Services accordion (servizi page) ---------- */
.svc-list { padding-bottom: var(--section); }
.svc { border-top: 2px solid var(--rule-strong); }
/* anchors land on the body; keep the summary heading in view */
.svc__body { scroll-margin-top: 6rem; }
.svc:last-of-type { border-bottom: 2px solid var(--rule-strong); }
.svc summary {
  display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: baseline; gap: 0 0.5rem;
  padding-block: 1.25rem;
  list-style: none; cursor: pointer;
}
.svc summary::-webkit-details-marker { display: none; }
.svc__num { font-size: 0.75rem; font-weight: 700; color: var(--red); }
.svc summary .h2 { font-size: clamp(1.375rem, 2vw + 0.75rem, 2.25rem); }
.svc summary::after {
  content: "+";
  font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--muted);
}
.svc[open] summary::after { content: "–"; }
.svc[open] summary .h2 { color: var(--red); }
.svc__body { display: grid; gap: 1.5rem; padding: 0 0 2rem 3rem; }
.svc__text { display: grid; gap: 1.5rem; }
.svc__body .copy { margin-top: 0; }
@media (min-width: 640px) {
  .svc summary { grid-template-columns: 4rem 1fr auto; padding-block: 1.75rem; }
  .svc__body { padding-left: 4.5rem; padding-bottom: 2.5rem; }
}
@media (min-width: 960px) {
  .svc__body {
    grid-template-columns: 5fr 7fr; gap: 1.5rem 4rem; align-items: start;
    padding-left: 4.5rem; padding-bottom: 3.5rem;
  }
}
/* Opening/closing animation where the browser can interpolate to `auto`.
   Elsewhere the accordion simply snaps, as native details do. */
@supports (interpolate-size: allow-keywords) {
  .svc::details-content {
    height: 0; overflow: clip;
    transition: height 0.45s var(--ease), content-visibility 0.45s allow-discrete;
  }
  .svc[open]::details-content { height: auto; }
}
/* Desktop enhancement: where the browser exposes ::details-content,
   show all four services expanded (as in the V1 layout) and drop
   the toggle. Browsers without it keep the working accordion. */
@supports selector(::details-content) {
  @media (min-width: 960px) {
    .svc::details-content { content-visibility: visible; display: block; height: auto; }
    .svc summary { pointer-events: none; }
    .svc summary::after, .svc[open] summary::after { content: none; }
    .svc[open] summary .h2 { color: inherit; }
  }
}

/* ---------- Contact ---------- */
.big-actions { display: grid; gap: 0.75rem; margin-top: 2rem; }
.big-action {
  display: block; padding: 1.25rem 1rem;
  border: 1px solid var(--ink); text-align: center; text-decoration: none;
}
.big-action:hover { color: var(--ink); background: var(--surface); }
.big-action .label { display: block; color: var(--muted); }
.big-action strong { display: block; margin-top: 0.25rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.big-action--primary { border-color: var(--red); background: var(--red); color: var(--white); }
.big-action--primary .label { color: rgba(255, 255, 255, 0.8); }
.big-action--primary:hover { background: #d42a0f; color: var(--white); }
@media (min-width: 640px) { .big-actions { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .big-actions { display: none; } }

.contact-aside { display: grid; gap: 1.5rem; align-content: start; }
.contact-aside .label { margin-bottom: 0.5rem; }
.contact-aside address { font-style: normal; }
.contact-aside p { margin: 0; }
.contact-aside > div + div { padding-top: 1.5rem; border-top: 1px solid var(--rule-strong); }

.form { display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.375rem; }
.field label { font-size: 0.875rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 0.875rem;
  border: 1px solid var(--rule-strong); border-radius: 0;
  background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.field textarea { min-height: 8rem; resize: vertical; }
.field--2 { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .field--2 { grid-template-columns: 1fr 1fr; } }

.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset__legend { padding: 0; margin-bottom: 0.375rem; font-size: 0.875rem; color: var(--muted); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ink); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 0.625rem 0.875rem; font-size: 0.9375rem; border-right: 1px solid var(--ink); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--red); color: var(--white); }
.seg input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -2px; }

.consent { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.875rem; color: var(--muted); }
.consent input { margin-top: 0.25rem; accent-color: var(--red); flex: none; }
.form .btn { justify-self: start; }
.form .btn[disabled] { opacity: 0.6; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Outcome of a JS submission: ink rule for success, red for failure. */
.form__status { padding: 0.75rem 1rem; border-left: 4px solid var(--ink); background: var(--surface); max-width: var(--measure); }
.form__status--error { border-left-color: var(--red); }
.form__status a { text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { padding-block: var(--section) 3rem; border-top: 2px solid var(--rule-strong); }
.site-footer__grid { display: grid; gap: 2rem; }
.site-footer .label { margin-bottom: 0.625rem; }
.site-footer address { font-style: normal; }
.site-footer p, .site-footer li { margin: 0; font-size: 0.9375rem; line-height: 1.7; }
.site-footer__group + .site-footer__group { margin-top: 1.25rem; }
.site-footer__legal { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); font-size: 0.75rem; color: var(--muted); }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem 3rem; } }

/* ---------- Text pages (privacy, 404) ---------- */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.5rem; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.prose p, .prose ul { margin-top: 1rem; }
.prose ul { padding-left: 1.25rem; list-style: square; }
.prose li + li { margin-top: 0.375rem; }

/* ---------- Motion ----------
   Progressive enhancement. `data-js` is set on <html> by an inline
   script before first paint; without it nothing is hidden and nothing
   waits for JavaScript. `data-reveal` marks single blocks, `data-stagger`
   marks a container whose children reveal one after the other (js/enhance.js
   sets --i on each child). */
@media (prefers-reduced-motion: no-preference) {
  /* page entrance: hero blocks rise in sequence, CSS only */
  .hero .eyebrow, .hero .h1, .hero .lead, .hero .actions, .hero .big-actions, .hero .ph {
    animation: fade-up var(--t-slow) var(--ease) both;
  }
  .hero .h1 { animation-delay: 0.08s; }
  .hero .lead { animation-delay: 0.16s; }
  .hero .actions, .hero .big-actions { animation-delay: 0.24s; }
  .hero .ph { animation-delay: 0.2s; }

  /* scroll reveal (sections and the stats strip only draw their rule, below) */
  [data-js] :is([data-reveal], [data-stagger] > *):not(.section, .stats) {
    opacity: 0; transform: translateY(28px);
    transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  [data-js] :is([data-reveal], [data-stagger] > *).is-in { opacity: 1; transform: none; }
  [data-js] .ph[data-reveal] { transform: translateY(28px) scale(0.98); }
  [data-js] .ph[data-reveal].is-in { transform: none; }

  /* section rules draw themselves in */
  [data-js] .section--ruled, [data-js] .stats, [data-js] .svc {
    border-top-color: transparent;
    background-image: linear-gradient(var(--rule-strong), var(--rule-strong));
    background-repeat: no-repeat; background-position: top left; background-size: 0% 2px;
    transition: background-size 0.9s var(--ease);
  }
  [data-js] :is(.section--ruled, .stats, .svc).is-in { background-size: 100% 2px; }
  [data-js] .section + .section.section--ruled { border-top-color: transparent; }

  /* numbers pop when the count-up starts */
  [data-js] .stat__value { transition: transform var(--t-base) var(--ease-out); }
  [data-js] .stat.is-in .stat__value { animation: number-pop 0.6s var(--ease-out) both; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes number-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.85); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .dock, .menu-btn, .nav, .skip { display: none !important; }
  body { padding-bottom: 0; background: #fff; }
  .band--dark, .band--red { background: #fff; color: #000; }
  a { text-decoration: none; }
}
