/* ---------------------------------------------------------------
   Angela Wu — personal site
   Component-showcase layout: left sidebar nav, numbered sections,
   product-mock demo cards. Dark-first with a light theme toggle.
   Token scale follows the Beautiful UI reference in design/.
   --------------------------------------------------------------- */

:root {
  /* surfaces */
  --page: #17181a;
  --canvas: #1c1d1f;
  --surface: #232427;
  --inset: #1f2022;
  --hover: #2a2b2e;
  --field: #2b2c2f;
  /* ink */
  --ink: #f2f3f4;
  --ink-2: #a5a8ad;
  --ink-3: #6c6f75;
  /* lines */
  --line: #2e3033;
  --line-strong: #3a3c40;
  /* color */
  --accent: #3d9aff;
  --accent-ink: #7ec0ff;
  --accent-tint: rgba(61, 154, 255, 0.16);
  --green: #3dbb72;
  --green-tint: rgba(61, 187, 114, 0.14);
  --orange: #f68f3c;
  --orange-tint: rgba(246, 143, 60, 0.15);
  --red: #ee5c61;
  --red-tint: rgba(238, 92, 97, 0.14);
  /* elevation */
  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-overlay: 0 0 0 1px var(--line-strong), 0 8px 28px rgba(0, 0, 0, 0.34);
  --shadow-inset-field: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  --stripe: rgba(255, 255, 255, 0.014);
  /* legacy aliases (article pages reference these) */
  --bg: var(--page);
  --panel: var(--surface);
  --panel-raised: var(--inset);
  --text: var(--ink);
  --text-muted: var(--ink-2);
  --text-faint: var(--ink-3);
  --border: var(--line);
  --border-soft: #26282b;
  --accent-strong: var(--accent-ink);
  --accent-dim: var(--accent-tint);
  --ok: var(--green);
  --chip-bg: var(--inset);
  --active-bg: var(--hover);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

html[data-theme="light"] {
  --page: #fafafb;
  --canvas: #f1f2f3;
  --surface: #ffffff;
  --inset: #f7f8f9;
  --hover: #f4f5f6;
  --field: #f2f2f3;
  --ink: #1f2124;
  --ink-2: #62656b;
  --ink-3: #9a9da3;
  --line: #ecedef;
  --line-strong: #e0e2e5;
  --accent: #0285ff;
  --accent-ink: #0170dd;
  --accent-tint: #e9f3ff;
  --green: #189a4d;
  --green-tint: #e8f5ed;
  --orange: #ef720c;
  --orange-tint: #fdf1e5;
  --red: #e3474c;
  --red-tint: #fcecec;
  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-card: 0 0 0 1px var(--line), 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.03);
  --shadow-overlay: 0 0 0 1px var(--line), 0 8px 28px rgba(0, 0, 0, 0.07);
  --shadow-inset-field: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  --stripe: rgba(0, 0, 0, 0.02);
  --border-soft: #f1f2f4;
  --chip-bg: #f2f2f3;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Google Sans", "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--page);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0 9px,
    var(--stripe) 9px 10px
  );
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.frame {
  max-width: 820px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--page);
  border-left: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
}

/* ---------------- Top header ---------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 34px;
}

.topbar .who {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.topbar h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}

.theme-toggle {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px;
  background: var(--field);
}

.theme-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  width: 26px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
}

.icon-btn {
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover { background: var(--hover); color: var(--ink); }

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 48px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--page);
  background: var(--ink);
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.cta:hover { opacity: 0.85; }

/* ---------------- Main column ---------------- */

.main { padding: 40px 44px 80px; min-width: 0; }

.section { margin-bottom: 58px; scroll-margin-top: 32px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.section-head .num {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.section-head h2 {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-head .desc { font-size: 13px; color: var(--ink-2); }

.section-intro {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: 60ch;
  margin: 0 0 12px;
  text-wrap: pretty;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.chip {
  height: 22px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--chip-bg);
  box-shadow: 0 0 0 1px var(--line);
  border-radius: 999px;
  padding: 0 9px;
  white-space: nowrap;
}

.chip.mono { font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace; font-size: 10px; font-weight: 400; }

.view-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.view-link:hover { background: var(--hover); }
.view-link .arrow { color: var(--ink-3); transition: transform 0.15s ease; }
.view-link:hover .arrow { transform: translateX(2px); color: var(--ink); }

/* ---------------- Overview card ---------------- */

.card {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  padding: 26px;
  position: relative;
  overflow: hidden;
}

.overview-card .wave-wrap {
  border-radius: 10px;
  background: var(--canvas);
  box-shadow: var(--shadow-hairline);
  margin-bottom: 22px;
  overflow: hidden;
  line-height: 0;
}

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

.overview-card article { max-width: 58ch; }

.overview-card article p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 14px;
}

.overview-card article p:last-child { margin-bottom: 0; }

.overview-card article a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-tint);
}

.overview-card article a:hover { border-bottom-color: var(--accent-ink); }

/* ---------------- Demo surface ---------------- */

.demo-surface {
  position: relative;
  background: var(--canvas);
  box-shadow: var(--shadow-hairline);
  border-radius: 14px;
  min-height: 280px;
  padding: 34px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.demo-surface.has-toggle { padding-bottom: 52px; }

.demo-stage { width: 100%; max-width: 430px; }
.demo-stage.wide { max-width: 560px; }

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.stage-head .t { font-size: 13px; font-weight: 600; }
.stage-head .s {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.stage-cap {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 12px;
}

/* variant toggle (bottom center of surface) */

.vtoggle {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  background: var(--field);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.vtoggle.static {
  position: static;
  transform: none;
  display: inline-flex;
  margin-bottom: 14px;
}

.vtoggle button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.vtoggle button:hover { color: var(--ink-2); }

.vtoggle button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
}

/* ---------------- Primitives ---------------- */

/* pill rows */

.prow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 12.5px;
}

.prow + .prow { margin-top: 8px; }

.prow .plabel {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prow.dim .plabel { color: var(--ink-2); font-weight: 400; }

.prow .pcount {
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* status icons */

.icn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
}

.icn.ok { background: var(--green); }

.ring {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ring svg { position: absolute; inset: 0; }
.ring.spin svg { animation: spin 1.1s linear infinite; }

.ring-num {
  position: relative;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* status pills */

.stat {
  height: 21px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex: none;
}

.stat.ok { background: var(--green-tint); color: var(--green); }
.stat.run { background: var(--orange-tint); color: var(--orange); }
.stat.idle { background: var(--field); color: var(--ink-3); }

/* search bar + meta */

.sbar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 13px;
  padding: 0 13px;
  font-size: 13px;
  color: var(--ink);
}

.sbar .qi { color: var(--ink-3); flex: none; display: inline-flex; }
.sbar .ph { color: var(--ink-3); }

.panel-card {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 14px;
  padding: 14px;
}

.sbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ink-2);
}

.sbar-meta .sep { color: var(--line-strong); }

.mini-picker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.mini-picker .dd { font-size: 7.5px; color: var(--ink-3); }

/* dropdown menu */

.menu {
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
  border-radius: 12px;
  padding: 6px;
}

.menu .menu-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 4px 8px 6px;
}

.mi {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink);
  transition: background 0.18s ease;
}

.mi.on { background: var(--hover); }

.mi .mic {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--field);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-2);
  flex: none;
}

.mi .ml { flex: 1; min-width: 0; line-height: 1.3; }
.mi .msub { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.mi .mtick { color: var(--accent); font-size: 11px; opacity: 0; transition: opacity 0.18s ease; }
.mi.on .mtick { opacity: 1; }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  border-radius: 8px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.btn.primary {
  background: var(--ink);
  color: var(--page);
  box-shadow: none;
}

.btn .bdd { font-size: 7.5px; color: var(--ink-3); }

.ghost-link { font-size: 11.5px; color: var(--ink-3); }

/* field rows (editable research steps) */

.field-row {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--field);
  box-shadow: var(--shadow-inset-field);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--ink);
  min-height: 34px;
}

.field-row + .field-row { margin-top: 7px; }
.field-row .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.field-row .minus { color: var(--ink-3); font-size: 13px; flex: none; }

.caret {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* citation chips */

.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--field);
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-2);
  vertical-align: 1px;
  margin: 0 1.5px;
  font-variant-numeric: tabular-nums;
}

.cite.hot { background: var(--accent-tint); color: var(--accent-ink); }

/* source cards */

.src-cards { display: flex; gap: 8px; }

.src-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
}

.src-card .sc-title {
  font-size: 11px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
}

.src-card .sc-src {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-3);
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
}

img.favicon {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  flex: none;
  background: var(--field);
}

/* result list */

.list-card {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 3px 12px;
}

.rrow {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0;
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}

.rrow:first-child { border-top: 0; }

.rrow .rsrc {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--accent-ink);
  flex: none;
  min-width: 86px;
}

.rrow .rtxt {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* donut + legend (polls) */

.poll-wrap { display: flex; align-items: center; gap: 24px; }
.donut { position: relative; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15)); }
.donut svg { display: block; }
.donut circle {
  fill: none;
  stroke-width: 8.5;
  transition: stroke-dasharray 0.9s cubic-bezier(0.23, 1, 0.32, 1);
}

.donut .donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 600;
}

.poll-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.poll-opt { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.poll-opt .swatch { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.poll-opt .olabel { color: var(--ink-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poll-opt.lead .olabel { color: var(--ink); font-weight: 500; }
.poll-opt .opct {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.poll-opt.lead .opct { color: var(--ink); }

/* quote panel (reference check) */

.quote-panel {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 12px;
  padding: 11px 13px;
}

.quote-panel .qp-head {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  color: var(--accent-ink);
  margin-bottom: 6px;
}

.quote-panel .qp-quote {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

/* selection demo */

.sel-text { font-size: 13.5px; line-height: 1.9; color: var(--ink); }

.sel-text .hl {
  border-radius: 3px;
  padding: 1px 2px;
  margin: -1px -2px;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.sel-text .hl.on { background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent-tint); }

.sel-menu {
  display: inline-flex;
  gap: 2px;
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
  border-radius: 10px;
  padding: 3px;
  margin-top: 14px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.sel-menu.on { opacity: 1; transform: translateY(0); }

.sel-menu span {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 7px;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease;
}

.sel-menu span.hot { background: var(--hover); color: var(--ink); }

/* mind-map tree */

.mm-tree svg { width: 100%; height: auto; display: block; }
.mm-tree .mm-edge { fill: none; stroke-width: 1.5; opacity: 0.9; }
.mm-tree text {
  font-family: "Google Sans", "Inter", ui-sans-serif, sans-serif;
  font-size: 10.5px;
  fill: var(--ink-2);
}
.mm-tree .mm-root-box { fill: var(--accent-tint); stroke: var(--accent); }
.mm-tree .mm-root-text { fill: var(--ink); font-weight: 600; font-size: 11px; }
.mm-canvas { position: relative; }

.mm-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 5px;
}

.mm-controls span {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  color: var(--ink-3);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* explore cards */

.explore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.explore-card {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  border-radius: 10px;
  padding: 9px 11px;
}

.explore-card .ec-src {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 9.5px;
  color: var(--ink-3);
  margin-bottom: 5px;
}

.explore-card .ec-txt { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }

.fade-in { animation: fadeUp 0.4s cubic-bezier(0.23, 1, 0.32, 1) both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Page footer ---------------- */

.page-foot {
  border-top: 1px solid var(--border-soft);
  margin-top: 24px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-3);
}

.page-foot a { color: var(--ink-2); text-decoration: none; }
.page-foot a:hover { color: var(--ink); }

/* ---------------- Project detail pages ---------------- */

.article-wrap { max-width: 720px; }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 26px;
}

.crumb:hover { color: var(--ink); }

.article-head { margin-bottom: 26px; }

.article-head .meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 14px;
}

.article-head h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.article-head .lede { font-size: 14.5px; color: var(--ink-2); line-height: 1.65; }

.fact-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border-soft);
  margin-top: 16px;
  padding-top: 14px;
}

.fact { display: flex; gap: 10px; font-size: 12.5px; }
.fact dt { color: var(--ink-3); min-width: 64px; flex: none; }
.fact dd { margin: 0; color: var(--ink-2); }
.fact dd a { color: var(--accent-ink); text-decoration: none; border-bottom: 1px solid var(--accent-tint); }

.hero-img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  margin: 4px 0 30px;
  display: block;
}

.article {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
}

.article p { margin: 0 0 16px; }

.article h2, .article h3, .article h4, .article h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 30px 0 12px;
  line-height: 1.3;
}

.article h2 { font-size: 20px; }
.article h3 { font-size: 17px; }
.article h4 { font-size: 15px; }
.article h6 { font-size: 13px; color: var(--ink-2); font-style: italic; }

.article a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-tint);
}

.article a:hover { border-bottom-color: var(--accent-ink); }

.article strong { font-weight: 600; }

.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin: 5px 0; }
.article li::marker { color: var(--ink-3); }
.article ul ul, .article ol ul, .article ul ol { margin-bottom: 0; }

.article img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  margin: 8px 0 18px;
  display: block;
}

.article hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 30px 0;
}

.article blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  color: var(--ink-2);
  margin: 0 0 16px;
}

.article .diagram { margin: 8px 0 20px; }

.article .diagram svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--canvas);
  box-shadow: var(--shadow-hairline);
  border-radius: 10px;
  padding: 14px 10px;
  box-sizing: border-box;
}

.article .diagram figcaption {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 8px;
}

.article .video-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin: 8px 0 18px;
  background: var(--canvas);
}

.article .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article code {
  font-family: "Google Sans Code", "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--field);
  border-radius: 5px;
  padding: 1px 5px;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border-soft);
  margin-top: 44px;
  padding-top: 20px;
}

.article-nav a {
  font-size: 12.5px;
  color: var(--ink-2);
  text-decoration: none;
  max-width: 46%;
}

.article-nav a:hover { color: var(--ink); }
.article-nav .dirlabel { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .frame { border: 0; }

  .main { padding: 28px 20px 60px; }

  .topbar { margin-bottom: 26px; }

  .section { margin-bottom: 44px; }

  .card { padding: 18px; }

  .demo-surface { padding: 24px 16px; }
  .demo-surface.has-toggle { padding-bottom: 50px; }

  .article-head h1 { font-size: 23px; }

  .poll-wrap { flex-direction: column; align-items: flex-start; gap: 14px; }

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

  .src-cards .src-card:nth-child(3) { display: none; }

  .section-meta .view-link { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring.spin svg { animation-duration: 3s; }
  .fade-in { animation: none; }
  .caret { animation: none; }
}
