/* ==========================================================================
   Alexas Lobby — base, layout and components.
   Every value comes from the token scales in tokens.css.
   ========================================================================== */

/* ---------- font ---------- */
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallback so swapping in Figtree costs ~no layout shift. */
@font-face {
  font-family: "Figtree Fallback";
  src: local("Arial");
  size-adjust: 97.5%;
  ascent-override: 96%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-canvas);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
input, textarea { font-variant-ligatures: none; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--color-action); text-decoration-color: var(--color-link-line); text-decoration-thickness: 1.5px; text-underline-offset: 0.2em; }
a:hover { color: var(--color-action-hover); text-decoration-color: currentColor; }
table { border-collapse: collapse; width: 100%; }
:target { scroll-margin-top: calc(var(--header-h) + var(--space-24)); }

/* ---------- focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2.5px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---------- type ---------- */
h1, h2, h3, h4 { font-weight: var(--fw-bold); text-wrap: balance; }
h1 { font-size: var(--step-4); line-height: var(--lh-h1); letter-spacing: var(--tr-h1); }
h2 { font-size: var(--step-3); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); }
h3 { font-size: var(--step-2); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); }
h4 { font-size: var(--step-1); line-height: var(--lh-tight); letter-spacing: -0.008em; }
p { text-wrap: pretty; }
.display { font-size: var(--step-5); line-height: var(--lh-display); letter-spacing: var(--tr-display); font-weight: var(--fw-heavy); }
.lead { font-size: var(--step-1); line-height: var(--lh-lead); color: var(--color-text-muted); }
.eyebrow {
  font-size: var(--step--2); font-weight: var(--fw-bold); letter-spacing: var(--tr-label);
  text-transform: uppercase; color: var(--color-text-brand); display: block;
  margin-bottom: var(--space-12);
}
.small { font-size: var(--step--1); }
.muted { color: var(--color-text-muted); }
.subtle { color: var(--color-text-subtle); }
.warnish { color: var(--color-danger-fg); }

/* ---------- the guardian ----------
   A pit bull standing square, facing the viewer. She appears only where the page is about
   safety and trust, and she is always gold. */
.guardian { flex: none; display: block; }
.ftr__guardian {
  display: flex; gap: var(--space-16); align-items: center;
  margin-top: var(--space-28); padding-top: var(--space-24);
  border-top: 1px solid color-mix(in oklch, currentColor 18%, transparent);
  max-width: 24rem;
}
.ftr__guardian .guardian { color: var(--color-accent-on-brand); }
.ftr__guardian p { font-size: var(--step--2); line-height: var(--lh-normal, 1.5); opacity: 0.85; }
/* In a brand page head: standing on its bottom edge, at the right. */
.pagehead--guarded { position: relative; overflow: hidden; }
.pagehead--guarded .wrap--wide { position: relative; }
.pagehead__guardian {
  position: absolute; right: 0; bottom: calc(var(--space-64) * -1);
  width: auto; height: 11.5rem; color: var(--color-accent-on-brand);
}
@media (max-width: 64rem) {
  .pagehead__guardian { position: static; height: 5rem; margin-top: var(--space-24); margin-bottom: calc(var(--space-64) * -1); }
}
/* A short note with her beside it, under a page title. */
.guardnote {
  display: flex; gap: var(--space-16); align-items: flex-end;
  margin-top: var(--space-24); padding: var(--space-12) var(--space-16) var(--space-12) var(--space-12);
  border-left: 3px solid var(--color-accent); background: var(--color-surface-accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; max-width: 44rem;
}
.guardnote .guardian { color: var(--color-text-brand); }
.guardnote p { font-size: var(--step--1); color: var(--color-text); }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-16); top: -4rem; z-index: 200;
  background: var(--color-action); color: var(--color-text-on-action);
  padding: var(--space-12) var(--space-16); border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold); transition: top var(--dur-base) var(--ease-signature);
}
.skip-link:focus-visible { top: var(--space-12); color: var(--color-text-on-action); }

/* ---------- layout ---------- */
.wrap { width: min(100% - (var(--gutter) * 2), var(--content-max)); margin-inline: auto; }
.wrap--wide { width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto; }
.section { padding-block: clamp(var(--space-64), 4vw + 2rem, var(--space-128)); }
.section--tight { padding-block: clamp(var(--space-48), 3vw + 1rem, var(--space-80)); }
.section--sunken { background: var(--color-surface-sunken); }
.section--brand { background: var(--color-surface-brand); color: var(--color-text-on-brand); }
.section--brand h2, .section--brand h3 { color: var(--color-text-on-brand); }
.section--brand .lead, .section--brand .muted { color: var(--ink-200); }
.section--brand .eyebrow { color: var(--color-accent-on-brand); }
.section-head { max-width: 46rem; margin-bottom: var(--space-48); }
.section-head--split {
  max-width: none; display: flex; flex-wrap: wrap; gap: var(--space-24);
  align-items: end; justify-content: space-between;
}
.section-head--split > div { max-width: 44rem; }
.grid { display: grid; gap: var(--space-24); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.grid--projects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 62rem) { .grid--projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .grid--projects { grid-template-columns: 1fr; } }
.prose { max-width: var(--prose-max); }
.prose > * + * { margin-top: var(--space-16); }
.prose h2 { margin-top: var(--space-48); }
.prose h3 { margin-top: var(--space-32); }
.prose ul, .prose ol { padding-left: var(--space-24); }
.prose ul li { list-style: disc; margin-top: var(--space-8); }
.prose ol li { list-style: decimal; margin-top: var(--space-8); }
.prose strong { font-weight: var(--fw-semibold); }
.stack > * + * { margin-top: var(--space-16); }
.stack-lg > * + * { margin-top: var(--space-32); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }
.cluster--sm { gap: var(--space-8); }

/* ---------- icons ---------- */
.icon { flex: none; }

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--color-action); --btn-fg: var(--color-text-on-action);
  --btn-bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-8);
  padding: var(--space-12) var(--space-24);
  min-height: 2.75rem;
  font-weight: var(--fw-semibold); font-size: var(--step--1); line-height: 1.2;
  letter-spacing: -0.004em;
  border-radius: var(--radius-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  text-decoration: none; text-align: center;
  transition: background-color var(--dur-micro) var(--ease-out),
              color var(--dur-micro) var(--ease-out),
              transform var(--dur-micro) var(--ease-out),
              border-color var(--dur-micro) var(--ease-out);
}
.btn:hover { --btn-bg: var(--color-action-hover); color: var(--btn-fg); }
.btn:active { --btn-bg: var(--color-action-active); transform: translateY(1px); }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; pointer-events: none; }
.btn--accent { --btn-bg: var(--color-accent); --btn-fg: var(--color-text-on-accent); }
.btn--accent:hover { --btn-bg: var(--color-accent-hover); }
.btn--accent:active { --btn-bg: var(--color-accent-active); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--color-text); --btn-bd: var(--color-border-strong); }
.btn--ghost:hover { --btn-bg: var(--color-surface-sunken); --btn-bd: var(--color-text-subtle); }
.btn--ghost:active { --btn-bg: var(--color-surface-sunken); }
.btn--quiet { --btn-bg: var(--color-action-soft); --btn-fg: var(--color-text-brand); }
.btn--quiet:hover { --btn-bg: var(--color-action-soft-hover); --btn-fg: var(--color-text-brand); }
.btn--onbrand { --btn-bg: var(--stone-0); --btn-fg: var(--ink-900); }
.btn--onbrand:hover { --btn-bg: var(--ink-50); --btn-fg: var(--ink-900); }
.btn--sm { padding: var(--space-8) var(--space-16); min-height: 2.375rem; font-size: var(--step--2); }
.btn--lg { padding: var(--space-16) var(--space-32); min-height: 3.25rem; font-size: var(--step-0); }
.btn--block { display: flex; width: 100%; }
.btn .icon { margin-block: -2px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > span { opacity: 0.35; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.icon-btn:hover { background: var(--color-surface-sunken); color: var(--color-text); }

.link-arrow { display: inline-flex; align-items: center; gap: var(--space-8); font-weight: var(--fw-semibold); text-decoration: none; }
.link-arrow .icon { transition: transform var(--dur-base) var(--ease-signature); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: 0.25rem 0.6rem 0.3rem;
  font-size: var(--step--2); font-weight: var(--fw-semibold); line-height: 1.3;
  border-radius: var(--radius-pill);
  background: var(--color-surface-sunken); color: var(--color-text-muted);
  border: 1px solid transparent;
}
.badge--verified { background: var(--color-success-bg); color: var(--color-success-fg); }
.badge--accent { background: var(--color-surface-accent-soft); color: var(--color-warning-fg); }
.badge--brand { background: var(--color-action-soft); color: var(--color-text-brand); }
.badge--info { background: var(--color-info-bg); color: var(--color-info-fg); }
.badge--danger { background: var(--color-danger-bg); color: var(--color-danger-fg); }
.badge--sample {
  background: transparent; color: var(--color-text-subtle);
  border-color: var(--color-border-strong); border-style: dashed;
}
/* ---------- membership badge ----------
   One badge, "Member", as an outline in the brand gold. It is not a tick, and
   it says nothing about a license (decision 0007). Who gets it is decided in
   src/lib/licensing.js. */
.memberbadge {
  display: inline-flex; align-items: center; gap: var(--space-8);
  padding: 0.3rem 0.8rem 0.35rem 0.65rem;
  font-size: var(--step--1); font-weight: var(--fw-bold); line-height: 1.3; letter-spacing: 0.01em;
  border-radius: var(--radius-pill); border: 2px solid var(--color-accent);
  white-space: nowrap;
}
.memberbadge__mark { width: 1.15em; height: 0.94em; flex: none; }
.memberbadge--member { background: transparent; color: var(--color-text-brand); }
:is(.pagehead--brand, .section--brand, .hero) .memberbadge--member {
  color: var(--color-accent-on-brand); border-color: var(--color-accent-on-brand);
}
.procard__licence { margin-top: var(--space-8); font-size: var(--step--2); color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* On the charcoal bands, the quiet greys have to lift to stay readable. */
:is(.pagehead--brand, .section--brand, .hero) :is(.badge--sample, .stars-count) { color: var(--color-text-on-brand-muted); }
:is(.pagehead--brand, .section--brand, .hero) .badge--sample { border-color: var(--ink-500); }
:is(.pagehead--brand, .section--brand, .hero) .stars { color: var(--color-accent-on-brand); }

/* ---------- stars ---------- */
.stars { display: inline-flex; gap: 1px; color: var(--color-star); vertical-align: -2px; }
.star { display: inline-flex; }
.star.is-empty { color: var(--color-border-strong); }
.star.is-half { position: relative; color: var(--color-border-strong); }
.star__half { position: absolute; inset: 0; width: 50%; overflow: hidden; color: var(--color-star); }
.stars-value { font-weight: var(--fw-bold); margin-left: var(--space-8); font-variant-numeric: tabular-nums; }
.stars-count { color: var(--color-text-subtle); font-size: var(--step--1); margin-left: var(--space-4); font-variant-numeric: tabular-nums; }

/* ---------- avatar ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); flex: none;
  font-weight: var(--fw-heavy); letter-spacing: 0.01em;
  background: oklch(0.92 0.045 var(--av-h)); color: oklch(0.34 0.07 var(--av-h));
}
:root[data-theme="dark"] .avatar { background: oklch(0.33 0.05 var(--av-h)); color: oklch(0.88 0.07 var(--av-h)); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .avatar { background: oklch(0.33 0.05 var(--av-h)); color: oklch(0.88 0.07 var(--av-h)); }
}

/* ---------- cards ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-1);
}
.card--flat { box-shadow: none; }
.card--pad-lg { padding: var(--space-32); }
.card__media { border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-sunken); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
/* One grade across every photograph so licensed stock and generated art sit together. */
.card__media img, .hero__media img, .rounded img, .projcard img, .photo img {
  filter: saturate(0.97) contrast(1.03) sepia(0.06);
}

/* ---------- header ---------- */
.demo-bar { background: var(--ink-950); color: var(--ink-100); font-size: var(--step--2); }
.demo-bar[hidden] { display: none; }
.demo-bar__inner {
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: flex; align-items: center; gap: var(--space-12);
  padding-block: var(--space-8); min-height: 2.5rem;
}
.demo-bar__inner .icon { color: var(--gold-400); }
.demo-bar strong { color: var(--stone-0); }
.demo-bar p { margin-right: auto; line-height: 1.4; }
.demo-bar__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem; border-radius: var(--radius-pill); color: var(--ink-200);
}
.demo-bar__close:hover { background: var(--ink-900); color: var(--stone-0); }

.hdr {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--color-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}
.hdr__inner {
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: flex; align-items: center; gap: var(--space-16);
  min-height: var(--header-h);
}
.hdr__logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--logo-ink); flex: none; }
.hdr__logo:hover { color: var(--logo-ink); }
/* The client's logo, horizontal lockup. Height sets the size; the width follows. */
.brandmark { display: block; height: 2.6rem; width: auto; aspect-ratio: 1348 / 305; }
@media (max-width: 30rem) { .brandmark { height: 2.25rem; } }
.hdr__nav { margin-left: var(--space-16); flex: none; }
.hdr__nav ul { display: flex; gap: var(--space-4); }
.hdr__nav a, .hdr__pro, .hdr__login { white-space: nowrap; }
/* Four sections made the bar longer, and nothing in it shrinks or wraps, so
   links give way instead. Below a wide window the two reading links go; just
   above the mobile menu "How it works" goes too. All three are in the footer
   and the menu at every width. */
@media (max-width: 92rem) { .hdr__nav-extra { display: none; } }
@media (max-width: 79rem) { .hdr__nav-wide { display: none; } }
/* On a page with the header search, the search is what stays. The reading
   links make room for it first, then the account links move into the menu,
   then the section links do. */
.hdr--search .hdr__nav-extra { display: none; }
.hdr--search .hdr__nav-wide { display: none; }
@media (max-width: 92rem) {
  .hdr--search .hdr__pro, .hdr--search .hdr__login { display: none; }
  .hdr--search .mobilenav { display: block; margin-left: 0; }
}
@media (max-width: 82rem) { .hdr--search .hdr__nav { display: none; } }
.hdr__nav a {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-8) var(--space-12); border-radius: var(--radius-sm);
  color: var(--color-text-muted); text-decoration: none; font-weight: var(--fw-medium);
  font-size: var(--step--1);
  transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.hdr__nav a:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.hdr__nav a[aria-current="page"] { color: var(--color-text); font-weight: var(--fw-semibold); }
.nav-caret { flex: none; transition: transform var(--dur-base) var(--ease-signature); }
.hdr__nav a[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }
.hdr__actions { display: flex; align-items: center; gap: var(--space-8); margin-left: auto; flex: none; }
.hdr__actions .btn { white-space: nowrap; }
.hdr__pro, .hdr__login {
  padding: var(--space-8) var(--space-12); border-radius: var(--radius-sm);
  color: var(--color-text-muted); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--step--1);
}
.hdr__pro:hover, .hdr__login:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.theme-icon--moon { display: none; }
:root[data-theme="dark"] .theme-icon--sun { display: none; }
:root[data-theme="dark"] .theme-icon--moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon--sun { display: none; }
  :root:not([data-theme="light"]) .theme-icon--moon { display: block; }
}

.hdr-search {
  display: flex; align-items: center; gap: var(--space-4);
  background: var(--color-surface-sunken); border: 1px solid var(--color-border);
  border-radius: var(--radius-pill); padding: var(--space-4) var(--space-4) var(--space-4) var(--space-12);
  max-width: 24rem; flex: 0 1 21rem; min-width: 19rem; margin-left: var(--space-8);
}
.hdr-search:focus-within { border-color: var(--color-border-brand); box-shadow: 0 0 0 3px var(--color-action-soft); }
.hdr-search__icon { color: var(--color-text-subtle); }
/* [type] lifts these above the general text-field rule further down, which
   would otherwise put a full bordered box inside the pill. */
.hdr-search input[type] {
  border: 0; border-radius: 0; background: none; box-shadow: none;
  width: auto; min-width: 0; min-height: 0; flex: 1; padding: var(--space-8) var(--space-4); font-size: var(--step--1);
}
.hdr-search input::placeholder { color: var(--color-text-subtle); }
.hdr-search input.hdr-search__zip { width: auto; flex: 0 1 8.5rem; min-width: 5rem; border-left: 1px solid var(--color-border); padding-left: var(--space-12); }
.hdr-search__go {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: var(--radius-pill);
  background: var(--color-action); color: var(--color-text-on-action); flex: none;
}
.hdr-search__go:hover { background: var(--color-action-hover); }

/* mega menu */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-3);
}
.mega[hidden] { display: none; }
.mega__inner {
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-32); padding-block: var(--space-32) var(--space-40);
}
.mega__title { font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--color-text-subtle); margin-bottom: var(--space-12); }
.mega__col ul { display: grid; gap: 2px; }
.mega__col a {
  display: flex; align-items: center; gap: var(--space-8);
  padding: var(--space-8); border-radius: var(--radius-sm);
  color: var(--color-text); text-decoration: none; font-size: var(--step--1);
}
.mega__col a:hover { background: var(--color-action-soft); color: var(--color-text-brand); }
.mega__col a .icon { color: var(--color-text-brand); }
.mega__col--cta { background: var(--color-surface-sunken); border-radius: var(--radius-lg); padding: var(--space-24); }
.mega__col--cta p { font-size: var(--step--1); color: var(--color-text-muted); margin-bottom: var(--space-16); }
.mega__note { margin-top: var(--space-16); font-size: var(--step--2); }

/* mobile nav */
.mobilenav { display: none; margin-left: auto; position: relative; }
.mobilenav summary { list-style: none; }
.mobilenav summary::-webkit-details-marker { display: none; }
.mobilenav .mn-close { display: none; }
.mobilenav[open] .mn-open { display: none; }
.mobilenav[open] .mn-close { display: block; }
.mobilenav__panel {
  position: absolute; right: 0; top: calc(100% + var(--space-8)); z-index: 120;
  min-width: 16rem; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3); padding: var(--space-8);
  /* Eleven sections make this a long list on a short phone. */
  max-height: calc(100vh - 6rem); overflow-y: auto;
}
.mobilenav__list a {
  display: block; padding: var(--space-12); border-radius: var(--radius-sm);
  color: var(--color-text); text-decoration: none; font-weight: var(--fw-medium);
}
.mobilenav__list a:hover { background: var(--color-surface-sunken); }

@media (max-width: 68rem) {
  .hdr__nav, .hdr__pro, .hdr__login, .hdr-search { display: none; }
  .mobilenav { display: block; }
  .hdr__actions { margin-left: auto; }
}
@media (max-width: 30rem) {
  .hdr__actions .btn { display: none; }
}

/* ---------- footer ---------- */
.ftr { background: var(--color-surface-brand); color: var(--ink-100); margin-top: var(--space-96); }
.ftr .hdr__logo, .ftr .hdr__logo:hover { color: var(--stone-0); }
.ftr .brandmark { height: 3.25rem; }
.ftr__inner {
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: grid; grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: var(--space-40); padding-block: var(--space-80) var(--space-48);
}
.ftr__brand { max-width: 26rem; }
@media (max-width: 68rem) { .ftr__inner { grid-template-columns: repeat(2, 1fr); }
  .ftr__brand { grid-column: 1 / -1; } }
@media (max-width: 34rem) { .ftr__inner { grid-template-columns: 1fr; } }
.ftr__blurb { margin-top: var(--space-16); color: var(--ink-200); font-size: var(--step--1); }
.ftr__contact { margin-top: var(--space-24); display: flex; flex-direction: column; gap: var(--space-8); }
.ftr__contact a { display: inline-flex; align-items: center; gap: var(--space-8); color: var(--stone-0); text-decoration: none; font-weight: var(--fw-semibold); }
.ftr__contact a:hover { color: var(--gold-300); }
.ftr__col h2 { font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--ink-300); margin-bottom: var(--space-16); font-weight: var(--fw-bold); }
.ftr__col ul { display: grid; gap: var(--space-8); }
.ftr__col a { color: var(--ink-100); text-decoration: none; font-size: var(--step--1); }
.ftr__col a:hover { color: var(--stone-0); text-decoration: underline; }
.ftr__more { margin-top: var(--space-16); }
.ftr__more a { display: inline-flex; align-items: center; gap: var(--space-4); color: var(--gold-300); font-weight: var(--fw-semibold); font-size: var(--step--1); text-decoration: none; }
.ftr__legal {
  border-top: 1px solid var(--ink-900);
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: flex; flex-wrap: wrap; gap: var(--space-16); justify-content: space-between;
  padding-block: var(--space-24) var(--space-40); font-size: var(--step--2); color: var(--ink-200);
}
.ftr__legal ul { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.ftr__legal a { color: var(--ink-200); text-decoration: none; }
.ftr__legal a:hover { color: var(--stone-0); text-decoration: underline; }

/* ---------- hero ---------- */
.hero { background: var(--color-surface-brand); color: var(--color-text-on-brand); position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 40%;
  height: 70%; border-radius: 50%;
  background: radial-gradient(closest-side, oklch(0.62 0.11 75 / 0.22), transparent);
  pointer-events: none;
}
.hero__inner {
  width: min(100% - (var(--gutter) * 2), var(--wide-max)); margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(var(--space-32), 4vw, var(--space-80));
  align-items: center;
  padding-block: clamp(var(--space-48), 5vw, var(--space-96)) clamp(var(--space-64), 6vw, var(--space-128));
  position: relative; z-index: 1;
}
.hero__copy { max-width: 36rem; }
.hero h1 { color: var(--stone-0); }
.hero h1 em { font-style: normal; color: var(--gold-400); }
.hero__sub { margin-top: var(--space-24); font-size: var(--step-1); line-height: var(--lh-lead); color: var(--ink-100); max-width: 34rem; }
.hero__proof { margin-top: var(--space-32); display: grid; gap: var(--space-12); }
.hero__proof li { display: flex; gap: var(--space-12); align-items: flex-start; font-size: var(--step--1); color: var(--ink-100); }
.hero__proof .icon { color: var(--gold-400); margin-top: 3px; }
.hero__proof strong { color: var(--stone-0); font-weight: var(--fw-semibold); }
.hero__media { position: relative; }
.hero__media img { width: 100%; border-radius: var(--radius-xl); aspect-ratio: 4 / 5; object-fit: cover; }
/* The family photo has a child on a shoulder: keep heads in the 4:5 crop. */
.hero__media img.hero__img--top { object-position: 50% 20%; }
.hero__chip {
  position: absolute; left: calc(var(--space-24) * -1); bottom: var(--space-40);
  background: var(--color-surface); color: var(--color-text);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-4);
  padding: var(--space-16); display: flex; gap: var(--space-12); align-items: center;
  max-width: 17rem;
}
.hero__chip .icon { color: var(--color-success-fg); flex: none; }
.hero__chip p { font-size: var(--step--2); line-height: 1.4; color: var(--color-text-muted); }
.hero__chip strong { display: block; color: var(--color-text); font-size: var(--step--1); }
@media (max-width: 60rem) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { max-width: 26rem; }
  .hero__chip { left: auto; right: calc(var(--space-16) * -1); }
}
@media (max-width: 38rem) { .hero__chip { position: static; max-width: none; margin-top: var(--space-16); } }

/* ---------- search bar (hero) ---------- */
/* ---------- the hero's trade picker: the front door ---------- */
.tradepick { margin-top: var(--space-32); }
.tradepick__label {
  font-size: var(--step--1); font-weight: var(--fw-semibold); color: var(--stone-0);
  margin-bottom: var(--space-12);
}
.tradepick__grid {
  display: grid; gap: var(--space-8);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
}
.tradepick__grid li { list-style: none; }
.tradepick__tile {
  display: flex; align-items: center; gap: var(--space-8);
  padding: var(--space-12);
  min-height: 3rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid color-mix(in oklch, var(--stone-0) 26%, transparent);
  background: color-mix(in oklch, var(--stone-0) 8%, transparent);
  color: var(--stone-0); font-size: var(--step--1); font-weight: var(--fw-semibold);
  text-decoration: none; line-height: 1.2;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.tradepick__tile:hover {
  background: color-mix(in oklch, var(--stone-0) 18%, transparent);
  border-color: var(--gold-400); color: var(--stone-0);
}
.tradepick__tile:focus-visible { outline: 2.5px solid var(--gold-400); outline-offset: 2px; }
.tradepick__icon { color: var(--gold-400); display: flex; flex: none; }
.tradepick__tile--more { justify-content: center; color: var(--ink-100); }
.tradepick__more { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-12); }
.tradepick__more input[type="search"] { flex: 3 1 12rem; min-height: 3rem; }
.tradepick__more input[type="text"] { flex: 1 1 7rem; min-height: 3rem; }
.tradepick__more .btn { flex: 0 0 auto; }
@media (max-width: 30rem) {
  /* Two half-width inputs at phone size clip their own placeholders. */
  .tradepick__more input[type="search"], .tradepick__more input[type="text"] { flex: 1 1 100%; }
  .tradepick__more .btn { width: 100%; }
}

.searchbox {
  margin-top: var(--space-32);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-12); box-shadow: var(--shadow-4);
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr) auto; gap: var(--space-8);
  align-items: stretch;
}
.searchbox .field { margin: 0; }
.searchbox label { font-size: var(--step--2); }
.searchbox input, .searchbox select { min-height: 3rem; }
.searchbox .btn { min-height: 3rem; align-self: end; }
@media (max-width: 44rem) {
  .searchbox { grid-template-columns: 1fr; }
  .searchbox .btn { width: 100%; }
}
.searchbox__hint { margin-top: var(--space-12); font-size: var(--step--2); color: var(--ink-200);
  display: grid; grid-template-columns: 1.1rem 1fr; gap: var(--space-8); align-items: start; }
.searchbox__hint .icon { margin-top: 2px; }
.searchbox__hint .icon { color: var(--gold-400); }

/* ---------- forms ---------- */
.field { display: grid; gap: var(--space-8); }
.field + .field { margin-top: var(--space-24); }
.field > label, .fieldset__legend {
  font-size: var(--step--1); font-weight: var(--fw-semibold); color: var(--color-text);
}
.field__hint { font-size: var(--step--2); color: var(--color-text-muted); }
.field__error {
  font-size: var(--step--2); color: var(--color-danger-fg); font-weight: var(--fw-medium);
  display: none; align-items: center; gap: var(--space-4);
}
.field.is-invalid .field__error { display: flex; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--color-danger-fg); }
.field.is-valid input { border-color: var(--color-success-fg); }
input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
input[type="password"], input[type="date"], input[type="number"], select, textarea {
  width: 100%; padding: var(--space-12) var(--space-16); min-height: 2.875rem;
  background: var(--color-surface); color: var(--color-text);
  border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-sm);
  transition: border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out);
}
textarea { min-height: 8rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--color-text-subtle); }
input:hover, select:hover, textarea:hover { border-color: var(--color-text-subtle); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--color-action); box-shadow: 0 0 0 3px var(--color-action-soft); outline: none;
}
input:disabled, select:disabled, textarea:disabled { background: var(--color-surface-sunken); color: var(--color-text-subtle); cursor: not-allowed; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 1.15rem center, right 0.85rem center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: var(--space-40);
}
fieldset { border: 0; padding: 0; }
.fieldset__legend { display: block; margin-bottom: var(--space-12); }
.choice-grid { display: grid; gap: var(--space-12); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.choice {
  position: relative; display: flex; gap: var(--space-12); align-items: flex-start;
  padding: var(--space-16); border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer;
  transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out);
}
.choice:hover { border-color: var(--color-text-subtle); background: var(--color-surface-sunken); }
.choice input { margin-top: 3px; accent-color: var(--color-action); width: 1.15rem; height: 1.15rem; flex: none; }
.choice:has(input:checked) { border-color: var(--color-action); background: var(--color-action-soft); }
.choice:has(input:focus-visible) { outline: 2.5px solid var(--color-focus); outline-offset: 2px; }
.choice__label { font-weight: var(--fw-semibold); font-size: var(--step--1); display: block; }
.choice__hint { font-size: var(--step--2); color: var(--color-text-muted); margin-top: 2px; }
.choice .icon { color: var(--color-text-brand); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-12); margin-top: var(--space-32); align-items: center; }
.form-note { font-size: var(--step--2); color: var(--color-text-muted); display: flex; gap: var(--space-8); align-items: center; }
.form-note .icon { color: var(--color-success-fg); }

/* ---------- pro card ---------- */
.prolist { display: grid; gap: var(--space-16); }
.procard {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-24);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-24);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.procard:hover { box-shadow: var(--shadow-3); border-color: var(--color-border-strong); transform: translateY(-2px); }
.procard__name { font-size: var(--step-1); font-weight: var(--fw-bold); letter-spacing: -0.014em; }
.procard__name a { color: var(--color-text); text-decoration: none; }
.procard__name a::after { content: ""; position: absolute; inset: 0; }
.procard__body { position: relative; min-width: 0; }
.procard__meta { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); margin-top: var(--space-4); font-size: var(--step--1); color: var(--color-text-muted); }
.procard__meta span { display: inline-flex; align-items: center; gap: var(--space-4); }
.procard__rating { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-12); }
.procard__badges { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-16); }
.procard__quote {
  margin-top: var(--space-16); padding-left: var(--space-16);
  border-left: 3px solid var(--color-border-brand);
  font-size: var(--step--1); color: var(--color-text-muted); line-height: 1.5;
}
.procard__quote cite { display: block; margin-top: var(--space-8); font-style: normal; font-size: var(--step--2); color: var(--color-text-subtle); }
.procard__side {
  display: grid; gap: var(--space-12); align-content: start; justify-items: stretch;
  min-width: 11rem; position: relative; z-index: 1;
  border-left: 1px solid var(--color-border); padding-left: var(--space-24);
}
.procard__price { font-size: var(--step--2); color: var(--color-text-muted); }
.procard__price strong { display: block; font-size: var(--step-1); color: var(--color-text); font-variant-numeric: tabular-nums; }
@media (max-width: 54rem) {
  .procard { grid-template-columns: auto minmax(0, 1fr); }
  .procard__side { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--color-border); padding-top: var(--space-16); min-width: 0;
    grid-template-columns: 1fr 1fr; align-items: center; }
}
@media (max-width: 30rem) { .procard__side { grid-template-columns: 1fr; } }

/* ---------- category tiles ---------- */
.cattile {
  display: flex; flex-direction: column; gap: var(--space-12);
  padding: var(--space-24); border-radius: var(--radius-lg);
  background: var(--color-surface); border: 1px solid var(--color-border);
  text-decoration: none; color: var(--color-text);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.cattile:hover { border-color: var(--color-border-brand); transform: translateY(-3px); box-shadow: var(--shadow-2); color: var(--color-text); }
.cattile__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: var(--radius-md);
  background: var(--color-action-soft); color: var(--color-text-brand);
}
.cattile:hover .cattile__icon { background: var(--color-action-soft-hover); }
.cattile__name { font-weight: var(--fw-bold); font-size: var(--step-0); letter-spacing: -0.012em; }
.cattile__meta { font-size: var(--step--2); color: var(--color-text-subtle); margin-top: auto; padding-top: var(--space-8); font-variant-numeric: tabular-nums; }

.projcard { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.projcard img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.projcard__body { padding: var(--space-24); display: flex; flex-direction: column; gap: var(--space-8); flex: 1; }
.projcard__title { font-size: var(--step-1); font-weight: var(--fw-bold); letter-spacing: -0.014em; }
.projcard__title a { color: var(--color-text); text-decoration: none; }
.projcard__title a::after { content: ""; position: absolute; inset: 0; }
.projcard__foot { margin-top: auto; padding-top: var(--space-12); display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-12); font-size: var(--step--1); }
.projcard__price { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* ---------- steps / process ---------- */
.steps { counter-reset: step; display: grid; gap: var(--space-32); grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.step { position: relative; padding-top: var(--space-48); }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 2.5rem; border-radius: var(--radius-pill);
  display: grid; place-items: center;
  background: var(--color-accent); color: var(--color-text-on-accent);
  font-weight: var(--fw-heavy); font-size: var(--step--1); font-variant-numeric: tabular-nums;
}
.step h3 { font-size: var(--step-1); }
.step p { margin-top: var(--space-8); color: var(--color-text-muted); font-size: var(--step--1); }
.section--brand .step p { color: var(--ink-200); }

/* ---------- stat / fact row ---------- */
.facts { display: grid; gap: var(--space-24); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.fact { border-top: 3px solid var(--color-border-brand); padding-top: var(--space-16); }
.fact__k { font-size: var(--step-2); font-weight: var(--fw-heavy); letter-spacing: -0.02em; }
.fact__v { color: var(--color-text-muted); font-size: var(--step--1); margin-top: var(--space-4); }

/* ---------- filters ---------- */
.results { display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: var(--space-40); align-items: start; }
.results > *, .dash > *, .wizard > * { min-width: 0; }
@media (max-width: 62rem) { .results { grid-template-columns: 1fr; } }
/* The rail sticks beside the results. It can be taller than the window (a
   section list, a dozen cities, the trades), and a sticky box taller than the
   window hides its own lower half, so it scrolls within itself instead. */
.filters {
  position: sticky; top: calc(var(--header-h) + var(--space-16));
  max-height: calc(100vh - var(--header-h) - var(--space-32)); overflow-y: auto;
  overscroll-behavior: contain; padding-right: var(--space-4);
}
@media (max-width: 62rem) { .filters { position: static; max-height: none; overflow: visible; padding-right: 0; } }
.filters__group + .filters__group { margin-top: var(--space-24); padding-top: var(--space-24); border-top: 1px solid var(--color-border); }
.filters__group h3 { font-size: var(--step--1); font-weight: var(--fw-bold); margin-bottom: var(--space-12); }
.filters__list { display: grid; gap: var(--space-8); }
.checkline { display: flex; gap: var(--space-8); align-items: center; font-size: var(--step--1); cursor: pointer; padding: var(--space-4); border-radius: var(--radius-xs); }
.checkline:hover { background: var(--color-surface-sunken); }
.checkline input { accent-color: var(--color-action); width: 1.05rem; height: 1.05rem; }
.checkline__count { margin-left: auto; color: var(--color-text-subtle); font-size: var(--step--2); font-variant-numeric: tabular-nums; }
.results__bar {
  display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center;
  justify-content: space-between; margin-bottom: var(--space-24);
  padding-bottom: var(--space-16); border-bottom: 1px solid var(--color-border);
}
.results__count { font-weight: var(--fw-semibold); }
.results__sort { display: flex; align-items: center; gap: var(--space-8); font-size: var(--step--1); }
.results__sort select { min-height: 2.5rem; padding-block: var(--space-8); width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-4);
  padding: var(--space-4) var(--space-12); border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong); background: var(--color-surface);
  font-size: var(--step--2); font-weight: var(--fw-medium); color: var(--color-text);
  text-decoration: none; min-height: 2rem;
}
.chip:hover { border-color: var(--color-action); background: var(--color-action-soft); color: var(--color-text-brand); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--color-action); border-color: var(--color-action); color: var(--color-text-on-action); }
.empty-state { text-align: center; padding: var(--space-64) var(--space-24); border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg); }
.empty-state .icon { color: var(--color-text-subtle); margin-inline: auto; margin-bottom: var(--space-16); }

/* ---------- wizard ---------- */
.wizard { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-48); align-items: start; }
@media (max-width: 58rem) { .wizard { grid-template-columns: 1fr; gap: var(--space-24); } }
.wizard__rail { position: sticky; top: calc(var(--header-h) + var(--space-24)); display: grid; gap: var(--space-4); }
@media (max-width: 58rem) { .wizard__rail { position: static; grid-auto-flow: column; overflow-x: auto; gap: var(--space-8); padding-bottom: var(--space-8); } }
.wizard__step {
  display: flex; gap: var(--space-12); align-items: center; padding: var(--space-12);
  border-radius: var(--radius-sm); font-size: var(--step--1); color: var(--color-text-subtle);
  white-space: nowrap;
}
.wizard__step b { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong); font-size: var(--step--2); font-variant-numeric: tabular-nums; flex: none; }
.wizard__step.is-current { background: var(--color-action-soft); color: var(--color-text-brand); font-weight: var(--fw-semibold); }
.wizard__step.is-current b { border-color: var(--color-action); background: var(--color-action); color: var(--color-text-on-action); }
.wizard__step.is-done { color: var(--color-text-muted); }
.wizard__step.is-done b { border-color: var(--color-success-fg); color: var(--color-success-fg); }
.wizard__panel[hidden] { display: none; }
.wizard__progress { height: 4px; border-radius: var(--radius-pill); background: var(--color-surface-sunken); overflow: hidden; margin-bottom: var(--space-24); }
.wizard__progress span { display: block; height: 100%; background: var(--color-accent); border-radius: inherit;
  transition: width var(--dur-enter) var(--ease-signature); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--color-border); overflow-x: auto; }
.tabs button, .tabs a {
  padding: var(--space-12) var(--space-16); font-weight: var(--fw-semibold); font-size: var(--step--1);
  color: var(--color-text-muted); border-bottom: 2.5px solid transparent; white-space: nowrap; text-decoration: none;
}
.tabs button:hover, .tabs a:hover { color: var(--color-text); }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--color-text-brand); border-bottom-color: var(--color-action); }
.tabpanel[hidden] { display: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.table { font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: var(--space-12) var(--space-16); text-align: left; border-bottom: 1px solid var(--color-border); }
.table thead th { font-weight: var(--fw-bold); font-size: var(--step--2); text-transform: uppercase;
  letter-spacing: var(--tr-label); color: var(--color-text-subtle); white-space: nowrap; }
.table tbody th { font-weight: var(--fw-semibold); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--color-surface-sunken); }
.table td.num, .table th.num { text-align: right; }

/* ---------- rating breakdown ---------- */
.dims { display: grid; gap: var(--space-12); }
.dim { display: grid; grid-template-columns: 11rem 1fr auto; gap: var(--space-12); align-items: center; font-size: var(--step--1); }
@media (max-width: 34rem) { .dim { grid-template-columns: 1fr auto; } .dim__bar { grid-column: 1 / -1; } }
.dim__bar { height: 8px; border-radius: var(--radius-pill); background: var(--color-surface-sunken); overflow: hidden; }
.dim__bar span { display: block; height: 100%; background: var(--color-action); border-radius: inherit; }
.dim__val { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }

/* ---------- review ---------- */
.review { padding-block: var(--space-24); border-bottom: 1px solid var(--color-border); }
.review:last-child { border-bottom: 0; }
.review__head { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }
.review__who { font-weight: var(--fw-semibold); }
.review__meta { font-size: var(--step--2); color: var(--color-text-subtle); }
.review__body { margin-top: var(--space-12); color: var(--color-text-muted); }
.review__tags { margin-top: var(--space-12); display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.review__report { margin-left: auto; color: var(--color-text-muted); }

/* ---------- misc ---------- */
.breadcrumb { font-size: var(--step--2); color: var(--color-text-subtle); padding-block: var(--space-16); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: center; }
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-text); text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--space-8); color: var(--color-border-strong); }
.pagehead { padding-block: var(--space-32) var(--space-48); }
.pagehead--brand { background: var(--color-surface-brand); color: var(--color-text-on-brand); padding-block: var(--space-48) var(--space-64); }
.pagehead--brand .breadcrumb, .pagehead--brand .breadcrumb a { color: var(--ink-200); }
.pagehead--brand h1 { color: var(--stone-0); }
.pagehead--brand .lead { color: var(--ink-100); }
.callout {
  display: flex; gap: var(--space-16); padding: var(--space-24);
  border-radius: var(--radius-md); background: var(--color-info-bg); color: var(--color-info-fg);
}
.callout .icon { flex: none; }
.callout p { color: inherit; }
.callout--warn { background: var(--color-warning-bg); color: var(--color-warning-fg); }
.callout--ok { background: var(--color-success-bg); color: var(--color-success-fg); }
.callout strong { font-weight: var(--fw-bold); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: clamp(var(--space-32), 4vw, var(--space-64)); align-items: center; }
.split--media-first > :first-child { order: -1; }
.ratio-43 { aspect-ratio: 4 / 3; }
.ratio-32 { aspect-ratio: 3 / 2; }
.ratio-169 { aspect-ratio: 16 / 9; }
.rounded { border-radius: var(--radius-lg); overflow: hidden; }
.faq details {
  border-bottom: 1px solid var(--color-border); padding-block: var(--space-16);
}
.faq summary {
  display: flex; gap: var(--space-16); align-items: center; justify-content: space-between;
  font-weight: var(--fw-semibold); cursor: pointer; list-style: none; padding: var(--space-8) 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: var(--step-2); color: var(--color-text-brand); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > p, .faq details > ul { margin-top: var(--space-8); color: var(--color-text-muted); max-width: var(--prose-max); }
.kpi { display: grid; gap: var(--space-4); }
/* icon + text rows that must never break between the icon and its line */
.iconrow { display: grid; grid-template-columns: 2.5rem 1fr; gap: var(--space-16); align-items: start; }
.iconrow .cattile__icon { width: 2.5rem; height: 2.5rem; }
.pinrow { display: grid; grid-template-columns: 1.25rem 1fr; gap: var(--space-8); align-items: start; }
.pinrow .icon { margin-top: 3px; color: var(--color-text-brand); }
.pinrow, .filters dd, .filters dt { overflow-wrap: anywhere; }
.media-band { max-height: clamp(14rem, 26vw, 22rem); }
.media-band img { height: 100%; width: 100%; object-fit: cover; }
.kpi__v { font-size: var(--step-2); font-weight: var(--fw-heavy); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi__k { font-size: var(--step--2); text-transform: uppercase; letter-spacing: var(--tr-label); color: var(--color-text-subtle); }
.dash { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-40); align-items: start; }
.dash > * { min-width: 0; }
@media (max-width: 62rem) { .dash { grid-template-columns: 1fr; } }
.dashnav { display: grid; gap: 2px; position: sticky; top: calc(var(--header-h) + var(--space-16)); }
@media (max-width: 62rem) {
  .dashnav { position: static; grid-auto-flow: column; grid-auto-columns: max-content;
    overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--color-border); }
}
.dashnav a { display: flex; align-items: center; gap: var(--space-12); padding: var(--space-12); border-radius: var(--radius-sm);
  color: var(--color-text-muted); text-decoration: none; font-weight: var(--fw-medium); font-size: var(--step--1); white-space: nowrap; }
.dashnav a:hover { background: var(--color-surface-sunken); color: var(--color-text); }
.dashnav a[aria-current="true"] { background: var(--color-action-soft); color: var(--color-text-brand); font-weight: var(--fw-semibold); }
.timeline { display: grid; gap: var(--space-24); position: relative; padding-left: var(--space-32); }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--color-border); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: calc(var(--space-32) * -1); top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--color-surface); border: 3px solid var(--color-border-strong); }
.timeline li.is-done::before { border-color: var(--color-success-fg); background: var(--color-success-fg); }
.timeline li.is-current::before { border-color: var(--color-accent); background: var(--color-accent); }

/* ---------- motion ---------- */
/* Scroll reveal is CSS-only via a scroll-driven animation. Browsers without
   support simply show the content — nothing is ever hidden waiting for script. */
@keyframes reveal-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: reveal-in linear both;
      animation-timeline: view();
      animation-range: entry 2% cover 20%;
    }
  }
}
@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;
  }
  .reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
}
@media print {
  .hdr, .ftr, .demo-bar, .filters, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  /* scroll-driven reveals never run when printing, so force the end state */
  .reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; word-break: break-all; }
}

/* -------------------------------------------------- code, commands and paths
   Added for the application build: the preview-login notice quotes email
   addresses, and the admin console quotes shell commands. Long tokens wrap
   rather than pushing the page sideways at 320px, which is how they were
   overflowing the viewport before. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.875em;
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.1em 0.35em;
  overflow-wrap: anywhere;
}
pre.code {
  margin: 0;
  padding: var(--space-16);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
pre.code code {
  background: none;
  border: 0;
  padding: 0;
  overflow-wrap: normal;
  white-space: pre;
}

/* The dashboards and the wizard are grid children whose content can be wider
   than its track (a table, a long word). min-width:0 lets them shrink so the
   page does not scroll sideways on a phone. */
.dash > *,
.results > *,
.wizard > * { min-width: 0; }

/* An empty state is sometimes the only block under the page's h1, so its
   heading has to be an h2 to keep the heading order intact. It should look the
   same either way. */
.empty-state h2,
.empty-state h3 { font-size: var(--step-1); line-height: var(--lh-2); }

/* A native file input's intrinsic width is wider than a phone screen, and it
   drags its field — and the whole form — sideways with it. */
input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: var(--step--1);
}
input[type="file"]::file-selector-button {
  font: inherit;
  margin-right: var(--space-12);
  padding: var(--space-8) var(--space-12);
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--color-surface-sunken); }

/* -------------------------------------------------- the quote wizard's steps
   A horizontal progress rail. Each step is one of five real pages, so this is a
   list of where you are rather than a set of tabs — it is not interactive, and
   it does not pretend the later steps can be jumped to. */
.stepbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-12);
  align-items: center;
}
.stepbar__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  color: var(--color-text-muted);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
}
.stepbar__item b {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border-strong);
  font-size: var(--step--2);
  font-variant-numeric: tabular-nums;
  font-weight: var(--fw-bold);
}
.stepbar__item.is-current {
  background: var(--color-action-soft);
  border-color: var(--color-action);
  color: var(--color-text-brand);
  font-weight: var(--fw-semibold);
}
.stepbar__item.is-current b {
  background: var(--color-action);
  border-color: var(--color-action);
  color: var(--color-text-on-action);
}
.stepbar__item.is-done b {
  border-color: var(--color-success-fg);
  color: var(--color-success-fg);
}
@media (max-width: 40rem) {
  .stepbar { gap: var(--space-8); }
  .stepbar__item { padding: var(--space-4) var(--space-8); }
  /* On a phone the numbers carry the meaning and the words wrap badly. */
  .stepbar__item:not(.is-current) span:not(.sr-only) { display: none; }
}

/* ==========================================================================
   Application components
   --------------------------------------------------------------------------
   The preview build was a marketing site; these are the pieces the working
   application needs on top of it — message threads, notices, the match list,
   and the layout wrappers the dashboards use. Same tokens, same rules: colour
   only from the semantic layer, spacing only from the scale.
   ========================================================================== */

/* ---------- wrappers ---------- */
.wrap--narrow {
  width: min(100% - (var(--gutter) * 2), 48rem);
  margin-inline: auto;
}

/* ---------- cards ---------- */
.card--pad { padding: var(--space-24); }
.card--featured {
  border-color: var(--color-border-brand);
  box-shadow: var(--shadow-2, var(--shadow-1));
}

/* ---------- a row of buttons ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  align-items: center;
}

/* ---------- notices ----------
   One per page at most. The icon is decorative; the text carries the meaning,
   and the colour is confirmation rather than the only signal. */
.notice {
  display: flex;
  gap: var(--space-12);
  align-items: flex-start;
  padding: var(--space-16) var(--space-20);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken);
  color: var(--color-text);
  font-size: var(--step--1);
}
.notice .icon { flex: none; margin-top: 0.1em; }
.notice > div > * + * { margin-top: var(--space-8); }
.notice__list { margin-top: var(--space-8); padding-left: var(--space-20); }
.notice__list li { list-style: disc; margin-top: var(--space-4); }
.notice--info    { background: var(--color-info-bg);    border-color: var(--color-info-fg);    }
.notice--info .icon    { color: var(--color-info-fg); }
.notice--success { background: var(--color-success-bg); border-color: var(--color-success-fg); }
.notice--success .icon { color: var(--color-success-fg); }
.notice--warning { background: var(--color-warning-bg); border-color: var(--color-warning-fg); }
.notice--warning .icon { color: var(--color-warning-fg); }
.notice--error   { background: var(--color-danger-bg);  border-color: var(--color-danger-fg);  }
.notice--error .icon   { color: var(--color-danger-fg); }

/* ---------- a list with ticks ---------- */
.ticklist li {
  display: flex;
  gap: var(--space-12);
  align-items: flex-start;
}
.ticklist .icon { flex: none; margin-top: 0.15em; color: var(--color-success-fg); }

/* ---------- forms ---------- */
.req { color: var(--color-danger-fg); }
/* A radio with a line of explanation under it — used where the choice needs a
   sentence, such as how many contractors may see a request. */
.radioline {
  display: flex;
  gap: var(--space-12);
  align-items: flex-start;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--color-surface);
}
.radioline:hover { border-color: var(--color-border-strong); background: var(--color-surface-sunken); }
.radioline input { accent-color: var(--color-action); width: 1.05rem; height: 1.05rem; margin-top: 0.15em; flex: none; }
.radioline:has(input:checked) { border-color: var(--color-action); background: var(--color-action-soft); }
.radioline:has(input:focus-visible) { outline: 2.5px solid var(--color-focus); outline-offset: 2px; }

/* ---------- message threads ---------- */
.thread { display: grid; gap: var(--space-12); }
.msg {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  max-width: 44rem;
}
/* The homeowner's own messages sit to the right so a thread can be skimmed for
   who said what without reading the labels. */
.msg--homeowner { margin-left: auto; background: var(--color-action-soft); border-color: var(--color-border-brand); }
.msg__who { font-size: var(--step--2); font-weight: var(--fw-semibold); display: flex; gap: var(--space-8); align-items: baseline; }
.msg__who .subtle { font-weight: var(--fw-regular); }
.msg__body { font-size: var(--step--1); margin-top: var(--space-4); white-space: pre-wrap; }

/* ---------- a contractor in a match list ---------- */
.matchrow {
  display: flex;
  gap: var(--space-16);
  align-items: flex-start;
  padding: var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.matchrow p + p { margin-top: var(--space-4); }
.matchrow > * { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 30rem) { .matchrow { flex-wrap: wrap; } }

/* ---------- photos a reviewer attached ---------- */
.review__shots {
  display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-12);
}
.review__shots li { list-style: none; }
.review__shots a {
  display: block; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--color-border);
}
.review__shots a:hover { border-color: var(--color-action); }
.review__shots a:focus-visible { outline: 2.5px solid var(--color-focus); outline-offset: 2px; }
.review__shots img {
  display: block; width: 5rem; height: 5rem; object-fit: cover;
  background: var(--color-surface-sunken);
}

/* ---------- a contractor's reply to a review ---------- */
.review__reply {
  margin-top: var(--space-16);
  padding: var(--space-12) var(--space-16);
  border-left: 3px solid var(--color-border-brand);
  background: var(--color-surface-sunken);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--step--1);
}
.review__reply-who {
  display: flex; gap: var(--space-8); align-items: center;
  font-weight: var(--fw-semibold); color: var(--color-text-brand);
  margin-bottom: var(--space-4);
}

/* ---------- layout variants ---------- */
/* .dash puts its rail first. The application's dashboards are the other way
   round: the work is on the left and the summary rail on the right. */
.dash--aside { grid-template-columns: minmax(0, 1fr) 19rem; }
@media (max-width: 62rem) { .dash--aside { grid-template-columns: 1fr; } }
.split--wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 62rem) { .split--wide { grid-template-columns: 1fr; } }

/* ------------------------------------------------- a business's profile */
.bizmeta > span { display: inline-flex; align-items: center; gap: var(--space-4); }
.group-title { font-size: var(--step-1); margin-top: var(--space-32); margin-bottom: var(--space-16); }
.group-title:first-of-type { margin-top: 0; }
.hours { display: grid; gap: var(--space-4); font-size: var(--step--1); }
.hours__row { display: flex; justify-content: space-between; gap: var(--space-12); padding: var(--space-4); border-radius: var(--radius-xs); }
.hours__row dt { color: var(--color-text-muted); }
.hours__row dd { font-variant-numeric: tabular-nums; text-align: right; }
.hours__row.is-today { background: var(--color-surface-sunken); font-weight: var(--fw-semibold); }
.hours__row.is-today dt { color: var(--color-text); }
.menu { display: grid; gap: var(--space-32); margin-top: var(--space-24); }
.menu__group h3 { font-size: var(--step-0); padding-bottom: var(--space-8); border-bottom: 1px solid var(--color-border); }
.menu__item { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4) var(--space-16); padding: var(--space-12) 0; border-bottom: 1px solid var(--color-border); }
.menu__name { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.menu__price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu__desc { grid-column: 1 / -1; color: var(--color-text-muted); font-size: var(--step--1); }
.hours-edit { display: grid; gap: var(--space-8); }
.hours-edit__row { display: grid; grid-template-columns: 6rem 1fr 1fr auto; gap: var(--space-12); align-items: center; }
.menu-box { width: 100%; font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--step--1); }
@media (max-width: 34rem) {
  .hours-edit__row { grid-template-columns: 1fr 1fr; }
  .hours-edit__row > strong, .hours-edit__row > .checkline { grid-column: span 2; }
}
