/* ============================================================
   TRUSTYEIGHT · operator-grade reference design system
   May 2026
   ============================================================ */

:root {
  --bg: #0a0a0a;
  --bg-soft: #111111;
  --bg-card: #161616;
  --border: #262626;
  --border-soft: #1f1f1f;
  --fg: #e8e6e3;
  --fg-mute: #8b8985;
  --fg-dim: #555350;
  --accent: #f4b860;        /* amber */
  --accent-hot: #fb923c;
  --good: #5ec88f;
  --bad: #ef6f6c;
  --warn: #e5b53f;
  --controv: #b794f4;
  --serif: "Instrument Serif", "Georgia", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --sans: "Inter var", "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

/* ===== TOP NAV ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding: 16px 40px;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 14px; }
.brand-name { font-weight: 700; letter-spacing: 0.08em; }
.brand-sub { color: var(--fg-mute); }
.navlinks { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.navlinks a {
  color: var(--fg-mute);
  text-decoration: none;
  transition: color 0.15s;
  text-transform: lowercase;
}
.navlinks a:hover { color: var(--accent); }
.stamp { display: flex; gap: 6px; align-items: baseline; }
.stamp-label { color: var(--fg-dim); }
.stamp-value { color: var(--fg); font-weight: 500; }

/* ===== SECTIONS ===== */
main { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
section { padding: 96px 0; border-top: 1px solid var(--border); }
section:first-of-type { padding-top: 48px; border-top: none; }
section.bordered { background: linear-gradient(180deg, rgba(244,184,96,0.02) 0%, transparent 100%); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}
.section-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
}
.section-head h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  flex: 1;
}
.section-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: lowercase;
}
.sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  margin: 48px 0 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

/* ===== HERO ===== */
.hero { padding: 80px 0 120px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 80px;
  align-items: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 0.06em;
}
.hero h1 {
  font-family: var(--sans);
  font-size: 84px;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-weight: 600;
  margin-bottom: 32px;
}
.hero h1 .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.hero h1 .amber { color: var(--accent); }
.hero-deck {
  font-size: 19px;
  line-height: 1.5;
  color: var(--fg-mute);
  max-width: 540px;
  margin-bottom: 40px;
}
.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
  font-family: var(--mono);
  font-size: 12px;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  max-width: 480px;
}
.hero-meta > div { display: flex; justify-content: space-between; }
.hero-meta .k { color: var(--fg-dim); }
.hero-meta .v { color: var(--fg); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.stat {
  background: var(--bg);
  padding: 28px;
}
.stat-num {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  line-height: 1;
}
.stat-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: lowercase;
  line-height: 1.35;
}

/* ===== PROSE ===== */
.prose { max-width: 820px; font-size: 16px; line-height: 1.65; color: var(--fg); }
.prose p { margin-bottom: 18px; }
.prose .lede { font-size: 21px; line-height: 1.45; color: var(--fg); margin-bottom: 28px; font-family: var(--serif); font-style: italic; }
.prose strong { color: var(--fg); }
.prose code, code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--accent);
  border: 1px solid var(--border-soft);
}
.prose .amber { color: var(--accent); }
.prose ol, .prose ul { margin: 16px 0 16px 28px; }
.prose li { margin-bottom: 10px; }
.num-list { counter-reset: item; list-style: none; padding: 0; }
.num-list li { counter-increment: item; position: relative; padding-left: 36px; }
.num-list li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}

/* ===== CALLOUT ===== */
.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 0 4px 4px 0;
}
.callout.warning { border-left-color: var(--warn); }
.callout.amber { border-left-color: var(--accent); }
.callout-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.callout blockquote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.5;
  color: var(--fg);
}
.callout ul li, .callout ol li { margin-bottom: 8px; font-size: 14.5px; }

/* ===== PIPELINE ASCII ===== */
.pipeline-diagram {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 40px;
}
.ascii {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg);
  white-space: pre;
}

/* ===== CARDS / GRIDS ===== */
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
.four-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 32px; }
.auth-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 32px; }
.llm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 32px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 2px;
}
.card.warning { border-color: var(--warn); }
.card-head {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.card-content { font-size: 14px; line-height: 1.55; color: var(--fg); }
.card-content p { margin-bottom: 12px; }
.card-content ul { margin: 10px 0 10px 20px; }
.card-content li { margin-bottom: 6px; }
.card-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.45;
}
.card-note.hot { color: var(--accent-hot); }
.kv {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.kv .good { color: var(--good); }
.kv .bad { color: var(--bad); }

/* ===== TABLES ===== */
table.data, table.wide-data {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--border-soft);
}
table.wide-data { font-size: 13px; margin-bottom: 32px; }
table.data th, table.wide-data th {
  text-align: left;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  background: var(--bg-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
table.data td, table.wide-data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg);
  vertical-align: top;
}
table.data tr:last-child td, table.wide-data tr:last-child td { border-bottom: none; }
table.data tr:hover, table.wide-data tr:hover { background: rgba(255,255,255,0.015); }
td.good { color: var(--good); }
td.bad { color: var(--bad); }
td.warn { color: var(--warn); }

/* ===== MONO LIST ===== */
.mono-list { display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--mono); }
.m-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 4px 9px;
  font-size: 11px;
  border-radius: 2px;
  color: var(--fg);
}

/* ===== THREAT CLASSES ===== */
.threat-classes {
  list-style: none;
  padding: 0;
  margin: 0 !important;
  font-family: var(--mono);
  font-size: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}
.threat-classes li {
  color: var(--fg-mute);
  padding-left: 14px;
  position: relative;
  margin-bottom: 0 !important;
}
.threat-classes li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--fg-dim);
}
.threat-classes li.hot { color: var(--accent-hot); font-weight: 700; }
.threat-classes li.hot::before { content: "★"; color: var(--accent-hot); }

/* ===== ANTI-PATTERN GRID ===== */
.anti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 32px;
}
.anti {
  background: rgba(239,111,108,0.06);
  border: 1px solid rgba(239,111,108,0.2);
  border-left: 3px solid var(--bad);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bad);
  border-radius: 0 2px 2px 0;
}

/* ===== DEFENSE LIST ===== */
.defense-list {
  list-style: none;
  padding: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.defense-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg);
}
.defense-list li:last-child { border-bottom: none; }
.defense-list strong { color: var(--accent); font-weight: 500; }

/* ===== EXAMPLE BLOCKS ===== */
.example {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg-soft);
  padding: 16px;
  border-radius: 2px;
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ===== TAGS ===== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
}
.tag.verified { color: var(--good); border-color: rgba(94,200,143,0.4); background: rgba(94,200,143,0.08); }
.tag.contradicted { color: var(--bad); border-color: rgba(239,111,108,0.4); background: rgba(239,111,108,0.08); }
.tag.controversial { color: var(--controv); border-color: rgba(183,148,244,0.4); background: rgba(183,148,244,0.08); }
.tag.plausible { color: var(--warn); border-color: rgba(229,181,63,0.4); background: rgba(229,181,63,0.08); }
.tag.unverif { color: var(--fg-mute); border-color: var(--border); background: var(--bg-soft); }

/* ===== GLOSSARY ===== */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 32px;
  font-size: 14px;
  line-height: 1.5;
}
.glossary-grid > div {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.glossary-grid dt {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-weight: 700;
}
.glossary-grid dd { color: var(--fg-mute); font-size: 13.5px; }

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-mute);
  margin-top: 64px;
}
.footer-left { display: flex; gap: 8px; align-items: center; }
.footer-mid { text-align: center; }
.footer-mid .dim { color: var(--fg-dim); }
.footer-right a { color: var(--accent); text-decoration: none; }
.footer-right a:hover { text-decoration: underline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  main { padding: 0 24px; }
  .topnav { padding: 14px 24px; grid-template-columns: 1fr; gap: 12px; }
  .navlinks { font-size: 11px; gap: 12px; justify-content: flex-start; }
  .stamp { font-size: 11px; }
  .hero h1 { font-size: 52px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .three-col, .auth-grid, .llm-grid, .four-col, .anti-grid { grid-template-columns: 1fr; }
  .glossary-grid { grid-template-columns: 1fr; }
  .threat-classes { grid-template-columns: 1fr; }
  .footer-mid { font-size: 10px; }
  footer { grid-template-columns: 1fr; text-align: center; gap: 16px; }
  section { padding: 64px 0; }
}

@media (max-width: 580px) {
  .hero h1 { font-size: 40px; }
  .section-head h2 { font-size: 22px; }
  .stat-num { font-size: 26px; }
  .navlinks { display: none; }
  .topnav { grid-template-columns: 1fr auto; gap: 8px; }
}

/* ===== UTILITY ===== */
.bordered { background: linear-gradient(180deg, rgba(244,184,96,0.015) 0%, transparent 60%); }

/* selection */
::selection { background: var(--accent); color: var(--bg); }
