/* CaptiFin — styles
   Palette: steel paper, navy ink, banker's green, brass for the ring fence. */

:root {
  --bg: #F4F6F8;
  --bg-alt: #EAEEF2;
  --surface: #FFFFFF;
  --ink: #14213D;
  --muted: #566173;
  --line: #CDD4DD;
  --primary: #1C6B57;
  --primary-hover: #155746;
  --on-primary: #FFFFFF;
  --brass: #A87A22;
  --tint: #E3EFEA;
  --contact-bg: #14213D;
  --contact-ink: #F4F6F8;
  --contact-muted: #B9C3D3;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1828;
    --bg-alt: #132034;
    --surface: #18263C;
    --ink: #E8ECF2;
    --muted: #9EAABB;
    --line: #2C3B53;
    --primary: #4FB394;
    --primary-hover: #67C4A6;
    --on-primary: #0B1A14;
    --brass: #D9AE55;
    --tint: #163B33;
    --contact-bg: #E8ECF2;
    --contact-ink: #14213D;
    --contact-muted: #44506A;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: inherit; }

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Buttons */
.button {
  display: inline-block;
  padding: 0.8em 1.4em;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.button:hover { background: var(--primary-hover); }
.button-light { background: var(--contact-ink); color: var(--contact-bg); }
.button-light:hover { background: var(--contact-muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 24px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark-mark {
  width: 22px;
  height: 22px;
  border: 2px dashed var(--brass);
  border-radius: 6px;
  position: relative;
}
.wordmark-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: var(--primary);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}
.nav-list a { text-decoration: none; color: var(--muted); }
.nav-list a:hover { color: var(--ink); }
.nav-list .nav-cta {
  color: var(--ink);
  font-weight: 600;
  padding: 0.45em 1em;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
.nav-list .nav-cta:hover { background: var(--ink); color: var(--bg); }
@media (max-width: 860px) { .nav-optional { display: none; } }

/* Hero */
.hero { padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 8vw, 96px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.5rem, 4.8vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  max-width: 13ch;
}
.lede {
  margin: 24px 0 32px;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
}
.hero-figure { margin: 0; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Diagram */
.diagram { display: block; width: 100%; height: auto; font-family: var(--font); }
.diagram-narrow { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 560px) {
  .diagram-wide { display: none; }
  .diagram-narrow { display: block; }
}
.dg-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.dg-box-primary { fill: var(--primary); stroke: var(--primary); }
.dg-arm { fill: var(--tint); stroke: var(--primary); stroke-width: 1.5; }
.dg-ring { fill: none; stroke: var(--brass); stroke-width: 2.5; stroke-dasharray: 9 7; }
.dg-line { stroke: var(--line); stroke-width: 2; fill: none; }
.dg-flow { stroke: var(--primary); stroke-width: 2.5; fill: none; }
.dg-arrowhead { fill: var(--primary); }
.dg-kicker { fill: var(--muted); font-size: 13px; }
.dg-name { fill: var(--ink); font-size: 20px; font-weight: 700; }
.dg-role { fill: var(--muted); font-size: 15px; }
.dg-name-s { fill: var(--ink); font-size: 16px; font-weight: 700; }
.dg-role-s { fill: var(--muted); font-size: 12.5px; }
.dg-on-primary { fill: var(--on-primary); }
.dg-ring-label { fill: var(--brass); font-size: 14px; font-weight: 600; }
.dg-ring-label-s { fill: var(--brass); font-size: 13px; font-weight: 600; }
.dg-flow-label { fill: var(--muted); font-size: 14px; }
.dg-flow-label-s { fill: var(--muted); font-size: 13px; }

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--bg-alt); }
.section h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 800;
  max-width: 20ch;
}
.section-head { margin-bottom: clamp(36px, 5vw, 56px); }
.section-head p {
  margin-top: 18px;
  color: var(--muted);
  max-width: 62ch;
}

/* The model: three parties */
.parties {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  border-top: 2px solid var(--ink);
}
.party { padding: 28px 28px 8px 0; }
.party + .party { padding-left: 28px; border-left: 1px solid var(--line); }
.party h3 { font-size: 1.35rem; font-weight: 700; }
.party-verb {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--primary);
}
.party ul { margin: 18px 0 0; padding: 0; list-style: none; }
.party li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.party-operator h3 { color: var(--primary); }
.party-operator .party-verb { color: var(--ink); }
.party-operator li { color: var(--ink); }
.two-col { columns: 2; column-gap: 28px; }
.two-col li { break-inside: avoid; }
.parties-note {
  margin-top: 36px;
  padding-left: 18px;
  border-left: 3px dashed var(--brass);
  max-width: 62ch;
}
@media (max-width: 900px) {
  .parties { grid-template-columns: 1fr; }
  .party, .party + .party { padding: 24px 0 8px; border-left: 0; }
  .party + .party { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) { .two-col { columns: 1; } }

/* Why own it: comparison */
.compare-scroll { overflow-x: auto; }
.compare {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.compare th, .compare td {
  padding: 18px 20px;
  vertical-align: top;
  border-top: 1px solid var(--line);
}
.compare thead th {
  border-top: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.compare tbody th {
  width: 20%;
  font-weight: 600;
  padding-left: 0;
}
.compare td { color: var(--muted); }
.compare .col-own {
  background: var(--surface);
  color: var(--ink);
  border-left: 3px solid var(--primary);
}
.compare thead .col-own { color: var(--primary); border-radius: 10px 10px 0 0; }
@media (max-width: 680px) {
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr { display: block; }
  .compare tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
    padding: 16px 0;
  }
  .compare tbody th {
    grid-column: 1 / -1;
    width: auto;
    padding: 0 0 10px;
    border: 0;
  }
  .compare td { border: 0; padding: 12px; font-size: 0.95rem; }
  .compare td:not(.col-own) { padding-left: 0; }
  .compare td::before {
    display: block;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }
  .compare td:not(.col-own)::before { content: "Referral"; }
  .compare td.col-own::before { content: "Own arm"; color: var(--primary); }
}

/* Track record */
.record {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: end;
}
.record-copy p { margin-top: 20px; max-width: 58ch; color: var(--muted); }
.record-copy strong { color: var(--ink); font-weight: 600; }
.record-stat {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
}
.record-number {
  font-size: clamp(5rem, 11vw, 8.5rem);
  font-weight: 800;
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 760px) { .record { grid-template-columns: 1fr; } }

/* Process */
.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  position: relative;
  counter-increment: step;
  padding-top: 64px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 21px;
  left: 56px;
  right: -16px;
  border-top: 2px dashed var(--line);
}
.steps h3 { font-size: 1.25rem; font-weight: 700; }
.steps p { margin-top: 10px; color: var(--muted); }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 0; }
  .steps li { padding: 0 0 32px 68px; min-height: 44px; }
  .steps li:not(:last-child)::after {
    top: 52px;
    bottom: 8px;
    left: 21px;
    right: auto;
    border-top: 0;
    border-left: 2px dashed var(--line);
  }
  .steps h3 { padding-top: 8px; }
}

/* Contact */
.contact { background: var(--contact-bg); color: var(--contact-ink); }
.contact-inner p { margin-top: 18px; max-width: 52ch; color: var(--contact-muted); font-size: 1.15rem; }
.contact .section-head, .contact h2 { max-width: 22ch; }
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 36px;
}
.contact-email { color: var(--contact-ink); font-weight: 600; text-underline-offset: 4px; }

/* Footer */
.site-footer { padding: 36px 0 44px; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 40px;
  font-size: 0.9rem;
  color: var(--muted);
}
.footer-inner p:first-child { max-width: 70ch; }
