/* ============================================================
   Insurance Risk Architecture — interactive prototype
   ============================================================ */

:root {
  --bg: #f4f1ea;            /* warm off-white paper */
  --bg-card: #ffffff;
  --ink: #111111;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --muted-2: #8a8a8a;
  --rule: #d9d4c8;
  --rule-strong: #111111;
  --navy: #1a365d;          /* petrol */
  --navy-soft: #4d6a8a;
  --red: #8b1a1a;           /* diesel */
  --red-soft: #b04a4a;
  --green: #1f8a3a;
  --amber: #c4881f;
  --tint: #efe8d8;          /* tan tint */
  --tint-2: #e6dec9;
  --tint-cool: #e3e8ee;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* serif for editorial titles */
.serif { font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif; }
.mono  { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- top chrome ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 241, 234, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand .dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  margin-right: 9px;
  transform: translateY(-1px);
}
.tnav {
  display: flex; gap: 22px; flex: 1;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.tnav a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.tnav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.tnav a.active { color: var(--ink); border-bottom-color: var(--red); }
.t-meta {
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---------- generic layout ---------- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}
section {
  border-bottom: 1px solid var(--rule);
  padding: 96px 0 112px;
}
section.tight { padding: 72px 0 88px; }

.section-tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 600;
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.section-tag .num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--muted-2);
  font-weight: 500;
  letter-spacing: 0.05em;
}
.section-tag .rule { flex: 1; height: 1px; background: var(--rule); }

h1.eyebrow {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  text-wrap: pretty;
  max-width: 14ch;
}
h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-wrap: pretty;
}
h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 0 0 8px;
}
.lede {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0 0 32px;
  text-wrap: pretty;
}
.body-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
}
.body-text p + p { margin-top: 12px; }

.byline {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.byline strong { color: var(--ink); font-weight: 600; }

/* ---------- hero ---------- */
.hero {
  padding: 80px 0 64px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: end;
}
.hero-meta {
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-size: 12.5px;
  color: var(--muted);
  border-left: 1px solid var(--rule);
  padding-left: 20px;
}
.hero-meta .row { display: flex; flex-direction: column; gap: 4px; }
.hero-meta .k {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.hero-meta .v { color: var(--ink); font-weight: 500; }
.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 22px;
}
.hero-tagline .pulse {
  width: 7px; height: 7px; background: var(--red); border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ---------- buttons / chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--bg-card);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.on .swatch { box-shadow: 0 0 0 1px rgba(255,255,255,.4); }
.chip .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}

button.btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: opacity .15s;
}
button.btn:hover { opacity: 0.85; }
button.btn.ghost {
  background: transparent;
  color: var(--ink);
}

/* ---------- cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.card.flat { border-radius: 2px; }
.card-pad { padding: 28px 32px; }
.card-pad-sm { padding: 20px 22px; }

/* ---------- sliders (custom range) ---------- */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--ink);
}
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  cursor: pointer;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--ink);
}
.slider.red::-webkit-slider-thumb { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.slider.red::-moz-range-thumb     { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.slider.navy::-webkit-slider-thumb { background: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.slider.navy::-moz-range-thumb     { background: var(--navy); box-shadow: 0 0 0 1px var(--navy); }

/* ---------- KV tables ---------- */
.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.kv td {
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.kv td:first-child { color: var(--muted); width: 38%; }
.kv td:last-child  { color: var(--ink); font-weight: 500; text-align: right; }
.kv tr:last-child td { border-bottom: none; }

/* ---------- tag pills ---------- */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.navy { background: var(--tint-cool); color: var(--navy); }
.pill.red  { background: #f3e3e3; color: var(--red); }
.pill.green{ background: #e3efe5; color: var(--green); }
.pill.amber{ background: #f3eadb; color: var(--amber); }
.pill.gray { background: #ececec; color: var(--ink-soft); }

/* ---------- footnote / aside ---------- */
.aside {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

/* ---------- grid utilities ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.flex-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: 12px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* ---------- numeric callout ---------- */
.bignum {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: var(--ink);
}
.bignum.red { color: var(--red); }
.bignum.navy { color: var(--navy); }
.bignum-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* ---------- closing ---------- */
.closing {
  background: var(--ink);
  color: var(--bg);
  padding: 96px 0;
  border-bottom: none;
}
.closing h2 { color: var(--bg); }
.closing .body-text { color: rgba(255,255,255,0.72); }
.closing .byline { color: rgba(255,255,255,0.55); }
.closing .byline strong { color: #fff; }

/* ---------- prose blockquote ---------- */
blockquote.pull {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 32px 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--red);
  text-wrap: pretty;
  max-width: 38ch;
}

/* ---------- focus rings ---------- */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #c8c2b3; border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #a8a08e; }
::-webkit-scrollbar-track { background: var(--bg); }
