/* GavelBook — site styles. Mobile first; wider screens adjust at 760px and 1040px. */

:root {
  --ink: #1D1D1B;
  --gold: #E2B240;
  --gold-soft: #F6E7BF;
  --teal: #0F5257;
  --teal-hover: #0A3D41;
  --slate: #545D6B;
  --mist: #EEF0F3;
  --line: #DCDFE5;
  --paper: #FFFFFF;
  --danger: #A3261B;
  --radius-s: 6px;
  --radius-m: 12px;
  --gutter: 16px;
  --max: 1080px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--teal-hover); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ── Header ───────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.brand .mark { width: 32px; height: 32px; color: var(--gold); }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 8px 8px; border-radius: var(--radius-s); }
.site-nav a:hover { background: var(--mist); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ── Buttons & fields ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--radius-s);
  background: var(--ink); color: #fff; font: inherit; font-weight: 650; font-size: 1rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #3a3a37; color: #fff; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 0.9rem; }

.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, .field legend { display: block; font-weight: 650; margin-bottom: 6px; padding: 0; }
.opt { font-weight: 400; color: var(--slate); }
.hint { display: block; color: var(--slate); font-size: 0.875rem; line-height: 1.45; margin: 6px 0 0; font-weight: 400; }
input[type="text"], input:not([type]), input[type="email"], select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid #B9BEC8; border-radius: var(--radius-s);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(15, 82, 87, 0.22); }
input[aria-invalid="true"] { border-color: var(--danger); }
.money { display: flex; align-items: center; border: 1.5px solid #B9BEC8; border-radius: var(--radius-s); padding-left: 12px; background: var(--paper); }
.money:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 82, 87, 0.22); }
.money span { color: var(--slate); font-weight: 600; }
.money input { border: 0; box-shadow: none !important; padding-left: 6px; font-variant-numeric: tabular-nums; }

/* Yes/no switches */
.toggle-field { margin-bottom: 0; border-top: 1px solid var(--line); }
.toggle-field:last-of-type { border-bottom: 1px solid var(--line); }
.field > label.toggle, .toggle { display: flex; margin: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; cursor: pointer; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; display: inline-block; position: relative; width: 50px; height: 30px; border-radius: 15px; background: #C5CAD3; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.toggle input:checked + .switch { background: var(--teal); }
.toggle input:checked + .switch::after { transform: translateX(20px); }
.toggle input:focus-visible + .switch { outline: 3px solid var(--teal); outline-offset: 2px; }
.toggle-text .hint { margin-top: 2px; }
.toggle-field + .field:not(.toggle-field) { margin-top: 18px; }

/* Segmented choice */
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 10px; border: 1.5px solid #B9BEC8; border-radius: var(--radius-s); font-weight: 600; cursor: pointer; text-align: center; }
.seg input:checked + span { border-color: var(--teal); background: var(--teal); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ── Home ─────────────────────────────────────────────── */
.hero { padding: 36px 0 28px; }
.hero h1 { font-size: clamp(2.4rem, 9vw, 4.25rem); font-weight: 800; letter-spacing: -0.035em; max-width: 12ch; margin-bottom: 0.3em; }
.lede { font-size: 1.15rem; color: #34383F; max-width: 36em; }
.zip-inline { margin-top: 22px; max-width: 30rem; }
.zip-inline label { display: block; font-weight: 650; margin-bottom: 6px; }
.zip-row { display: flex; gap: 8px; }
.zip-row input { flex: 1; min-width: 0; font-variant-numeric: tabular-nums; }
.zip-row .btn { flex: none; }

.quick { margin-top: 22px; }
.quick p { font-size: 0.92rem; font-weight: 600; color: var(--slate); margin: 0 0 8px; }
.example {
  display: flex; flex-direction: column; margin-top: 28px; padding: 20px 18px;
  background: var(--mist); border-radius: var(--radius-m); text-decoration: none; color: var(--ink);
}
.example:hover { color: var(--ink); background: #E7EAEE; }
.example-label { font-size: 0.85rem; font-weight: 650; color: var(--slate); }
.example-title { font-weight: 600; margin: 4px 0 12px; line-height: 1.35; }
.example .range-figure { font-size: 2.1rem; margin-bottom: 12px; }
.example .band { display: block; }
.example .band-fill { display: block; }
.example-cta { color: var(--teal); font-weight: 650; margin-top: 10px; text-decoration: underline; text-underline-offset: 0.18em; }
.recent { margin-bottom: 8px; }
.recent h2 { font-size: 1.05rem; margin-bottom: 10px; }
.recent-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.recent-list a { display: block; white-space: nowrap; text-decoration: none; color: var(--ink); background: var(--mist); border-radius: var(--radius-s); padding: 9px 12px; font-size: 0.92rem; }
.recent-list a strong { display: block; font-variant-numeric: tabular-nums; }

.services { padding-top: 12px; }
.cat { margin: 26px 0 0; }
.cat h3 { font-size: 0.95rem; font-weight: 700; color: var(--slate); margin: 0 0 4px; letter-spacing: 0; }
.price-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink);
}
.price-row:hover { background: #FAFAF7; color: var(--ink); }
.price-row:hover .row-name { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-name { font-weight: 650; font-size: 1.05rem; }
.row-blurb { color: var(--slate); font-size: 0.875rem; line-height: 1.4; margin-top: 2px; }
.row-price { flex: none; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.price-row.is-request .row-price { font-weight: 600; }
.req-label { color: var(--teal); font-size: 0.92rem; }
.req-count { color: var(--slate); font-size: 0.78rem; font-weight: 500; }

.how { padding: 44px var(--gutter) 8px; }
.how h2, .reads h2 { font-size: 1.5rem; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 16px; }
.steps li { counter-increment: s; position: relative; padding-left: 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--ink); font-weight: 800; display: grid; place-items: center; }
.how-note { color: var(--slate); font-size: 0.95rem; margin-top: 18px; max-width: 42em; }
.reads { padding-top: 28px; padding-bottom: 48px; }
.read-list { margin: 0; padding-left: 1.2em; }
.read-list li { margin: 6px 0; }

/* ── Service page ─────────────────────────────────────── */
.service-page { padding-top: 14px; padding-bottom: 48px; }
.back { margin: 0 0 12px; font-size: 0.95rem; }
.back a::before { content: "‹ "; }
.service-cat { color: var(--slate); font-weight: 600; font-size: 0.9rem; margin: 0 0 4px; }
.service-head h1 { font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 0.25em; }
.service-blurb { color: #34383F; font-size: 1.1rem; max-width: 34em; }
.estimate-grid { display: grid; gap: 22px; margin-top: 10px; }

.result { background: var(--mist); border-radius: var(--radius-m); padding: 20px 18px; scroll-margin-top: 12px; }
.result-prompt { margin: 0; color: var(--slate); font-weight: 500; }
.result.is-loading .result-body { opacity: 0.45; transition: opacity 0.15s; }
.result-label { font-size: 0.95rem; color: var(--slate); font-weight: 600; margin: 0 0 4px; }
.range-figure { font-size: clamp(2.1rem, 9vw, 2.9rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 0 0 14px; }
.range-figure .dash { color: var(--slate); font-weight: 500; padding: 0 0.12em; }

/* The estimate band: where the range sits, measured from $0. */
.band { position: relative; height: 14px; background: #D9DDE4; border-radius: 7px; margin: 0 0 6px; overflow: hidden; }
.band-fill { position: absolute; top: 0; bottom: 0; background: var(--gold); border-radius: 7px; transition: left 0.35s ease, width 0.35s ease; }
.band-mid { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); border-radius: 2px; transition: left 0.35s ease; }
.band-gap { height: 12px; }
.band-scale { display: flex; justify-content: space-between; color: var(--slate); font-size: 0.8rem; font-variant-numeric: tabular-nums; margin-bottom: 16px; }
.result-text { font-size: 0.98rem; }
.result-text h3 { font-size: 1rem; margin: 18px 0 6px; }
.includes { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.includes li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; font-size: 0.86rem; }
.fine { color: var(--slate); font-size: 0.88rem; line-height: 1.5; }
.fine ul { margin: 6px 0 0; padding-left: 1.1em; }
.alt-figure { font-weight: 750; font-variant-numeric: tabular-nums; font-size: 1.25rem; margin: 0 0 4px; }
.chapter { border-top: 1px solid #CDD2DA; padding-top: 14px; margin-top: 14px; }
.chapter:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.chapter h3 { margin: 0 0 2px; font-size: 1.1rem; }
.chapter .sub { color: var(--slate); font-size: 0.9rem; margin: 0 0 6px; }
.result-msg { color: var(--danger); font-weight: 600; margin-top: 10px; }
.challenge { margin-top: 12px; }
.form-note { color: var(--slate); font-size: 0.875rem; margin-top: 18px; }
.questions { min-width: 0; }

.sticky-range {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff; font-variant-numeric: tabular-nums;
  transform: translateY(110%); transition: transform 0.2s ease;
}
.sticky-range.is-shown { transform: none; }
.sticky-range strong { font-size: 1.15rem; }
.sticky-range button { background: transparent; color: var(--gold); border: 0; font: inherit; font-weight: 650; cursor: pointer; padding: 8px 0; }

.request-panel { background: var(--mist); border-radius: var(--radius-m); padding: 22px 18px; margin-top: 12px; max-width: 40rem; }
.request-panel h2 { font-size: 1.35rem; }
.form-msg { margin: 14px 0 0; font-weight: 600; }
.form-msg.is-error { color: var(--danger); }
.form-msg.is-done { color: var(--teal); }

.explore { margin-top: 36px; }
.explore h2 { font-size: 1.15rem; }
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; text-decoration: none; color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 550; font-size: 0.93rem; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-request { color: var(--slate); }
.disclaimer-line { color: var(--slate); font-size: 0.88rem; margin-top: 28px; max-width: 46em; }

/* ── Articles & long text ─────────────────────────────── */
.prose-wrap { padding-top: 24px; padding-bottom: 56px; }
.prose { max-width: 40rem; }
.prose h1 { font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.12rem; margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.prose details:first-of-type { border-top: 2px solid var(--ink); margin-top: 18px; }
.prose summary { cursor: pointer; font-weight: 650; padding: 12px 32px 12px 0; list-style: none; position: relative; }
.prose summary::-webkit-details-marker { display: none; }
.prose summary::after { content: "+"; position: absolute; right: 4px; top: 8px; font-size: 1.4rem; font-weight: 500; color: var(--teal); }
.prose details[open] summary::after { content: "\2212"; }
.prose details[open] summary { color: var(--teal); }
.next-read { margin-top: 2em; font-weight: 650; }
.article-list { list-style: none; margin: 8px 0 0; padding: 0; max-width: 40rem; border-top: 2px solid var(--ink); }
.article-list a { display: flex; flex-direction: column; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.a-title { font-weight: 700; font-size: 1.15rem; }
.a-desc { color: #34383F; margin-top: 2px; }
.a-time { color: var(--slate); font-size: 0.85rem; margin-top: 4px; }
.article-list a:hover .a-title { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

/* ── Footer & cookie notice ───────────────────────────── */
.site-footer { background: var(--ink); color: #E4E5E8; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); }
.site-footer a { color: #fff; }
.footer-note { max-width: 44em; font-size: 0.95rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0; }
.copyright { color: #A9ADB5; font-size: 0.85rem; margin: 0; }
.cookie-notice {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
  display: flex; align-items: center; gap: 14px; max-width: 34rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 12px 14px; box-shadow: 0 6px 24px rgba(29, 29, 27, 0.16); font-size: 0.9rem;
}
.cookie-notice p { margin: 0; }

/* ── Admin ────────────────────────────────────────────── */
.admin { padding-top: 20px; padding-bottom: 56px; }
.admin h1 { font-size: 1.8rem; }
.admin h2 { font-size: 1.2rem; margin-top: 30px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--mist); border-radius: var(--radius-s); padding: 12px 14px; }
.stat b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--slate); font-size: 0.85rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.93rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 650; color: var(--slate); }
.tbl td.num, .tbl th.num { text-align: right; }
.bar { display: inline-block; height: 8px; background: var(--gold); border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.tbl-wrap { overflow-x: auto; }
.notice { background: #FFF7E0; border: 1px solid var(--gold); border-radius: var(--radius-s); padding: 12px 14px; }

/* ── Wider screens ────────────────────────────────────── */
@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .site-nav a { padding: 8px 12px; }
  .hero { padding: 64px 0 36px; }
  .hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: center; }
  .example { margin-top: 0; padding: 28px 26px; }
  .services { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: start; }
  .services .cat { margin-top: 30px; }
  .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .stat-row { grid-template-columns: repeat(4, 1fr); }
  .result { padding: 26px 26px; }
  .request-panel { padding: 28px 28px; }
  .sticky-range { display: none; }
}
@media (min-width: 1040px) {
  .estimate-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 44px; align-items: start; }
  .estimate-grid .result { order: 2; position: sticky; top: 20px; }
  .estimate-grid .questions { order: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
