/* Replacement Programs — light theme, Poppins everywhere.
   Tokens are the only place colors live; build.js fills them from config.json. */
:root {
  --ink: #161A1F;
  --muted: #5B636E;
  --paper: #F6F4EE;
  --surface: #FFFFFF;
  --line: #E2DDD3;
  --accent: #1E5F4E;
  --accent-soft: #E4F0EB;
  --red: #D62A3A;
  --red-hover: #B9202F;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(22, 26, 31, .04), 0 10px 30px -12px rgba(22, 26, 31, .16);
  --max: 1180px;
  --gutter: 24px;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); text-wrap: balance; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.eyebrow::before { content: ''; width: 22px; height: 2px; background: var(--accent); border-radius: 2px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid rgba(30, 95, 78, .45); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-weight: 700; font-size: 1.02rem; line-height: 1;
  padding: 16px 22px; border-radius: var(--radius); border: 0; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hover); }
.btn-red:active { transform: translateY(1px); }
.btn-red .arrow { width: 18px; height: 18px; flex: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-pending { background: #EEECE6; color: var(--muted); cursor: default; font-weight: 600; }
.btn-pending:hover { text-decoration: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(246, 244, 238, .92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 36px; height: 36px; flex: none; }
.brand b { color: var(--accent); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); font-weight: 500; font-size: .95rem; padding: 8px 12px; border-radius: 6px; }
.nav a:hover { background: #ECE9E1; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-cta { margin-left: 8px; padding: 11px 16px !important; font-size: .92rem; }
.menu-btn { display: none; background: none; border: 1.5px solid var(--line); border-radius: 6px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 72px; flex-direction: column; align-items: stretch; background: var(--paper); border-bottom: 1px solid var(--line); padding: 10px var(--gutter) 18px; }
  .nav.open { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; }
  .nav-cta { margin: 8px 0 0; }
}

/* ---------- Hero (centered stack: eyebrow, headline, lead, ZIP card, then the photos) ---------- */
.hero { padding: 56px 0 24px; }
.hero-stack { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-stack h1 { max-width: 20ch; }
.hero-stack .lead { margin: 0 auto 28px; max-width: 60ch; }
.hero-stack .finder { width: 100%; max-width: 660px; text-align: left; }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; margin-top: 56px; }
.mosaic a { position: relative; display: block; border-radius: 14px; overflow: hidden; background: #DDD8CE; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.mosaic a:nth-child(even) { transform: translateY(24px); }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.mosaic a:hover img { transform: scale(1.04); }
.mosaic .tag { position: absolute; left: 12px; bottom: 12px; background: rgba(255, 255, 255, .94); color: var(--ink); font-weight: 600; font-size: .8rem; padding: 6px 10px; border-radius: 6px; letter-spacing: .01em; }
@media (max-width: 960px) {
  .hero { padding: 36px 0 16px; }
  .mosaic { grid-template-columns: repeat(2, 1fr); margin-top: 36px; }
  .mosaic a:nth-child(even) { transform: none; }
}

/* ---------- Finder ---------- */
.finder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.finder .step { display: flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.finder .step em { font-style: normal; color: var(--accent); font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font: inherit; font-weight: 600; font-size: .92rem; color: var(--ink); transition: border-color .15s, background .15s; }
.tile svg { width: 30px; height: 30px; color: var(--muted); }
.tile:hover { border-color: #B9B3A6; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.tile[aria-pressed="true"] svg { color: var(--accent); }
.zip-row { display: flex; gap: 10px; }
.zip-row input {
  flex: 1; min-width: 0; font: inherit; font-weight: 600; font-size: 1.25rem; letter-spacing: .12em;
  padding: 0 18px; height: 56px; border: 1.5px solid var(--line); border-radius: var(--radius); background: #FBFAF7; color: var(--ink);
}
.zip-row input::placeholder { color: #A6A199; font-weight: 500; letter-spacing: .02em; }
.zip-row input:focus { border-color: var(--accent); background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(30, 95, 78, .12); }
.zip-row .btn { height: 56px; padding: 0 24px; }
.place { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-top: 12px; font-weight: 500; color: var(--accent); font-size: .98rem; }
.place svg { width: 18px; height: 18px; flex: none; }
.place[data-state="error"] { color: var(--red); }
.place[data-state="idle"] { color: var(--muted); font-weight: 400; }
.place[data-state="loading"] { color: var(--muted); }
.finder .fine { margin: 14px 0 0; font-size: .82rem; color: var(--muted); }
@media (max-width: 560px) {
  .finder { padding: 20px 18px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .zip-row { flex-direction: column; }
  .zip-row .btn { width: 100%; }
}

/* ---------- Ledger (project types) ---------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-head p { margin: 0; max-width: 52ch; }
.ledger { border-top: 1px solid var(--line); }
.ledger-row { display: grid; grid-template-columns: 64px 180px 1fr auto; gap: 28px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--line); }
.ledger-row .n { font-weight: 700; font-size: 1.6rem; color: #C9C3B7; letter-spacing: -0.03em; }
.ledger-row .thumb { border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; background: #DDD8CE; }
.ledger-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ledger-row h3 { margin-bottom: 4px; }
.ledger-row p { margin: 0; color: var(--muted); max-width: 60ch; }
.ledger-row .go { font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.ledger-row .go svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .section-head { flex-direction: column; align-items: start; gap: 10px; }
  .section { padding: 48px 0; }
  .ledger-row { grid-template-columns: 110px 1fr; gap: 16px; }
  .ledger-row .n { display: none; }
  .ledger-row .go { grid-column: 2; }
}

/* ---------- Steps band ---------- */
.band { background: var(--accent); color: #fff; padding: 64px 0; }
.band h2, .band h3 { color: #fff; }
.band .eyebrow { color: #BFE3D5; }
.band .eyebrow::before { background: #BFE3D5; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 12px; }
.step-card { border-top: 2px solid rgba(255, 255, 255, .28); padding-top: 18px; }
.step-card .num { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: #BFE3D5; margin-bottom: 12px; }
.step-card p { color: rgba(255, 255, 255, .84); margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 22px; } }

/* ---------- Split (FAQ / answers) ---------- */
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; }
.split .sticky { position: sticky; top: 96px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; font-weight: 600; font-size: 1.05rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 500; font-size: 1.4rem; color: var(--muted); flex: none; width: 28px; text-align: center; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 18px; max-width: 64ch; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 24px; } .split .sticky { position: static; } }

/* ---------- Disclosure ---------- */
.disclosure { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 22px; font-size: .92rem; color: var(--muted); }
.disclosure strong { color: var(--ink); }

/* ---------- Vertical page ---------- */
.vhero { padding: 48px 0 24px; }
.vhero .photo { width: 100%; margin-top: 48px; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 21 / 9; box-shadow: var(--shadow); background: #DDD8CE; }
.vhero .photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 960px) { .vhero { padding: 36px 0 16px; } .vhero .photo { aspect-ratio: 4 / 3; margin-top: 32px; } }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 40px; border-top: 1px solid var(--line); }
.feature { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 28px 1fr; gap: 14px; }
.feature .check { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.feature .check svg { width: 14px; height: 14px; }
.feature h3 { font-size: 1.05rem; margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .96rem; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.signs { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.signs li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-weight: 500; display: flex; gap: 10px; align-items: start; }
.signs li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-top: 9px; }
@media (max-width: 640px) { .signs { grid-template-columns: 1fr; } }

/* ---------- Results (offer wall) ---------- */
.results-head { padding: 40px 0 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.crumbs a { color: var(--muted); }
.crumbs span { color: #B4AEA2; }
.results-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); max-width: 22ch; }
.results-head .sub { color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.results-head .sub svg { width: 18px; height: 18px; color: var(--accent); }
.tabs { display: flex; gap: 6px; margin-top: 26px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 12px 16px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.results { display: grid; grid-template-columns: 1fr 320px; gap: 40px; padding: 32px 0 64px; align-items: start; }
.aside { position: sticky; top: 96px; display: grid; gap: 18px; }
.aside .finder { padding: 20px; box-shadow: none; }
.aside .finder .tiles { grid-template-columns: repeat(2, 1fr); }
.aside .note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; font-size: .92rem; color: var(--muted); }
.aside .note h3 { font-size: 1rem; margin-bottom: 8px; }
.aside .note ul { margin: 0; padding-left: 18px; }
.aside .note li { margin-bottom: 4px; }
@media (max-width: 960px) { .results { grid-template-columns: 1fr; } .aside { position: static; } }
.wall { display: grid; gap: 14px; }
.wall-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; margin-bottom: 4px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; display: grid; grid-template-columns: 44px 1fr auto; gap: 20px; align-items: center; transition: border-color .15s, box-shadow .15s; }
.offer:hover { border-color: #C9C3B7; box-shadow: var(--shadow); }
.offer .rank { width: 44px; height: 44px; border-radius: 10px; background: var(--paper); color: var(--muted); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.offer.top .rank { background: var(--accent); color: #fff; }
.offer h3 { margin: 0 0 4px; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.offer .badge { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 4px 8px; border-radius: 4px; }
.offer .tag { margin: 0 0 10px; color: var(--muted); font-size: .96rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-size: .8rem; font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 4px 9px; border-radius: 999px; }
.offer .cta { display: grid; gap: 6px; justify-items: end; }
.offer .cta small { color: var(--muted); font-size: .78rem; }
@media (max-width: 640px) {
  .offer { grid-template-columns: 1fr; padding: 18px; }
  .offer .rank { display: none; }
  .offer .cta { justify-items: stretch; }
  .offer .cta .btn { width: 100%; }
}
.notice { background: #FFF6E5; border: 1px solid #F1DDB0; color: #6B4E0F; border-radius: var(--radius); padding: 14px 18px; font-size: .95rem; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); }
.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); height: 118px; position: relative; overflow: hidden; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .04), transparent); animation: sh 1.2s infinite; }
@keyframes sh { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- Prose (legal, contact) ---------- */
.prose { max-width: 760px; padding: 48px 0 72px; }
.prose h1 { margin-bottom: .3em; }
.prose h2 { font-size: 1.35rem; margin-top: 1.8em; }
.prose p, .prose li { color: #3E454E; }
.prose .updated { color: var(--muted); font-size: .9rem; margin-bottom: 2em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #EFECE4; padding: 48px 0 28px; margin-top: 24px; font-size: .92rem; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h4 { font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: var(--ink); }
.foot-grid .brand { margin-bottom: 12px; }
.foot-grid .about { color: var(--muted); max-width: 40ch; }
.foot-legal { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 18px; color: var(--muted); font-size: .84rem; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .foot-grid { grid-template-columns: 1fr; } }
