/* ==========================================================================
   THE TAC ENGINEER — Design system
   Static site for Cloudflare Pages. No build step required.
   ========================================================================== */

:root {
  /* Brand palette */
  --navy-900: #0B1424;      /* primary background (hero, header, footer) */
  --navy-800: #17263B;      /* secondary background */
  --navy-700: #22344F;
  --accent: #3B82F6;        /* electric blue — large elements, dark backgrounds */
  --accent-strong: #2563EB; /* accessible blue for text links/buttons on light bg */
  --accent-soft: #EFF5FF;
  --text: #172033;          /* primary text */
  --text-muted: #64748B;    /* secondary text */
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;       /* light background */
  --border: #E2E8F0;
  --on-dark: #E6EDF7;
  --on-dark-muted: #9FB0C8;

  /* Status colours */
  --ok: #15803D;   --ok-bg: #ECFDF3;
  --warn: #B45309; --warn-bg: #FFF7E6;
  --danger: #B91C1C; --danger-bg: #FEF2F2;
  --info: #1D4ED8; --info-bg: #EFF5FF;

  /* Type */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Layout */
  --container: 1180px;
  --prose: 74ch;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: #1D4ED8; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 .6em; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 750; }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 650; }
h4 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1.1em; }
li { margin-bottom: .35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent-strong); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; color: #fff; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
.site-header {
  background: var(--navy-900);
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-weight: 750; font-size: 1.02rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.brand-name span { color: var(--accent); }

.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.18); color: #fff;
  border-radius: var(--radius-sm); padding: .45rem .7rem; font: inherit; font-size: .9rem; cursor: pointer;
}
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--on-dark-muted); text-decoration: none; font-size: .93rem; font-weight: 500;
}
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.site-nav a[aria-current="page"] { color: #fff; background: rgba(59,130,246,.18); }

@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: .4rem; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--navy-900); border-bottom: 1px solid rgba(255,255,255,.08); display: none; }
  .site-nav.open { display: block; }
  .no-js .site-nav { display: block; position: static; }
  .site-nav ul { flex-direction: column; padding: .5rem 1.5rem 1rem; }
  .site-nav a { padding: .75rem .5rem; font-size: 1rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.3rem;
  border-radius: var(--radius-sm); font-weight: 600; font-size: .98rem; text-decoration: none;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #1D4ED8; color: #fff; }
.btn-outline-dark { border-color: rgba(255,255,255,.28); color: #fff; }
.btn-outline-dark:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.05); }
.btn-outline { border-color: var(--border); color: var(--text); background: #fff; }
.btn-outline:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(2px); }

/* ---------- Hero ---------- */
.hero {
  background: var(--navy-900);
  color: var(--on-dark);
  padding: clamp(4rem, 9vw, 7rem) 0 clamp(4rem, 8vw, 6rem);
  position: relative; overflow: hidden;
}
.hero::after { /* faint engineering grid, no gradients */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 3rem; align-items: center; }
.eyebrow { font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; display: block; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.5vw, 3.6rem); margin-bottom: .35em; }
.hero-statement { font-size: clamp(1.2rem, 2.2vw, 1.5rem); font-weight: 600; color: #fff; line-height: 1.45; margin-bottom: .9rem; max-width: 30ch; }
.hero-desc { color: var(--on-dark-muted); font-size: 1.08rem; max-width: 52ch; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-panel {
  background: var(--navy-800); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
  font-family: var(--mono); font-size: .82rem; color: var(--on-dark-muted); overflow: hidden;
}
.hero-panel-bar { display: flex; justify-content: space-between; padding: .6rem 1rem; border-bottom: 1px solid rgba(255,255,255,.07); font-size: .75rem; letter-spacing: .04em; }
.hero-panel pre { margin: 0; padding: 1.1rem 1rem 1.2rem; white-space: pre-wrap; line-height: 1.75; }
.hero-panel .k { color: var(--accent); }
.hero-panel .ok { color: #4ADE80; }
.hero-panel .w { color: #FBBF24; }
.hero-panel .c { color: #6B7D98; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-panel { display: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-dark { background: var(--navy-800); color: var(--on-dark); }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 2.2rem; flex-wrap: wrap; }
.section-head h2 { margin-bottom: .25rem; }
.section-head p { color: var(--text-muted); margin: 0; max-width: 60ch; }
.section-dark .section-head p { color: var(--on-dark-muted); }
.section-head .eyebrow { color: var(--accent-strong); margin-bottom: .5rem; }
.section-dark .eyebrow { color: var(--accent); }
.link-more { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; display: flex; flex-direction: column;
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { box-shadow: var(--shadow-hover); border-color: #CBD5E1; }
.card h3 { font-size: 1.12rem; margin-bottom: .5rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent-strong); }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.card.linkable { position: relative; }
.card .excerpt { color: var(--text-muted); font-size: .97rem; margin-bottom: 1.1rem; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .85rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: .9rem; margin-top: auto; }
.card-meta .read { font-weight: 600; color: var(--accent-strong); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
.cat-label { font-size: .74rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }

/* Category cards (homepage) */
.cat-card { padding: 1.6rem; }
.cat-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 1.1rem; }
.cat-icon svg { width: 24px; height: 24px; }
.cat-card p { color: var(--text-muted); font-size: .95rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.chips li { margin: 0; font-size: .78rem; font-weight: 500; padding: .22rem .55rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); color: #334155; }
.cat-card .link-more { margin-top: auto; font-size: .93rem; }

/* Lab cards */
.lab-card { padding: 0; overflow: hidden; }
.lab-thumb { background: var(--navy-900); border-bottom: 1px solid var(--border); aspect-ratio: 16 / 7; display: grid; place-items: center; padding: 1rem; }
.lab-thumb img { width: 100%; height: 100%; object-fit: contain; }
.lab-body { padding: 1.3rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.lab-body dl { margin: 0 0 1rem; font-size: .9rem; }
.lab-body dt { font-weight: 600; color: var(--text); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; margin-top: .6rem; }
.lab-body dd { margin: .1rem 0 0; color: var(--text-muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 650; padding: .2rem .6rem; border-radius: 999px; border: 1px solid; white-space: nowrap; letter-spacing: .02em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-planned { color: #475569; background: #F1F5F9; border-color: #CBD5E1; }
.badge-progress { color: var(--warn); background: var(--warn-bg); border-color: #FCD34D; }
.badge-completed { color: var(--ok); background: var(--ok-bg); border-color: #86EFAC; }
.badge-demo { color: #6D28D9; background: #F5F3FF; border-color: #C4B5FD; }
.badge-demo::before { display: none; }

/* ---------- Methodology flow ---------- */
.flow { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .75rem; counter-reset: step; }
.flow li { margin: 0; position: relative; background: var(--navy-900); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 1.1rem 1rem; counter-increment: step; }
.flow li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: .75rem; color: var(--accent); display: block; margin-bottom: .45rem; }
.flow li:not(:last-child)::after { content: "→"; position: absolute; right: -.62rem; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: .9rem; z-index: 2; }
.flow strong { color: #fff; font-size: .95rem; display: block; line-height: 1.3; margin-bottom: .35rem; }
.flow span { color: var(--on-dark-muted); font-size: .82rem; line-height: 1.5; display: block; }
@media (max-width: 1100px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } .flow li::after { display: none; } }
@media (max-width: 640px) {
  .flow { grid-template-columns: 1fr; gap: .5rem; }
  .flow li { display: grid; grid-template-columns: 2.4rem 1fr; padding: .9rem 1rem; }
  .flow li::before { grid-row: span 2; margin: .1rem 0 0; }
}

/* ---------- About band ---------- */
.about-band { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: start; }
.about-band .facts { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.about-band .facts li { margin: 0; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; gap: .9rem; font-size: .97rem; }
.about-band .facts li:last-child { border-bottom: 0; }
.about-band .facts b { font-family: var(--mono); color: var(--accent-strong); font-weight: 600; min-width: 2.2rem; }
@media (max-width: 860px) { .about-band { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: var(--on-dark-muted); padding: 3.5rem 0 2rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.site-footer h2 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--on-dark-muted); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-tagline { max-width: 36ch; margin-top: 1rem; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-top: 1.5rem; font-size: .85rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Page header (inner pages) ---------- */
.page-header { background: var(--navy-800); color: var(--on-dark); padding: 3rem 0 2.6rem; }
.page-header h1 { color: #fff; margin-bottom: .4rem; }
.page-header p { color: var(--on-dark-muted); max-width: 64ch; margin: 0; font-size: 1.05rem; }
.breadcrumb { font-size: .85rem; margin-bottom: 1rem; color: var(--on-dark-muted); }
.breadcrumb a { color: var(--on-dark-muted); text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb span[aria-hidden] { margin: 0 .4rem; opacity: .6; }
.page-header .meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.2rem; font-size: .88rem; color: var(--on-dark-muted); align-items: center; }
.page-header .meta-row .badge { font-size: .72rem; }

/* ---------- Filters / search ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search input { width: 100%; font: inherit; font-size: .97rem; padding: .7rem 1rem .7rem 2.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; color: var(--text); }
.search input:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(59,130,246,.2); }
.search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-chips button { font: inherit; font-size: .86rem; font-weight: 500; padding: .42rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: #334155; cursor: pointer; }
.filter-chips button:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.filter-chips button[aria-pressed="true"] { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.empty-state { padding: 3rem 1rem; text-align: center; color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.result-count { font-size: .88rem; color: var(--text-muted); margin: -1rem 0 1.25rem; }

.group-title { display: flex; align-items: baseline; gap: .75rem; margin: 3rem 0 1.25rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.group-title:first-child { margin-top: 0; }
.group-title h2 { font-size: 1.35rem; margin: 0; }
.group-title span { font-size: .88rem; color: var(--text-muted); }

/* ---------- Notices ---------- */
.demo-banner {
  background: #F5F3FF; border: 1px solid #DDD6FE; color: #4C1D95; border-radius: var(--radius-sm);
  padding: .85rem 1.1rem; font-size: .93rem; line-height: 1.6; margin-bottom: 2rem;
}
.demo-banner strong { margin-right: .35rem; }

/* ---------- Article / documentation layout ---------- */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 3.5rem; padding: 3rem 0 4rem; }
.toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; font-size: .88rem; }
.toc h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .8rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: .32rem 0 .32rem .9rem; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); text-decoration: none; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent-strong); font-weight: 600; }
@media (max-width: 1024px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 2rem; }
  .toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 2rem; background: var(--bg-soft); }
  .toc ol { columns: 2; column-gap: 1.5rem; border: 0; }
  .toc a { padding-left: 0; border: 0; }
}
@media (max-width: 560px) { .toc ol { columns: 1; } }

.prose { max-width: var(--prose); }
.prose h2 { margin-top: 2.6rem; padding-top: .4rem; scroll-margin-top: 90px; font-size: 1.55rem; }
.prose h2:first-child { margin-top: 0; }
.prose h2 .num { font-family: var(--mono); font-size: .85rem; color: var(--accent-strong); font-weight: 600; margin-right: .6rem; vertical-align: .15em; }
.prose h3 { margin-top: 1.8rem; scroll-margin-top: 90px; }
.prose p, .prose li { color: #24304A; }
.prose strong { color: var(--text); }
.prose code:not(pre code) { font-family: var(--mono); font-size: .86em; background: #F1F5F9; border: 1px solid var(--border); padding: .08em .35em; border-radius: 4px; color: #0F2A5C; word-break: break-word; }

/* Code blocks */
.code-block { margin: 1.4rem 0 1.6rem; border-radius: var(--radius); overflow: hidden; background: var(--navy-900); border: 1px solid #0F1D33; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: .45rem .5rem .45rem 1rem; background: var(--navy-800); font-family: var(--mono); font-size: .75rem; color: var(--on-dark-muted); letter-spacing: .03em; }
.copy-btn { font: inherit; font-size: .72rem; background: transparent; color: var(--on-dark-muted); border: 1px solid rgba(255,255,255,.15); border-radius: 4px; padding: .2rem .55rem; cursor: pointer; }
.copy-btn:hover { color: #fff; border-color: rgba(255,255,255,.35); }
.code-block pre { margin: 0; padding: 1rem 1.1rem 1.15rem; overflow-x: auto; font-family: var(--mono); font-size: .84rem; line-height: 1.65; color: #DCE6F5; tab-size: 2; }
.code-block .cm { color: #6B7D98; }
.code-block .hl { color: #93C5FD; }

/* Callouts */
.callout { border: 1px solid; border-left-width: 4px; border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.5rem 0; font-size: .97rem; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: .35rem; }
.callout-note { background: var(--info-bg); border-color: #BFDBFE; border-left-color: var(--info); }
.callout-note .callout-title { color: var(--info); }
.callout-warning { background: var(--warn-bg); border-color: #FDE68A; border-left-color: #D97706; }
.callout-warning .callout-title { color: var(--warn); }
.callout-important { background: var(--danger-bg); border-color: #FECACA; border-left-color: var(--danger); }
.callout-important .callout-title { color: var(--danger); }
.callout-success { background: var(--ok-bg); border-color: #BBF7D0; border-left-color: var(--ok); }
.callout-success .callout-title { color: var(--ok); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.4rem 0 1.8rem; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .7rem .95rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 650; color: var(--text); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* Figures */
figure { margin: 1.6rem 0 2rem; }
figure .diagram { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
figcaption { font-size: .86rem; color: var(--text-muted); margin-top: .6rem; text-align: center; }
.screenshot-placeholder { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; color: var(--text-muted); font-size: .9rem; background: var(--bg-soft); }

/* Fact sheet (labs, cases, projects) */
.fact-sheet { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 0 0 2.2rem; background: #fff; }
.fact-sheet div { padding: .9rem 1.1rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: -1px; }
.fact-sheet dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 650; margin-bottom: .2rem; }
.fact-sheet dd { margin: 0; font-size: .93rem; font-weight: 500; }

/* Step list */
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 1.2rem 2.75rem; margin: 0; border-left: 2px solid var(--border); margin-left: .9rem; }
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before { content: counter(s); position: absolute; left: -.95rem; top: -.1rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--navy-900); color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center; font-family: var(--mono); }
.steps > li > strong:first-child { display: block; margin-bottom: .2rem; }

/* Article footer: tags, prev/next, related */
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 2.5rem 0 0; }
.tag-list li { margin: 0; font-size: .8rem; padding: .22rem .6rem; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border); color: #334155; font-family: var(--mono); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.prev-next a { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; text-decoration: none; color: var(--text); background: #fff; }
.prev-next a:hover { border-color: var(--accent-strong); }
.prev-next small { display: block; font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.prev-next .next { text-align: right; grid-column: 2; }
.prev-next span { font-weight: 600; line-height: 1.4; display: block; }
@media (max-width: 640px) { .prev-next { grid-template-columns: 1fr; } .prev-next .next { grid-column: 1; text-align: left; } }
.related { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 3rem 0 3.5rem; }
.related h2 { font-size: 1.3rem; margin-bottom: 1.4rem; }

/* Simple content pages */
.page-body { padding: 3rem 0 4.5rem; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 3.5rem; align-items: start; }
.side-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; background: var(--bg-soft); font-size: .95rem; }
.side-box h2 { font-size: 1rem; margin-bottom: .8rem; }
.side-box ul { list-style: none; padding: 0; margin: 0; }
.side-box li { padding: .45rem 0; border-bottom: 1px solid var(--border); margin: 0; }
.side-box li:last-child { border-bottom: 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 2rem; } }

.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li { margin: 0; }
.contact-list a { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: #fff; box-shadow: var(--shadow); }
.contact-list a:hover { border-color: var(--accent-strong); }
.contact-list .ic { width: 42px; height: 42px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; flex: none; }
.contact-list .ic svg { width: 22px; height: 22px; }
.contact-list small { display: block; color: var(--text-muted); font-size: .85rem; }
.contact-list strong { display: block; font-size: 1rem; }

.not-found { text-align: center; padding: 6rem 0; }
.not-found .code { font-family: var(--mono); font-size: 4rem; color: var(--accent-strong); font-weight: 700; line-height: 1; margin-bottom: 1rem; }

/* Print */
@media print {
  .site-header, .site-footer, .toc, .related, .prev-next, .copy-btn, .nav-toggle { display: none !important; }
  .doc-layout { display: block; }
  .page-header { background: none; color: #000; padding: 0; }
  .page-header h1, .page-header p { color: #000; }
  .code-block pre { white-space: pre-wrap; }
}
