/* ==========================================================================
   Subpage styling — /meta/, /projects/<slug>/
   Reuses tokens & components from main.css; adds breadcrumbs, long-form
   blocks, code blocks, decision grid, cost table, step lists.
   ========================================================================== */

.subpage {
  padding: calc(var(--nav-h) + 40px) 0 80px;
}

.crumbs {
  display: flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
.crumbs a {
  color: var(--text-dim);
}
.crumbs a:hover { color: var(--accent-1); }
.crumbs span[aria-current="page"] { color: var(--text); }

/* ---- Hero ---------------------------------------------------------------- */
.subpage-hero {
  padding: 8px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.subpage-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 14px;
}
.subpage-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.subpage-hero h1 .accent {
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subpage-hero .lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 800px;
  line-height: 1.65;
}
.subpage-hero strong { color: var(--text); font-weight: 600; }

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}
.chip-static {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.subpage-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ---- Sections ------------------------------------------------------------ */
.subpage-section {
  margin: 56px 0;
}
.subpage-section > p,
.subpage-section > ul,
.subpage-section > ol {
  max-width: 820px;
}
.subpage-section h2.section-title {
  margin-bottom: 18px;
}
.subpage-section p {
  color: var(--text-dim);
}
.subpage-section strong { color: var(--text); font-weight: 600; }
.subpage-section code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(76, 201, 240, 0.08);
  color: var(--accent-1);
  border: 1px solid rgba(76, 201, 240, 0.15);
}

.subpage-section a {
  color: var(--accent-1);
  border-bottom: 1px dashed rgba(76, 201, 240, 0.35);
}
.subpage-section a:hover { border-bottom-color: var(--accent-1); }

/* ---- Architecture SVG ---------------------------------------------------- */
.arch-diagram {
  margin: 28px 0 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.arch-diagram svg {
  width: 100%;
  height: auto;
  min-width: 640px;
}

/* ---- Code blocks --------------------------------------------------------- */
.code-block {
  background: rgba(7, 9, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 22px 0;
}
.code-block code {
  background: none;
  border: none;
  color: var(--text);
  padding: 0;
  font-size: inherit;
}
.code-block .k { color: #c792ea; }            /* keyword */
.code-block .s { color: #c3e88d; }            /* string */
.code-block .c { color: #5c698a; font-style: italic; } /* comment */
.code-block .n { color: #4cc9f0; }            /* number/name */

/* ---- Step list (ordered) ------------------------------------------------- */
.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 24px 0;
  max-width: 820px;
}
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 14px 0 14px 58px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  width: 40px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-1);
  opacity: 0.85;
}
.step-list li strong { color: var(--text); font-weight: 600; }

/* ---- Tick list override for subpage -------------------------------------- */
.subpage-section .tick-list {
  max-width: 820px;
}
.subpage-section .tick-list li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--text-dim);
}
.subpage-section .tick-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--accent-1);
  font-weight: 700;
}

/* ---- Cost table ---------------------------------------------------------- */
.cost-table {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  max-width: 820px;
}
.cost-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.5fr;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  color: var(--text-dim);
}
.cost-row:last-child { border-bottom: none; }
.cost-row.cost-head {
  background: rgba(76, 201, 240, 0.05);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cost-row.cost-total {
  background: rgba(123, 44, 191, 0.06);
  color: var(--text);
  font-weight: 600;
}

/* ---- Decision grid ------------------------------------------------------- */
.decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0;
}
.decision {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: border-color .25s ease, transform .25s ease;
}
.decision:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.decision h4 {
  font-size: 1.02rem;
  margin-bottom: 10px;
  color: var(--text);
}
.decision p {
  font-size: 0.93rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

/* ---- Case-study specific ------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: left;
}
.metric .m-val {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.6rem;
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}
.metric .m-label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.4;
}

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 24px 0;
}
.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.stage strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---- Footer CTA ---------------------------------------------------------- */
.subpage-footer-cta {
  margin-top: 80px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  background-image:
    radial-gradient(500px 300px at 10% 0%, rgba(123, 44, 191, 0.15), transparent 70%),
    radial-gradient(400px 300px at 90% 100%, rgba(76, 201, 240, 0.10), transparent 70%);
}
.subpage-footer-cta h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.subpage-footer-cta p {
  color: var(--text-dim);
  margin-bottom: 18px;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
  .cost-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .cost-row.cost-head span:nth-child(2),
  .cost-row.cost-head span:nth-child(3) { display: none; }
  .subpage-footer-cta { padding: 28px 22px; }
}
