/* ==========================================================================
   CiviSight — site styles
   Design tokens and values taken verbatim from the design handoff bundle.
   Layout is desktop-first (matching the handoff), with breakpoints added at
   1024 / 860 / 620px — the handoff did not specify responsive behaviour.
   ========================================================================== */

:root {
  /* surfaces */
  --paper: #FAF8F4;
  --paper-alt: #F2EEE5;
  --white: #FFFFFF;
  --field: #FCFBF8;
  --dark: #12233A;
  --darker: #0E1B2E;

  /* text */
  --ink: #17233B;
  --ink-soft: #28323F;
  --body: #4A5261;
  --muted: #5B6472;
  --muted-2: #6B7280;
  --muted-3: #8A8F98;
  --muted-mono: #8A8578;

  /* text on dark */
  --on-dark-head: #F4F6F9;
  --on-dark-body: #C4CDDB;
  --on-dark-muted: #8B9AB0;
  --on-dark-link: #B9C4D4;
  --on-dark-strong: #DCE2EC;

  /* brand */
  --navy: #1C3F6E;
  --gold: #A07C3E;
  --gold-dark-bg: #C9A464;
  --gold-bright: #E7C480;

  /* borders */
  --hair: #E9E2D6;
  --card-border: #E7E0D3;
  --card-border-2: #E2DBCD;
  --inner: #EFEAE0;
  --inner-2: #ECE6DA;

  /* status */
  --green: #2C7A4B;
  --green-dark: #245239;
  --green-bg: #F1F7F2;
  --green-border: #D8E4DB;
  --red: #C6553F;
  --red-text: #B04A34;
  --red-bg: #FCF3F1;
  --red-bg-2: #FCF6F3;
  --red-border: #EBD9D2;
  --red-title: #8A4433;
  --red-body: #7A5A50;

  /* type */
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* metrics */
  --header-h: 67px;

  /* shadows */
  --shadow-sm: 0 12px 34px -26px rgba(23, 35, 59, 0.4);
  --shadow-md: 0 18px 44px -34px rgba(23, 35, 59, 0.45);
  --shadow-lg: 0 24px 60px -38px rgba(23, 35, 59, 0.5);

  /* layout — the page shell. Content fills the viewport up to --shell, then
     centres; --gutter grows with the screen so the margins stay proportional.
     Prose blocks keep their own narrower caps so line length stays readable. */
  --shell: 1600px;
  --gutter: clamp(24px, 3.4vw, 64px);
  --measure: 62ch;
}

/* --------------------------------------------------------------- base --- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--navy); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }
p { text-wrap: pretty; }
img { max-width: 100%; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: var(--paper);
  padding: 12px 20px; font-size: 14.5px; font-weight: 600; border-radius: 0 0 5px 0;
}
.skip-link:focus { left: 0; color: var(--paper); }

/* ------------------------------------------------------------ layout --- */

/* Layout wrappers scale with the shell; text-led wrappers stay proportionally
   narrower so copy-heavy sections don't run to unreadable line lengths. */
.wrap      { max-width: var(--shell); margin: 0 auto; }
.wrap-1100 { max-width: min(1360px, var(--shell)); margin: 0 auto; }
.wrap-1000 { max-width: min(1240px, var(--shell)); margin: 0 auto; }
.wrap-960  { max-width: min(1120px, var(--shell)); margin: 0 auto; }
.wrap-900  { max-width: min(1000px, var(--shell)); margin: 0 auto; }
.wrap-860  { max-width: min(940px,  var(--shell)); margin: 0 auto; }

.section       { padding: 112px var(--gutter); }
.section-hero  { padding: 104px var(--gutter) 88px; }
.section-dark  { background: var(--dark); color: #EDEFF3; padding: 110px var(--gutter); }
.section-alt   { background: var(--paper-alt); padding: 112px var(--gutter); border-top: 1px solid var(--hair); }
.center        { text-align: center; }

/* --------------------------------------------------------- typography --- */

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 26px;
}
.kicker-dark { color: var(--gold-dark-bg); }

.h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 5.4vw, 66px); line-height: 1.03; letter-spacing: -0.02em;
  margin: 0 0 26px; color: var(--ink);
}
.h1-sm { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.05; }
.h1-dark { color: var(--on-dark-head); }

.h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(32px, 4.4vw, 52px); line-height: 1.06; letter-spacing: -0.018em;
  margin: 0 0 20px; color: var(--ink);
}
.h2-dark { color: var(--on-dark-head); font-size: clamp(34px, 4.6vw, 54px); line-height: 1.08; }

.lede { font-size: 20px; line-height: 1.55; color: var(--body); margin: 0 0 34px; }
.lede-19 { font-size: 19px; line-height: 1.6; color: var(--body); margin: 0; }
.lede-dark { font-size: 19px; line-height: 1.6; color: var(--on-dark-body); margin: 0; }

.eyebrow-note {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-mono);
}

/* ----------------------------------------------------------- buttons --- */

.btn {
  display: inline-block; font-family: var(--sans);
  font-size: 15.5px; font-weight: 600; padding: 15px 26px;
  border-radius: 5px; border: none; cursor: pointer; transition: background .2s ease, color .2s ease;
}
.btn-navy { background: var(--navy); color: var(--paper); }
.btn-navy:hover { background: #16345B; color: var(--paper); }
.btn-gold { background: var(--gold-bright); color: var(--dark); }
.btn-gold:hover { background: #DFB86E; color: var(--dark); }
.btn-sm { font-size: 14.5px; padding: 12px 22px; }

/* ------------------------------------------------------------ header --- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 248, 244, 0.86);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}
.site-header__inner {
  max-width: var(--shell); margin: 0 auto; padding: 15px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
/* Brand mark: skyscraper glyph + Ubuntu wordmark, matching civisight.org. */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  transition: opacity .2s ease;
}
.wordmark:hover { color: var(--ink); opacity: .82; }
.wordmark__glyph {
  height: 40px; width: auto; object-fit: contain; flex: none;
}
.wordmark__text {
  font-family: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700; font-size: 17px; letter-spacing: 0.12em;
  color: var(--ink); line-height: 1;
}
.site-footer .wordmark-sm {
  font-family: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700; font-size: 15px; letter-spacing: 0.12em;
  color: var(--on-dark-strong);
}
@media (max-width: 620px) {
  .wordmark__glyph { height: 34px; }
  .wordmark__text  { font-size: 15px; letter-spacing: 0.08em; }
}

.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav a { font-size: 14.5px; color: var(--body); font-weight: 500; }
.site-nav a.is-active {
  color: var(--ink); font-weight: 500;
  border-bottom: 2px solid var(--gold); padding-bottom: 2px;
}
.site-nav a.nav-cta {
  font-size: 14px; font-weight: 600; color: var(--paper);
  background: var(--navy); padding: 10px 18px; border-radius: 4px; border-bottom: none;
}
.site-nav a.nav-cta:hover { background: #16345B; color: var(--paper); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--hair); border-radius: 4px;
  padding: 8px 10px; cursor: pointer; line-height: 0;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px; background: var(--ink);
  margin: 4px 0; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------------ footer --- */

.site-footer { background: var(--darker); color: var(--on-dark-muted); padding: 34px var(--gutter); }
.site-footer__inner {
  max-width: var(--shell); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
/* footer wordmark now defined with the header brand mark above */
.site-footer__links { display: flex; align-items: center; gap: 24px; font-size: 13.5px; }
.site-footer__links a { color: var(--on-dark-link); }
.site-footer__links a:hover { color: var(--gold-bright); }

/* ------------------------------------------------------------ reveal --- */

[data-reveal] { will-change: opacity, transform; }
.reveal-init { opacity: 0; transform: translateY(14px); transition: opacity .4s ease-out, transform .4s ease-out; }
.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal-init { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ======================================================== HOME: hero === */

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 64px; align-items: center;
}
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-note {
  margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--hair);
  font-size: 14.5px; line-height: 1.6; color: var(--muted); max-width: 560px;
}
.hero-note strong { color: var(--ink); font-weight: 600; }
.hero-inline { font-size: 14.5px; color: var(--muted-2); }
.hero-inline a { font-weight: 600; }

/* The frame is 4:5, so letting it take the full column on a wide screen would
   make the hero absurdly tall. Cap it and pin it to the right edge instead. */
.video-frame {
  border: 1px solid var(--card-border-2); border-radius: 8px; overflow: hidden;
  background: var(--darker); box-shadow: 0 24px 60px -30px rgba(23, 35, 59, 0.55);
  max-width: 540px; margin-left: auto;
}
.video-frame__inner {
  position: relative; aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #16273f, #0d1826);
}
.video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.video-frame__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(14, 27, 46, .1), rgba(14, 27, 46, .55));
}
.video-frame__caption {
  position: absolute; left: 18px; bottom: 16px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em;
  color: rgba(250, 248, 244, .82); text-transform: uppercase;
}

/* ====================================================== HOME: stakes === */

.pullquote {
  margin: 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 4.2vw, 52px); line-height: 1.14; letter-spacing: -0.015em;
  color: var(--on-dark-head);
}
.pullquote .amount { color: var(--gold-bright); }
.attribution {
  margin-top: 26px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-muted);
}

/* ===================================================== HOME: portals === */

.portals-intro { max-width: 760px; margin-bottom: 56px; }
.portals-controls { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.portals-hint {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted-mono);
}
.track { position: relative; height: 2px; background: #E4DED3; margin: 8px 6px 30px; border-radius: 2px; }
.track__dot {
  position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%;
  background: #B4894C; box-shadow: 0 0 0 4px rgba(180, 137, 76, .18);
  transition: left .75s cubic-bezier(.4, 0, .2, 1);
}
.is-submitted .track__dot { left: calc(100% - 10px); }
@media (prefers-reduced-motion: reduce) { .track__dot { transition: none; } }

.portals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.card {
  background: var(--white); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 22px; box-shadow: var(--shadow-sm);
}
.card__kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 4px;
}
.card__title { font-family: var(--serif); font-weight: 600; font-size: 19px; margin-bottom: 18px; color: var(--ink); }

.panel { border: 1px solid var(--inner-2); border-radius: 7px; padding: 15px; background: var(--field); }
.panel__head { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 12px; }
.kv {
  display: flex; justify-content: space-between; font-size: 12.5px;
  color: var(--muted-2); padding: 7px 0; border-top: 1px solid var(--inner);
}
.kv span:last-child { color: var(--ink-soft); font-weight: 500; }

.status-row { margin-top: 14px; display: flex; align-items: center; gap: 9px; }
.status-row__label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.dot-amber { color: #C79A45; font-size: 9px; line-height: 1; }
.dot-green { color: var(--green); font-size: 9px; line-height: 1; }

.meter-label { font-size: 12.5px; color: var(--muted-2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.meter-label span:last-child { color: var(--ink-soft); font-weight: 600; }
.meter { height: 8px; background: var(--inner); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.meter__fill { height: 100%; width: 87%; background: var(--navy); border-radius: 99px; transition: width .6s ease-out; }
.is-submitted .meter__fill { width: 88%; }
@media (prefers-reduced-motion: reduce) { .meter__fill { transition: none; } }

.rows { border: 1px solid var(--inner-2); border-radius: 7px; overflow: hidden; }
.rows__row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 13px; font-size: 12.5px;
}
.rows__row--first { background: var(--field); }
.rows__row--first span:first-child { color: var(--ink-soft); font-weight: 500; }
.rows__row--rest { border-top: 1px solid var(--inner); color: var(--muted-3); }

.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 99px; font-weight: 500;
  background: #F4ECD9; color: #7A5B22;
}
.is-submitted .pill { background: #E4EFE6; color: #2C5738; }

.agency-note { margin-top: 14px; font-size: 12px; line-height: 1.5; color: var(--muted-3); }
.agency-label { font-size: 12.5px; color: var(--muted-2); margin-bottom: 10px; }

.awaiting {
  border: 1px dashed #E0D9CC; border-radius: 7px; padding: 26px 14px; text-align: center;
  font-size: 12.5px; color: #A29C8E; font-family: var(--mono); letter-spacing: 0.04em;
}
.validated { border: 1px solid var(--green-border); background: var(--green-bg); border-radius: 7px; padding: 14px; }
.validated__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.validated__head .check { color: var(--green); font-size: 14px; }
.validated__head .label { font-size: 13px; font-weight: 600; color: var(--green-dark); }
.validated .kv-green {
  display: flex; justify-content: space-between; font-size: 12px; color: #4A6153; padding: 5px 0;
}
.validated .kv-green + .kv-green { border-top: 1px solid #DDEAE0; }
.validated .kv-green span:last-child { font-family: var(--mono); }

/* only one of the two agency states is shown at a time */
.state-submitted { display: none; }
.is-submitted .state-submitted { display: block; }
.is-submitted .state-awaiting { display: none; }

/* ================================================== HOME: validation === */

.validation-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 72px; align-items: center;
}
.validation-grid > :not(.check-card) p { max-width: var(--measure); }
.check-card {
  background: var(--white); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 24px; box-shadow: 0 18px 44px -30px rgba(23, 35, 59, .45);
}
.check-card__kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-mono); margin-bottom: 16px;
}
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 8px; }
.field-bad {
  display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--red); background: var(--red-bg); border-radius: 6px; padding: 12px 14px;
}
.field-bad__value { font-family: var(--mono); font-size: 15px; color: var(--ink-soft); }
.field-bad__tag { font-size: 12px; font-weight: 600; color: var(--red); }
.field-error { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--red-text); }
.field-fixed {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--inner);
  display: flex; align-items: center; gap: 9px;
}
.field-fixed .check { color: var(--green); }
.field-fixed .text { font-size: 13px; color: #4A6153; }
.field-fixed .value { font-family: var(--mono); color: var(--green-dark); font-weight: 500; }

/* =================================================== HOME: audiences === */

.audience-intro { max-width: 720px; margin-bottom: 52px; }
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.audience { border-top: 2px solid var(--navy); padding-top: 20px; }
.audience__title { font-family: var(--serif); font-weight: 600; font-size: 23px; margin-bottom: 12px; color: var(--ink); }
.audience p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }

.callout {
  margin-top: 44px; background: var(--dark); border-radius: 10px; padding: 28px 32px;
  color: var(--on-dark-strong); font-size: 16.5px; line-height: 1.6;
  max-width: 108ch;
}
.callout__tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold-dark-bg); margin-right: 14px;
}

/* ================================================= HOME: screenshots === */

.shot {
  border: 1px solid var(--card-border-2); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-lg);
}
/* Captures keep their own 3:2 ratio, so the frames are narrowed instead of
   cropped — that keeps the whole screenshot visible without a tall banner. */
.shot--wide { margin: 0 auto 24px; max-width: 820px; }
.shot__ph {
  background-image: repeating-linear-gradient(135deg, #EFEAE0 0 12px, #F5F1E9 12px 24px);
  display: flex; align-items: center; justify-content: center;
}
.shot__ph--wide { aspect-ratio: 16 / 8; }
.shot__ph--std { aspect-ratio: 16 / 10; }
.shot__ph span { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; color: #A29C8E; }

/* Real captures, shown whole at their native 3:2 — no cropping, no distortion.
   Size is controlled by the frame widths above/below, not by a forced ratio. */
.shot__img { display: block; width: 100%; height: auto; }
.shot__cap { padding: 16px 22px; border-top: 1px solid var(--inner-2); font-size: 14px; color: var(--muted); }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 1180px; margin: 0 auto; }

.embed {
  border: 1px solid var(--card-border-2); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-lg); background: #000;
}
.embed__ratio { aspect-ratio: 16 / 9; }
.embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ===================================================== HOME: closing === */

.close-mailto {
  display: inline-block; font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3.2vw, 34px); color: var(--gold-bright);
  border-bottom: 2px solid rgba(231, 196, 128, .35); padding-bottom: 4px;
}
.close-mailto:hover { color: #F2D79B; }

/* ==================================================== PRODUCT: rows === */

.feature-rows { display: flex; flex-direction: column; gap: 96px; }
.feature-row { display: flex; gap: 56px; align-items: center; }
.feature-row--flip { flex-direction: row-reverse; }
.feature-row__media { flex: 1.25; min-width: 0; }
.feature-row__text { flex: 1; min-width: 0; max-width: 620px; }
.feature-frame {
  border: 1px solid var(--card-border-2); border-radius: 10px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow-lg);
}
.feature-frame img { display: block; width: 100%; height: auto; }
.feature-kicker {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 14px;
}
.feature-title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1; letter-spacing: -0.015em; margin: 0 0 16px; color: var(--ink);
}
.feature-body { font-size: 17px; line-height: 1.62; color: var(--body); margin: 0 0 22px; }
.impact {
  background: var(--paper-alt); border-left: 2px solid var(--gold);
  padding: 14px 18px; font-size: 14.5px; line-height: 1.55; color: var(--muted);
}
.impact__tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 6px;
}

/* ============================================= CASE STUDY: the loop === */

.cs-hero-note {
  margin: 32px 0 0; border-left: 2px solid rgba(201, 164, 100, 0.35); padding-left: 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  line-height: 1.7; color: var(--on-dark-muted); max-width: 600px;
}

/* --- the rail: six stages that visibly close back on themselves --- */
.rail { position: relative; }
.rail__stages {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 18px 8px;
}
.rail__stage {
  display: flex; align-items: center; gap: 10px; position: relative;
  background: var(--paper); padding-right: 4px;
}
.rail__stage + .rail__stage::before {
  content: "\2192"; position: absolute; left: -22px;
  color: var(--muted-3); font-size: 13px;
}
.rail__num {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--white); border: 1px solid #E0D6C2;
  font-family: var(--mono); font-size: 13px; color: var(--gold);
}
.rail__name {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-soft);
}
/* a dashed U beneath the rail: stage 6 returns to stage 1 */
.rail__return {
  height: 42px; margin-top: 6px;
  border: 2px dashed var(--card-border-2); border-top: none; border-radius: 0 0 12px 12px;
  position: relative;
}
.rail__return::before {
  content: ""; position: absolute; left: -7px; top: -4px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 8px solid var(--card-border-2);
}
.rail__return-label {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  background: var(--paper); padding: 0 14px; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold);
}
.rail__caption {
  margin: 26px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); max-width: 620px;
}

/* ============================================= CASE STUDY: ledger === */
/* Card layout from the shipped design (a67672c); each card is now a
   <details> so the headline reads on its own side and the detail drops
   down on click. */

.ledger-head {
  display: grid; grid-template-columns: 1fr 220px 1fr; gap: 0 28px;
  align-items: center; margin-bottom: 34px;
}
.ledger-head__bad {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--red-text); text-align: right;
}
.ledger-head__good {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--navy);
}

.ledger { display: flex; flex-direction: column; gap: 26px; }
/* start, not stretch — either side can be open on its own without the
   closed one inflating to match */
.ledger-step { display: grid; grid-template-columns: 1fr 220px 1fr; gap: 0 28px; align-items: start; }

.step-bad {
  background: var(--red-bg-2); border: 1px solid var(--red-border);
  border-radius: 10px; padding: 24px 26px;
}
.step-good {
  background: var(--white); border: 1px solid #D9E0EC; border-radius: 10px;
  padding: 24px 26px; box-shadow: 0 12px 34px -28px rgba(28, 63, 110, .5);
}

/* --- the clickable headline --- */
.step-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  cursor: pointer; list-style: none;
}
.step-head::-webkit-details-marker { display: none; }
.step-bad__title  { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.32; color: var(--red-title); }
.step-good__title { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.32; color: var(--navy); }
.step-bad:hover  .step-bad__title  { color: #6F3527; }
.step-good:hover .step-good__title { color: #16345B; }
.step-bad:has(> .step-head:focus-visible),
.step-good:has(> .step-head:focus-visible) { outline: 2px solid var(--navy); outline-offset: 2px; }
.step-head:focus-visible { outline: none; }

/* plus/minus drawn in CSS, no icon font */
.step-toggle { position: relative; width: 18px; height: 18px; flex: none; margin-top: 5px; }
.step-toggle::before, .step-toggle::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%); transition: transform .25s ease;
}
.step-toggle::before { width: 12px; height: 1.5px; }
.step-toggle::after  { width: 1.5px; height: 12px; }
.step-bad  .step-toggle::before, .step-bad  .step-toggle::after { background: var(--red); }
.step-good .step-toggle::before, .step-good .step-toggle::after { background: var(--navy); }
.step-bad[open]  .step-toggle::after,
.step-good[open] .step-toggle::after { transform: translate(-50%, -50%) scaleY(0); }

/* --- what drops down --- */
.step-body { margin-top: 16px; }
.step-frame {
  font-size: 14.5px; line-height: 1.55; margin: 0 0 14px;
  padding-bottom: 14px; border-bottom: 1px solid;
}
.step-bad  .step-frame { color: var(--red-body); border-bottom-color: var(--red-border); }
.step-good .step-frame { color: var(--body);     border-bottom-color: var(--inner-2); }

.bullets { display: flex; flex-direction: column; gap: 8px; }
.bullet { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.55; }
.bullet--bad { color: var(--red-body); }
.bullet--bad .mark { color: var(--red); flex: none; }
.bullet--good { color: var(--body); }
.bullet--good .mark { color: var(--green); flex: none; }

.step-mid {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 10px; text-align: center; padding-top: 18px;
}
.step-badge {
  font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--gold);
  border: 1px solid #E0D6C2; background: var(--paper); border-radius: 99px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex: none;
}
.step-label { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); line-height: 1.4; max-width: 180px; }

/* ======================================== CASE STUDY: analysis layer === */

.ai-layer { background: var(--dark); padding: 96px var(--gutter); }
.ai-layer__tag {
  display: inline-block; margin-bottom: 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold-dark-bg);
}
.ai-layer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 46px; }
.ai-card {
  background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(201, 164, 100, 0.22);
  border-radius: 10px; padding: 26px 24px;
}
.ai-card__label {
  display: block; font-family: var(--serif); font-weight: 600; font-size: 20px;
  color: var(--gold-bright); margin-bottom: 12px;
}
.ai-card p { margin: 0; font-size: 14.5px; line-height: 1.62; color: var(--on-dark-body); }
.ai-card__eg {
  display: block; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6; color: var(--on-dark-muted);
}
/* the guardrail sits with the capability, not in a footnote elsewhere */
.ai-layer__note {
  margin: 40px 0 0; border-left: 2px solid rgba(201, 164, 100, 0.35); padding-left: 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  line-height: 1.75; color: var(--on-dark-muted); max-width: 660px;
}

/* --- AI-assisted marker: present, deliberately not loud --- */
.cs-ai-tag {
  display: inline-block; margin-left: 7px; vertical-align: 1px; white-space: nowrap;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold);
  border: 1px solid #E0D6C2; border-radius: 99px; padding: 2px 7px;
}

/* --- outcomes: three vantage points, all affirmative --- */
.cs-outcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; }
.cs-outcome__title {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  line-height: 1.25; color: var(--ink); margin: 0 0 16px;
}
.cs-outcome__list {
  list-style: none; margin: 0; padding: 0 0 0 16px;
  display: flex; flex-direction: column; gap: 10px;
  border-left: 2px solid #D9E0EC; font-size: 15px; line-height: 1.6; color: var(--body);
}

.cs-closing {
  margin: 64px 0 0; padding: 40px 44px; background: var(--dark); border-radius: 10px;
  font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 2.3vw, 27px);
  line-height: 1.42; color: var(--on-dark-head); text-wrap: pretty;
}
.cs-trust-note {
  margin: 24px 0 0; border-left: 2px solid var(--hair); padding-left: 16px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.04em;
  line-height: 1.75; color: var(--muted-mono); max-width: 620px;
}

.cs-cta { margin-top: 52px; text-align: center; }
.cs-cta__note {
  margin: 16px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--muted);
  max-width: 460px; margin-left: auto; margin-right: auto;
}

/* ==================================================== COMPANY: team === */

.section-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 32px;
  border-bottom: 1px solid var(--hair); padding-bottom: 14px;
}
.section-label--alt { border-bottom-color: #E0D9CA; }

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }

.founder {
  background: var(--white); border: 1px solid var(--card-border); border-radius: 10px;
  overflow: hidden; box-shadow: var(--shadow-md);
}
.founder__head { display: flex; gap: 22px; padding: 28px 28px 0; align-items: flex-start; }
.founder__photo {
  width: 104px; height: 104px; object-fit: cover; border-radius: 8px;
  flex: none; border: 1px solid var(--card-border);
}
.founder__name { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink); }
.founder__role {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); margin-top: 6px;
}
.founder__links { display: flex; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.founder__links a, .founder__link { font-size: 13.5px; font-weight: 600; }
.founder__link { display: inline-block; margin-top: 10px; }
.founder__bio { padding: 20px 28px 28px; margin: 0; font-size: 15px; line-height: 1.62; color: var(--muted); }

.advisor { display: flex; gap: 22px; align-items: flex-start; }
.advisor__photo {
  width: 88px; height: 88px; object-fit: cover; border-radius: 8px;
  flex: none; border: 1px solid #E0D9CA;
}
.advisor__name { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); }
.advisor__role {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); margin: 5px 0 10px;
}
.advisor p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

/* ==================================================== CONTACT: form === */

.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 80px; align-items: start;
}
.contact-links { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.contact-link {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px solid var(--card-border); background: var(--white);
  border-radius: 8px; padding: 16px 20px;
}
.contact-link:hover { border-color: var(--gold); }
.contact-link__label { font-size: 14.5px; color: var(--body); }
.contact-link__value { font-size: 14.5px; font-weight: 600; color: var(--navy); }

/* Inputs stop being usable past a point, so the card doesn't ride the shell. */
.form-card {
  background: var(--white); border: 1px solid var(--card-border); border-radius: 10px;
  padding: 36px; box-shadow: var(--shadow-lg);
  max-width: 720px;
}
.form-card__title { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); margin-bottom: 6px; }
.form-card__note { font-size: 14.5px; color: var(--muted-2); margin: 0 0 26px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field--full { margin-top: 18px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

.input, .textarea {
  font-family: var(--sans); font-size: 14.5px; color: var(--ink);
  background: var(--field); border: 1px solid #DED6C6; border-radius: 6px;
  padding: 11px 13px; width: 100%;
}
.textarea { resize: vertical; min-height: 110px; }
.input:focus, .textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.form-submit { font-size: 15px; padding: 14px 26px; }
.form-status { font-size: 13.5px; font-weight: 500; }
.form-status--ok { color: var(--green); }
.form-status--err { color: var(--red-text); }
.is-hidden { display: none; }

/* =================================================== responsive ======= */

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-grid .video-frame__inner { aspect-ratio: 16 / 10; }
  /* stacked hero: the frame spans the column again, so drop the desktop cap */
  .hero-grid .video-frame { max-width: none; margin-left: 0; }
  .validation-grid { grid-template-columns: 1fr; gap: 44px; }
  .contact-grid { grid-template-columns: 1fr; gap: 52px; }
  .feature-rows { gap: 72px; }
  .feature-row, .feature-row--flip { flex-direction: column; gap: 32px; align-items: stretch; }
  .feature-row__text { max-width: none; }
  .ledger-head, .ledger-step { grid-template-columns: 1fr 160px 1fr; gap: 0 20px; }
  .step-label { max-width: 140px; }
  .cs-outcome-grid { gap: 32px; }
  .ai-layer__grid { gap: 18px; }
}

@media (max-width: 860px) {
  .section, .section-alt { padding: 76px 24px; }
  .section-hero { padding: 64px 24px 56px; }
  .section-dark { padding: 76px 24px; }
  .site-header__inner, .site-footer__inner { padding-left: 24px; padding-right: 24px; }

  /* nav collapses to a disclosure menu */
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--hair);
    padding: 4px 24px 14px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 16px; line-height: 1.35; }
  .site-nav a.is-active { border-bottom: 1px solid var(--hair); }
  .site-nav a.nav-cta {
    margin-top: 10px; text-align: center; border-bottom: none;
    padding: 11px 18px; font-size: 15px; line-height: 1.25;
  }

  .portals-grid { grid-template-columns: 1fr; gap: 18px; }
  .audience-grid { grid-template-columns: 1fr; gap: 24px; }
  .shot-pair { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr; gap: 24px; }
  .callout { padding: 24px; }
  .callout__tag { display: block; margin: 0 0 10px; }

  /* ledger stacks: shift line, step marker, then the two outcomes */
  .ledger-head { display: none; }
  .ledger-step { grid-template-columns: 1fr; gap: 14px; }
  .step-mid { flex-direction: row; justify-content: flex-start; gap: 12px; text-align: left; padding-top: 0; }
  .step-label { max-width: none; }
  .step-bad::before, .step-good::before {
    display: block; font-family: var(--mono); font-size: 10.5px;
    letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px;
  }
  .step-bad::before { content: "Today"; color: var(--red-text); }
  .step-good::before { content: "With CiviSight"; color: var(--navy); }

  /* rail: a tidy two-column grid, since inline arrows can't survive wrapping */
  .rail__stages { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .rail__stage + .rail__stage::before { display: none; }
  .rail__return { height: 34px; }
  .rail__return-label { font-size: 10px; letter-spacing: 0.1em; padding: 0 10px; }

  /* walkthrough: track moves to the left gutter, columns stack */
  /* all three dot sizes match here so they share one centre line on the rail */
  /* scoped to the marker — the end-cap dot must stay in flow, or the
     end cap collapses and the track stops short of it */
  /* margin:0 overrides the base auto margins, which would otherwise still
     centre this dot inside the flex end cap despite justify-content */
  /* both columns now share an edge, so slide up rather than in */

  .ai-layer { padding: 72px var(--gutter); }
  .ai-layer__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 34px; }

  .cs-outcome-grid { grid-template-columns: 1fr; gap: 34px; }
  .cs-closing { padding: 30px 26px; margin-top: 48px; }

  .form-card { padding: 26px; }
  .founder__head { padding: 22px 22px 0; }
  .founder__bio { padding: 16px 22px 22px; }
}

@media (max-width: 620px) {
  .section, .section-alt, .section-dark { padding: 60px 20px; }
  .section-hero { padding: 52px 20px 48px; }
  .site-header__inner, .site-footer__inner { padding-left: 20px; padding-right: 20px; }
  .site-nav { padding: 12px 20px 20px; }
  .site-nav a { padding: 13px 0; }
  .site-nav a.nav-cta { margin-top: 14px; padding: 13px 18px; }
  .rail__return {
    width: 76%; height: 24px; margin: 16px auto 0;
    border: 0; border-top: 2px dashed var(--card-border-2); border-radius: 0;
  }
  .rail__return::before { left: -1px; top: -6px; }
  .rail__return-label { bottom: -8px; padding: 0 10px; font-size: 10px; }
  .lede { font-size: 18px; }
  .lede-19, .lede-dark { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-actions { gap: 16px; }
  .btn { width: 100%; text-align: center; }
  .hero-inline { width: 100%; }
  .founder__head { flex-direction: column; gap: 16px; }
  .advisor { flex-direction: column; gap: 16px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .site-footer__links { flex-wrap: wrap; gap: 16px; }
}
