/* ============================================================
   THE GENTLEMEN — THREAT INTELLIGENCE ASSESSMENT
   Design: printed report, tucked in a manila folder
   ============================================================ */

:root {
  --folder: #C9A464;
  --folder-dark: #A9834B;
  --folder-tab: #D8B876;

  --paper: #FBF7ED;
  --paper-edge: #F1E9D6;

  --ink: #2A2419;
  --ink-dim: #55503F;
  --ink-faint: #8A8168;

  --rule: #D9CFB4;
  --rule-strong: #2A2419;

  --accent: #7C3626;
  --accent-soft: #EFE0D2;

  --max-w: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--folder);
  background-image: linear-gradient(180deg, var(--folder), var(--folder-dark));
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 44px 16px 70px;
}

a { color: var(--accent); text-decoration-underline; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, .navlink:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- Desk / folder wrapper ---------- */
.desk { display: flex; justify-content: center; }
.folder-wrap { width: 100%; max-width: 860px; }

.folder-tab {
  display: inline-block;
  background: var(--folder-tab);
  border: 1px solid var(--folder-dark);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 26px 32px;
  margin: 0 0 -20px 28px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.paper {
  position: relative;
  z-index: 2;
  background: var(--paper);
  box-shadow: 0 22px 44px rgba(35, 25, 8, 0.35), 0 1px 0 rgba(255,255,255,0.4) inset;
  transform: rotate(-0.2deg);
}

/* ---------- Letterhead ---------- */
.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 32px 16px;
  border-bottom: 2px solid var(--rule-strong);
}
.doc-header-title {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.doc-header-right { text-align: right; }
.doc-author { font-weight: 700; font-size: 15px; color: var(--ink); }
.doc-date { font-size: 12px; color: var(--ink-faint); }

/* ---------- Top nav ---------- */
.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner {
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.navlink {
  font-size: 12.5px;
  color: var(--ink-dim);
  text-decoration: none;
  white-space: nowrap;
  padding: 10px 8px;
  border-bottom: 2px solid transparent;
}
.navlink:hover { color: var(--ink); }
.navlink.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Layout shell ---------- */
main { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
section { padding: 26px 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

h1, h2, h3, h4 {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35em;
}
h2 { font-size: 26px; }
h3 { font-size: 18px; color: var(--accent); margin-top: 1.5em; }
p { color: var(--ink-dim); margin: 0 0 1em; max-width: 68ch; }
strong { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding-top: 30px; }
.hero-kicker { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.06em; margin-bottom: 10px; }
.hero h1 { font-size: clamp(34px, 6vw, 48px); margin-bottom: 6px; }
.hero .aka { font-size: 14px; color: var(--ink-dim); margin-bottom: 20px; }
.hero-thesis { font-size: 16px; color: var(--ink-dim); max-width: 60ch; margin-top: 0; }
.threat-level { font-size: 14px; color: var(--ink-dim); margin: 10px 0 4px; }
.threat-level strong { color: var(--accent); }

/* Stat row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 1px;
  background: var(--rule);
  margin-top: 22px;
  border: 1px solid var(--rule);
}
.stat { background: var(--paper); padding: 14px 14px; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }

/* ---------- Key judgments ---------- */
.kj-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.kj-item {
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
}
.kj-item p { margin: 0; color: var(--ink); font-size: 15px; }

/* ---------- Callout / plain-terms box ---------- */
.callout {
  margin: 20px 0;
  padding: 16px 18px;
  background: var(--accent-soft);
  border: 1px solid var(--rule);
}
.callout-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 8px;
}
.callout p:last-child { margin-bottom: 0; }

.callout.analyst { background: var(--paper-edge); }
.callout.analyst textarea {
  width: 100%;
  min-height: 110px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  padding: 12px;
  resize: vertical;
}

.callout.analyst-note { margin-top: 18px; }

/* ---------- Timeline ---------- */
.timeline { margin-top: 16px; position: relative; padding-left: 26px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--rule);
}
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -26px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.tl-date { font-size: 12.5px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.tl-item h4 { font-size: 15.5px; margin-bottom: 4px; color: var(--ink); }
.tl-item p { font-size: 14.5px; margin-bottom: 0; }

/* ---------- Victimology bars ---------- */
.bar-group { margin-top: 4px; display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 128px 1fr 38px; align-items: center; gap: 12px; }
.bar-name { font-size: 12.5px; color: var(--ink-dim); }
.bar-track { height: 8px; background: var(--paper-edge); border: 1px solid var(--rule); }
.bar-fill { height: 100%; background: var(--accent); opacity: 0.75; }
.bar-pct { font-size: 12px; font-weight: 700; color: var(--ink); text-align: right; }

.vic-block {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 18px 20px 20px;
}
.vic-block-title {
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vic-block-title span {
  font-size: 11px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Kill chain / TTP phases ---------- */
.phase { margin-top: 30px; }
.phase-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.phase-num { font-size: 22px; font-weight: 700; color: var(--rule); line-height: 1; }
.phase-head h3 { margin: 0; }
.ttp-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.ttp-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ttp-id { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.ttp-name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.ttp-card p { font-size: 14px; margin: 0; color: var(--ink-dim); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin-top: 14px; border: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 540px; }
.cve-table th:nth-child(1), .cve-table td:nth-child(1) { width: 16%; }
.cve-table th:nth-child(2), .cve-table td:nth-child(2) { width: 24%; }
.cve-table th:nth-child(3), .cve-table td:nth-child(3) { width: 60%; }
th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding: 10px 14px;
  background: var(--paper-edge);
  border-bottom: 1px solid var(--rule);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--rule); color: var(--ink-dim); vertical-align: top; }
tr:last-child td { border-bottom: none; }
td.mono, .hash { font-size: 12px; color: var(--ink); word-break: break-all; }
.sev { font-size: 10.5px; font-weight: 700; padding: 2px 7px; white-space: nowrap; }
.sev-critical { color: var(--accent); border: 1px solid var(--accent); }
.sev-high { color: var(--ink-dim); border: 1px solid var(--rule); }

/* ---------- Tool tags ---------- */
.tool-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tool-tag { font-size: 12.5px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); padding: 6px 12px; }
.tool-tag .fn { color: var(--ink-faint); font-size: 11px; }

/* ---------- Mitigations ---------- */
.mit-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mit-list li { display: flex; gap: 12px; padding: 12px 16px; background: var(--paper); border: 1px solid var(--rule); font-size: 14.5px; color: var(--ink-dim); }
.mit-list .pri { font-size: 11px; font-weight: 700; color: var(--accent); height: fit-content; }
.mit-list strong { color: var(--ink); }

/* ---------- References ---------- */
.source-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.source-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: baseline; padding: 10px 4px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.source-list .idx { color: var(--ink-faint); font-size: 12px; }
.source-list a { color: var(--ink); font-weight: 500; }
.source-list a:hover { color: var(--accent); }
.source-list .pub { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }

/* ---------- Footer ---------- */
footer { padding: 16px 32px 34px; text-align: center; }
footer .fnote { font-size: 12.5px; color: var(--ink-faint); max-width: 60ch; margin: 0 auto; }
footer a { color: var(--ink-dim); }

.footer-meta { margin-top: 18px; }
.footer-name { display: block; font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 14px; }
.footer-social { display: flex; justify-content: center; gap: 36px; }
.footer-social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  color: var(--ink-dim);
  font-size: 12.5px;
}
.footer-social-link:hover { color: var(--accent); }
.footer-social-icon { width: 19px; height: 19px; fill: currentColor; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--paper);
  padding: 10px 16px; z-index: 100; font-size: 13px;
}
.skip-link:focus { left: 12px; top: 12px; }
