/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #0f0f0f;
  --surface:     #1a1a1a;
  --border:      #2a2a2a;
  --text:        #f0f0f0;
  --muted:       #888;
  --accent:      #4f8ef7;
  --accent-dim:  #1e3a6e;
}

/* ─── Reset / Base ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* ─── Nav ───────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 1.75rem;
  overflow-x: auto;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
}

nav a:focus {
  color: var(--accent);
  outline: none;
}

/* ─── Sections ──────────────────────────────────────────────── */
section {
  max-width: 860px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: none;
}

/* ─── Hero ──────────────────────────────────────────────────── */
#hero {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

#hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

#hero .tagline {
  font-size: 1.125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

#hero .quote {
  font-size: 1rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 1.25rem;
}

#hero .subtitle {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ─── Section Headings ──────────────────────────────────────── */
h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

h3:first-of-type {
  margin-top: 0;
}

p {
  color: var(--text);
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* ─── Flow Diagrams ─────────────────────────────────────────── */
.flow-block {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.flow-block pre {
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre;
}

/* ─── Callout Box ───────────────────────────────────────────── */
.callout {
  background-color: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-size: 0.9375rem;
}

/* ─── Tables ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

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

thead tr {
  background-color: var(--surface);
}

th {
  text-align: left;
  padding: 0.625rem 0.875rem;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ─── Image Grid ────────────────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.image-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.img-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.img-card img {
  width: 100%;
  height: auto;
  display: block;
}

.img-card figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ─── Section Subtitle ──────────────────────────────────────── */
.section-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* ─── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ─── Responsive — 375px mobile ────────────────────────────── */
@media (max-width: 600px) {
  #hero h1 {
    font-size: 1.625rem;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-grid-2 {
    grid-template-columns: 1fr;
  }

  nav {
    gap: 1.25rem;
  }

  section {
    padding: 2.5rem 1rem;
  }
}
