/* 205 Data Lab content portal — design system. Hand-written, no build step. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --ink: #0b1b2b;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eff2f6;
  --text: #0b1b2b;
  --text-muted: #55657a;
  --border: #dfe4ec;
  --border-strong: #c6cedb;
  --accent: #2f6bff;
  --accent-hover: #1f55d8;
  --accent-contrast: #ffffff;
  --accent-soft: #e7eeff;
  --link: #1f55d8;
  --header-bg: rgba(247, 248, 250, .86);
  --cta-bg: #0b1b2b;
  --cta-fg: #ffffff;
  --shadow: 0 1px 2px rgba(11,27,43,.06), 0 8px 24px -12px rgba(11,27,43,.18);
  --shadow-hover: 0 2px 4px rgba(11,27,43,.08), 0 18px 36px -14px rgba(11,27,43,.28);
  --code-bg: #f1f4f8;
  --code-fg: #0b1b2b;
  --code-hl: #fff3b8;
  --inline-code-bg: #e9edf3;
  --focus: #2f6bff;

  --b-article: #1d4ed8;      --b-article-bg: #e3ebff;
  --b-interactive: #6d28d9;  --b-interactive-bg: #eee5ff;
  --b-dashboard: #0f766e;    --b-dashboard-bg: #d9f4ef;
  --b-diagram: #b45309;      --b-diagram-bg: #fdecd0;
  --b-tool: #be185d;         --b-tool-bg: #fde4ef;
  --b-dataset: #4d7c0f;      --b-dataset-bg: #e6f3cf;
  --b-draft: #7a5b00;        --b-draft-bg: #fff1bf;
  --b-members: #334155;      --b-members-bg: #e2e8f0;
  --danger: #b42318;         --danger-bg: #fdecea;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07111c;
    --surface: #0e1d2e;
    --surface-alt: #0a1726;
    --text: #e8eef6;
    --text-muted: #93a4b8;
    --border: #1d3047;
    --border-strong: #2b4260;
    --accent: #5b8bff;
    --accent-hover: #7da0ff;
    --accent-contrast: #06101c;
    --accent-soft: #14284a;
    --link: #8aabff;
    --header-bg: rgba(7, 17, 28, .86);
    --cta-bg: #12294a;
    --cta-fg: #ffffff;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-hover: 0 2px 4px rgba(0,0,0,.5), 0 18px 36px -14px rgba(0,0,0,.75);
    --code-bg: #0d1117;
    --code-fg: #e6edf3;
    --code-hl: #3a3a12;
    --inline-code-bg: #16283d;
    --focus: #8aabff;
    --b-article: #9db8ff;      --b-article-bg: #172a52;
    --b-interactive: #c4a8ff;  --b-interactive-bg: #2a1d52;
    --b-dashboard: #6fe0d0;    --b-dashboard-bg: #0f3a37;
    --b-diagram: #ffc277;      --b-diagram-bg: #43290b;
    --b-tool: #ff9cc6;         --b-tool-bg: #4a1530;
    --b-dataset: #b5e26b;      --b-dataset-bg: #27380d;
    --b-draft: #ffd95e;        --b-draft-bg: #44370a;
    --b-members: #cbd5e1;      --b-members-bg: #26364a;
    --danger: #ff9b8f;         --danger-bg: #4a1a16;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111c;
  --surface: #0e1d2e;
  --surface-alt: #0a1726;
  --text: #e8eef6;
  --text-muted: #93a4b8;
  --border: #1d3047;
  --border-strong: #2b4260;
  --accent: #5b8bff;
  --accent-hover: #7da0ff;
  --accent-contrast: #06101c;
  --accent-soft: #14284a;
  --link: #8aabff;
  --header-bg: rgba(7, 17, 28, .86);
  --cta-bg: #12294a;
  --cta-fg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.5), 0 18px 36px -14px rgba(0,0,0,.75);
  --code-bg: #0d1117;
  --code-fg: #e6edf3;
  --code-hl: #3a3a12;
  --inline-code-bg: #16283d;
  --focus: #8aabff;
  --b-article: #9db8ff;      --b-article-bg: #172a52;
  --b-interactive: #c4a8ff;  --b-interactive-bg: #2a1d52;
  --b-dashboard: #6fe0d0;    --b-dashboard-bg: #0f3a37;
  --b-diagram: #ffc277;      --b-diagram-bg: #43290b;
  --b-tool: #ff9cc6;         --b-tool-bg: #4a1530;
  --b-dataset: #b5e26b;      --b-dataset-bg: #27380d;
  --b-draft: #ffd95e;        --b-draft-bg: #44370a;
  --b-members: #cbd5e1;      --b-members-bg: #26364a;
  --danger: #ff9b8f;         --danger-bg: #4a1a16;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.02em; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); letter-spacing: -.03em; font-weight: 800; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25rem; }
code, pre, kbd { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-contrast); }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.container-narrow { max-width: 720px; }
@media (min-width: 720px) { .container { padding-inline: 24px; } }
/* narrow containers carry their own gutter; max-width includes it via border-box */
.container.container-narrow { max-width: 720px; }
@media (min-width: 720px) { .container.container-narrow { max-width: 768px; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -64px; z-index: 100;
  background: var(--accent); color: var(--accent-contrast); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: var(--accent-contrast); }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: -.01em; }
.wordmark:hover { color: var(--text); }
.wordmark-mark {
  display: inline-grid; place-items: center; height: 30px; padding: 0 8px; border-radius: 7px;
  background: var(--accent); color: var(--accent-contrast);
  font-family: var(--font-mono); font-weight: 500; font-size: .85rem; letter-spacing: -.02em;
}
.wordmark-text { font-size: 1.05rem; }
.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a {
  padding: 8px 12px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.main-nav a:hover { color: var(--text); background: var(--surface-alt); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 8px 8px 4px 4px; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-form input {
  width: 180px; height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; transition: width .2s ease, border-color .2s;
}
.search-form input:focus { width: 240px; border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-form input::placeholder { color: var(--text-muted); }
.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; padding: 0;
}
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-alt); }

@media (max-width: 860px) {
  .search-form input, .search-form input:focus { width: 120px; }
  .header-actions .button { display: none; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; row-gap: 0; padding-block: 8px; }
  .main-nav { order: 3; width: 100%; margin: 0 -4px; }
  .search-form input, .search-form input:focus { width: 108px; }
  .wordmark-text { display: none; }
}

.signin-link { padding: 8px 4px; font-size: .9rem; font-weight: 500; color: var(--text-muted); text-decoration: none; white-space: nowrap; }
.signin-link:hover { color: var(--text); }
.signout-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.user-name { font-size: .9rem; color: var(--text-muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .user-name { display: none; } }

.staff-bar { background: var(--ink); color: #dbe5f2; font-size: .85rem; padding: 8px 0; }
.staff-bar a { color: #9db8ff; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-contrast);
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-contrast); }
.button:active { transform: translateY(1px); }
.button-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.button-ghost:hover { background: var(--surface-alt); border-color: var(--text-muted); color: var(--text); }
.button-small { padding: 8px 14px; font-size: .85rem; border-radius: 8px; }
.button-invert { background: #fff; color: var(--ink); border-color: #fff; }
.button-invert:hover { background: #e8eef9; border-color: #e8eef9; color: var(--ink); }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-mono); font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.lede { font-size: clamp(1.05rem, 1rem + .35vw, 1.25rem); line-height: 1.55; color: var(--text-muted); max-width: 46em; }
.link-arrow { font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Hero / page head ---------- */
.hero {
  position: relative; overflow: hidden; padding: 56px 0 48px; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 340px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 48px,
    var(--bg);
  background-blend-mode: normal;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 40%, var(--bg)); pointer-events: none; opacity: .9; }
.hero-inner { position: relative; z-index: 1; }
.hero h1 { max-width: 18em; margin-bottom: .45em; }
.hero .lede { margin-bottom: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 900px) { .hero { padding: 96px 0 80px; } }

.page-head { padding: 40px 0 28px; }
.page-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8rem); }
.page-head .lede { margin-bottom: 1.2em; }
@media (min-width: 900px) { .page-head { padding: 64px 0 36px; } }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--surface-alt); border-block: 1px solid var(--border); }
.section-tight { padding: 32px 0; }
.section-top-0 { padding-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; }
@media (min-width: 900px) { .section { padding: 72px 0; } .section-tight { padding: 40px 0; } }

/* ---------- Grid + cards ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
@media (min-width: 640px) { .grid-featured { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) {
  .grid-featured { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .grid-featured .card-large { grid-column: span 2; grid-row: span 2; }
  .grid-featured .card-large .card-media { aspect-ratio: 16 / 8.5; }
  .grid-featured .card-large .card-title { font-size: 1.6rem; }
  .grid-featured .card-large .card-summary { font-size: 1.02rem; -webkit-line-clamp: 5; line-clamp: 5; }
}

.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-strong); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-alt); }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8rem; color: var(--text-muted); }
.card-title { font-size: 1.15rem; margin: 0; letter-spacing: -.015em; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.card-title a:hover { color: var(--accent); }
.card-summary {
  margin: 0; color: var(--text-muted); font-size: .95rem; line-height: 1.55;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.card .tag-list { margin-top: auto; padding-top: 6px; position: relative; z-index: 2; }

/* Badges */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: .68rem; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; line-height: 1.4;
  color: var(--b-article); background: var(--b-article-bg);
}
.badge-article { color: var(--b-article); background: var(--b-article-bg); }
.badge-interactive { color: var(--b-interactive); background: var(--b-interactive-bg); }
.badge-dashboard { color: var(--b-dashboard); background: var(--b-dashboard-bg); }
.badge-diagram { color: var(--b-diagram); background: var(--b-diagram-bg); }
.badge-tool { color: var(--b-tool); background: var(--b-tool-bg); }
.badge-dataset { color: var(--b-dataset); background: var(--b-dataset-bg); }
.badge-draft { color: var(--b-draft); background: var(--b-draft-bg); border: 1px dashed currentColor; }
.badge-members { color: var(--b-members); background: var(--b-members-bg); }

/* Generated covers */
.cover-pattern {
  --c1: #1d4ed8; --c2: #0b1b2b; --line: rgba(255,255,255,.12);
  position: relative; width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 14px 16px;
  color: rgba(255,255,255,.92);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(135deg, var(--c1), var(--c2));
}
.cover-pattern span {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; background: rgba(0,0,0,.28);
}
.cover-article { --c1: #2f6bff; --c2: #0b1b2b; }
.cover-interactive {
  --c1: #7c3aed; --c2: #1b0f45;
  background:
    radial-gradient(rgba(255,255,255,.22) 1.5px, transparent 1.6px) 0 0 / 18px 18px,
    linear-gradient(135deg, var(--c1), var(--c2));
}
.cover-dashboard {
  --c1: #0d9488; --c2: #082b33;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.14) 0 10px, transparent 10px 24px) 0 100% / 100% 45% no-repeat,
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(135deg, var(--c1), var(--c2));
}
.cover-diagram {
  --c1: #d97706; --c2: #3b1d05;
  background:
    radial-gradient(circle at 25% 35%, rgba(255,255,255,.22) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.22) 0 6px, transparent 7px),
    linear-gradient(120deg, transparent 24%, rgba(255,255,255,.18) 24.5% 25.5%, transparent 26% 69%, rgba(255,255,255,.18) 69.5% 70.5%, transparent 71%),
    linear-gradient(135deg, var(--c1), var(--c2));
}
.cover-tool {
  --c1: #db2777; --c2: #3a0d26;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 2px, transparent 2px 14px),
    linear-gradient(135deg, var(--c1), var(--c2));
}
.cover-dataset {
  --c1: #65a30d; --c2: #1a2c07; --line: rgba(255,255,255,.16);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 56px 100%,
    linear-gradient(135deg, var(--c1), var(--c2));
}

/* Tags, topics, chips */
.tag-list, .topic-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a {
  display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .78rem; text-decoration: none;
  color: var(--text-muted); background: var(--surface-alt); border: 1px solid var(--border);
}
.tag-list a:hover { color: var(--accent); border-color: var(--accent); }
.topic-cloud { gap: 10px; }
.topic-cloud a {
  display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); font-weight: 500; font-size: .92rem;
}
.topic-cloud a:hover { border-color: var(--accent); color: var(--accent); }
.topic-cloud .muted { font-family: var(--font-mono); font-size: .75rem; }

.filter-bar { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin-top: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chip {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; font-size: .88rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-active, .chip-active:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
:root[data-theme="dark"] .chip-active, :root[data-theme="dark"] .chip-active:hover { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip-active, :root:not([data-theme="light"]) .chip-active:hover { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
}

/* Pagination, empty, search */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; }
.empty { text-align: center; padding: 56px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); }
.empty p { margin: 0 0 .5em; }
.search-large { display: flex; gap: 10px; margin-bottom: 14px; max-width: 640px; }
.search-large input {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem;
}
.search-large input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-large .button { height: 48px; }

/* Forms */
.form-card { display: grid; gap: 16px; max-width: 420px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .9rem; font-weight: 600; }
.field input {
  height: 48px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem; width: 100%;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-errors { padding: 10px 14px; border-radius: var(--radius-sm); color: var(--danger); background: var(--danger-bg); font-size: .9rem; }
.form-card .button { justify-self: start; }

/* Members-only teaser */
.locked-panel {
  display: grid; gap: 0; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin-block: 24px;
}
.locked-cover { aspect-ratio: 16 / 6; overflow: hidden; }
.locked-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.locked-body { padding: 24px; display: grid; gap: 8px; justify-items: start; }
.locked-body h2 { margin: 6px 0 0; }
.locked-body p { margin: 0 0 8px; }
.artifact-locked .locked-panel { padding: 20px; justify-items: start; gap: 8px; margin: 0; }
.artifact-locked .locked-panel p { margin: 0; }

/* CTA */
.cta { background: var(--cta-bg); color: var(--cta-fg); padding: 56px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { margin: 0; color: rgba(255,255,255,.78); max-width: 38em; }

/* ---------- Byline ---------- */
.byline { display: flex; align-items: center; gap: 12px; }
.avatars { display: flex; }
.avatar {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem;
  border: 2px solid var(--bg);
}
.avatars .avatar + .avatar { margin-left: -10px; }
.byline-names { font-weight: 600; font-size: .95rem; }
.byline-names a { color: var(--text); text-decoration: none; }
.byline-names a:hover { color: var(--accent); text-decoration: underline; }
.byline-roles { font-size: .82rem; }

/* ---------- Article ---------- */
.article-head { padding-top: 40px; padding-bottom: 24px; }
.article-head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .9rem; }
.article-cover { margin-bottom: 32px; }
.article-cover img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.article > .prose { padding-bottom: 56px; }
@media (min-width: 900px) { .article-head { padding-top: 64px; } }

/* ---------- Artifact ---------- */
.artifact-head { padding: 32px 0 20px; }
.artifact-title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.artifact-title-row > div:first-child { flex: 1 1 420px; min-width: 0; }
.artifact-title-row h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); }
.artifact-title-row .lede { margin-bottom: 0; }
.artifact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.artifact-stage { padding-bottom: 8px; }
.artifact-frame-wrap {
  border-radius: var(--radius); border: 1px solid var(--border); background: #fff; overflow: hidden;
}
.artifact-frame-wrap iframe { display: block; width: 100%; border: 0; background: #fff; }
.artifact-frame-main { box-shadow: var(--shadow-hover); }
.artifact-frame-main iframe:fullscreen { height: 100% !important; }
.artifact-body { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
.artifact-body .prose { max-width: 720px; }
@media (min-width: 960px) {
  .artifact-body { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; align-items: start; }
  .artifact-aside { position: sticky; top: calc(var(--header-h) + 24px); }
}
.artifact-aside { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.artifact-aside .byline { margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--text-muted); font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
.facts dd { margin: 0; min-width: 0; }
.aside-title { margin: 24px 0 8px; font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); font-weight: 500; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.plain-list a { text-decoration: none; font-weight: 500; }
.plain-list a:hover { text-decoration: underline; }

/* Embedded artifact inside prose */
.artifact-embed { margin: 2em 0; }
.artifact-embed figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; font-size: .88rem; }
.artifact-embed figcaption a { font-weight: 600; }
@media (min-width: 1000px) { .prose .artifact-embed { margin-inline: -60px; } }

/* ---------- Prose ---------- */
.prose { font-size: 1.0625rem; line-height: 1.75; overflow-wrap: break-word; min-width: 0; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .6em; font-size: 1.65rem; }
.prose h3 { margin: 1.8em 0 .5em; font-size: 1.28rem; }
.prose h4 { margin: 1.5em 0 .4em; font-size: 1.05rem; }
.prose :is(h2, h3, h4) a { color: inherit; text-decoration: none; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre, .prose .highlight, .prose figure { margin-block: 0 1.3em; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; margin-bottom: 0; }
.prose li::marker { color: var(--text-muted); }
.prose a { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 650; }
.prose blockquote {
  margin-inline: 0; padding: .2em 0 .2em 1.25em; border-left: 3px solid var(--accent); color: var(--text-muted); font-size: 1.1em; font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose img { display: block; border-radius: var(--radius-sm); margin: 1.6em auto; border: 1px solid var(--border); }
.prose figure img { margin-bottom: .5em; }
.prose figcaption { font-size: .88rem; color: var(--text-muted); }
.prose code {
  font-size: .88em; padding: .15em .4em; border-radius: 5px; background: var(--inline-code-bg);
  overflow-wrap: anywhere;
}
.prose pre, .prose .highlight pre {
  margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .86rem; line-height: 1.6; border-radius: var(--radius-sm);
  background: var(--code-bg); color: var(--code-fg); tab-size: 2; -webkit-overflow-scrolling: touch;
}
.prose pre code, .prose .highlight code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; }
.prose .highlight { border-radius: var(--radius-sm); border: 1px solid var(--border); overflow: hidden; background: var(--code-bg); }
.prose > pre { border: 1px solid var(--border); }
.prose .highlight pre { border-radius: 0; }
.prose table {
  display: block; width: 100%; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .94rem; line-height: 1.5;
  -webkit-overflow-scrolling: touch;
}
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { font-weight: 650; background: var(--surface-alt); white-space: nowrap; border-bottom: 2px solid var(--border-strong); }
.prose tbody tr:hover { background: var(--surface-alt); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 28px; background: var(--bg); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-tagline { margin: 12px 0 0; max-width: 28em; font-size: .92rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-start; font-size: .92rem; }
.footer-nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { margin-top: 32px; font-size: .82rem; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
}

/* OAuth consent */
.consent-card { display: grid; gap: 16px; max-width: 560px; margin-top: 24px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.consent-card dl { display: grid; gap: 14px; margin: 0; }
.consent-card dt { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.consent-card dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.consent-host { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600; }
.consent-note { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--b-draft-bg); color: var(--b-draft); font-size: .9rem; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 12px; }
