/* ==========================================================================
   Whale.io Accountability Dossier — Design System
   Editorial / financial-intelligence aesthetic.
   Palette: deep ink navy + copper accent + slate neutrals.
   ========================================================================== */

:root {
  /* Surfaces */
  --ink-900: #070b14;
  --ink-850: #0a1020;
  --ink-800: #0e1526;
  --ink-750: #121b30;
  --ink-700: #16203a;
  --ink-600: #1d2a48;

  /* Lines */
  --line: #1e2a45;
  --line-soft: #172239;
  --line-strong: #2b3c60;

  /* Text */
  --text: #e8eef9;
  --text-2: #b6c3da;
  --text-3: #8695b1;
  --text-4: #5f6d88;

  /* Accents */
  --copper: #d79a5b;
  --copper-dim: #a4713c;
  --copper-soft: rgba(215, 154, 91, 0.12);

  --teal: #46b89a;
  --teal-soft: rgba(70, 184, 154, 0.12);

  --azure: #5d92e8;
  --azure-soft: rgba(93, 146, 232, 0.12);

  --rose: #d1626f;
  --rose-soft: rgba(209, 98, 111, 0.12);

  --amber: #d9a441;
  --amber-soft: rgba(217, 164, 65, 0.12);

  /* Type */
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Consolas, monospace;

  /* Metrics */
  --maxw: 1180px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Subtle page texture so large dark areas don't read as flat black */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(215, 154, 91, 0.05), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(93, 146, 232, 0.045), transparent 60%);
}

.wrap { position: relative; z-index: 1; }

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0 0 1em; }

a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 14px;
}

.lede { font-size: 18px; color: var(--text-2); max-width: 74ch; }

.mono { font-family: var(--mono); font-size: 0.92em; }

/* ---------- Layout ---------- */

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

section { padding: 84px 0; border-top: 1px solid var(--line-soft); }
section:first-of-type { border-top: 0; }

.section-head { margin-bottom: 40px; max-width: 78ch; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; }
.section-head p { color: var(--text-2); margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
/* Main column + sticky-ish aside, used on the report page */
.grid-sidebar { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 66px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(140deg, var(--copper), var(--copper-dim));
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 16px;
  color: var(--ink-900);
}
.brand-text { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--text); }
.brand-text span { color: var(--text-4); font-weight: 400; }
.brand:hover { text-decoration: none; }

.site-nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.site-nav a {
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--ink-750); text-decoration: none; }
.site-nav a.cta {
  background: var(--copper);
  color: var(--ink-900);
  font-weight: 650;
  margin-left: 10px;
}
.site-nav a.cta:hover { background: #e6a968; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--ink-750);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

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

.hero { padding: 96px 0 72px; border-top: 0; }

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  margin-bottom: 22px;
  max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--copper); }

.hero .lede { font-size: 19px; margin-bottom: 32px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary { background: var(--copper); color: var(--ink-900); }
.btn-primary:hover { background: #e6a968; text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--ink-750); text-decoration: none; }

.hero-note {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; color: var(--text-3);
  border-left: 2px solid var(--line-strong);
  padding-left: 14px;
  max-width: 68ch;
}

/* ---------- Stat strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat { background: var(--ink-850); padding: 22px 20px; }
.stat-val {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.1;
}
.stat-val.accent { color: var(--copper); }
.stat-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-4);
  margin-top: 7px;
  font-weight: 600;
}
.stat-sub { font-size: 12px; color: var(--text-4); margin-top: 4px; }

/* ---------- Cards ---------- */

.card {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--text-2); font-size: 14.5px; margin-bottom: 0; }
.card p + p { margin-top: 10px; }

.card-accent { border-left: 3px solid var(--copper); }
.card-rose { border-left: 3px solid var(--rose); }
.card-teal { border-left: 3px solid var(--teal); }
.card-azure { border-left: 3px solid var(--azure); }

/* ---------- Callout ---------- */

.callout {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 26px 0;
}
.callout h4 { font-size: 16px; margin-bottom: 8px; color: var(--amber); font-family: var(--sans); font-weight: 650; }
.callout p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.callout.rose { border-left-color: var(--rose); }
.callout.rose h4 { color: var(--rose); }
.callout.teal { border-left-color: var(--teal); }
.callout.teal h4 { color: var(--teal); }

/* ---------- Claim panel ---------- */

.claim {
  background: linear-gradient(150deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: center;
}
.claim-figure {
  font-family: var(--serif);
  font-size: clamp(46px, 7vw, 72px);
  font-weight: 600;
  color: var(--copper);
  line-height: 1;
  letter-spacing: -0.03em;
}
.claim-figure-label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-4); font-weight: 650; margin-top: 12px;
}
.claim ul { margin: 16px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14.5px; }
.claim li { margin-bottom: 8px; }

/* ---------- Tables ---------- */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--ink-850);
}

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  background: var(--ink-800);
  color: var(--text-4);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.017); }

td strong, th strong { color: var(--text); font-weight: 600; }
td .sub { display: block; font-size: 12px; color: var(--text-4); margin-top: 3px; }

.num { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.t-right { text-align: right; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-rose { background: var(--rose-soft); color: var(--rose); border-color: rgba(209, 98, 111, 0.28); }
.badge-teal { background: var(--teal-soft); color: var(--teal); border-color: rgba(70, 184, 154, 0.28); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(217, 164, 65, 0.28); }
.badge-azure { background: var(--azure-soft); color: var(--azure); border-color: rgba(93, 146, 232, 0.28); }
.badge-copper { background: var(--copper-soft); color: var(--copper); border-color: rgba(215, 154, 91, 0.28); }
.badge-mute { background: var(--ink-700); color: var(--text-3); border-color: var(--line); }

/* ---------- Ownership chain ---------- */

.chain { display: flex; flex-direction: column; gap: 0; align-items: center; }

.chain-node {
  width: 100%;
  max-width: 560px;
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  text-align: center;
}
.chain-node.terminal { border-color: var(--copper); background: var(--ink-800); }
.chain-node .role {
  font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-4); font-weight: 700; margin-bottom: 6px;
}
.chain-node .name { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--text); }
.chain-node.terminal .name { color: var(--copper); font-size: 22px; }
.chain-node .meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); margin-top: 6px; }

.chain-link {
  width: 1px;
  height: 26px;
  background: linear-gradient(var(--line-strong), var(--copper-dim));
  position: relative;
}
.chain-link::after {
  content: "";
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--copper-dim);
}

/* ---------- Ownership tree (monospace) ---------- */

.tree {
  background: var(--ink-850);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.tree pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre;
}
.tree pre b { color: var(--copper); font-weight: 500; }
.tree pre i { color: var(--rose); font-style: normal; }

@media (max-width: 760px) {
  .tree { padding: 16px 14px; }
  .tree pre { font-size: 10.5px; line-height: 1.6; }
}

/* ---------- Proof items ---------- */

.proof {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-850);
  margin-bottom: 12px;
  overflow: hidden;
}
.proof summary {
  padding: 17px 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.proof summary::-webkit-details-marker { display: none; }
.proof summary:hover { background: var(--ink-800); }
.proof summary .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--copper);
  background: var(--copper-soft);
  border: 1px solid rgba(215, 154, 91, 0.25);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  flex-shrink: 0;
}
.proof summary .chev { margin-left: auto; color: var(--text-4); font-size: 12px; transition: transform 0.18s; }
.proof[open] summary .chev { transform: rotate(180deg); }
.proof-body { padding: 4px 22px 22px; border-top: 1px solid var(--line-soft); }
.proof-body p { font-size: 14.5px; color: var(--text-2); margin: 16px 0; }
.proof-body .table-wrap { border: 1px solid var(--line-soft); }

/* ---------- Pattern list ---------- */

.pattern {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pattern:last-child { border-bottom: 0; }
.pattern-num {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  color: var(--line-strong);
  line-height: 1;
}
.pattern h4 { font-family: var(--sans); font-size: 15px; font-weight: 650; margin-bottom: 5px; }
.pattern p { font-size: 14px; color: var(--text-3); margin: 0; }

/* ---------- Timeline ---------- */

.timeline { border-left: 1px solid var(--line-strong); padding-left: 28px; margin-left: 6px; }
.tl-item { position: relative; padding-bottom: 30px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -34px; top: 7px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-900);
  border: 2px solid var(--copper-dim);
}
.tl-date {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--copper);
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.tl-item h4 { font-family: var(--sans); font-size: 15.5px; font-weight: 650; margin-bottom: 5px; }
.tl-item p { font-size: 14px; color: var(--text-3); margin: 0; }
.tl-item .src { font-size: 12px; color: var(--text-4); margin-top: 6px; display: block; }

/* ---------- Steps ---------- */

.step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.step:last-child { border-bottom: 0; }
.step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--copper-soft);
  border: 1px solid rgba(215, 154, 91, 0.3);
  color: var(--copper);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  font-family: var(--mono);
}
.step h4 { font-family: var(--sans); font-size: 16px; font-weight: 650; margin-bottom: 6px; }
.step p { font-size: 14.5px; color: var(--text-2); margin-bottom: 8px; }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-4); font-weight: 400; }
.field input, .field select, .field textarea {
  background: var(--ink-900);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14.5px;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--copper-dim);
  box-shadow: 0 0 0 3px var(--copper-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-4); }

.checkbox { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.checkbox input { width: auto; margin-top: 3px; flex-shrink: 0; }

.form-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: none;
}
.form-status.show { display: block; }
.form-status.ok { background: var(--teal-soft); border: 1px solid rgba(70, 184, 154, 0.3); color: var(--teal); }
.form-status.err { background: var(--rose-soft); border: 1px solid rgba(209, 98, 111, 0.3); color: var(--rose); }

/* ---------- Source list ---------- */

.sources { columns: 2; column-gap: 40px; }
.source-group { break-inside: avoid; margin-bottom: 26px; }
.source-group h4 { font-family: var(--sans); font-size: 14px; font-weight: 650; margin-bottom: 10px; color: var(--copper); }
.source-group ul { margin: 0; padding-left: 17px; }
.source-group li { font-size: 13.5px; color: var(--text-3); margin-bottom: 5px; }

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-850);
  padding: 52px 0 40px;
  margin-top: 40px;
}
.footer-top { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 44px; margin-bottom: 40px; }
.site-footer h4 { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer li a, .site-footer p { color: var(--text-3); font-size: 14px; }
.site-footer li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--line-soft);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-4);
}
.footer-bottom p { margin: 0; font-size: 12.5px; }

.disclaimer {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.7;
}
.disclaimer strong { color: var(--text-2); }

/* ---------- Utilities ---------- */

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-24 { margin-bottom: 24px; }
.text-muted { color: var(--text-3); }
.small { font-size: 13px; }

.subhead {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-4);
  margin: 36px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
}

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

/* The full nav needs real room; collapse it to a menu well before phone width. */
@media (max-width: 1040px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink-850);
    border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px;
    margin-left: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 11px 12px; font-size: 15px; }
  .site-nav a.cta { margin: 8px 0 0; text-align: center; }
}

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  /* 4 tiles wrapping into a 3-column grid leaves one orphan — go to 2x2 instead. */
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .claim { grid-template-columns: 1fr; gap: 28px; padding: 30px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 76px; }
  section { padding: 60px 0; }
  .hero { padding: 64px 0 52px; }
  .container { padding: 0 16px; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4, .grid-sidebar { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .sources { columns: 1; }
  .footer-top { grid-template-columns: 1fr; }
  .claim { padding: 24px; }
  .section-head h2 { font-size: 26px; }
  table { font-size: 12.5px; }
  thead th, tbody td { padding: 11px 12px; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-nav, .hero-actions, .site-footer { display: none; }
  .proof[open] .proof-body, .proof-body { display: block !important; }
}
