/* DealSource Systems v3.
   Direction: instrument-grade origination infrastructure on private bank paper.
   Palette P2 Midnight & Champagne. Champagne is a scalpel, not a paint roller:
   the origin dot, hairline moments, small data highlights only. */

/* ---------- Fonts (self-hosted, subset, variable) ---------- */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-var.woff2") format("woff2");
  font-weight: 380 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/plexmono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* Size-adjusted local fallback so swap causes zero layout shift */
@font-face {
  font-family: "Newsreader-fallback";
  src: local("Georgia");
  size-adjust: 96%;
  ascent-override: 76.6%;
  descent-override: 27.6%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  --midnight: #0b1420;
  --midnight-2: #101b29;       /* raised surface on midnight */
  --paper: #f5f2eb;
  --paper-deep: #ece7db;
  --ink: #0b1420;
  --ink-72: rgba(11, 20, 32, 0.74);
  --ink-50: rgba(11, 20, 32, 0.5);
  --ink-30: rgba(11, 20, 32, 0.3);
  --slate: #4d5a68;
  --rule: rgba(11, 20, 32, 0.16);
  --rule-strong: rgba(11, 20, 32, 0.38);
  --champagne: #b99a5f;
  --champ-dark: #c9ad74;       /* champagne on midnight */
  --champ-light: #7d6430;      /* champagne on paper, AA at small mono sizes */
  --paper-on-ink: #f5f2eb;
  --paper-72: rgba(245, 242, 235, 0.74);
  --paper-55: rgba(245, 242, 235, 0.55);
  --paper-35: rgba(245, 242, 235, 0.34);
  --paper-rule: rgba(245, 242, 235, 0.14);
  --serif: "Newsreader", "Newsreader-fallback", Georgia, serif;
  --mono: "Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 38rem;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset-ish ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(11, 20, 32, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
svg { overflow: visible; }

.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;
}

::selection { background: var(--midnight); color: var(--paper); }

:focus-visible {
  outline: 1.5px solid var(--champ-light);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2vw, 1.5rem);
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Type helpers ---------- */

.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--champ-light);
}
.kicker-dark { color: var(--champ-dark); }

h2 {
  font-weight: 400;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  color: var(--paper);
  background: var(--midnight);
  padding: 1.02rem 1.8rem;
  border: 1px solid var(--midnight);
  border-radius: 2px;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease),
              box-shadow 160ms var(--ease);
}
.button:hover {
  transform: translateY(-1px);
  background: #16222f;
  box-shadow: 0 1px 0 var(--rule-strong);
}
.button:active { transform: translateY(0); }

.button-light {
  color: var(--midnight);
  background: var(--paper);
  border-color: var(--paper);
}
.button-light:hover {
  background: #fffdf8;
  box-shadow: 0 1px 0 rgba(245, 242, 235, 0.4);
}

/* ---------- Pulse dot (the one champagne signal light) ---------- */

.pulse-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--champ-dark);
  margin-right: 0.55em;
  vertical-align: 1px;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 173, 116, 0.45); }
  50%      { box-shadow: 0 0 0 5px rgba(201, 173, 116, 0); }
}

/* ---------- Credibility bar ---------- */

.credbar {
  background: var(--midnight);
  color: var(--paper-72);
}
.credbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  max-width: 74rem;
  margin-inline: auto;
  padding: 0.55rem clamp(1.25rem, 4vw, 2.5rem);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.credbar-link {
  text-decoration: none;
  color: var(--paper-72);
  transition: color 160ms var(--ease);
}
.credbar-link:hover { color: var(--paper); }
.credbar-fact { color: var(--paper-55); white-space: nowrap; }

/* ---------- Sticky frosted header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 242, 235, 0.82);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: 74rem;
  margin-inline: auto;
  padding: 0.95rem clamp(1.25rem, 4vw, 2.5rem);
}

/* The Origin Point wordmark: the o of Source is an engraved ring
   with the champagne dot at its origin. */
.wordmark { text-decoration: none; }
.wm-text {
  font-family: var(--serif);
  font-weight: 430;
  font-size: 1.3rem;
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1;
}
.wm-o {
  display: inline-block;
  width: 0.56em;
  height: 0.56em;
  margin-inline: 0.03em;
  vertical-align: baseline;
}
.wm-ring { stroke: currentColor; }
.wm-dot { fill: var(--champ-light); }
.wordmark-dark .wm-dot, .footer-giant .wm-dot { fill: var(--champ-dark); }

.site-nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 1.9rem);
  align-items: center;
}
.site-nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-72);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  padding-bottom: 3px;
  transition: background-size 160ms var(--ease), color 160ms var(--ease);
}
.site-nav a:hover { color: var(--ink); background-size: 100% 1px; }
.site-nav .nav-cta {
  color: var(--paper);
  background: var(--midnight);
  background-image: none;
  padding: 0.65rem 1.1rem;
  border-radius: 2px;
  transition: background-color 160ms var(--ease);
}
.site-nav .nav-cta:hover { background: #16222f; color: var(--paper); }

/* Active page marker: a steady champagne underline, distinct from the
   ink hover underline. Never applied to the CTA. */
.site-nav a[aria-current="page"]:not(.nav-cta) {
  color: var(--ink);
  background-image: linear-gradient(var(--champ-light), var(--champ-light));
  background-size: 100% 1px;
}
.site-nav a[aria-current="page"]:not(.nav-cta):hover {
  background-image: linear-gradient(var(--champ-light), var(--champ-light));
}

/* Multipage nav: hold the header to a single line and a calm height across
   the tablet band, tightening the link gap before anything wraps. */
.header-inner { min-height: 56px; }
@media (max-width: 1024px) {
  .site-nav { gap: clamp(0.9rem, 2vw, 1.5rem); }
  .site-nav a { font-size: 0.68rem; letter-spacing: 0.1em; }
}

/* Mobile nav: below 760px the links wrap onto their own calm rows beneath
   the wordmark, so the full Tier 1 nav stays reachable on phones without a
   JS toggle. Zero-JS keeps it identical on every static page. The older rule
   that hid secondary links on the homepage is overridden in this band. */
@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .site-nav {
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    align-items: center;
    margin-top: 0.25rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rule);
  }
  .site-nav a:not(.nav-cta) {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    padding-block: 0.45rem;
  }
  .site-nav .nav-cta { margin-left: auto; }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 8vh, 6rem) clamp(3rem, 7vh, 5rem);
  overflow: hidden;
}

/* Optional cinematic film layer. Off by default; enable with data-film="on"
   on .hero once hero-film.mp4 exists. Masks are pre-built so the film fades
   into the paper background and never fights the type. */
.hero-film { display: none; }
.hero[data-film="on"] .hero-film {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero[data-film="on"] .hero-film video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0; /* main.js drives opacity as a per-loop fade envelope */
  filter: saturate(0.92) contrast(1.06);
  /* Top and bottom fades so the film never draws a dividing line against the
     header or the section below; the horizontal fade keeps the left text
     column clean while letting the film read clearly through the centre and
     right. */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 72%, transparent 98%),
    linear-gradient(to right, transparent 2%, rgba(0,0,0,0.5) 30%, #000 58%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 22%, #000 72%, transparent 98%),
    linear-gradient(to right, transparent 2%, rgba(0,0,0,0.5) 30%, #000 58%);
  mask-composite: intersect;
}
.hero .grid { position: relative; z-index: 1; }

.hero-grid { row-gap: 0; }
.hero .kicker {
  grid-column: 2 / 12;
  grid-row: 1;
  margin-bottom: 2rem;
}
.hero h1 {
  grid-column: 2 / 13;
  grid-row: 2;
  font-size: clamp(2.7rem, 6.6vw, 5.2rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.02em;
}
.hero h1 .h1-line { display: block; }
.hero h1 .h1-line-2 { margin-left: calc(100% / 12); color: var(--slate); }
.hero h1 em { font-style: italic; font-weight: 420; }
.hero h1 .h1-dot { color: var(--champ-light); font-style: normal; }

.hero-lede {
  grid-column: 2 / 9;
  grid-row: 3;
  max-width: var(--measure);
  margin-top: 2.2rem;
  font-size: 1.18rem;
  color: var(--ink-72);
}

/* Product-in-hero: the thesis input */
.thesis-form {
  grid-column: 2 / 10;
  grid-row: 4;
  margin-top: 2.6rem;
}
.thesis-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-72);
  margin-bottom: 0.7rem;
}
.thesis-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
  max-width: 44rem;
}
.thesis-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 0.95rem 1.05rem;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.thesis-input::placeholder { color: var(--ink-72); }
.thesis-input:focus {
  outline: none;
  border-color: var(--midnight);
  background: #fffdf8;
}
.thesis-row .button { flex: none; white-space: nowrap; }
.thesis-hint {
  margin-top: 0.7rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-72);
}

/* ---------- Proof: stat strip directly below the hero ---------- */

.proof { padding-block: 0 clamp(3.5rem, 8vh, 5.5rem); }
.hero-stats {
  grid-column: 2 / 13;
  padding-top: 2.2rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: clamp(1.4rem, 3vw, 3rem);
}
.hstat { padding-right: clamp(0.8rem, 2vw, 2rem); }
.hstat + .hstat { border-left: 1px solid var(--rule); padding-left: clamp(1.4rem, 3vw, 3rem); }
.hstat-figure {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.hstat-figure .num { display: inline-block; }
.num.w1 { min-width: 1ch; }
.num.w2 { min-width: 2ch; }
.num.w3 { min-width: 3ch; }
.hstat-unit { font-size: 40%; color: var(--ink-72); letter-spacing: 0; }
.hstat-caption {
  display: block;
  margin-top: 0.75rem;
  max-width: 15rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-72);
}
.hstat-source {
  grid-column: 1 / -1;
  margin-top: 2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--ink-72);
}

/* staggered fade-up on load */
.fade-in-up { animation: fade-up 0.6s var(--ease) both; }
.d-1 { animation-delay: 80ms; }
.d-2 { animation-delay: 160ms; }
.d-3 { animation-delay: 240ms; }
.d-4 { animation-delay: 320ms; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* scroll reveals (progressively enhanced) */
@supports (animation-timeline: view()) {
  .reveal {
    animation: fade-up linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 38%;
  }
}

/* ---------- The system, live (telemetry) ---------- */

.telemetry {
  background: var(--midnight);
  color: var(--paper-on-ink);
  padding-block: clamp(5rem, 11vh, 8.5rem);
}
.telemetry-grid { row-gap: 0; }
.tel-head { grid-column: 2 / 10; grid-row: 1; }
.tel-head h2 { margin-top: 1.4rem; color: var(--paper-on-ink); }
.tel-lede {
  margin-top: 1.4rem;
  max-width: var(--measure);
  color: var(--paper-72);
  font-size: 1.08rem;
}

/* Map / Detect / Engage: names the pipeline the visual below depicts */
.tel-phases {
  list-style: none;
  margin: 2.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}
.tel-phases li {
  padding-top: 1rem;
  border-top: 1px solid var(--paper-rule);
}
.tel-phase-k {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--champ-dark);
  margin-bottom: 0.7rem;
}
.tel-phases p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--paper-72);
}

/* Legend: what each mark on the map means */
.tel-legend {
  list-style: none;
  margin: 0;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--paper-rule);
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--paper-55);
}
.tel-legend li { display: flex; align-items: center; gap: 0.55rem; }
.lg-mark { display: inline-block; width: 14px; height: 14px; flex: none; position: relative; }
.lg-dot::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 5px; height: 5px; border-radius: 50%; background: var(--paper-35);
}
.lg-ring::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.4px solid var(--champ-dark);
}
.lg-ring::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 4px; height: 4px; border-radius: 50%; background: var(--champ-dark); z-index: 1;
}
.lg-sweep::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px; border-radius: 50%;
  border: 1.4px solid var(--paper-55);
  border-top-color: var(--champ-dark);
}

.tel-panel {
  grid-column: 1 / 13;
  grid-row: 2;
  margin-top: 3.2rem;
  background: var(--midnight-2);
  border: 1px solid var(--paper-rule);
  border-radius: 3px;
  overflow: hidden;
}
.tel-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  border-bottom: 1px solid var(--paper-rule);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tel-title { color: var(--paper-55); }
.tel-status { color: var(--champ-dark); }

.tel-map { border-bottom: 1px solid var(--paper-rule); }
.tel-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1160 / 400;
  overflow: hidden;
}
.md-field circle { fill: var(--paper-35); }
.md-field .md-loc { fill: var(--champ-dark); }
.md-ring {
  fill: none;
  stroke: var(--champ-dark);
  stroke-width: 1.2;
  opacity: 0.9;
}
/* With JS running, rings start hidden and are lit one by one */
.js .md-ring {
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  transform: scale(0.4);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.js .md-ring.on { opacity: 0.9; transform: scale(1); }
.js .md-field .md-loc { fill: var(--paper-35); transition: fill 700ms var(--ease); }
.js .md-field .md-loc.on { fill: var(--champ-dark); }

.tel-sweep { opacity: 0; transition: transform 1500ms var(--ease), opacity 600ms var(--ease); }
.js .tel-sweep.live { opacity: 1; }
.sweep-halo { fill: none; stroke: rgba(201, 173, 116, 0.18); stroke-width: 1; }
.sweep-ring {
  fill: none;
  stroke: var(--paper-55);
  stroke-width: 1.4;
  animation: sweep-breathe 3.2s var(--ease) infinite;
}
.sweep-dot { fill: var(--champ-dark); }
@keyframes sweep-breathe {
  0%, 100% { stroke-opacity: 0.55; }
  50%      { stroke-opacity: 1; }
}

.tel-meta {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.3fr;
  align-items: stretch;
}
.tel-meta > * { padding: 1.4rem 1.4rem 1.5rem; }
.tel-meta > * + * { border-left: 1px solid var(--paper-rule); }

.tel-counters { display: grid; row-gap: 1.1rem; align-content: start; }
.tel-counter { display: grid; }
.tel-num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--paper-on-ink);
}
.tel-cap {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-55);
  margin-top: 0.25rem;
}

.tel-pulse { display: flex; flex-direction: column; justify-content: flex-end; gap: 0.8rem; }
.tel-pulse svg { width: 100%; height: 44px; }
.hb-line {
  stroke: var(--champ-dark);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-dasharray: 640;
  stroke-dashoffset: 0;
  animation: heartbeat 5.5s linear infinite;
}
@keyframes heartbeat {
  from { stroke-dashoffset: 1280; }
  to   { stroke-dashoffset: 0; }
}
.tel-pulse-cap {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-55);
}

.tel-feedwrap { display: grid; align-content: start; row-gap: 0.8rem; }
.tel-feed-cap {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-55);
}
.tel-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--paper-72);
}
.tel-feed li {
  padding-block: 0.42rem;
  border-top: 1px solid var(--paper-rule);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tel-feed li:first-child { border-top: 0; }
.tel-feed li.fresh { animation: feed-in 500ms var(--ease-out) both; }
.tel-feed li.fresh .feed-time { color: var(--champ-dark); }
@keyframes feed-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.feed-time {
  color: var(--paper-55);
  margin-right: 0.9em;
  font-variant-numeric: tabular-nums;
}

.tel-note {
  grid-column: 2 / 12;
  grid-row: 3;
  margin-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--paper-72);
}

/* ---------- Old way vs DealSource way ---------- */

.compare { padding-block: clamp(5.5rem, 11vh, 8.5rem) clamp(4.5rem, 9vh, 7rem); }
.compare-grid { row-gap: 0; }
.compare-head { grid-column: 2 / 11; grid-row: 1; }
.compare-panels {
  grid-column: 1 / 13;
  grid-row: 2;
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
}
.compare-panel {
  border-radius: 3px;
  padding: clamp(1.6rem, 3vw, 2.4rem);
}
.compare-panel h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.cmp-canvas { margin-block: 1.6rem; }
.cmp-canvas svg { width: 100%; height: auto; aspect-ratio: 480 / 300; }

.cmp-old {
  background: var(--paper-deep);
  border: 1px solid var(--rule);
}
.cmp-old h3 { color: var(--ink-72); }
.cmp-tangle { stroke: var(--ink-30); stroke-width: 1.5; }
.cmp-old .cmp-list { color: var(--ink-72); }
.cmp-old .cmp-list li::before { background: var(--ink-30); }

.cmp-new {
  background: var(--midnight);
  color: var(--paper-on-ink);
}
.cmp-new h3 { color: var(--paper-55); }
.cmp-path { stroke: var(--paper-55); stroke-width: 1.3; }
.cmp-line { stroke: var(--champ-dark); stroke-width: 1.6; }
.cmp-ring { fill: none; stroke: var(--paper-on-ink); stroke-width: 2; }
.cmp-origin { fill: var(--champ-dark); }
.cmp-new .cmp-list { color: var(--paper-72); }
.cmp-new .cmp-list li::before { background: var(--champ-dark); }

.cmp-chip rect { fill: var(--midnight-2); stroke: var(--paper-rule); stroke-width: 1; }
.cmp-chip text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  fill: var(--paper-72);
}

.cmp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.98rem;
  line-height: 1.55;
}
.cmp-list li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.4rem;
  border-top: 1px solid var(--rule);
}
.cmp-new .cmp-list li { border-top-color: var(--paper-rule); }
.cmp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 6px;
  height: 1px;
}

/* Line drawing: scroll-driven where supported, IO fallback otherwise */
.cmp-draw {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}
.cmp-chip { opacity: 0; }
@supports (animation-timeline: view()) {
  .cmp-draw {
    animation: stroke-in linear both;
    animation-timeline: view();
    animation-range: entry 25% cover 55%;
  }
  .cmp-chip {
    animation: fade-up linear both;
    animation-timeline: view();
    animation-range: cover 35% cover 60%;
  }
}
.no-at .compare-panel.in .cmp-draw { animation: stroke-in 2s var(--ease) both; }
.no-at .compare-panel.in .cmp-chip { animation: fade-up 700ms var(--ease) 1.5s both; }
@keyframes stroke-in { to { stroke-dashoffset: 0; } }

/* ---------- How it works ---------- */

.how { padding-block: clamp(4.5rem, 9vh, 7rem) clamp(5.5rem, 11vh, 8.5rem); }
.how-grid { row-gap: 0; }
.how-head { grid-column: 4 / 12; grid-row: 1; }
.how-head h2 { max-width: 34rem; }

.how-cards {
  grid-column: 2 / 13;
  grid-row: 2;
  list-style: none;
  margin: 3.2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 2vw, 1.5rem);
  counter-reset: card;
}
.how-card {
  position: relative;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out),
              border-color 260ms var(--ease-out);
}
/* champagne hairline, revealed on hover */
.how-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--champagne);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--ease-out);
}
.how-card:hover {
  transform: translateY(-3px);
  border-color: var(--rule-strong);
  box-shadow: 0 14px 30px -18px rgba(11, 20, 32, 0.35);
}
.how-card:hover::before { transform: scaleX(1); }
.card-no {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--ink-30);
  margin-bottom: 1.1rem;
}
.how-card h3 {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.how-card p {
  margin-top: 0.85rem;
  font-size: 1rem;
  color: var(--ink-72);
}
/* scroll-staggered entrance (JS adds .in; hidden only when JS present) */
.js .how-card {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out),
              box-shadow 260ms var(--ease-out), border-color 260ms var(--ease-out);
}
.js .how-card.in { opacity: 1; transform: translateY(0); }
.js .how-card.in:hover { transform: translateY(-3px); }
/* entrance stagger is applied per card by main.js via setTimeout,
   so hover transitions stay instant once cards are in */

/* ---------- Evidence ---------- */

.evidence {
  background: var(--paper-deep);
  border-block: 1px solid var(--rule);
  padding-block: clamp(5.5rem, 11vh, 8.5rem);
}
.evidence-grid { row-gap: 0; }
.evidence-head { grid-column: 4 / 12; grid-row: 1; }

.case {
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: clamp(1.8rem, 4vw, 3rem);
  background: var(--paper);
  position: relative;
}
.case::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--midnight);
}
.case-featured { grid-column: 2 / 9; grid-row: 2; margin-top: 3.2rem; }
.tombstone { grid-column: 9 / 13; grid-row: 2; margin-top: 3.2rem; }
.case-secondary { grid-column: 4 / 12; grid-row: 3; margin-top: 2.4rem; }
.case-tertiary { grid-column: 2 / 10; grid-row: 4; margin-top: 2.4rem; }

.case-quote {
  margin: 2rem 0 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
}
.case-quote blockquote {
  margin: 0;
  font-size: 1.18rem;
  font-style: italic;
  line-height: 1.55;
  color: var(--midnight);
  max-width: 36rem;
}
.case-quote figcaption {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-72);
}
.case-watch {
  display: inline-block;
  margin-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--midnight);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.case-watch:hover { color: var(--champ-light); }

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.case-client {
  font-style: italic;
  font-weight: 450;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
}
.case-type {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-72);
}
.case-stats {
  display: flex;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--rule);
}
.stat-figure {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-figure .num { display: inline-block; }
.stat-unit { font-size: 40%; color: var(--ink-72); letter-spacing: 0; }
.stat-caption {
  display: block;
  font-size: 0.88rem;
  max-width: 13.5rem;
  margin-top: 0.6rem;
  line-height: 1.5;
  color: var(--ink-72);
}
.case-body {
  margin-top: 1.9rem;
  max-width: var(--measure);
  font-size: 1.02rem;
  color: var(--ink-72);
}

/* Deal tombstone pull-quote */
.tombstone {
  align-self: start;
  background: var(--midnight);
  color: var(--paper-on-ink);
  border-radius: 3px;
  padding: 2.2rem 1.8rem 2rem;
  text-align: center;
  display: grid;
  justify-items: center;
}
.tomb-rule {
  display: block;
  width: 2.4rem;
  height: 1px;
  background: var(--champ-dark);
}
.tomb-figure {
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 3.4rem;
  line-height: 1;
}
.tomb-line {
  margin-top: 0.9rem;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--paper-72);
}
.tomb-divider {
  display: block;
  width: 5rem;
  height: 1px;
  background: var(--paper-rule);
  margin-block: 1.5rem;
}
.tomb-firm {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.tomb-meta {
  margin-top: 0.6rem;
  margin-bottom: 1.6rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.9;
  color: var(--paper-55);
}

/* ---------- FAQ ---------- */

.faq { padding-block: clamp(5rem, 10vh, 7.5rem); }
.faq-grid { row-gap: 0; }
.faq-head { grid-column: 4 / 12; grid-row: 1; }
.faq-list { grid-column: 4 / 12; grid-row: 2; margin-top: 2.8rem; }

.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary h3 {
  font-size: 1.2rem;
  font-weight: 450;
  line-height: 1.35;
  letter-spacing: -0.01em;
  transition: color 160ms var(--ease);
}
.faq-item summary:hover h3 { color: var(--champ-light); }
.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--ink-50);
  flex: none;
  transition: transform 200ms var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item > p {
  margin: 0;
  padding: 0 0 1.6rem 1.5rem;
  max-width: var(--measure);
  font-size: 1.02rem;
  color: var(--ink-72);
}
.faq-item a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.faq-item a:hover { color: var(--champ-light); }

@supports (interpolate-size: allow-keywords) {
  .faq-item { interpolate-size: allow-keywords; }
  .faq-item::details-content {
    block-size: 0;
    overflow-y: clip;
    transition: block-size 250ms var(--ease), content-visibility 250ms allow-discrete;
  }
  .faq-item[open]::details-content { block-size: auto; }
}

/* ---------- CTA ---------- */

.cta {
  background: var(--midnight);
  color: var(--paper-on-ink);
  padding-block: clamp(6rem, 13vh, 9.5rem);
}
.cta-grid { row-gap: 0; }
.cta h2 {
  grid-column: 2 / 11;
  grid-row: 2;
  font-size: clamp(2.2rem, 4vw, 3rem);
  color: var(--paper-on-ink);
}
.cta-lede {
  grid-column: 2 / 9;
  grid-row: 3;
  margin-top: 1.8rem;
  max-width: var(--measure);
  color: var(--paper-72);
}
.cta-prefill {
  grid-column: 2 / 10;
  grid-row: 4;
  margin-top: 1.4rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--champ-dark);
}
.cta-prefill[hidden] { display: none; }
.cta-actions { grid-column: 2 / 12; grid-row: 5; margin-top: 2.4rem; }
.cta-note {
  grid-column: 2 / 12;
  grid-row: 6;
  margin-top: 1.6rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--paper-55);
}
.cta-note a {
  color: var(--paper-72);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.cta-note a:hover { color: var(--paper); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--midnight);
  color: var(--paper-72);
  border-top: 1px solid var(--paper-rule);
  overflow: hidden;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
  max-width: 74rem;
  margin-inline: auto;
  padding: 3rem clamp(1.25rem, 4vw, 2.5rem) 1rem;
}
.footer-brand .wordmark { display: inline-block; margin-bottom: 0.9rem; color: var(--paper-on-ink); }
.footer-tagline {
  max-width: 24rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--paper-55);
}
.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.footer-nav-primary,
.footer-nav-secondary {
  display: grid;
  gap: 0.55rem;
}
.footer-nav a {
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.footer-nav-primary a {
  font-size: 0.7rem;
  color: var(--paper-72);
}
.footer-nav-secondary {
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid var(--paper-rule);
}
.footer-nav-secondary a {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--paper-55);
}
.footer-nav a:hover { color: var(--paper); }
.footer-meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  line-height: 2.1;
  color: var(--paper-55);
}
.dlc-lockup {
  display: inline-block;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper-72);
  border: 1px solid var(--paper-rule);
  border-radius: 2px;
  padding: 0.55rem 0.9rem;
  transition: border-color 160ms var(--ease), color 160ms var(--ease);
}
.dlc-lockup:hover { border-color: var(--paper-55); color: var(--paper); }

/* The giant cropped wordmark */
.footer-giant {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  margin-top: 1.5rem;
  height: clamp(5rem, 12vw, 10.5rem);
  overflow: hidden;
}
.giant-text {
  display: block;
  font-family: var(--serif);
  font-weight: 430;
  font-size: clamp(7rem, 17.5vw, 15.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: rgba(245, 242, 235, 0.13);
  transform: translateY(0.12em);
}
.footer-giant .wm-ring { stroke: currentColor; }
.footer-giant .wm-dot { fill: rgba(201, 173, 116, 0.55); }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .tel-meta { grid-template-columns: 1fr 1fr; }
  .tel-pulse { display: none; }
  .case-featured { grid-column: 1 / 13; }
  .tombstone { grid-column: 3 / 11; grid-row: 3; margin-top: 2.4rem; }
  .case-secondary { grid-column: 1 / 13; grid-row: 4; }
  .case-tertiary { grid-column: 1 / 13; grid-row: 5; }
}

@media (max-width: 900px) {
  .hero h1 .h1-line-2 { margin-left: calc(100% / 14); }
  .how-head, .evidence-head, .faq-head, .faq-list, .how-cards,
  .compare-head, .compare-panels, .tel-head, .tel-note {
    grid-column: 1 / 13;
    grid-row: auto;
  }
  .compare-panels { grid-template-columns: 1fr; }
  .how-cards { grid-template-columns: 1fr; }
  .hero .kicker, .hero h1, .hero-lede, .thesis-form, .hero-stats { grid-column: 1 / 13; }
}

@media (max-width: 700px) {
  body { font-size: 1.0625rem; }
  .credbar-fact { display: none; }
  .hero { padding-block: 3rem 3.5rem; }
  .hero .kicker { margin-bottom: 1.6rem; }
  .hero-lede { margin-top: 1.8rem; font-size: 1.1rem; }
  .thesis-row { flex-direction: column; }
  .thesis-row .button { width: 100%; text-align: center; }
  .hero-stats { grid-template-columns: 1fr; row-gap: 1.8rem; }
  .hstat { padding-right: 0; }
  .hstat + .hstat { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.8rem; }
  .hstat-source { margin-top: 0.4rem; }
  .tel-phases { grid-template-columns: 1fr; gap: 1.1rem; }
  .tel-legend { gap: 0.9rem 1.2rem; }
  .tel-panel { margin-inline: -0.25rem; }
  .tel-svg { aspect-ratio: auto; height: 230px; }
  .tel-meta { grid-template-columns: 1fr; }
  .tel-meta > * + * { border-left: 0; border-top: 1px solid var(--paper-rule); }
  .tombstone { grid-column: 1 / 13; }
  .cta h2, .cta-lede, .cta-prefill, .cta-actions, .cta-note { grid-column: 1 / 13; }
  .footer-meta { text-align: left; }
  .footer-giant { height: clamp(3.4rem, 16vw, 5rem); }
  .giant-text { font-size: clamp(4.6rem, 23vw, 7rem); }
}

/* ---------- Reduced motion: everything still, final values shown ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in-up, .reveal { animation: none; opacity: 1; transform: none; }
  .pulse-dot, .sweep-ring, .hb-line { animation: none; }
  .cmp-draw { animation: none !important; stroke-dashoffset: 0; }
  .cmp-chip { animation: none !important; opacity: 1; }
  .js .md-ring { opacity: 0.9; transform: none; transition: none; }
  .js .md-field .md-loc { fill: var(--champ-dark); }
  .js .tel-sweep { opacity: 0; }
  .js .how-card { opacity: 1; transform: none; }
  .hero[data-film="on"] .hero-film video { display: none; }
}
