/* Roofline base: tokens, type, controls. Aerial-survey vernacular: concrete ground, spruce ink, one survey-flag
   pink that only ever marks something flagged or the next action. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo";
  font-style: italic;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("../fonts/archivo-latin-italic.woff2") format("woff2");
}

:root {
  --concrete: #e8eae4;
  --paper: #f6f7f3;
  --ink: #15231e;
  --ink-2: #4a5852;
  --ink-3: #5f6b65; /* 4.6:1 on concrete, 5.2:1 on paper */
  --line: #c3c8be;
  --line-soft: #d8dcd3;
  --flag: #d81e5b;
  --flag-deep: #b0124a;
  --flag-wash: #f8dde6;
  --lawn: #3d7a50;
  --lawn-wash: #dcebdf;
  --lawn-deep: #2f6440;
  --roof: #b07812;
  --roof-wash: #f3e6c8;
  --night: #15231e;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --wide: 125%;
  --semi: 112%;
  --narrow: 78%;

  /* type scale (1.25 minor third from 17px) */
  --t-xs: 0.8125rem;
  --t-sm: 0.9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.3125rem;
  --t-xl: 1.75rem;
  --t-2xl: 2.375rem;
  --t-3xl: clamp(2.6rem, 5.4vw, 4.6rem);

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--ink);
  background: var(--concrete);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--flag); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--flag-deep); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--flag); color: #fff; }

:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; border-radius: 3px; }

.display {
  font-stretch: var(--wide);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 0.96;
}
.figure { font-stretch: var(--narrow); font-variant-numeric: tabular-nums; font-weight: 650; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.xsmall { font-size: var(--t-xs); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* ---------- logo: a roof pitch over a baseline, the flag where the ridge is */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-stretch: var(--wide); font-weight: 850; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo svg { width: 30px; height: 30px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--r-md); border: 1.5px solid transparent;
  font-weight: 700; font-stretch: var(--semi); font-size: var(--t-sm); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn-flag { background: var(--flag); color: #fff; }
.btn-flag:hover { background: var(--flag-deep); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #24372f; color: #fff; }
.btn-line { border-color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn-ghost:hover { color: var(--ink); background: rgba(21, 35, 30, .06); }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: var(--t-md); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--t-xs); }

/* ---------- forms */
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: var(--t-sm); }
.field .hint { font-size: var(--t-xs); color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(216, 30, 91, .18); }
.input[aria-invalid="true"] { border-color: var(--flag); }
.form-error { color: var(--flag-deep); font-size: var(--t-sm); font-weight: 600; min-height: 1.2em; }
/* a status line that is an error by default and a confirmation once .ok is set */
.form-msg { color: var(--flag-deep); font-size: var(--t-sm); font-weight: 600; min-height: 1.2em; }
.form-msg.ok { color: var(--lawn-deep); }

/* ---------- demo marker: anything not from real records */
.demo-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-left: 6px; vertical-align: 2px;
  border-radius: 999px; border: 1px dashed var(--roof); color: var(--roof); background: var(--roof-wash);
  font-size: 11px; font-weight: 750; font-stretch: var(--narrow); letter-spacing: .02em;
}

/* ---------- toast */
.toast-host { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-md); font-size: var(--t-sm); box-shadow: 0 10px 30px rgba(21, 35, 30, .3); animation: toast-in .25s var(--ease); }
.toast.error { background: var(--flag-deep); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* SAM 3 tags pinned on an aerial photo (lib.js aiPins); the parent is position: relative, 16:10 */
.ai-pins { position: absolute; inset: 0; pointer-events: none; }
.ai-pins svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ai-pins line { stroke: #fff; stroke-width: 1.5; opacity: .9; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6)); }
.ai-dot { position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(0, 0, 0, .5); }
.ai-tag { position: absolute; left: 0; top: 0; display: grid; gap: 1px;
  padding: 4px 8px 5px; border-radius: 6px; background: rgba(21, 35, 30, .9); color: #fff; border-left: 3px solid var(--c);
  font-size: 11.5px; line-height: 1.2; white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.ai-tag b { font-weight: 750; }
.ai-tag span { opacity: .78; font-size: 10.5px; }
.ai-tag.house { background: var(--flag); border-left-color: #fff; }
.ai-pins.pop .ai-dot, .ai-pins.pop .ai-tag { animation: pin-in .4s var(--ease) both; animation-delay: calc(var(--i) * 90ms + 120ms); }
@keyframes pin-in { from { opacity: 0; translate: 0 6px; } }
@media (prefers-reduced-motion: reduce) { .ai-pins.pop .ai-dot, .ai-pins.pop .ai-tag { animation: none; } }

/* photo vs AI view slider (lib.js compareSlider) */
.compare-slider { --cut: 0%; position: relative; overflow: hidden; background: #000; user-select: none; -webkit-user-select: none; }
.compare-slider img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-slider .cs-top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--cut)); }
.compare-slider .handle { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 3px; transform: translateX(-50%); background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .5); pointer-events: none; }
.compare-slider .knob { position: absolute; top: 50%; left: clamp(22px, var(--cut), calc(100% - 22px)); transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #15231e; box-shadow: 0 4px 16px rgba(0, 0, 0, .35); pointer-events: none; }
.compare-slider .knob::before { content: "‹ ›"; font-weight: 800; font-size: 1.05rem; letter-spacing: 2px; }
.compare-slider .cs-tag { position: absolute; top: 12px; padding: 4px 9px; border-radius: 4px; background: rgba(21, 35, 30, .82); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.compare-slider .cs-tag.left { left: 12px; }
.compare-slider .cs-tag.right { right: 12px; background: var(--flag); }
.compare-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare-slider:has(input:focus-visible) { outline: 3px solid var(--flag); outline-offset: 3px; }
