@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --ivory: #1E2028;
  --paper: #191B22;
  --warm-white: #252830;
  --surface: #262931;
  --surface2: #2E313A;
  --border: #3A3D47;
  --border-light: #33363F;
  --text: #E8E6E3;
  --text2: #A09B93;
  --text3: #6B6660;
  --accent: #8EAFF8;
  --accent2: #6B93F5;
  --accent-light: rgba(142,175,248,0.1);
  --red: #F87171;
  --red-dim: #EF4444;
  --red-bg: rgba(248,113,113,0.08);
  --orange: #FBBF24;
  --orange-bg: rgba(251,191,36,0.08);
  --green: #6EE7B7;
  --green-bg: rgba(110,231,183,0.08);
  --purple: #C4B5FD;
  --purple-bg: rgba(196,181,253,0.08);
  --cyan: #67E8F9;

  --serif: 'Source Serif 4', 'Georgia', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sans);
  background: var(--ivory);
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 940px; margin: 0 auto; padding: 0 32px; }

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

/* ——— Header ——— */
header {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(37,40,48,0.92);
}
header .container { display: flex; align-items: center; justify-content: space-between; }
header h1 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: -0.2px; }
header h1 a { color: var(--text); text-decoration: none; }
header h1 span { color: var(--text3); font-family: var(--sans); font-weight: 400; font-size: 14px; margin-left: 4px; }
.conf {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-bg);
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px solid rgba(248,113,113,0.15);
}

/* ——— Nav ——— */
nav {
  background: rgba(37,40,48,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 47px;
  z-index: 99;
  overflow-x: auto;
}
nav .container { display: flex; gap: 0; }
nav a {
  color: var(--text3);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  display: block;
  letter-spacing: 0.1px;
}
nav a:hover { color: var(--text2); text-decoration: none; }
nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ——— Page ——— */
.page { padding: 40px 0 80px; }
h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.4px;
  color: var(--text);
}
.sub { color: var(--text3); font-size: 15px; margin-bottom: 32px; font-weight: 400; line-height: 1.6; }
h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 14px;
  color: var(--text);
}
h3:first-child { margin-top: 0; }

/* ——— Cards ——— */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(28,25,23,0.04);
}
.card p { color: var(--text2); font-size: 14px; line-height: 1.7; }

/* ——— Tags ——— */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  vertical-align: middle;
  font-family: var(--sans);
}
.t-red { background: var(--red-bg); color: var(--red); }
.t-orange { background: var(--orange-bg); color: var(--orange); }
.t-green { background: var(--green-bg); color: var(--green); }
.t-purple { background: var(--purple-bg); color: var(--purple); }
.t-blue { background: var(--accent-light); color: var(--accent); }
.t-gray { background: var(--surface2); color: var(--text3); }

/* ——— Quote ——— */
.quote {
  border-left: 3px solid var(--border);
  padding: 12px 18px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text);
  font-style: italic;
  font-family: var(--serif);
  background: var(--surface2);
  border-radius: 0 4px 4px 0;
}
.mono { font-family: var(--mono); font-size: 11px; color: var(--text2); }

/* ——— Narrative ——— */
.narrative { font-size: 15.5px; line-height: 1.9; color: var(--text2); }
.narrative p { margin-bottom: 18px; }
.narrative strong { color: var(--text); font-weight: 600; }
.narrative code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}
.narrative .callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px 20px;
  margin: 20px 0;
  box-shadow: 0 1px 2px rgba(28,25,23,0.04);
}
.narrative .callout-title {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* ——— Tables ——— */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text3);
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  font-family: var(--sans);
}
.tbl td {
  font-size: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text2);
  vertical-align: top;
  line-height: 1.6;
}
.tbl tr:hover td { background: var(--surface2); }

/* ——— Timeline ——— */
.tl-filters { display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap; }
.tf {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text3);
  padding: 5px 14px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--sans);
}
.tf:hover { border-color: var(--text2); color: var(--text2); }
.tf.active { background: var(--accent); border-color: var(--accent); color: var(--paper); }

.tl { position: relative; padding-left: 28px; }
.tl::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: var(--border);
}
.tl-year {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  margin: 32px 0 14px;
  position: relative;
}
.tl-year:first-child { margin-top: 0; }
.tl-entry {
  position: relative;
  margin-bottom: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(28,25,23,0.03);
}
.tl-entry:hover { border-color: var(--border); box-shadow: 0 2px 6px rgba(28,25,23,0.06); }
.tl-entry::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--paper);
}
.tl-entry.hi::before { background: var(--accent); }
.tl-entry.danger::before { background: var(--red); }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.tl-date { font-size: 11px; color: var(--text3); font-weight: 600; font-family: var(--sans); }
.tl-body { font-size: 14.5px; color: var(--text2); line-height: 1.7; }
.tl-body strong { color: var(--text); }
.tl-names { font-size: 11.5px; color: var(--accent); margin-top: 5px; font-weight: 500; }
.tl-evidence {
  font-size: 11px;
  color: var(--text3);
  margin-top: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.15s;
}
.tl-evidence:hover { color: var(--accent); }
.tl-img {
  margin-top: 10px;
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: none;
  cursor: pointer;
}
.tl-img.show { display: block; }
.tl-link { font-size: 11px; margin-top: 4px; }

/* ——— Accordion ——— */
.acc {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(28,25,23,0.03);
}
.acc-head {
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  transition: background 0.1s;
}
.acc-head:hover { background: var(--surface2); }
.acc-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-arrow { color: var(--text3); transition: transform 0.2s; font-size: 13px; }
.acc.open .acc-arrow { transform: rotate(180deg); }
.acc-body {
  display: none;
  padding: 0 20px 18px;
  border-top: 1px solid var(--border-light);
}
.acc.open .acc-body { display: block; padding-top: 16px; }
.acc-body p, .acc-body li { font-size: 14.5px; color: var(--text2); line-height: 1.75; }
.acc-body ul { padding-left: 18px; }
.acc-body li { margin-bottom: 5px; }
.lbl {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  margin: 16px 0 6px;
  font-family: var(--sans);
}
.lbl:first-child { margin-top: 0; }

/* ——— Strength bar ——— */
.str-bar { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.str-track { height: 3px; border-radius: 2px; flex: 1; background: var(--surface2); overflow: hidden; }
.str-fill { height: 100%; border-radius: 2px; }
.str-label { font-size: 11px; font-weight: 600; white-space: nowrap; }

/* ——— People grid ——— */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 24px; }
.pcard {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 16px 20px;
  box-shadow: 0 1px 2px rgba(28,25,23,0.03);
  transition: box-shadow 0.15s;
}
.pcard:hover { box-shadow: 0 2px 8px rgba(28,25,23,0.07); }
.pcard .pname { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.pcard .phandle { font-size: 13px; color: var(--accent); font-weight: 500; }
.pcard .pdetail { font-size: 14px; color: var(--text2); margin-top: 8px; line-height: 1.7; }

/* ——— Projects ——— */
.proj {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 18px 22px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(28,25,23,0.03);
}
.proj-name { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.proj-ticker { color: var(--accent); font-family: var(--sans); font-weight: 600; }
.proj-stats { display: flex; gap: 20px; margin: 10px 0; flex-wrap: wrap; }
.proj-stat { font-size: 11px; color: var(--text3); font-weight: 500; }
.proj-stat strong { color: var(--text); font-size: 14px; display: block; font-family: var(--sans); }
.proj p { font-size: 14.5px; color: var(--text2); line-height: 1.7; }

/* ——— Evidence grid ——— */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.eitem {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.eitem:hover { border-color: var(--border); box-shadow: 0 2px 6px rgba(28,25,23,0.06); }
.eitem-info { padding: 12px 16px; }
.eitem-file {
  font-size: 10px;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 4px;
  word-break: break-all;
  font-weight: 500;
}
.eitem-desc { font-size: 14px; color: var(--text2); line-height: 1.6; }
.eitem-img { width: 100%; display: none; border-top: 1px solid var(--border-light); }
.eitem.open .eitem-img { display: block; }
.eitem-link {
  display: block;
  font-size: 10px;
  color: var(--accent);
  margin-top: 4px;
  padding: 0 16px 10px;
  font-weight: 500;
}

/* ——— Lightbox ——— */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,16,20,0.92);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.show { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 6px; box-shadow: 0 16px 48px rgba(0,0,0,0.3); }

/* ——— Video ——— */
video {
  background: var(--text);
  border-radius: 0;
}

/* ——— Scrollbar ——— */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ——— Print ——— */
@media print {
  header, nav { position: static; }
  body { background: #fff; color: #111; }
  .card, .acc, .tl-entry, .pcard, .proj, .eitem { box-shadow: none; border-color: #ddd; background: #fff; }
}

::selection { background: rgba(142,175,248,0.25); }
