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

:root {
  --bg: #0c0c0e;
  --bg-card: #141418;
  --bg-hover: #1a1a20;
  --border: #2a2a32;
  --border-accent: #3d3d4a;
  --text: #e8e6e3;
  --text-muted: #a8a4b0;
  --text-dim: #7a7884;
  --accent: #c9a84c;
  --accent-dim: #a08338;
  --red: #c45c5c;
  --red-dim: #8a3a3a;
  --blue: #5c8ac4;
  --green: #5ca87a;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* --- NAV --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

nav .nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

nav .logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--accent);
  text-decoration: none;
}

nav .nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}

nav .nav-links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

nav .nav-links a:hover,
nav .nav-links a.active { color: var(--text); }

/* --- LAYOUT --- */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 6rem 2rem 4rem;
}

.container.wide { max-width: 1000px; }

/* --- HERO --- */
.hero {
  padding: 8rem 2rem 4rem;
  max-width: 820px;
  margin: 0 auto;
}

.hero h1 {
  font-family: 'Source Serif 4', serif;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  letter-spacing: -0.02em;
}

.hero h1 .hhh {
  color: var(--accent);
}

.hero .subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 600px;
}

.hero .meta {
  margin-top: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* --- SECTION HEADERS --- */
h2 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin: 3rem 0 1.2rem;
  letter-spacing: -0.01em;
}

h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* --- TIMELINE --- */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin: 2.5rem 0 1rem;
  position: relative;
}

.timeline-year::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: -4px;
}

.timeline-entry {
  position: relative;
  margin: 0.8rem 0;
  padding: 0.9rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s, background 0.2s;
}

.timeline-entry:hover {
  border-color: var(--border-accent);
  background: var(--bg-hover);
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 1.2rem;
  width: 5px;
  height: 5px;
  background: var(--text-dim);
  border-radius: 50%;
  margin-left: -2.5px;
}

.timeline-entry.critical {
  border-left: 3px solid var(--red);
}

.timeline-entry.critical::before {
  background: var(--red);
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
}

.timeline-entry .date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  margin-bottom: 0.3rem;
}

.timeline-entry .title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
}

.timeline-entry .detail {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-entry a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color 0.2s;
}

.timeline-entry a:hover {
  border-color: var(--accent);
}

.timeline-label {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-top: 0.4rem;
}

.timeline-label.gov { background: var(--red-dim); color: #f0c0c0; }
.timeline-label.corp { background: #2a3040; color: #8ab4e0; }
.timeline-label.legal { background: #302a40; color: #b08ae0; }
.timeline-label.safety { background: #2a3a2a; color: #80c090; }

/* --- PATTERN BOX --- */
.pattern-box {
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
}

.pattern-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.4rem 0;
}

.pattern-box .closer {
  font-family: 'Source Serif 4', serif;
  font-style: italic;
  color: var(--text);
  font-size: 1rem;
  margin-top: 1rem;
}

/* --- DOCUMENTS --- */
.doc-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.doc-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.doc-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.doc-card .doc-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.doc-card .doc-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.doc-card .doc-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- PROSE --- */
.prose {
  font-family: 'Source Serif 4', serif;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.prose p { margin: 1rem 0; }

.prose strong { color: var(--text); font-weight: 600; }

.prose em { font-style: italic; }

.prose blockquote {
  border-left: 2px solid var(--accent-dim);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* --- FRAMEWORK --- */
.trilemma-pair {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin: 1rem 0;
}

.trilemma-pair .pair-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.trilemma-pair .pair-result {
  font-weight: 600;
  color: var(--red);
  margin-bottom: 0.3rem;
}

.trilemma-pair .pair-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- SOURCE LIST --- */
.source-list {
  list-style: none;
  margin: 1rem 0;
}

.source-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.source-list li:last-child { border-bottom: none; }

.source-list a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.source-list a:hover { border-color: var(--accent); }

.source-list .source-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

/* --- FOOTER --- */
footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 6rem 1.2rem 3rem; }
  .container { padding: 5rem 1.2rem 3rem; }
  nav .nav-links { gap: 1rem; }
  nav .nav-links a { font-size: 0.72rem; }
  .timeline { padding-left: 1.5rem; }
  .timeline-year::before { left: -1.5rem; }
  .timeline-entry::before { left: -1.5rem; }
}
