@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;1,9..144,300&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: #0f1117;
  --bg2: #161922;
  --bg3: #1e2230;
  --border: #2a2f3e;
  --text: #d4d8e8;
  --text-muted: #6b7394;
  --text-dim: #4a5070;
  --accent: #4ecdc4;
  --accent2: #f7c59f;
  --white: #eef0f8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

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

.nav-logo span { color: var(--text-muted); }

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

.nav-links a {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.2s;
}

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

/* ── BREADCRUMB ── */
.breadcrumb {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 2rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-dim); }

/* ── PAGE HERO ── */
.page-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 3rem;
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; right: -100px;
  width: 500px; height: 400px;
  background: radial-gradient(circle, rgba(78,205,196,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.page-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-tag::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--accent);
}

h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 1.5rem;
  max-width: 750px;
}

h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.page-intro {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 680px;
  line-height: 1.85;
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0 2rem;
}

/* ── MAIN LAYOUT ── */
.page-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

/* ── ARTICLE PROSE ── */
.article-body h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
  margin: 2.5rem 0 1rem;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin: 2rem 0 0.7rem;
}

.article-body p {
  font-size: 0.97rem;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 1.2rem;
}

.article-body p:last-child { margin-bottom: 0; }

.article-body strong {
  color: var(--white);
  font-weight: 500;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(78,205,196,0.3);
  transition: border-color 0.2s;
}

.article-body a:hover { border-color: var(--accent); }

/* ── CODE ── */
code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8em;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.1em 0.45em;
  border-radius: 3px;
  color: var(--accent2);
}

pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text);
}

/* ── CALLOUT ── */
.callout {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1.5rem 1.8rem;
  margin: 1.8rem 0;
}

.callout-warn {
  border-left-color: var(--accent2);
}

.callout p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.callout-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.callout-warn .callout-label { color: var(--accent2); }

/* ── TABLE ── */
.table-wrap {
  overflow-x: auto;
  margin: 1.8rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

thead { background: var(--bg3); }

th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.9rem 1.2rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
  line-height: 1.5;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.015); }

.td-good { color: #4ecdc4; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.td-warn { color: var(--accent2); font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }
.td-bad  { color: #e84343; font-family: 'IBM Plex Mono', monospace; font-size: 0.75rem; }

/* ── SIDEBAR ── */
.sidebar { position: sticky; top: 80px; }

.sidebar-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.3rem 0;
  display: block;
  transition: color 0.2s;
  line-height: 1.4;
}

.sidebar-nav a:hover { color: var(--accent); }
.sidebar-nav a.current { color: var(--accent); }

.sidebar-cta {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1.5rem;
}

.sidebar-cta p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.8rem;
}

.sidebar-cta a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(78,205,196,0.3);
  transition: border-color 0.2s;
}

.sidebar-cta a:hover { border-color: var(--accent); }

.sidebar-cta-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-logo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-copy {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-hero > * {
  animation: fadeUp 0.5s ease both;
}

.page-tag  { animation-delay: 0.05s; }
h1         { animation-delay: 0.12s; }
.page-intro { animation-delay: 0.2s; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-links { display: none; }
}

/* ── HOME SPECIFIC ── */
.hero {
  position: relative;
  padding: 7rem 2rem 5rem;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -120px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(78,205,196,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: var(--accent);
}

.hero-intro {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 620px;
  line-height: 1.8;
  margin-bottom: 3rem;
}

.hero-intro a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(78,205,196,0.35);
  transition: border-color 0.2s;
}

.hero-intro a:hover { border-color: var(--accent); }

.hero-stats { display: flex; gap: 3rem; flex-wrap: wrap; }

.stat { display: flex; flex-direction: column; gap: 0.2rem; }

.stat-number {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
}

.stat-number sup { font-size: 0.9rem; color: var(--accent); }

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 80px;
}

section h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 1rem;
}

section h3 {
  font-family: 'Fraunces', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 0.6rem;
}

section p { margin-bottom: 1rem; }
section p:last-child { margin-bottom: 0; }

.prose { max-width: 720px; }
.prose p { font-size: 0.97rem; color: var(--text); line-height: 1.85; }
.prose strong { color: var(--white); font-weight: 500; }

.layers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2.5rem;
}

.layer {
  background: var(--bg2);
  padding: 2rem 1.8rem;
  transition: background 0.25s;
}

.layer:hover { background: var(--bg3); }

.layer-icon { font-size: 1.4rem; margin-bottom: 0.8rem; display: block; }

.layer p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

.articles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2.5rem;
}

.article-card {
  background: var(--bg2);
  padding: 2.2rem 2rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: background 0.2s;
  position: relative;
}

.article-card:hover { background: var(--bg3); }

.article-card::after {
  content: '→';
  position: absolute;
  top: 2.2rem; right: 2rem;
  color: var(--text-dim);
  font-size: 1rem;
  transition: color 0.2s, transform 0.2s;
}

.article-card:hover::after { color: var(--accent); transform: translateX(3px); }

.card-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.article-card h3 { font-size: 1.05rem; color: var(--white); padding-right: 2rem; }
.article-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.65; }

.steps {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2.5rem;
}

.step {
  background: var(--bg2);
  padding: 2rem;
  transition: background 0.2s;
}

.step:hover { background: var(--bg3); }

.step-body h3 { font-size: 1rem; margin-bottom: 0.5rem; }

.step-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .layers { grid-template-columns: 1fr; }
  .articles { grid-template-columns: 1fr; }
}
