/* ============================================================
   CivilPlanAI — marketing site
   Design system lifted from product tokens (frontend/tailwind.config.ts)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* Ink */
  --ink: #1a1d24;
  --ink-2: #4a5060;
  --ink-3: #7a8090;
  --ink-4: #aab0bd;
  /* Lines */
  --line: #d8dce4;
  --line-2: #e6e9ef;
  /* Paper */
  --paper: #fafbfd;
  --paper-2: #f3f5f9;
  --paper-3: #ffffff;
  /* Brand blueprint blue */
  --brand: #1f8bff;
  --brand-2: #e8f2ff;
  --brand-3: #c8def8;
  /* Severity — ONLY inside finding UI, never decoration */
  --crit: #d23b3b;   --crit-bg: #fdecec;
  --warn: #c87a13;   --warn-bg: #fdf3e3;
  --info: #4a6ea0;   --info-bg: #eaf0f8;
  --ok:   #2f8a52;   --ok-bg:   #e6f3ec;

  --font-sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --maxw: 1160px;
  --gutter: 40px;

  /* tweakable */
  --grid-opacity: 1;
  --accent: var(--brand);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--brand-3); color: var(--ink); }

a { color: inherit; text-decoration: none; }

/* ---------- type ---------- */
.mono {
  font-family: var(--font-mono);
  font-feature-settings: "ss01";
  letter-spacing: -0.01em;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}
.eyebrow.no-tick::before { display: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.06;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6vw, 76px); font-weight: 600; }
h2 { font-size: clamp(30px, 3.6vw, 46px); }
h3 { font-size: 21px; line-height: 1.25; letter-spacing: -0.018em; }
p  { margin: 0; }

.lede { font-size: clamp(18px, 1.5vw, 21px); color: var(--ink-2); line-height: 1.6; text-wrap: pretty; }
.muted { color: var(--ink-2); }
.muted-3 { color: var(--ink-3); }

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
section { position: relative; }
.band { padding: clamp(80px, 11vw, 150px) 0; }
.band-paper2 { background: var(--paper-2); }
.rule-top { border-top: 1px solid var(--line); }

/* faint drafting grid texture — sits BEHIND all section content */
.gridded > * { position: relative; z-index: 1; }
.gridded::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grid-opacity);
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 35%, transparent 80%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 35%, transparent 80%);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  padding: 13px 20px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn .mono { font-size: 13.5px; }
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(26,29,36,.04), 0 8px 22px -12px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(26,29,36,.04), 0 14px 30px -12px color-mix(in srgb, var(--accent) 75%, transparent); }
.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-4); background: var(--paper-3); }
.btn-soft { background: var(--paper-3); border-color: var(--line); color: var(--ink); }
.btn-soft:hover { border-color: var(--ink-4); }

.arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 500; color: var(--ink-2);
  border-bottom: 1px solid transparent; padding-bottom: 1px;
  transition: color .15s ease, gap .15s ease;
}
.arrow-link:hover { color: var(--ink); gap: 12px; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-3);
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); letter-spacing: -0.01em; white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip-crit { color: var(--crit); background: var(--crit-bg); border-color: transparent; }
.chip-warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.chip-info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.chip-ok   { color: var(--ok);   background: var(--ok-bg);   border-color: transparent; }

/* ---------- card surfaces ---------- */
.card {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-logo { height: 26px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a.navlink {
  font-size: 14.5px; color: var(--ink-2); font-weight: 450;
  transition: color .15s ease;
}
.nav-links a.navlink:hover { color: var(--ink); }
@media (max-width: 820px) { .nav-links .navlink { display: none; } }
.nav-cta .cta-short { display: none; }
@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .nav-cta .cta-full { display: none; }
  .nav-cta .cta-short { display: inline; }
  .nav-links { gap: 0; }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   HERO — plan sheet with self-drawing finding
   ============================================================ */
.hero { padding-top: clamp(50px, 7vw, 86px); padding-bottom: clamp(60px, 8vw, 110px); overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { margin: 22px 0 0; }
.hero h1 .em { color: var(--ink); }
.hero-sub { margin-top: 26px; max-width: 36ch; }
.hero-cta { display: flex; align-items: center; gap: 22px; margin-top: 34px; flex-wrap: wrap; }
.hero-note {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line);
  font-size: 14.5px; color: var(--ink-3); max-width: 42ch; display: flex; gap: 11px; align-items: flex-start;
}
.hero-note .sq { width: 9px; height: 9px; border: 1.5px solid var(--accent); margin-top: 5px; flex: none; }

/* the sheet */
.sheet-frame { position: relative; }
.sheet {
  position: relative;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--line-2), 0 30px 60px -34px rgba(26,29,36,.28), 0 12px 24px -20px rgba(26,29,36,.2);
  aspect-ratio: 4 / 3.1;
  overflow: hidden;
}
.sheet svg { display: block; width: 100%; height: 100%; }

/* draw-in animation for the finding box */
.draw {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  animation: draw 1.1s cubic-bezier(.65,0,.35,1) forwards;
  animation-delay: .55s;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.fade-seq { opacity: 0; animation: fadeIn .5s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .draw { animation: none; stroke-dashoffset: 0; }
  .fade-seq { animation: none; opacity: 1; }
}

/* callout card floating on the sheet */
.callout {
  position: absolute;
  width: 224px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 40px -20px rgba(26,29,36,.4);
  padding: 12px 13px 13px;
  font-size: 13px;
}
.callout .co-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.callout .co-title { font-weight: 600; font-size: 13.5px; }
.callout .co-body { color: var(--ink-2); line-height: 1.45; }
.callout .co-meta { margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }

/* ============================================================
   FINDING CARD (interactive) — section 5
   ============================================================ */
.finding {
  width: 100%; max-width: 540px;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 30px 60px -40px rgba(26,29,36,.3);
  overflow: hidden;
}
.finding-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  background: var(--paper);
}
.finding-loc { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.finding-body { padding: 6px 18px 4px; }
.frow { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.frow:last-child { border-bottom: 0; }
.frow .flabel { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.frow .fval { font-size: 15px; color: var(--ink); line-height: 1.5; }
.frow .fval .pin-ref { color: var(--accent); font-family: var(--font-mono); font-size: 13px; }
.conf-bar { display: inline-flex; align-items: center; gap: 8px; }
.conf-bar .ticks { display: inline-flex; gap: 3px; }
.conf-bar .ticks i { width: 16px; height: 6px; border-radius: 2px; background: var(--line); display: block; }
.conf-bar .ticks i.on { background: var(--ok); }
.finding-actions { display: flex; gap: 10px; align-items: center; height: 80px; padding: 14px 18px; border-top: 1px solid var(--line-2); background: var(--paper); }
.finding-actions .btn { flex: 1; justify-content: center; }
.fbtn-approve:hover { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.fbtn-edit:hover { border-color: var(--ink-4); }
.fbtn-reject:hover { background: var(--crit-bg); border-color: var(--crit); color: var(--crit); }
.finding-resolved {
  display: none; align-items: center; gap: 10px; height: 80px;
  padding: 14px 18px; border-top: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 13.5px;
}
.finding.is-resolved .finding-actions { display: none; }
.finding.is-resolved .finding-resolved { display: flex; }
.undo-btn {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink-3);
  background: transparent; border: 0; cursor: pointer;
  padding: 5px 10px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.undo-btn:hover { color: var(--ink); background: var(--paper-2); }
.finding-caption { margin-top: 20px; font-size: 15px; color: var(--ink-2); }
.finding-caption b { color: var(--ink); font-weight: 600; }

/* ============================================================
   HOW IT WORKS — four beats
   ============================================================ */
.beats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
@media (max-width: 760px) { .beats { grid-template-columns: 1fr; } }
.beat { background: var(--paper-3); padding: 34px 32px; position: relative; transition: background .2s ease; }
.beat:hover { background: var(--paper); }
.beat .bnum { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); letter-spacing: 0.04em; }
.beat h3 { margin: 16px 0 10px; }
.beat p { color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }

/* stat chips row */
.statline { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 36px; }
.stat {
  display: inline-flex; align-items: baseline; gap: 10px;
  padding: 13px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-3);
}
.stat .k { font-family: var(--font-mono); font-size: 15px; color: var(--ink); font-weight: 600; }
.stat .v { font-size: 14px; color: var(--ink-3); }

/* ============================================================
   PERSONAS
   ============================================================ */
.personas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 14px; }
@media (max-width: 860px) { .personas { grid-template-columns: 1fr; } }
.persona { padding: 30px 28px 32px; }
.persona .role { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); letter-spacing: 0.04em; }
.persona h3 { margin: 14px 0 0; font-size: 18px; }
.persona p { margin-top: 12px; color: var(--ink-2); font-size: 15px; }

/* trust pillars */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 40px; }
@media (max-width: 760px) { .pillars { grid-template-columns: 1fr; } }
.pillar { background: var(--paper-3); padding: 26px 26px; }
.pillar .pi { width: 22px; height: 22px; display: grid; place-items: center; margin-bottom: 14px; }
.pillar h4 { font-size: 15.5px; }
.pillar p { margin-top: 7px; color: var(--ink-3); font-size: 14px; line-height: 1.5; }

/* ============================================================
   CTA + footer
   ============================================================ */
.cta-mail {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 2px solid var(--accent); padding-bottom: 4px;
  transition: gap .15s ease;
}
.cta-mail:hover { gap: 16px; }

.footer { background: var(--ink); color: #c9cdd6; padding: 70px 0 56px; }
.footer .wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-logo { height: 28px; filter: brightness(0) invert(1); opacity: .95; }
.footer-tag { font-size: 15px; color: #9aa0ad; margin-top: 16px; max-width: 34ch; line-height: 1.5; }
.footer-meta { font-family: var(--font-mono); font-size: 12.5px; color: #7a8090; line-height: 1.9; text-align: right; }
.footer-meta a { color: #c9cdd6; }
.footer-meta a:hover { color: #fff; }

/* small util */
.kc { font-family: var(--font-mono); font-size: 0.92em; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 6px; }
.split-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(34px,5vw,72px); align-items: center; }
@media (max-width: 880px) { .split-2 { grid-template-columns: 1fr; } }
.stacklist { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.stacklist .li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; }
.stacklist .li .n { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); padding-top: 3px; }
.stacklist .li p { color: var(--ink-2); font-size: 16px; }
.stacklist .li b { color: var(--ink); font-weight: 600; }
