/* 0391 (Kyle 12/2): civil home page. Hero, How it works, What you get, Bid Desk, civil FAQ copy, link row.
   Builds on landing_v2.css tokens. 8px spacing scale; one accent (orange), used sparingly.
   Product images are the /civil assets (static/img/civil/*), linked by reference. */

.ch {
  --ch-accent: var(--v2-accent, #f97316);
  --ch-text: var(--v2-text, #f8fafc);
  --ch-muted: var(--v2-text-muted, #94a3b8);
  --ch-line: rgba(148, 163, 184, 0.16);
  --ch-panel: #0a101c;
  --ch-cut: #2159d6;
  --ch-fill: #e53136;
}

/* ── shared type ─────────────────────────────────────────── */
.ch-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.ch-sec { padding: 96px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.ch-h2 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 1.15rem + 1.9vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 750;
  color: var(--ch-text);
  max-width: 22ch;
}
.ch-lead { margin: 0; font-size: 1.125rem; line-height: 1.6; color: var(--ch-muted); max-width: 60ch; }
.ch-head { margin-bottom: 56px; }
.ch-link { color: var(--ch-text); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(249, 115, 22, 0.55); padding-bottom: 2px; }
.ch-link:hover { color: #fff; border-bottom-color: var(--ch-accent); }
.ch-link:focus-visible { outline: 2px solid var(--ch-accent); outline-offset: 3px; border-radius: 2px; }

/* ── HERO ────────────────────────────────────────────────── */
.ch-hero {
  position: relative;
  padding: 120px 0 88px;
  overflow: hidden;
  background:
    radial-gradient(900px 480px at 78% 38%, rgba(33, 89, 214, 0.10), transparent 70%),
    var(--v2-bg, #030712);
}
/* faint survey grid behind the hero: the grid-point map, not decoration */
.ch-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 45%, #000, transparent 85%);
          mask-image: radial-gradient(70% 70% at 70% 45%, #000, transparent 85%);
}
.ch-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 13fr);
  gap: 56px;
  align-items: center;
}
.ch-hero-text { min-width: 0; }
/* the Foreman AI lockup, smaller and left-aligned here (landing_v2.css styles the parts) */
.ch-hero .agent-hero-lockup { display: inline-flex; flex-direction: row; gap: 12px; margin: 0 0 32px; }
.ch-hero .agent-hero-lockup-icon { width: 44px; height: 44px; }
.ch-hero .agent-hero-lockup-name { font-size: 1.75rem; text-shadow: none; }
.ch-h1 {
  margin: 0 0 24px;
  font-size: clamp(2.125rem, 1.4rem + 2.1vw, 3.125rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 800;
  color: var(--ch-text);
  text-wrap: balance;
}
.ch-sub { margin: 0 0 32px; font-size: 1.1875rem; line-height: 1.6; color: #b8c2d1; max-width: 54ch; }
.ch-ctas { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 0 0 40px; }
.ch-ctas .v2-btn { min-height: 48px; }
.ch-hero-quote { margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--ch-accent); max-width: 44ch; }
.ch-hero-quote blockquote { margin: 0 0 4px; font-size: 1.0625rem; font-weight: 650; color: var(--ch-text); }
.ch-hero-quote figcaption { font-size: 0.875rem; color: var(--ch-muted); }

/* before / after viewer */
.ch-viewer { min-width: 0; margin: 0; }
.ch-viewer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: var(--ch-muted);
}
.ch-viewer-bar b { color: var(--ch-text); font-weight: 650; }
.ch-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.ch-legend-ramp {
  width: 96px;
  height: 8px;
  border-radius: 4px;
  /* the app's ramp, no white stop */
  background: linear-gradient(90deg, #172e83, #2159d6, #08b3df, #f9d13e, #ffad20, #fa6729, #e53136, #94194d);
}
.ch-stage {
  position: relative;
  aspect-ratio: 1600 / 826;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--ch-line);
  background: #141b26;
  box-shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.8);
  --ch-pos: 50%;
  touch-action: pan-y;
}
.ch-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* without JS the after image covers the stage in full; JS turns on the split */
.ch-stage.is-split .ch-after { clip-path: inset(0 0 0 var(--ch-pos)); }
.ch-handle { display: none; }
.ch-stage.is-split .ch-handle {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ch-pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.ch-stage.is-split .ch-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23030712' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-5 6 5 6M15 6l5 6-5 6'/%3E%3C/svg%3E") center / 20px no-repeat;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.ch-tag {
  position: absolute;
  top: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fff;
  background: rgba(3, 7, 18, 0.72);
  pointer-events: none;
}
.ch-tag--before { left: 12px; display: none; }
.ch-tag--after { right: 12px; }
.ch-stage.is-split .ch-tag--before { display: block; }
.ch-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
}
.ch-range:focus-visible + .ch-handle::after { outline: 3px solid var(--ch-accent); outline-offset: 2px; }
.ch-figs { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 16px 0 0; padding: 0; list-style: none; }
.ch-figs li { font-size: 0.875rem; color: var(--ch-muted); }
.ch-figs b { display: block; font-size: 1.375rem; font-weight: 750; color: var(--ch-text); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ch-viewer-cap { margin: 12px 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ch-muted); }

/* ── HOW IT WORKS ────────────────────────────────────────── */
.ch-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; counter-reset: ch-step; }
.ch-steps li { counter-increment: ch-step; padding-top: 24px; border-top: 1px solid var(--ch-line); position: relative; }
.ch-steps li::before {
  content: counter(ch-step, decimal-leading-zero);
  display: block;
  margin-bottom: 16px;
  font: 700 0.8125rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.08em;
  color: var(--ch-accent);
}
.ch-steps li::after { content: ""; position: absolute; top: -1px; left: 0; width: 32px; height: 1px; background: var(--ch-accent); }
.ch-steps h3 { margin: 0 0 8px; font-size: 1.1875rem; line-height: 1.3; font-weight: 700; color: var(--ch-text); }
.ch-steps p { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--ch-muted); }

/* ── WHAT YOU GET: alternating rows ──────────────────────── */
.ch-row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.ch-row + .ch-row { margin-top: 96px; }
.ch-row--flip .ch-shot { order: 2; }
.ch-shot { margin: 0; min-width: 0; }
.ch-shot-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--ch-line); background: #fff; box-shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.8); }
.ch-shot-frame--dark { background: #141b26; }
.ch-shot img { display: block; width: 100%; height: auto; }
.ch-shot-frame--crop { aspect-ratio: 4 / 3; }
.ch-shot-frame--crop img { height: 100%; object-fit: cover; object-position: top center; }
.ch-shot figcaption { margin: 12px 0 0; font-size: 0.875rem; line-height: 1.5; color: var(--ch-muted); }
.ch-copy { min-width: 0; }
.ch-copy h3 { margin: 0 0 16px; font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem); line-height: 1.2; letter-spacing: -0.015em; font-weight: 750; color: var(--ch-text); }
.ch-copy > p { margin: 0 0 24px; font-size: 1.0625rem; line-height: 1.65; color: var(--ch-muted); }
.ch-copy > p strong { color: var(--ch-text); font-weight: 650; }
.ch-ticks { margin: 0 0 24px; padding: 0; list-style: none; display: grid; gap: 12px; }
.ch-ticks li { position: relative; padding-left: 20px; font-size: 1rem; line-height: 1.5; color: #d6dde8; }
.ch-ticks li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 8px; height: 2px; background: var(--ch-accent); }
.ch-more { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 0.9375rem; }

/* spec sheet: the files in the package */
.ch-spec { margin: 96px 0 0; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 64px; align-items: start; }
.ch-spec h3 { margin: 0 0 8px; font-size: 1.375rem; line-height: 1.25; font-weight: 750; color: var(--ch-text); }
.ch-spec-intro p { margin: 0 0 24px; font-size: 1rem; line-height: 1.6; color: var(--ch-muted); }
.ch-spec dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 32px; }
.ch-spec dl > div { padding: 16px 0; border-top: 1px solid var(--ch-line); }
.ch-spec dt { margin: 0 0 4px; font-size: 1rem; font-weight: 650; color: var(--ch-text); }
.ch-spec dd { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--ch-muted); }

/* ── BID DESK ────────────────────────────────────────────── */
.ch-desk { background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 60%); }
.ch-desk .ch-shot-frame--crop { aspect-ratio: 5 / 4; }
.ch-desk-steps { margin: 0 0 32px; padding: 0; list-style: none; display: grid; gap: 0; }
.ch-desk-steps li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--ch-line); font-size: 1rem; line-height: 1.5; color: #d6dde8; }
.ch-desk-steps li:last-child { border-bottom: 1px solid var(--ch-line); }
.ch-desk-steps b { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ch-muted); padding-top: 2px; }

/* ── link row + GC line ──────────────────────────────────── */
.ch-links { padding: 40px 0; border-top: 1px solid rgba(255, 255, 255, 0.05); }
.ch-links nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; font-size: 0.9375rem; }
.ch-links nav b { color: var(--ch-text); font-weight: 700; margin-right: 8px; }
.ch-links nav a { color: var(--ch-muted); text-decoration: none; }
.ch-links nav a:hover { color: var(--ch-text); text-decoration: underline; text-underline-offset: 3px; }
.ch-gc { margin: 24px 0 0; font-size: 0.9375rem; color: var(--ch-muted); }
.ch-gc a { color: var(--ch-text); text-decoration: none; border-bottom: 1px solid rgba(148, 163, 184, 0.4); }
.ch-gc a:hover { border-bottom-color: var(--ch-accent); }

/* bottom CTA now carries two buttons */
.agent-page .v2-bottom-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 24px; }

/* FAQ answers: keep links readable */
.ch-faq .v2-faq-answer-inner a { color: var(--ch-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(249, 115, 22, 0.6); }

/* ── responsive ──────────────────────────────────────────── */
@media (max-width: 1099px) {
  .ch-hero { padding: 104px 0 72px; }
  .ch-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* one column: the 3D site sits right under the headline so it is on the first screen */
  .ch-hero-text { display: contents; }
  .ch-hero .agent-hero-lockup { order: 1; justify-self: start; }
  .ch-h1 { order: 2; max-width: 20ch; }
  .ch-viewer { order: 3; margin: 8px 0 40px; }
  .ch-sub { order: 4; }
  .ch-ctas { order: 5; }
  .ch-hero-quote { order: 6; }
}
@media (max-width: 1023px) {
  .ch-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
  .ch-row, .ch-row--flip { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ch-row--flip .ch-shot { order: 0; }
  .ch-row + .ch-row { margin-top: 80px; }
  .ch-spec { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 80px; }
  .ch-sec { padding: 80px 0; }
}
@media (max-width: 640px) {
  .ch-wrap { padding: 0 16px; }
  .ch-hero { padding: 80px 0 56px; }
  .ch-h1 { margin-bottom: 24px; }
  .ch-hero .agent-hero-lockup { margin-bottom: 24px; }
  .ch-hero .agent-hero-lockup-icon { width: 36px; height: 36px; }
  .ch-hero .agent-hero-lockup-name { font-size: 1.5rem; }
  .ch-sub { font-size: 1.0625rem; }
  .ch-ctas { flex-direction: column; align-items: stretch; gap: 12px; }
  .ch-ctas .v2-btn { width: 100%; box-sizing: border-box; }
  .ch-sec { padding: 64px 0; }
  .ch-head { margin-bottom: 40px; }
  .ch-steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .ch-spec dl { grid-template-columns: minmax(0, 1fr); }
  .ch-desk-steps li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ch-figs { gap: 8px 24px; }
  .ch-figs b { font-size: 1.1875rem; }
  .ch-legend-ramp { width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-stage * { transition: none !important; }
}

/* 0403 (Kyle 12/2: "use a good looking image... a stock photo of a civil site"): an aerial photo of a subdivision
   under construction (new streets, graded lots) behind the hero, darkened so the headline reads. Replaces 0400/0402's
   labeled heat-map sheet. Photo: Unsplash, free under the Unsplash License (S0usIUQI8Jo). */
.ch-hero {
  background:
    linear-gradient(180deg, rgba(3, 7, 18, 0.35) 0%, rgba(3, 7, 18, 0) 30%, rgba(3, 7, 18, 0) 72%, var(--v2-bg, #030712) 100%),
    linear-gradient(90deg, rgba(3, 7, 18, 0.94) 0%, rgba(3, 7, 18, 0.84) 38%, rgba(3, 7, 18, 0.5) 70%, rgba(3, 7, 18, 0.6) 100%),
    url("../../img/civil/civil-hero-site.jpg") 60% 50% / cover no-repeat,
    var(--v2-bg, #030712);
}
@media (max-width: 1099px) {
  .ch-hero {
    background:
      linear-gradient(180deg, rgba(3, 7, 18, 0.78) 0%, rgba(3, 7, 18, 0.88) 50%, var(--v2-bg, #030712) 100%),
      url("../../img/civil/civil-hero-site.jpg") 50% 0 / cover no-repeat,
      var(--v2-bg, #030712);
  }
}
