/* ─────────────────────────────────────────────────────────────
   PROJECT PAGE — shared styles
───────────────────────────────────────────────────────────── */

:root {
  --bg:          #1c1c1c;
  --bg-bar:      #242424;
  --bg-card:     #202020;
  --border:      rgba(255,255,255,0.07);
  --text:        #b0b0b0;
  --text-dim:    #4a4a4a;
  --text-bright: #e8e8e8;
  --green:       #39d353;
  --accent:      #d6ff00;
  --orange:      #ffb020;
  --tag-bg:      rgba(214,255,0,0.05);
  --tag-border:  rgba(214,255,0,0.18);
  --max-w:       760px;
}

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

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Fira Mono', monospace;
  min-height: 100vh;
  padding-bottom: 6rem;
}

/* ── Nav bar ─────────────────────────────────────────────── */
.proj-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.proj-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.proj-nav a:hover { color: var(--accent); }

.proj-nav .sep { color: var(--text-dim); }

.proj-nav .crumb-current {
  color: var(--text-bright);
}

/* ── Page wrapper ────────────────────────────────────────── */
.proj-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3.5rem 2rem 0;
}

/* ── Hero ────────────────────────────────────────────────── */
.proj-hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.proj-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.proj-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.proj-tagline {
  font-size: 0.92rem;
  color: var(--text-bright);
  line-height: 1.6;
  margin-bottom: 1.4rem;
  max-width: 600px;
}

.proj-meta {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.proj-tags-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.proj-tags-hero .tag {
  background: var(--tag-bg);
  border-color: var(--tag-border);
  color: var(--accent);
}

.proj-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-bright);
  text-decoration: none;
  border: 1px solid rgba(214,255,0,0.25);
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  align-self: flex-start;
}
.proj-link:visited {
  color: var(--text-bright);
}
.proj-link:hover {
  color: var(--accent);
  border-color: var(--tag-border);
  background: var(--tag-bg);
}

/* ── Sections ────────────────────────────────────────────── */
.proj-section {
  margin-bottom: 2.8rem;
}

.proj-section h2 {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.proj-section p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.9rem;
}

.proj-section p:last-child { margin-bottom: 0; }

.proj-section strong { color: var(--text-bright); font-weight: 500; }

/* ── Ordered / unordered lists ───────────────────────────── */
.proj-section ol,
.proj-section ul {
  padding-left: 1.4rem;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
}

.proj-section li { margin-bottom: 0.35rem; }

/* ── Code blocks ─────────────────────────────────────────── */
.proj-section pre {
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--orange);
  margin: 1rem 0;
}

.proj-section code {
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--orange);
  background: rgba(255,176,32,0.07);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

.proj-section pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ── Stack table ─────────────────────────────────────────── */
.stack-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.stack-table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.stack-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  vertical-align: top;
  line-height: 1.5;
}

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

.stack-table td:first-child {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  width: 34%;
}

.stack-table td:nth-child(2) {
  color: var(--text-bright);
  width: 30%;
}

/* ── Principles / callout ────────────────────────────────── */
.principles {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.principle {
  display: flex;
  gap: 0.9rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

.principle .pnum {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 600;
  width: 1.4rem;
}

/* ── Architecture diagram ────────────────────────────────── */
.arch-block {
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1.3rem 1.4rem;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
  margin-top: 0.5rem;
  font-family: inherit;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .proj-nav { padding: 0.65rem 1.2rem; }
  .proj-page { padding: 2.2rem 1.2rem 0; }
  .proj-title { font-size: 1.5rem; }
  .proj-link { margin-left: 0; }
  .stack-table td:first-child { width: auto; white-space: normal; }
  .stack-table td:nth-child(2) { width: auto; }
}
