/* =========================================================
   Sara Kumlin — Candidate case file
   Palette: paper + ink, one green for "approved", one
   highlighter yellow for role-relevant evidence.
   ========================================================= */

:root {
  --paper: #F4F0E6;
  --paper-2: #ECE6D8;
  --card: #FFFDF8;
  --ink: #14202B;
  --ink-2: #36424D;
  --muted: #646E78;
  --line: #DED6C5;
  --line-strong: #C7BCA6;
  --navy: #1B3A57;
  --green: #1D6B4C;
  --green-2: #2E8A64;
  --green-soft: #E2EEE6;
  --hl: #FFD84D;
  --hl-soft: rgba(255, 216, 77, .38);
  --hl-edge: #E0B530;

  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-sans: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 8px;
  --shadow: 0 1px 0 rgba(20, 32, 43, .04), 0 10px 30px -16px rgba(20, 32, 43, .22);
  --shadow-lift: 0 1px 0 rgba(20, 32, 43, .05), 0 18px 40px -18px rgba(20, 32, 43, .32);
  --topbar: 60px;
  --gutter: 24px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(27, 58, 87, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 58, 87, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }

.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.label {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; }

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.icon { width: 18px; height: 18px; flex: none; }

/* ---------- Buttons, pills, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  font-weight: 500; font-size: 15.5px; line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  background: transparent;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--navy); border-color: var(--navy); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); background: var(--card); }
.btn--green { background: var(--green); border-color: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-2); border-color: var(--green-2); }
.btn--small { padding: 8px 14px; font-size: 14px; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px;
}
.pill--green { background: var(--green-soft); color: var(--green); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--f-mono); font-size: 13px; font-weight: 500;
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--card);
  cursor: pointer; transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.tag {
  display: inline-block;
  font-family: var(--f-mono); font-size: 11.5px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-2);
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 240, 230, .88);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  height: var(--topbar);
  max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--f-display); font-size: 15px; letter-spacing: .02em;
}
.brand__text { font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.brand__text .mono { color: var(--muted); font-weight: 400; font-size: 12.5px; }

.steps { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 14px; }
.steps__list { display: flex; gap: 5px; }
.steps__list a {
  display: block; width: 26px; height: 18px; position: relative;
}
.steps__list a::before {
  content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 4px; border-radius: 2px;
  background: var(--line); transition: background .3s;
}
.steps__list a.is-done::before { background: var(--green); }
.steps__list a.is-active::before { background: var(--ink); }
.steps__list a:hover::before { background: var(--ink-2); }
.steps__label {
  font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.steps__label b { font-weight: 600; color: var(--ink); }

.topbar__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.lang { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; background: var(--card); }
.lang__btn {
  border: 0; background: transparent; cursor: pointer;
  font-family: var(--f-mono); font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; color: var(--muted);
}
.lang__btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.topbar__progress { height: 2px; background: transparent; }
.topbar__progress span { display: block; height: 100%; width: 0; background: var(--green); transition: width .1s linear; }

/* ---------- Sections ---------- */
.section { padding: 104px 0; scroll-margin-top: var(--topbar); }
.section__head { margin-bottom: 44px; max-width: 520px; }
.section__head--wide { max-width: 760px; }
.index { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.section__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(36px, 5vw, 58px); line-height: 1.02; letter-spacing: -.02em;
  margin-bottom: 16px;
}
.section__sub { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 58ch; }
.aside-note {
  margin-top: 20px; padding-left: 14px; border-left: 2px solid var(--line-strong);
  font-size: 15px; color: var(--muted); font-style: italic;
}

/* ---------- Hero / intake ---------- */
.hero { padding-top: 72px; padding-bottom: 72px; }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: 64px; align-items: center;
}
.kicker { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(29, 107, 76, .5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29,107,76,.45); } 70% { box-shadow: 0 0 0 10px rgba(29,107,76,0); } 100% { box-shadow: 0 0 0 0 rgba(29,107,76,0); } }
.hero__name {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(60px, 9.4vw, 124px); line-height: .9; letter-spacing: -.035em;
  margin: 22px 0 26px;
}
.hero__lede { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.45; color: var(--ink-2); max-width: 30ch; font-family: var(--f-display); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; }

.record { padding: 0; overflow: hidden; scroll-margin-top: calc(var(--topbar) + 20px); }
.record__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--ink); color: var(--paper);
}
.barcode {
  flex: 1; height: 14px; max-width: 120px; opacity: .55;
  background: repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 3px, currentColor 3px 5px, transparent 5px 6px, currentColor 6px 7px, transparent 7px 10px);
}
.record__id { display: flex; gap: 20px; padding: 22px 20px 18px; align-items: flex-end; border-bottom: 1px dashed var(--line-strong); }
.record__photo { position: relative; width: 132px; flex: none; }
.record__photo img { width: 132px; height: auto; aspect-ratio: 461 / 568; object-fit: cover; border-radius: 4px; filter: saturate(.92); }
.record__who { min-width: 0; padding-bottom: 4px; }
.record__name { font-family: var(--f-display); font-size: 30px; line-height: 1.05; margin: 4px 0 12px; }
.record__rows { padding: 8px 20px 18px; }
.record__rows > div { display: grid; grid-template-columns: 118px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--paper-2); }
.record__rows > div:last-child { border-bottom: 0; }
.record__rows dt { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.record__rows dd { font-size: 15px; line-height: 1.4; }
.typing::after { content: "▍"; color: var(--muted); margin-left: 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Role brief */
.brief {
  margin-top: 64px; padding: 32px;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 40px;
  grid-template-areas: "pick fit" "next fit"; grid-template-rows: auto 1fr;
  scroll-margin-top: calc(var(--topbar) + 24px);
}
.brief__pick { grid-area: pick; }
.brief__fit { grid-area: fit; }
.brief__next { grid-area: next; align-self: end; display: flex; }
.brief__q { font-family: var(--f-display); font-weight: 500; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; margin-bottom: 10px; }
.brief__hint { color: var(--ink-2); font-size: 15.5px; margin-bottom: 22px; }
.brief__fit {
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  padding: 24px 26px; position: relative;
}
.fit__label { margin-bottom: 6px; }
.fit__title { font-family: var(--f-display); font-weight: 500; font-size: 26px; line-height: 1.15; margin-bottom: 16px; }
.fit__points { display: grid; gap: 10px; margin-bottom: 20px; }
.fit__points li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 15.5px; line-height: 1.45; }
.check { width: 18px; height: 18px; margin-top: 2px; color: var(--green); }
.fit__ev { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.fit__ev a {
  font-size: 13px; text-decoration: none; padding: 5px 10px; border-radius: 4px;
  background: var(--hl-soft); border: 1px solid rgba(224, 181, 48, .45);
}
.fit__ev a:hover { background: var(--hl); }
.fit-anim { animation: fitIn .45s ease both; }
@keyframes fitIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Screening console ---------- */
.split { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 64px; align-items: start; }
.console { padding: 26px; font-family: var(--f-mono); }
.console .btn { font-family: var(--f-sans); }
.console__lines { display: grid; gap: 18px; }
.scr__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font-size: 14px; margin-bottom: 8px; }
.scr__name { color: var(--ink); }
.scr__status { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.scr__status.is-ok { color: var(--green); }
.scr__status.is-pos { color: var(--navy); }
.scr__bar { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.scr__bar span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 3px; }
.scr__line.is-done .scr__bar span { background: var(--green); }
.scr__line.is-pos.is-done .scr__bar span { background: var(--navy); }
.console__foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; padding-top: 18px; border-top: 1px dashed var(--line-strong); min-height: 58px; }
.console__result { font-size: 14px; color: var(--ink-2); }
.console__result strong { color: var(--ink); }
.indicators { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.indicators li {
  font-family: var(--f-sans); font-size: 13.5px; font-weight: 500;
  padding: 6px 11px; border-radius: 6px;
  background: var(--green-soft); color: var(--green);
  opacity: 0; transform: translateY(6px) scale(.96);
  transition: opacity .35s, transform .35s cubic-bezier(.2,.9,.3,1.3);
}
.indicators li.is-in { opacity: 1; transform: none; }
.console__next {
  display: flex; justify-content: flex-end;
  margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong);
  opacity: 0; transform: translateY(6px); visibility: hidden;
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.console__next.is-in { opacity: 1; transform: none; visibility: visible; transition-delay: .15s, .15s, 0s; }

/* ---------- Trail / timeline ---------- */
.trail { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; align-items: start; }
.exposure { position: sticky; top: calc(var(--topbar) + 28px); }
.exposure__box { padding: 20px; max-height: calc(100vh - var(--topbar) - 56px); overflow-y: auto; }
.exposure__count { font-family: var(--f-display); font-size: 44px; line-height: 1; margin: 8px 0 6px; }
.exposure__count .muted { font-size: 24px; }
.exposure__sub { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.45; }
.exposure__list { display: grid; gap: 6px; }
.exposure__list li {
  display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center;
  font-size: 13.5px; color: #A39C8E; transition: color .4s;
}
.exposure__list li .box {
  width: 14px; height: 14px; border-radius: 3px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; transition: background .3s, border-color .3s;
}
.exposure__list li .box svg { width: 10px; height: 10px; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .3s cubic-bezier(.2,.9,.3,1.4); color: #fff; }
.exposure__list li.is-on { color: var(--ink); }
.exposure__list li.is-on .box { background: var(--green); border-color: var(--green); }
.exposure__list li.is-on .box svg { opacity: 1; transform: none; }
.exposure__done { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--green); opacity: 0; transition: opacity .4s; }
.exposure__done.is-on { opacity: 1; }

.timeline { position: relative; padding-left: 52px; display: grid; gap: 22px; }
.timeline__rail { position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline__fill {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--p, 0) * 100%);
  background: linear-gradient(var(--navy), var(--green)); border-radius: 2px;
}
.timeline__fill::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(29,107,76,.18);
}

.tl { position: relative; scroll-margin-top: calc(var(--topbar) + 24px); }
.tl__node {
  position: absolute; left: -45px; top: 26px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line-strong); transition: background .3s, border-color .3s;
}
.tl.is-passed .tl__node { background: var(--green); border-color: var(--green); }
.tl--interlude .tl__node { width: 10px; height: 10px; left: -42px; top: 20px; border-width: 2px; }

.chapter { padding: 24px 26px 20px; transition: border-color .3s, box-shadow .3s; }
.chapter__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 10px; }
.chapter__meta .label { color: var(--muted); }
.chapter__years { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.chapter__title { font-family: var(--f-display); font-weight: 500; font-size: 28px; line-height: 1.12; letter-spacing: -.01em; margin-bottom: 4px; }
.chapter__org { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }
.chapter__org b { font-weight: 600; color: var(--ink); }
.chapter__summary { font-size: 16.5px; line-height: 1.55; margin-bottom: 14px; }
.chapter__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chapter__toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
  border: 0; background: none; cursor: pointer;
  font-family: var(--f-mono); font-size: 12.5px; font-weight: 600; color: var(--navy);
}
.chapter__toggle svg { width: 14px; height: 14px; transition: transform .25s; }
.chapter__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.chapter__evidence { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.chapter__evidence > div { overflow: hidden; }
.chapter__evidence.is-open { grid-template-rows: 1fr; }
.chapter__evidence ul { display: grid; gap: 8px; padding: 12px 0 4px; border-top: 1px dashed var(--line-strong); margin-top: 10px; }
.chapter__evidence li { position: relative; padding-left: 18px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.chapter__evidence li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 1px; background: var(--line-strong); }
.current { background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }

.interlude { padding: 12px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255, 253, 248, .5); }
.interlude__title { font-family: var(--f-display); font-style: italic; font-size: 19px; line-height: 1.25; }
.interlude__meta { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }

/* Role relevance: highlighter + badge */
.hl {
  background-image: linear-gradient(100deg, transparent 0, var(--hl) .15em, var(--hl) calc(100% - .2em), transparent 100%);
  background-repeat: no-repeat; background-size: 0% .42em; background-position: 0 88%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .75s cubic-bezier(.6, 0, .2, 1);
}
.is-key .hl { background-size: 100% .42em; }
.keybadge {
  display: none; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px; background: var(--hl); color: var(--ink);
}
.keybadge svg { width: 11px; height: 11px; }
.is-key .keybadge { display: inline-flex; animation: fitIn .4s ease both; }
.card.is-key { border-color: var(--hl-edge); box-shadow: 0 0 0 3px rgba(255, 216, 77, .32), var(--shadow); }

/* ---------- Ownership tree ---------- */
.tree { position: relative; }
.tree__top { display: flex; justify-content: center; position: relative; padding-bottom: 44px; }
.tree__top::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 44px; background: var(--ink); margin-left: -1px; }
.ubo {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
  padding: 14px 22px 14px 14px; box-shadow: var(--shadow-lift);
}
.ubo__img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid rgba(244,240,230,.25); }
.ubo__name { font-family: var(--f-display); font-size: 24px; line-height: 1.1; }
.ubo__role { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-top: 3px; }

.entities { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; position: relative; padding-top: 40px; }
.entities::before { content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 2px; background: var(--ink); }
.entity { position: relative; display: flex; flex-direction: column; }
.entity::before { content: ""; position: absolute; left: 50%; top: -40px; width: 2px; height: 40px; background: var(--ink); margin-left: -1px; }
.entity__share {
  position: absolute; top: -30px; left: 50%; transform: translateX(6px);
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--paper); padding: 0 4px;
}
.entity__card { padding: 18px 18px 16px; flex: 1; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s, border-color .3s; }
.entity__card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.entity__type { margin-bottom: 6px; }
.entity__name { font-family: var(--f-display); font-weight: 500; font-size: 21px; line-height: 1.15; margin-bottom: 12px; }
.entity__items { display: grid; gap: 7px; margin-bottom: 14px; flex: 1; align-content: start; }
.entity__items li { position: relative; padding-left: 15px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.entity__items li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 2px; background: var(--green); }
.entity__ev { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.entity__ev .label { font-size: 10.5px; width: 100%; }
.entity__ev a { font-family: var(--f-mono); font-size: 11.5px; padding: 2px 7px; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; }
.entity__ev a:hover { border-color: var(--ink); }
.entity__card .keybadge { align-self: flex-start; margin-bottom: 10px; }
.tree__foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 28px; letter-spacing: .02em; }
.tree__foot b { color: var(--green); font-weight: 600; }

/* draw-in of connectors */
.js .tree .tree__top::after, .js .tree .entities::before, .js .tree .entity::before { transition: transform .7s cubic-bezier(.6,0,.2,1); }
.js .tree:not(.in-view) .tree__top::after { transform: scaleY(0); transform-origin: top; }
.js .tree:not(.in-view) .entities::before { transform: scaleX(0); }
.js .tree:not(.in-view) .entity::before { transform: scaleY(0); transform-origin: top; }
.js .tree.in-view .entities::before { transition-delay: .35s; }
.js .tree.in-view .entity::before { transition-delay: .7s; }

/* ---------- Risk assessment ---------- */
.risk { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.risk__table { padding: 8px 0; overflow: hidden; }
.rk__row { display: grid; grid-template-columns: minmax(0, .9fr) 112px minmax(0, 1.6fr); gap: 18px; padding: 16px 24px; border-bottom: 1px solid var(--paper-2); align-items: baseline; transition: background .3s; }
.rk__row:last-child { border-bottom: 0; }
.rk__head { padding-top: 10px; padding-bottom: 10px; }
.rk__head span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rk__factor { font-weight: 500; font-size: 15.5px; line-height: 1.35; }
.rk__factor s { text-decoration-thickness: 1.5px; text-decoration-color: rgba(20,32,43,.55); }
.rk__ev { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.rk__row.is-key { background: rgba(255, 216, 77, .12); }
.rk__row .keybadge { margin-top: 6px; }

.matrix { padding: 22px 22px 26px; position: sticky; top: calc(var(--topbar) + 28px); }
.matrix__value { font-family: var(--f-display); font-size: 26px; line-height: 1.15; margin: 6px 0 22px; }
.matrix__plot {
  display: grid; grid-template-columns: 20px auto 1fr auto; grid-template-rows: auto 1fr auto auto;
  column-gap: 6px; row-gap: 4px; align-items: center;
}
.matrix__grid {
  grid-column: 2 / 5; grid-row: 1 / 3;
  aspect-ratio: 1; position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px;
}
.matrix__grid i { border-radius: 4px; }
.matrix__y { grid-column: 1; grid-row: 1 / 3; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); justify-self: center; }
.matrix__ylo, .matrix__yhi { display: none; }
.matrix__xlo { grid-column: 2; grid-row: 3; font-size: 10.5px; color: var(--muted); }
.matrix__xhi { grid-column: 4; grid-row: 3; font-size: 10.5px; color: var(--muted); justify-self: end; }
.matrix__x { grid-column: 2 / 5; grid-row: 4; justify-self: center; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.matrix__dot {
  position: absolute; z-index: 2; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper); font-family: var(--f-display); font-size: 16px;
  box-shadow: 0 0 0 5px rgba(255, 253, 248, .85), var(--shadow-lift);
  left: 50%; top: 50%;
  transition: left 1.1s cubic-bezier(.6, 0, .2, 1) .3s, top 1.1s cubic-bezier(.6, 0, .2, 1) .3s;
}
.matrix.in-view .matrix__dot { left: 16.66%; top: 16.66%; }

/* ---------- Statement / letter ---------- */
.letter { max-width: 780px; margin: 0 auto; padding: 52px 60px 40px; position: relative; }
.letter::before {
  content: ""; position: absolute; top: -12px; left: 48px; width: 18px; height: 48px;
  border: 2.5px solid #9AA3AB; border-radius: 9px; border-bottom-color: transparent;
}
.letter__body { font-family: var(--f-display); font-size: 19.5px; line-height: 1.62; color: var(--ink); position: relative; }
.letter__body p + p { margin-top: 1em; }
.letter__sign { margin-top: 1.4em; }
.letter__sig { font-family: var(--f-display); font-style: italic; font-size: 34px; line-height: 1; margin-top: 8px; color: var(--navy); }
.letter.is-collapsed .letter__body { max-height: 400px; overflow: hidden; }
.letter.is-collapsed .letter__body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(rgba(255,253,248,0), var(--card) 85%);
}
.letter__toggle { margin-top: 22px; }

/* ---------- Decision ---------- */
.decision { padding-bottom: 72px; }
.verdict { text-align: center; padding: 56px 32px 48px; position: relative; overflow: hidden; }
.verdict__stamp { height: 128px; display: grid; place-items: center; margin: 6px 0 18px; }
.verdict__rec { font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 46ch; margin: 0 auto 6px; }
.verdict__rec strong { color: var(--ink); font-weight: 600; }
.verdict__closed { font-family: var(--f-display); font-style: italic; font-size: 22px; color: var(--muted); margin-bottom: 30px; }
.contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.contact .phone-num { font-family: var(--f-mono); }

.docs { margin-top: 40px; scroll-margin-top: calc(var(--topbar) + 24px); }

.totop { display: flex; justify-content: center; margin-top: 48px; }

/* ---------- Sticky "Next" bar (mobile/tablet only) ---------- */
.nextbar { display: none; }
.docs__title { margin-bottom: 14px; }
.docs__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.doc {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.doc:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-strong); }
.doc__icon {
  width: 42px; height: 52px; flex: none; position: relative; border-radius: 4px;
  background: var(--paper); border: 1.5px solid var(--ink);
  display: grid; place-items: end center; padding-bottom: 6px;
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 600;
}
.doc__icon::before { content: ""; position: absolute; top: -1.5px; right: -1.5px; width: 12px; height: 12px; background: var(--card); border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); border-bottom-left-radius: 3px; }
.doc__name { font-family: var(--f-display); font-size: 21px; line-height: 1.15; }
.doc__meta { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.doc__dl { margin-left: auto; width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--paper); transition: background .2s; }
.doc:hover .doc__dl { background: var(--green); }

/* ---------- Stamps ---------- */
.stamp {
  --c: var(--green);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--c); border: 3px solid var(--c); border-radius: 6px;
  font-family: var(--f-sans); font-weight: 700; text-transform: uppercase; letter-spacing: .14em;
  position: relative; filter: url(#ink);
}
.stamp::before { content: ""; position: absolute; inset: 4px; border: 1.5px solid var(--c); border-radius: 3px; }
.stamp--big { padding: 16px 30px 12px; transform: rotate(-5deg); }
.stamp__main { font-size: 46px; line-height: 1; letter-spacing: .12em; }
.stamp__sub { font-size: 12px; letter-spacing: .14em; margin-top: 6px; font-weight: 600; }
.js .verdict:not(.in-view) .stamp--big { opacity: 0; }
.js .verdict.in-view .stamp--big { animation: stampIn .5s cubic-bezier(.2, .8, .3, 1) .15s both; }
@keyframes stampIn {
  0% { opacity: 0; transform: rotate(-9deg) scale(1.35); }
  100% { opacity: 1; transform: rotate(-5deg) scale(1); }
}

/* ---------- Redaction reveal ---------- */
.redact {
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat; background-position: right center; background-size: 0% 100%;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size .8s cubic-bezier(.7, 0, .2, 1) var(--d, .2s);
}
.js .reveal:not(.in-view) .redact { background-size: 100% 100%; }

/* ---------- Generic reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in-view { opacity: 1; transform: none; }
.js .hero__lede.reveal { opacity: 1; transform: none; }

/* Jump-to flash */
.flash { animation: flash 1.6s ease; }
@keyframes flash {
  0%, 100% { box-shadow: var(--shadow); }
  20%, 60% { box-shadow: 0 0 0 4px rgba(27, 58, 87, .35), var(--shadow-lift); }
}
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Footer, toast, noscript ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0 44px; }
.footer__inner { display: flex; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--paper); font-size: 14px; padding: 11px 18px; border-radius: 8px;
  box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.noscript { max-width: 640px; margin: 40px auto; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .entities { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entities::before, .entity::before, .tree__top::after, .entity__share { display: none; }
  .entities { padding-top: 0; }
  .tree__top { padding-bottom: 24px; }
}

@media (max-width: 980px) {
  :root { --gutter: 20px; }
  .section { padding: 80px 0; }
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__lede { max-width: 36ch; }
  .record { max-width: 520px; }
  .brief { grid-template-columns: 1fr; gap: 28px; grid-template-areas: "pick" "fit" "next"; grid-template-rows: auto; }
  .brief__next { justify-content: flex-end; }
  .split { grid-template-columns: 1fr; gap: 8px; }
  .trail { grid-template-columns: 1fr; gap: 0; }
  .exposure { display: none; }
  .risk { grid-template-columns: 1fr; }
  .matrix { position: static; max-width: 420px; }
  .docs__list { grid-template-columns: 1fr; }
  .steps__list { display: none; }
  .steps { justify-content: flex-start; }

  /* One consistent way forward on small screens: the sticky bar replaces the in-section Next buttons */
  .brief__next, .console__next { display: none; }
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .nextbar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    padding: 18px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(244, 240, 230, 0), rgba(244, 240, 230, .94) 38%);
    transform: translateY(115%); transition: transform .3s cubic-bezier(.2, .7, .2, 1);
    pointer-events: none;
  }
  .nextbar.is-on { transform: none; }
  .nextbar.is-on .nextbar__btn { pointer-events: auto; }
  .nextbar__btn {
    width: 100%; max-width: 520px; margin: 0 auto; justify-content: center;
    padding: 14px 20px; font-size: 16px; box-shadow: var(--shadow-lift);
  }
  .nextbar__btn span { overflow: hidden; text-overflow: ellipsis; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

@media (max-width: 720px) {
  .entities { grid-template-columns: 1fr; padding-left: 26px; padding-top: 22px; }
  .tree__top { justify-content: flex-start; padding-bottom: 0; }
  .entities::before { display: block; left: 10px; right: auto; top: 0; bottom: 60px; width: 2px; height: auto; }
  .entity::before { display: block; left: -16px; top: 60px; width: 16px; height: 2px; margin-left: 0; }
  .js .tree:not(.in-view) .entities::before { transform: scaleY(0); transform-origin: top; }
  .js .tree:not(.in-view) .entity::before { transform: scaleX(0); transform-origin: left; }
  .rk__head { display: none; }
  .rk__row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px 18px; }
  .rk__ev { grid-column: 1 / -1; }
  .letter { padding: 40px 22px 30px; }
  .letter::before { left: 24px; }
  .letter__body { font-size: 18px; }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; --topbar: 56px; }
  body { font-size: 16px; }
  .topbar__inner { gap: 12px; }
  .brand__text { display: none; }
  .btn--small.btn--ink span { display: none; }
  .btn--small.btn--ink { padding: 8px 10px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 40px; padding-bottom: 48px; }
  .hero__name { margin: 16px 0 18px; }
  .hero__cta .btn { flex: 1 1 auto; justify-content: center; }
  .record__id { gap: 14px; padding: 18px 16px 14px; }
  .record__photo, .record__photo img { width: 104px; }
  .record__name { font-size: 25px; }
  .record__rows { padding: 6px 16px 14px; }
  .record__rows > div { grid-template-columns: 1fr; gap: 2px; }
  .brief { padding: 22px 18px; margin-top: 44px; }
  .brief__q { font-size: 26px; }
  .brief__fit { padding: 20px 18px; }
  .fit__title { font-size: 23px; }
  .console { padding: 20px 18px; }
  .scr__row { font-size: 13px; }
  .console__foot { flex-direction: column; align-items: flex-start; }
  .console__next .btn, .brief__next .btn { flex: 1; justify-content: center; }
  .timeline { padding-left: 34px; }
  .timeline__rail { left: 8px; }
  .tl__node { left: -33px; }
  .tl--interlude .tl__node { left: -30px; }
  .chapter { padding: 20px 18px 16px; }
  .chapter__title { font-size: 24px; }
  .ubo { padding: 12px 18px 12px 12px; }
  .verdict { padding: 40px 18px 36px; }
  .stamp__main { font-size: 34px; }
  .stamp--big { padding: 14px 22px 10px; }
  .verdict__rec { font-size: 18px; }
  .contact .btn { flex: 1 1 100%; justify-content: center; }
  .footer__inner { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal { transform: none; }
}

@media print {
  .topbar, .toast, .hero__cta, .brief__pick, #scrRun, .letter__toggle, .docs { display: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .letter.is-collapsed .letter__body { max-height: none; }
  .letter.is-collapsed .letter__body::after { display: none; }
  body { background: #fff; }
}
