/* Groundline design system — dark-first.
   The visual language is a modern instrument panel over survey ink: deep
   charcoal surfaces, one luminous violet accent, hairline borders, and tables
   meant to be read. Every colour still has a semantic job; the glow is
   reserved for the few things that deserve attention (CTAs, the accent phrase,
   the value a metric exists to show). The site map keeps a light "plan sheet"
   background because survey linework is drawn in ink and must stay legible. */

:root {
  --ink: #e9eef5;
  --graphite: #aab6c3;
  --muted: #7e8a97;
  --line: rgba(148, 163, 184, 0.16);
  --line-soft: rgba(148, 163, 184, 0.09);
  --surface: #0e141d;
  --surface-alt: #131b26;
  --paper: #080c12;
  --card: #0e1620;

  --primary: #8b5cf6;
  --primary-dark: #a78bfa;
  --primary-soft: rgba(139, 92, 246, 0.14);
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent: #f0a35c;
  --accent-soft: rgba(240, 163, 92, 0.13);
  --positive: #4ade80;
  --positive-soft: rgba(74, 222, 128, 0.12);
  --caution: #fbbf24;
  --caution-soft: rgba(251, 191, 36, 0.12);
  --negative: #f87171;
  --negative-soft: rgba(248, 113, 113, 0.13);

  --grad: linear-gradient(96deg, #c4b5fd 0%, #a78bfa 45%, #8b5cf6 100%);
  --btn-grad: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 60%, #a78bfa 100%);

  --radius: 9px;
  --radius-lg: 15px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 32px rgba(0, 0, 0, 0.3);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --measure: 68ch;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 18% -8%, rgba(139, 92, 246, 0.10), transparent 60%),
    radial-gradient(900px 420px at 88% -12%, rgba(96, 165, 250, 0.05), transparent 55%),
    var(--paper);
  font-feature-settings: "tnum" 1;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 .5em; letter-spacing: -0.02em; }
h1 { font-size: 2.1rem; font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 750; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
small { font-size: .82rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
::selection { background: rgba(139, 92, 246, 0.3); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }

/* Gradient accent phrase — one per page, in the headline. */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- header ------------------------------------------------------------ */
.masthead {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  position: sticky; top: 0; z-index: 50;
}
.masthead-inner { display: flex; align-items: center; gap: 26px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); font-size: 1.06rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 21px; height: 21px; flex: none; color: var(--primary); }
.nav { display: flex; gap: 18px; align-items: center; margin-left: auto; font-size: .9rem; }
.nav a { color: var(--graphite); }
.nav a:hover { color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--primary); font-weight: 650; }
.nav a.btn, .nav .btn { color: #ffffff; }

/* --- banners ----------------------------------------------------------- */
.demo-banner {
  background: var(--caution-soft); color: var(--caution);
  border-bottom: 1px solid var(--line);
  font-size: .8rem; padding: 7px 12px; text-align: center;
}
.live-banner { background: var(--primary-soft); color: var(--primary-dark); }
.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: .92rem; border: 1px solid; }
.flash-error { background: var(--negative-soft); border-color: var(--negative); color: var(--negative); }
.flash-ok { background: var(--positive-soft); border-color: var(--positive); color: var(--positive); }
.flash-info { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

/* --- buttons and forms -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  background: var(--btn-grad); color: #ffffff; font-weight: 700; font-size: .92rem;
  cursor: pointer; font-family: inherit; text-decoration: none;
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 8px 24px rgba(124, 58, 237, 0.3);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.4), 0 10px 30px rgba(124, 58, 237, 0.4); }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(148, 163, 184, 0.06); color: var(--ink); border-color: var(--line);
  box-shadow: none;
}
.btn-secondary:hover { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.35); filter: none; box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: .84rem; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

label { display: block; font-size: .84rem; font-weight: 600; color: var(--graphite); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 13px; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}
.field { margin-bottom: 16px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.searchbar { display: flex; gap: 10px; }
.searchbar input { flex: 1; padding: 14px 18px; font-size: 1.02rem; border-radius: 12px; }

/* --- layout primitives -------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; }
/* Right-heavy split, for when the richer table sits on the right. */
.split-rev { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 24px; }
/* Fixed-count grids: auto-fit leaves orphan cards when the count is a poor
   match for the container width; these keep 2×2 / 3×3 compositions intact. */
.grid-2-max { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3-max { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .split, .split-rev { grid-template-columns: 1fr; }
  .grid-3-max { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) { .grid-2-max, .grid-3-max { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.045), rgba(148, 163, 184, 0.012)), var(--card);
  padding: 20px;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: rgba(148, 163, 184, 0.28); }
.card-tight { padding: 14px 16px; }
.card h3 { margin-bottom: .4em; }
.section { padding: 46px 0; border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: none; }

/* --- metrics ------------------------------------------------------------ */
.metric {
  border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.015)), var(--card);
  position: relative; overflow: hidden;
}
.metric::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--primary); opacity: .85;
}
.metric.positive::before { background: var(--positive); }
.metric.negative::before { background: var(--negative); }
.metric.caution::before { background: var(--caution); }
.metric .label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 750; }
.metric .value { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.metric.positive .value { color: var(--positive); }
.metric.negative .value { color: var(--negative); }
.metric.caution .value { color: var(--caution); }
.metric .note { font-size: .76rem; color: var(--muted); margin-top: 4px; }

/* --- tables ------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
th { background: var(--surface-alt); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--graphite); font-weight: 750; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: rgba(148, 163, 184, 0.05); }

/* --- pills and labels --------------------------------------------------- */
.pill {
  display: inline-block; padding: 2.5px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid transparent;
}
.pill-verified, .pill-high, .pill-permitted, .pill-likely_fits { background: var(--positive-soft); color: var(--positive); border-color: rgba(74, 222, 128, 0.25); }
.pill-medium { background: var(--primary-soft); color: var(--primary-dark); border-color: rgba(139, 92, 246, 0.25); }
.pill-estimated, .pill-low, .pill-conditional, .pill-fits_with_modification, .pill-accessory { background: var(--caution-soft); color: var(--caution); border-color: rgba(251, 191, 36, 0.25); }
.pill-official_determination_required, .pill-requires_variance, .pill-special_exception { background: var(--accent-soft); color: var(--accent); border-color: rgba(240, 163, 92, 0.25); }
.pill-user_supplied, .pill-not_addressed, .pill-insufficient_data { background: rgba(148, 163, 184, 0.1); color: var(--graphite); border-color: rgba(148, 163, 184, 0.2); }
.pill-prohibited, .pill-does_not_fit { background: var(--negative-soft); color: var(--negative); border-color: rgba(248, 113, 113, 0.25); }

/* --- evidence ----------------------------------------------------------- */
details.evidence { border: 1px solid var(--line); border-radius: 11px; margin: 10px 0; background: var(--surface); }
details.evidence > summary {
  cursor: pointer; padding: 10px 14px; font-size: .84rem; font-weight: 650; color: var(--primary); list-style: none;
}
details.evidence > summary::-webkit-details-marker { display: none; }
details.evidence > summary::before { content: "▸ "; }
details.evidence[open] > summary::before { content: "▾ "; }
details.evidence .evidence-body { padding: 0 14px 12px; font-size: .84rem; color: var(--graphite); }
/* Inside a table cell the disclosure sheds its chrome — a bordered box per
   row reads as noise when there are ten of them. */
td details.evidence { margin: 5px 0 0; background: transparent; border: none; border-radius: 0; }
td details.evidence > summary { padding: 2px 0; font-size: .78rem; }
td details.evidence .evidence-body { padding: 2px 0 6px; }

.derivation { list-style: none; margin: 0; padding: 0; }
.derivation li { padding: 5px 0 5px 16px; border-left: 2px solid rgba(139, 92, 246, 0.3); margin-left: 3px; }
.formula { font-family: var(--mono); font-size: .8rem; background: var(--surface-alt); padding: 8px 10px; border-radius: 8px; display: block; overflow-x: auto; }

.callout { border: 1px solid var(--line); border-left: 3px solid var(--primary); background: var(--surface); padding: 13px 17px; border-radius: 0 12px 12px 0; margin: 14px 0; font-size: .9rem; }
.callout-caution { border-left-color: var(--caution); background: var(--caution-soft); }
.callout-negative { border-left-color: var(--negative); background: var(--negative-soft); }
.callout-positive { border-left-color: var(--positive); background: var(--positive-soft); }
.callout strong { display: block; margin-bottom: 4px; }

/* --- property workspace ------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 22px; }
.tabs a {
  padding: 10px 14px; font-size: .88rem; color: var(--graphite); white-space: nowrap;
  border-bottom: 2px solid transparent; font-weight: 500;
}
.tabs a:hover { color: var(--ink); text-decoration: none; background: rgba(148, 163, 184, 0.06); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.property-head { padding: 22px 0 16px; }
.property-head h1 { margin-bottom: 4px; font-size: 1.7rem; }
.property-sub { color: var(--muted); font-size: .9rem; }

/* Survey linework is ink-on-paper; keep the sheet light so it stays legible. */
.gl-sitemap { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #f4f2ec; max-width: 100%; }

.deflist { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 6px 18px; font-size: .89rem; margin: 0; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; font-weight: 600; }

/* --- copilot ------------------------------------------------------------ */
.chat { display: flex; flex-direction: column; gap: 14px; }
.msg { border-radius: var(--radius-lg); padding: 14px 18px; font-size: .92rem; }
.msg-user { background: var(--primary-soft); border: 1px solid rgba(139, 92, 246, 0.2); align-self: flex-end; max-width: 78%; }
.msg-assistant { background: var(--card); border: 1px solid var(--line); }
.msg-assistant h4 { margin: 14px 0 5px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.msg-assistant h4:first-child { margin-top: 0; }
.msg-assistant ul { margin: 0 0 6px; padding-left: 20px; }
.msg-blocked { background: var(--negative-soft); border: 1px solid var(--negative); color: var(--negative); }
.toolstrip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.toolchip { font-family: var(--mono); font-size: .7rem; background: var(--surface-alt); color: var(--graphite); padding: 2px 8px; border-radius: 999px; }
.toolchip.err { background: var(--negative-soft); color: var(--negative); }

/* --- marketing ---------------------------------------------------------- */
.hero { padding: 74px 0 54px; border-bottom: 1px solid var(--line-soft); }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); max-width: 20ch; }
.hero .lede { font-size: 1.12rem; color: var(--graphite); max-width: 62ch; }

/* Centered hero, in the modern-landing register. */
.hero-center { text-align: center; padding: 92px 0 58px; position: relative; }
.hero-center h1 { max-width: 22ch; margin-left: auto; margin-right: auto; font-size: clamp(2.3rem, 5.4vw, 3.7rem); }
.hero-center .lede { margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 30px 0 22px; }
.hero-actions .btn { padding: 13px 26px; font-size: 1rem; }
.proof { display: flex; gap: 10px 26px; justify-content: center; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.proof span::before { content: "✓ "; color: var(--primary); font-weight: 700; }

.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; color: var(--primary); margin-bottom: 14px; }
.hero-center .eyebrow {
  display: inline-block; padding: 5px 14px; border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.3); background: var(--primary-soft);
}

/* Stat band under the hero — icon left, number right, like a control room. */
.statband { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 34px 0 6px; }
.stat {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.05), rgba(148, 163, 184, 0.015)), var(--card);
}
.stat .icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.stat .icon svg { width: 20px; height: 20px; }
.stat .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; text-align: right; }
.stat .cap { font-size: .76rem; color: var(--muted); text-align: right; }

.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { padding: 9px 0 9px 24px; position: relative; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before { content: "—"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }
.price-table { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.price-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; display: flex; flex-direction: column; background: var(--card); }
.price-card.featured { border-color: rgba(139, 92, 246, 0.55); box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 12px 40px rgba(124, 58, 237, 0.15); }
.price-card .amount { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.price-card ul { list-style: none; padding: 0; margin: 14px 0; flex: 1; font-size: .88rem; }
.price-card li { padding: 5px 0; border-bottom: 1px solid var(--line-soft); }

footer.site { border-top: 1px solid var(--line); margin-top: 56px; padding: 36px 0 52px; font-size: .84rem; color: var(--muted); background: rgba(8, 12, 18, 0.5); }
footer.site .cols { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 26px; }
footer.site h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { padding: 3px 0; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--primary); }

.disclaimer { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 22px; max-width: none; }

/* --- address autocomplete ------------------------------------------------ */
.ac-wrap { position: relative; flex: 1; display: flex; }
.ac-wrap input { flex: 1; }
.ac-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  margin: 0; padding: 6px; list-style: none;
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  max-height: 320px; overflow-y: auto;
}
.ac-item {
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: .93rem; font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ac-item:hover, .ac-item.active { background: var(--primary-soft); color: var(--primary-dark); }

/* --- mobile ------------------------------------------------------------- */
/* One consolidated pass. The masthead is the critical piece: a dozen nav
   links in a fixed-height row overflow every phone. Below 860px the header
   wraps to two rows and the nav becomes a horizontal scroller — a no-JS
   pattern that keeps every destination reachable with a thumb. */
@media (max-width: 860px) {
  .masthead-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px 18px; }
  .brand { flex: 1 1 auto; }
  .nav {
    flex: 1 1 100%; margin-left: 0; gap: 14px; font-size: .86rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

@media (max-width: 700px) {
  .wrap, .wrap-narrow { padding: 0 16px; }
  .section { padding: 32px 0; }
  .hero, .hero-center { padding: 44px 0 36px; }
  .hero-center h1 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
  h1 { font-size: 1.7rem; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; min-width: 200px; }
  .statband { gap: 12px; margin-top: 24px; }
  .stat { padding: 14px 16px; }
  .stat .num { font-size: 1.4rem; }
  .grid { gap: 14px; }
  .metric .value { font-size: 1.3rem; }
  .property-head h1 { font-size: 1.35rem; }
  th, td { padding: 8px 10px; }
  footer.site { padding: 26px 0 36px; }
}

@media (max-width: 560px) {
  /* Search-style forms stack: a side-by-side input+button leaves a 140px
     input on a phone, which reads as broken. */
  .searchbar { flex-direction: column; }
  .searchbar .btn { width: 100%; }
  .deflist { grid-template-columns: 1fr; gap: 2px 0; }
  .deflist dt { margin-top: 8px; }
  .deflist dt:first-child { margin-top: 0; }
  .proof { flex-direction: column; gap: 6px; align-items: center; }
  .msg-user { max-width: 100%; }
  .price-card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .card { transition: none; }
  .btn:hover { transform: none; }
}

@media print {
  :root {
    --ink: #101418; --graphite: #4a5560; --muted: #67727e;
    --line: #d8dee4; --line-soft: #e8edf1;
    --surface: #f5f7f9; --surface-alt: #ebeff3; --paper: #ffffff; --card: #ffffff;
  }
  html { color-scheme: light; }
  body { background: #fff; color: #101418; font-size: 11pt; }
  .masthead, .tabs, .nav, footer.site, .btn { display: none !important; }
}
