@import url("https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&family=Literata:opsz,wght@7..72,400;7..72,500&family=JetBrains+Mono:wght@400;500&family=Unbounded:wght@500;600;700&display=swap");

:root, [data-theme="light"] {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #ecebe4;
  --ink: #111111;
  --muted: #66655f;
  --line: #e0ded5;
  --accent: #d97757;
  --accent-ink: #ffffff;
  --link: #0b57d0;
  --link-hover: #0842a0;
  --article: #f2b544;
  --guide: #3e8bff;
  --system: #8d63ff;
  --video: var(--accent);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.12);
  --radius: 20px;
  --sans: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --accent-font: "Unbounded", "Onest", ui-sans-serif, system-ui, sans-serif; /* emphasis phrases and labels only, never body */
  --fs-title: clamp(34px, 4.6vw, 52px);
  --fs-subtitle: clamp(19px, 2vw, 23px);
  --fs-label: 11.5px;
  --section-gap: clamp(72px, 8vw, 112px);
  --hairline: 1px solid var(--line);
  --wrap: 1200px;
  color-scheme: light;
}

[data-theme="dark"] {
  --link: #7cacf8;
  --link-hover: #a8c7fa;
  --bg: #0b0c0e;
  --surface: #141619;
  --surface-2: #1c1f23;
  --ink: #f2f1ec;
  --muted: #9b9a94;
  --line: #262a2f;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -16px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; }
.logo-avatar { width: 30px; height: 30px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: conic-gradient(from 200deg, var(--accent), var(--system), var(--guide), var(--accent)); color: #fff; font: 800 13px/1 var(--sans); letter-spacing: 0; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.logo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav { display: flex; gap: 4px; flex: 1; justify-content: flex-end; margin-right: 12px; }
.nav a { padding: 7px 12px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.tools { display: flex; align-items: center; gap: 6px; }
.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--surface-2); font: 500 12px/1 var(--mono); }
.lang a { padding: 6px 9px; border-radius: 999px; color: var(--muted); }
.lang a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
[data-theme="dark"] .theme-btn .moon { display: none; }

/* Labels */
.label { display: inline-flex; align-items: center; gap: 7px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.label::before { content: ""; width: 14px; height: 14px; background: var(--c, var(--ink)); -webkit-mask: var(--icon, linear-gradient(#000 0 0)) center / contain no-repeat; mask: var(--icon, linear-gradient(#000 0 0)) center / contain no-repeat; }
.t-article { --c: var(--article); --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 3h8l4 4v14H6z'/><path d='M9 12h6M9 16h6M9 8h3'/></svg>"); }
.t-guide { --c: var(--guide); --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><path d='M10 6h10M10 12h10M10 18h10'/><circle cx='5' cy='6' r='1.5'/><circle cx='5' cy='12' r='1.5'/><circle cx='5' cy='18' r='1.5'/></svg>"); }
.t-system { --c: var(--system); --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='6' cy='6' r='2.5'/><circle cx='18' cy='6' r='2.5'/><circle cx='12' cy='18' r='2.5'/><path d='M8.5 6h7M7.2 8.2l3.6 7.6M16.8 8.2l-3.6 7.6'/></svg>"); }
.t-video { --c: var(--video); --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 4.5v15l13-7.5z' fill='black'/></svg>"); }
.meta { font: 400 13px/1.4 var(--mono); color: var(--muted); }

/* Home intro line */
.intro { padding: 64px 0 40px; }
.intro p { margin: 0; max-width: 900px; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 600; color: var(--muted); }
.intro b { color: var(--ink); font-weight: 700; }
.intro mark { background: var(--accent); color: var(--accent-ink); padding: 0 .18em; border-radius: .2em; }

/* Sections */
.section { padding: 28px 0 56px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2, .page-head h1 { margin: 0; font-size: 15px; font: 500 12.5px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 64px 0 32px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.ph-title { display: flex; align-items: center; gap: 18px; }
.page-head h1 { font: 700 clamp(40px, 6vw, 76px)/0.95 var(--sans); letter-spacing: -0.045em; text-transform: none; color: var(--ink); }
.ph-icon { flex: none; width: 64px; height: 64px; border-radius: 18px; background: color-mix(in srgb, var(--c) 18%, transparent); display: grid; place-items: center; }
.ph-icon::before { content: ""; width: 30px; height: 30px; background: var(--c); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ph-count { align-self: flex-start; margin-top: 4px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 500 14px/1 var(--mono); }
.page-head p { margin: 0 0 6px; max-width: 380px; color: var(--muted); font-size: 17px; text-align: right; }
@media (max-width: 820px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 16px; padding: 40px 0 24px; }
  .page-head p { text-align: left; }
  .ph-icon { width: 48px; height: 48px; border-radius: 14px; }
  .ph-icon::before { width: 22px; height: 22px; }
}

/* Latest */
.latest { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.feature { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .2s; }
.feature:hover, .card:hover, .vcard:hover { transform: translateY(-3px); }
.feature .cover { aspect-ratio: 16 / 8; }
.feature .body { padding: 28px 30px 30px; display: flex; flex-direction: column; gap: 12px; }
.feature h3 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; }
.feature p { margin: 0; color: var(--muted); font-size: 17px; max-width: 620px; }

/* Cover art */
.cover { position: relative; background: var(--c); color: rgb(0 0 0 / 0.78); overflow: hidden; }
.cover::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgb(0 0 0 / .07) 1px, transparent 1px), linear-gradient(90deg, rgb(0 0 0 / .07) 1px, transparent 1px); background-size: 28px 28px; }
.cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, rgb(255 255 255 / .38), transparent 55%); }
.cover svg { position: absolute; right: 7%; bottom: 10%; width: 42%; max-width: 260px; height: auto; z-index: 1; }
.cover .kicker { position: absolute; left: 20px; top: 18px; z-index: 1; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.cover.t-video { background: #121417; color: #fff; }
.cover.t-video::before { background-image: linear-gradient(rgb(255 255 255 / .05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px); }
.cover.t-video::after { background: radial-gradient(80% 60% at 30% 20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%), radial-gradient(70% 60% at 90% 100%, rgb(141 99 255 / .45), transparent 70%); }

.play { position: absolute; inset: 0; margin: auto; z-index: 2; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 10px 30px -6px color-mix(in srgb, var(--accent) 50%, transparent); transition: transform .2s; }
.play svg { position: static; width: 22px; height: 22px; margin-left: 3px; }
.dur { position: absolute; right: 14px; bottom: 14px; z-index: 2; padding: 4px 8px; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; font: 500 12px/1 var(--mono); }
.vtitle { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 2; font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; color: #fff; }

/* Video card */
.vcard { display: flex; flex-direction: column; gap: 12px; transition: transform .2s; }
.vcard .cover { aspect-ratio: 9 / 13; border-radius: var(--radius); }
.vcard:hover .play { transform: scale(1.08); }
.latest .vcard .cover { aspect-ratio: auto; flex: 1; min-height: 360px; }
.vcard .vmeta { display: flex; justify-content: space-between; gap: 10px; }

/* Feed */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; }
.chip[data-type]:not([data-type="all"])::before { content: ""; width: 15px; height: 15px; background: var(--c); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid.videos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .2s; }
.card .cover { aspect-ratio: 16 / 9; }
.card .cover svg { width: 36%; }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 21px; line-height: 1.18; letter-spacing: -0.025em; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.card .play { width: 50px; height: 50px; }
.card .play svg { width: 18px; height: 18px; }
[hidden] { display: none !important; }

/* Community block */
.about-blog { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 40px; border-radius: 28px; background: var(--ink); color: var(--bg); }
.about-blog h2 { margin: 0 0 10px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1.1; }
.about-blog p { margin: 0; color: color-mix(in srgb, var(--bg) 65%, var(--ink)); font-size: 17px; }
.btn { border: 0; cursor: pointer; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.sub-wrap small { display: block; margin: 10px 16px 0; font-size: 13px; color: color-mix(in srgb, var(--bg) 55%, var(--ink)); }
.sub-wrap.done small { color: var(--accent); }

/* Footer */
.footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 32px 0 48px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.socials { display: flex; flex-wrap: wrap; gap: 6px; }
.socials a { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.socials a:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.footer .meta a:hover { color: var(--ink); }

/* Item page */
.item-head { padding: 56px 0 32px; }
.item-head h1 { max-width: 860px; }
.item-head h1 { margin: 16px 0 16px; font-size: clamp(34px, 5vw, 58px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 700; }
.item-head .lede { margin: 0 0 18px; font-size: 20px; color: var(--muted); max-width: 680px; }
.item-cover { aspect-ratio: 21 / 8; border-radius: 28px; margin-bottom: 48px; }
.item-cover svg { max-width: 300px; }
.cover.hero-cover { aspect-ratio: auto; }
.cover.hero-cover img { display: block; position: relative; z-index: 1; width: 100%; height: auto; }
.cover.hero-cover .hero-dark { display: none; }
[data-theme="dark"] .cover.hero-cover .hero-light { display: none; }
[data-theme="dark"] .cover.hero-cover .hero-dark { display: block; }
.cover.has-hero::before, .cover.has-hero::after { display: none; }
.cover.has-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left center; z-index: 0; }
.cover.has-hero .hero-dark { display: none; }
[data-theme="dark"] .cover.has-hero .hero-light { display: none; }
[data-theme="dark"] .cover.has-hero .hero-dark { display: block; }
.item-layout { display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 64px; }
.toc { position: sticky; top: 96px; align-self: start; }
.toc h2 { margin: 0 0 14px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.35; }
.toc a:hover, .toc a.on { color: var(--ink); border-color: var(--c); }
.prose { font: 400 19px/1.7 var(--serif); }
.prose h2 { font: 700 28px/1.15 var(--sans); letter-spacing: -0.03em; margin: 48px 0 14px; scroll-margin-top: 90px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 18px; }
.prose pre { margin: 0 0 22px; padding: 18px 20px; border-radius: 14px; background: var(--surface-2); font: 400 14px/1.6 var(--mono); overflow-x: auto; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 0 0 40px; font-family: var(--sans); }
.facts div { background: var(--surface); padding: 16px 18px; }
.facts dt { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.facts dd { margin: 0; font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }

/* Player + networks */
.player-block { margin: 8px 0 40px; font-family: var(--sans); }
.player { border-radius: var(--radius); aspect-ratio: 16 / 9; }
.player.vertical { aspect-ratio: 9 / 16; max-width: 340px; }
.player-block.solo { display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: start; }
.player-block.solo .player.vertical { width: 340px; }
.player-block.solo .player:not(.vertical) { width: min(720px, 100%); }
.player-block .networks-title { margin: 18px 0 10px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.networks { display: flex; flex-wrap: wrap; gap: 8px; }
.networks a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.networks a::after { content: "\2197"; color: var(--muted); font-weight: 400; }
.networks a:first-child { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.networks a:hover { border-color: var(--ink); }

/* Author block */
.author { margin: 56px 0 0; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; gap: 20px; font-family: var(--sans); }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--guide), var(--system), var(--article), var(--accent)); display: grid; place-items: center; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .25); font-size: 24px; }
.author h3 { margin: 0 0 4px; font-size: 19px; }
.author p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.author small, .side-card small { display: block; margin: 8px 16px 0; font-size: 13px; color: var(--muted); }

/* About page */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px; align-items: start; }
.about-grid .prose { max-width: 680px; }
.path { list-style: none; margin: 8px 0 28px; padding: 0; display: grid; gap: 10px; font-family: var(--sans); }
.path li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 16px; line-height: 1.45; }
.path li b { display: block; font-size: 17px; letter-spacing: -0.01em; }
.path li span { color: var(--muted); }
.path .n { font: 500 13px/1.6 var(--mono); color: var(--muted); }
.path li.now { border-color: var(--ink); }
.path li.now .n { color: var(--ink); }
.side-card { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.side-card h2 { margin: 0 0 12px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.side-card .socials { margin-bottom: 22px; }

/* Search */
.search { width: min(640px, 100% - 32px); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .4); }
.search::backdrop { background: rgb(0 0 0 / .35); backdrop-filter: blur(4px); }
.search input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 20px 22px; font-size: 18px; outline: none; }
.search ul { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow: auto; }
.search li a { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; }
.search li a:hover, .search li a:focus { background: var(--surface-2); outline: none; }
.search li b { font-weight: 600; }
.search .empty { padding: 14px; color: var(--muted); }

/* Responsive */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.videos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; margin-bottom: 36px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .side-card { position: static; }
}
@media (max-width: 820px) {
  .header .wrap { flex-wrap: wrap; height: auto; padding: 12px 0 0; gap: 8px 12px; }
  .logo { flex: 1; }
  .nav { order: 3; justify-content: flex-start; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 10px; }
  .nav::-webkit-scrollbar { display: none; }
  .latest { grid-template-columns: 1fr; }
  .latest .vcard .cover { aspect-ratio: 16 / 11; min-height: 0; }
  .about-blog { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
  .player-block.solo { grid-template-columns: 1fr; gap: 8px; }
  .player-block.solo .player.vertical { width: 100%; max-width: 360px; }
}
@media (max-width: 600px) {
  .wrap { width: calc(100% - 32px); }
  .nav { margin: 0 -16px; padding: 0 16px 10px; }
  .nav a { padding: 7px 4px; } /* 4px grid step, design system */
  .grid, .grid.videos { grid-template-columns: 1fr; }
  .grid.videos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .vtitle { font-size: 16px; left: 12px; bottom: 12px; }
  .intro { padding: 36px 0 24px; }
  .feature .body { padding: 22px; }
  .item-head { padding: 36px 0 24px; }
  .item-cover { aspect-ratio: 16 / 9; border-radius: 20px; margin-bottom: 32px; }
  .prose { font-size: 18px; }
  .facts { grid-template-columns: 1fr; }
  .author { grid-template-columns: 1fr; padding: 22px; }
}

/* Tags + wide first card on list pages */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 500 12px/1.4 var(--mono); }
.tag-filters { margin-bottom: 22px; }
.tag-list { display: grid; gap: 20px; }
.feature.wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: none; }
.feature.wide .cover { aspect-ratio: auto; min-height: 360px; }
.feature.wide .body { justify-content: center; padding: 40px; }
.tag-list .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 820px) {
  .feature.wide { grid-template-columns: 1fr; }
  .feature.wide .cover { min-height: 0; aspect-ratio: 16 / 9; }
  .feature.wide .body { padding: 22px; }
}
@media (max-width: 600px) { .tag-list .grid { grid-template-columns: 1fr; } }
.tag-list .grid .card .cover { aspect-ratio: 16 / 7; }

/* View all */
.more { display: flex; justify-content: center; margin-top: 32px; }
.more-btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; transition: transform .15s; }
.more-btn:hover { transform: translateY(-2px); }
.more-btn span { color: var(--accent); }

/* Rich post blocks */
.prose a:not(.link-card) { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a:not(.link-card):hover { color: var(--accent); }
sup.fn a { text-decoration: none !important; font: 600 11px/1 var(--mono); color: var(--accent); padding: 0 2px; }
.prose figure { margin: 8px 0 32px; font-family: var(--sans); }
.prose figcaption { margin-top: 10px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.prose h4 { margin: 0 0 18px; font: 600 15px/1.3 var(--sans); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 8px 0 28px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; font-family: var(--sans); }
.stats div { background: var(--surface); padding: 20px 22px; display: grid; gap: 4px; }
.stats b { font-size: 40px; line-height: 1; letter-spacing: -0.04em; color: var(--accent); }
.stats span { color: var(--muted); font-size: 14px; line-height: 1.35; }

.chart, .flow { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.bar-row { display: grid; grid-template-columns: 170px 1fr 48px; gap: 14px; align-items: center; padding: 6px 0; font-size: 14px; }
.bar-row span { color: var(--muted); }
.bar-row b { font: 600 13px/1 var(--mono); text-align: right; }
.bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); }
.line-svg { width: 100%; height: 200px; overflow: visible; }
.line-svg .area { fill: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); }
.line-svg .stroke { fill: none; stroke: var(--c, var(--accent)); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.line-svg circle { fill: var(--surface); stroke: var(--c, var(--accent)); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.line-x { display: flex; justify-content: space-between; margin-top: 12px; }
.line-x span { display: grid; text-align: center; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.line-x b { color: var(--ink); font-weight: 600; }

.flow-row { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.node { flex: 1 1 0; min-width: 110px; padding: 14px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 4px; align-content: start; }
.node b { font-size: 14px; }
.node span { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.node.human { background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.arrow { flex: none; width: 18px; align-self: center; height: 2px; background: var(--line); position: relative; }
.arrow::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid var(--muted); border-right: 0; }

.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table-wrap th { text-align: left; padding: 10px 12px; font: 500 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--ink); }
.table-wrap td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap td:first-child { font-weight: 600; }

.img-ph { aspect-ratio: 16 / 9; border-radius: 18px; background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--c, var(--accent)) 22%, var(--surface-2))); display: grid; place-items: center; }
.img-ph::before { content: ""; width: 44px; height: 44px; background: var(--muted); opacity: .6; -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='3'/><circle cx='9' cy='10' r='2'/><path d='m21 16-5-5-9 9'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'><rect x='3' y='4' width='18' height='16' rx='3'/><circle cx='9' cy='10' r='2'/><path d='m21 16-5-5-9 9'/></svg>") center / contain no-repeat; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 32px; }
.gallery figure { margin: 0; }
.gallery .img-ph { aspect-ratio: 4 / 3; }

.prose blockquote { margin: 36px 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--accent); }
.prose blockquote p { margin: 0 0 10px; font: 600 30px/1.2 var(--sans); letter-spacing: -0.02em; }
.prose blockquote cite { font: normal 400 13px/1 var(--mono); color: var(--muted); }
.callout { margin: 8px 0 28px; padding: 18px 22px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-family: var(--sans); }
.callout b { display: block; margin-bottom: 4px; font-size: 15px; }
.callout p { margin: 0 !important; font-size: 16px; line-height: 1.5; }
.link-card { display: grid; gap: 6px; margin: 8px 0 28px; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-family: var(--sans); transition: border-color .15s; }
.link-card:hover { border-color: var(--ink); }
.link-card b { font-size: 17px; line-height: 1.3; }
.link-card span:not(.label) { color: var(--muted); font-size: 14px; line-height: 1.45; }
.link-card .lc-site { font: 500 12px/1 var(--mono) !important; color: var(--accent) !important; }
.sources { margin: 0; padding-left: 22px; font: 400 15px/1.5 var(--sans); }
.sources li { margin-bottom: 10px; scroll-margin-top: 90px; }
.sources li span { display: block; font: 400 12px/1.4 var(--mono); color: var(--muted); }
@media (max-width: 600px) {
  .bar-row { grid-template-columns: 110px 1fr 40px; gap: 10px; }
  .gallery { grid-template-columns: 1fr; }
  .prose blockquote p { font-size: 24px; }
  .flow-row { flex-direction: column; }
  .arrow { width: 2px; height: 14px; align-self: center; }
  .arrow::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; }
}

/* Social logos */
.socials a, .networks a { display: inline-flex; align-items: center; gap: 8px; }
.socials svg, .networks svg { width: 16px; height: 16px; flex: none; }

/* About: photo + sidebar */
.about-head { display: block; }
.ah-row { display: flex; align-items: center; gap: 22px; }
.ah-row h1 { margin: 8px 0 0; }
.photo { flex: none; width: 96px; height: 96px; border-radius: 50%; background: conic-gradient(from 200deg, var(--accent), var(--system), var(--guide), var(--accent)); padding: 3px; position: relative; }
.photo::after { content: "Y"; position: absolute; inset: 3px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font: 800 34px/1 var(--sans); color: var(--muted); }
.about-head .lede { margin: 24px 0 18px; }
.ah-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.ah-meta span { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.side { display: grid; gap: 16px; }
.side .side-card { position: static; padding: 8px; }
.side .side-card h2 { margin: 14px 14px 8px; }
.soc-list { display: grid; }
.soc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; transition: background .15s; }
.soc-row:hover { background: var(--surface-2); }
.soc-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.soc-row:hover .soc-ico { background: var(--ink); color: var(--bg); }
.soc-ico svg { width: 18px; height: 18px; }
.soc-row b { display: block; font-size: 15px; font-weight: 600; }
.soc-row small { font: 400 12px/1.3 var(--mono); color: var(--muted); }
.soc-row i { font-style: normal; color: var(--muted); }
.side-sub { position: relative; overflow: hidden; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), var(--surface); }
.side-sub::before { content: ""; display: block; width: 30px; height: 30px; margin-bottom: 16px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='3'/><path d='m4 7 8 6 8-6'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'><rect x='3' y='5' width='18' height='14' rx='3'/><path d='m4 7 8 6 8-6'/></svg>") center / contain no-repeat; }
.side-sub h3 { margin: 0 0 16px; font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); }
.side-sub .btn { width: 100%; border-radius: 12px; padding: 13px; }
.side-sub small { display: block; margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
.side-sub .sub-wrap.done small { color: var(--accent); }
.path .n { font: 500 13px/1.6 var(--mono); color: var(--muted); }
.path li.now { border-color: var(--ink); }
.path li.now .n { color: var(--ink); }
.path .n { font-size: 15px; }
@media (max-width: 1000px) { .side { position: static; } }
@media (max-width: 600px) { .photo { width: 72px; height: 72px; } .photo::after { font-size: 26px; } .ah-row { gap: 16px; } }
.soc-row small { display: block; margin: 0; }
.photo span { position: absolute; bottom: 16px; z-index: 1; }

/* Official social logos (Simple Icons) in brand colors */
.si { display: inline-block; flex: none; width: 16px; height: 16px; background: var(--ink); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.soc-ico .si { width: 20px; height: 20px; }
.si-x { --m: url(/icons/x.svg); background: var(--ink); }
.si-youtube { --m: url(/icons/youtube.svg); background: #ff0000; }
.si-instagram { --m: url(/icons/instagram.svg); background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.si-tiktok { --m: url(/icons/tiktok.svg); background: var(--ink); filter: drop-shadow(-1px -1px 0 #25f4ee) drop-shadow(1px 1px 0 #fe2c55); }
.si-threads { --m: url(/icons/threads.svg); background: var(--ink); }
.si-reddit { --m: url(/icons/reddit.svg); background: #ff4500; }
.si-linkedin { --m: url(/icons/linkedin.svg); background: #0a66c2; }
.si-github { --m: url(/icons/github.svg); background: var(--ink); }
.si-telegram { --m: url(/icons/telegram.svg); background: #26a5e4; }
.socials a:hover .si-x, .networks a:first-child .si-x, .socials a:hover .si-threads, .networks a:first-child .si-threads, .socials a:hover .si-github, .networks a:first-child .si-github, .socials a:hover .si-tiktok, .networks a:first-child .si-tiktok { background: var(--bg); }
.soc-row:hover .soc-ico { background: var(--surface-2); color: inherit; }
.flow-row { overflow: visible; }
.node { min-width: 0; }
.prose .networks a { text-decoration: none; }
.prose .networks a:hover { color: inherit; }
.prose .networks a:first-child:hover { color: var(--bg); }

/* Post teaser on video pages */
.teaser { position: relative; margin-top: 32px; max-width: 580px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.teaser-text { padding: 26px 28px 0; height: 360px; overflow: hidden; }
.teaser-text h3 { margin: 12px 0 14px; font-size: 26px; line-height: 1.15; letter-spacing: -0.025em; }
.teaser-text h4 { margin: 18px 0 6px; font-size: 17px; }
.teaser-text p { margin: 0 0 10px; font: 400 16px/1.65 var(--serif); color: color-mix(in srgb, var(--ink) 85%, var(--surface)); }
.teaser-text a { text-decoration: underline; text-decoration-color: var(--accent); }
.teaser-text sup a { text-decoration: none; color: var(--accent); font-size: 11px; }
.teaser-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--surface) 78%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%); }
.teaser-btn { position: absolute; left: 50%; bottom: 24px; translate: -50% 0; display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; white-space: nowrap; box-shadow: var(--shadow); transition: transform .15s; }
.teaser-btn span { color: var(--accent); }
.teaser-btn:hover { transform: translateY(-2px); }

/* About: timeline, system map, roadmap */
.about-prose .stats { margin: 28px 0 8px; grid-template-columns: repeat(4, 1fr); }
.about-prose .stats b { font-size: 34px; }
.path-art { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.path-art picture { display: block; }
.path-art img { width: 100%; height: auto; }
.path-art .path-dark { display: none; }
[data-theme="dark"] .path-art .path-light { display: none; }
[data-theme="dark"] .path-art .path-dark { display: block; }
.sys-map { margin: 12px 0 8px !important; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--surface); }
.sys-map h4 { text-align: center; color: var(--muted); font: 500 11.5px/1 var(--mono) !important; text-transform: uppercase; letter-spacing: .1em; }
.hub { width: max-content; max-width: 100%; margin: 0; padding: 16px 24px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 32px -12px color-mix(in srgb, var(--accent) 60%, transparent); text-align: center; display: grid; gap: 4px; position: relative; z-index: 1; }
.hub b { font-size: 20px; letter-spacing: -0.02em; }
.hub span { font-size: 13px; opacity: .85; }
/* Map: hub on top-left, one spine down the left edge from the hub's bottom edge to the centre of the last card, one tick per card (same stroke and colour as the phone flowchart spine) */
.branches { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; padding-left: 48px; position: relative; }
.branches::before { content: ""; position: absolute; left: 24px; top: -14px; bottom: 0; width: 1.5px; background: var(--muted); }
.branch { position: relative; display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface-2); text-decoration: none !important; transition: transform .15s; }
.branch::before { content: ""; position: absolute; left: -24px; top: calc(50% - 0.75px); width: 24px; height: 1.5px; background: var(--muted); }
/* The spine runs to the list bottom; the last card paints the map surface over the spine below its centre */
.branch:last-child::after { content: ""; position: absolute; left: -24px; top: 50%; bottom: 0; width: 2px; background: var(--surface); }
.branch:hover { transform: translateY(-2px); }
.branch b { font-size: 15px; line-height: 1.25; color: var(--ink); }
.branch span:not(.label) { font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.branch.soon { outline: 1px dashed var(--line); outline-offset: -1px; background: transparent; pointer-events: none; }
.branch.t-product { --system: var(--accent); }
.roadmap { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0 8px; font-family: var(--sans); }
.roadmap::before { content: ""; position: absolute; left: 10px; right: 10px; top: 9px; height: 2px; background: linear-gradient(90deg, var(--accent) 0 30%, var(--line) 30% 100%); }
.rm-node { position: relative; z-index: 1; display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.rm-now .rm-node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 20%, transparent); animation: rm-pulse 2.4s ease-in-out infinite; }
.rm-next .rm-node { border-color: var(--accent); }
.rm-later .rm-node { border-style: dashed; border-color: var(--muted); }
@keyframes rm-pulse { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--accent) 6%, transparent); } }
.rm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 18px 0 12px; }
.rm-head b { font-size: 18px; letter-spacing: -0.02em; }
.rm-head span { font: 500 11.5px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rm-now .rm-head span { color: var(--accent); }
.roadmap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.roadmap li { position: relative; padding: 13px 14px 13px 40px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; line-height: 1.4; }
.roadmap li::before { content: ""; position: absolute; left: 14px; top: 15px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.rm-now li { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 60%); }
.rm-now li::before { border: 0; background: conic-gradient(var(--accent) 0 60%, color-mix(in srgb, var(--accent) 25%, transparent) 60% 100%); }
.rm-next li::before { border-color: var(--accent); }
.rm-later li { background: transparent; border-style: dashed; color: var(--muted); }
.rm-later li::before { border-style: dashed; border-color: var(--muted); }
@media (max-width: 700px) {
  .about-prose .stats { grid-template-columns: repeat(2, 1fr); }
  .roadmap { grid-template-columns: 1fr; gap: 6px; padding-left: 34px; }
  .roadmap::before { left: 9px; right: auto; top: 10px; bottom: 10px; width: 2px; height: auto; background: linear-gradient(var(--accent) 0 30%, var(--line) 30% 100%); }
  .rm-node { position: absolute; left: -34px; top: 0; }
  .rm-head { margin: 0 0 10px; }
  .rm-col { position: relative; margin-bottom: 14px; }
}
.label:not([class*="t-"])::before { display: none; }
.ah-row h1 { margin: 0; }

/* Community button (Discord EN / Telegram RU) */
.si-discord { --m: url(/icons/discord.svg); background: #5865f2; }
.community-btn { display: inline-flex; align-items: center; line-height: 1.2; justify-content: center; gap: 10px; padding: 13px 22px; text-decoration: none !important; font-family: var(--sans); }
.community-btn .si { width: 18px; height: 18px; background: currentColor; filter: none; }
.about-blog .community-btn { justify-self: end; }
.side-sub p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.side-sub .community-btn { width: 100%; border-radius: 12px; }
@media (max-width: 820px) { .about-blog .community-btn { justify-self: start; } }
.community-btn { color: #fff; transition: filter .15s, transform .15s; }
.community-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.community-discord { background: #5865f2; }
.community-telegram { background: #2481cc; }

/* Home community card */
.community-card { --brand: #5865f2; position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 36px 40px; border-radius: 28px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: radial-gradient(70% 140% at 0% 50%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%), var(--surface); }
.community-card[data-brand="telegram"] { --brand: #2481cc; }
.community-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 14%, transparent); filter: blur(20px); pointer-events: none; }
.cc-logo { width: 72px; height: 72px; border-radius: 22px; background: var(--brand); display: grid; place-items: center; box-shadow: 0 14px 30px -12px var(--brand); }
.cc-logo .si { width: 38px; height: 38px; background: #fff; filter: none; }
.cc-text h2 { margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.03em; line-height: 1.1; }
.cc-text p { margin: 0 0 14px; color: var(--muted); font-size: 16px; max-width: 520px; }
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-tags span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 500 12px/1.4 var(--mono); }
.community-card .community-btn { position: relative; z-index: 1; padding: 15px 26px; font-size: 16px; box-shadow: 0 12px 28px -12px var(--brand); }
@media (max-width: 820px) {
  .community-card { grid-template-columns: 1fr; gap: 18px; padding: 26px; }
  .cc-logo { width: 56px; height: 56px; border-radius: 16px; }
  .cc-logo .si { width: 30px; height: 30px; }
  .community-card .community-btn { justify-self: start; }
}

/* ===== Interaction states (real pseudo-classes + .is-* twins for the design system) ===== */
:focus-visible, .is-focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn.is-hover { filter: brightness(1.05); }
.btn:active, .btn.is-active { transform: scale(.97); filter: brightness(.92); }
.community-btn.is-hover { filter: brightness(1.08); transform: translateY(-1px); }
.community-btn:active, .community-btn.is-active { transform: scale(.97); filter: brightness(.92); }
.more-btn.is-hover, .teaser-btn.is-hover { transform: translateY(-2px); }
.more-btn:active, .more-btn.is-active, .teaser-btn:active { transform: scale(.97); }
.chip.is-hover { color: var(--ink); border-color: var(--muted); }
.chip:active, .chip.is-active { transform: scale(.96); }
.icon-btn.is-hover { background: var(--surface-2); }
.icon-btn:active, .icon-btn.is-active { background: var(--line); transform: scale(.94); }
.networks a.is-hover { border-color: var(--ink); }
.socials a.is-hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.networks a:active, .networks a.is-active, .socials a:active, .socials a.is-active { transform: scale(.97); }
.nav a.is-hover { color: var(--ink); background: var(--surface-2); }
.prose a.is-hover { color: var(--accent); }
:is(.btn, .more-btn, .chip, .icon-btn, .community-btn):disabled,
:is(.btn, .more-btn, .chip, .icon-btn, .community-btn, .networks a, .socials a, .nav a).is-disabled,
[aria-disabled="true"] { opacity: .4; cursor: not-allowed; pointer-events: none; filter: grayscale(.4); transform: none; }
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--spin, var(--accent-ink)); border-right-color: transparent; animation: spin .7s linear infinite; }
.more-btn.is-loading { --spin: var(--bg); }
.community-btn.is-loading { --spin: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Input */
.input { width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--muted); }
.input:hover, .input.is-hover { border-color: var(--muted); }
.input:focus, .input.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); outline: none; }
.input.is-error { border-color: #e5484d; box-shadow: 0 0 0 3px rgb(229 72 77 / .2); }
.input:disabled, .input.is-disabled { opacity: .45; cursor: not-allowed; }
.field-hint { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.field-hint.error { color: #e5484d; }

/* Empty state + skeleton */
.empty-state { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 44px 24px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state .es-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty-state .es-ico svg { width: 24px; height: 24px; }
.empty-state h3 { margin: 6px 0 0; font-size: 19px; }
.empty-state p { margin: 0 0 8px; color: var(--muted); max-width: 360px; font-size: 15px; }
.skeleton { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.sk { background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 60%, var(--line)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; border-radius: 8px; }
.skeleton .sk-cover { aspect-ratio: 16 / 9; border-radius: 0; }
.skeleton .sk-body { padding: 20px 22px 22px; display: grid; gap: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Error pages */
.error-page { padding: 96px 0 56px; display: grid; justify-items: start; gap: 14px; }
.error-code { font: 800 clamp(110px, 18vw, 220px)/.85 var(--sans); letter-spacing: -0.06em; background: linear-gradient(135deg, var(--accent), var(--system)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin: 10px 0 0; font-size: clamp(32px, 4.5vw, 52px); letter-spacing: -0.04em; line-height: 1.05; }
.error-page p { margin: 0 0 12px; max-width: 520px; color: var(--muted); font-size: 18px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.error-actions .btn, .error-actions .more-btn { padding: 14px 24px; font-size: 15px; }

/* Design system page */
.ds-nav { position: sticky; top: 64px; z-index: 5; display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.ds-section { padding: 48px 0 8px; scroll-margin-top: 140px; }
.ds-section > h2 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.03em; }
.ds-section > p { margin: 0 0 24px; color: var(--muted); max-width: 640px; }
.ds-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ds-panel { position: relative; padding: 28px; border-radius: var(--radius); background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.ds-panel-label { position: absolute; top: 12px; right: 14px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ds-swatch { display: grid; gap: 4px; }
.ds-swatch i { height: 56px; border-radius: 12px; border: 1px solid var(--line); }
.ds-swatch b { font: 600 12px/1.3 var(--mono); }
.ds-swatch code { font: 400 11.5px/1.3 var(--mono); color: var(--muted); }
.ds-type { display: grid; gap: 4px; }
.ds-type-row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ds-type-row code { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.ds-scale { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.ds-scale div { display: grid; gap: 6px; justify-items: center; font: 400 11.5px/1 var(--mono); color: var(--muted); }
.ds-scale .bar { background: var(--accent); width: 18px; border-radius: 4px; }
.ds-scale .rad { width: 64px; height: 64px; background: var(--surface-2); border: 1px solid var(--line); }
.ds-icons { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-icons > span { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.ds-icons .si { width: 20px; height: 20px; }
.ds-matrix { display: grid; grid-template-columns: 150px repeat(6, minmax(0, 1fr)); gap: 10px 14px; align-items: center; overflow-x: auto; }
.ds-matrix .h { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ds-matrix .rowname { font-size: 13.5px; font-weight: 600; }
.ds-matrix .cell { display: flex; align-items: center; min-height: 52px; }
.ds-matrix .networks, .ds-matrix .socials { margin: 0; }
.ds-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ds-stack { display: grid; gap: 20px; max-width: 720px; }
.ds-stack .prose { font-size: 17px; }
.ds-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.ds-fields label { display: grid; gap: 6px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 900px) { .ds-duo, .ds-grid { grid-template-columns: 1fr; } .ds-type-row { grid-template-columns: 1fr; gap: 6px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
.chip[aria-pressed="true"]:hover, .chip[aria-pressed="true"].is-hover { color: var(--bg); border-color: var(--ink); background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
:is(.socials a.is-hover, .networks a:first-child) :is(.si-x, .si-threads, .si-github, .si-tiktok) { background: var(--bg); }

/* ===== Hover v2: lift + colored glow, arrows nudge, outlines fill ===== */
:is(.btn, .more-btn, .teaser-btn, .community-btn, .chip, .icon-btn, .networks a, .socials a, .nav a) { transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, background-color .2s, color .2s, border-color .2s, filter .2s; }
.more-btn span, .teaser-btn span, .networks a::after { display: inline-block; transition: transform .2s cubic-bezier(.2,.8,.2,1); }

.btn:hover, .btn.is-hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.community-discord:hover, .community-discord.is-hover { box-shadow: 0 10px 26px -10px #5865f2; }
.community-telegram:hover, .community-telegram.is-hover { box-shadow: 0 10px 26px -10px #2481cc; }
.more-btn:hover, .more-btn.is-hover, .teaser-btn:hover, .teaser-btn.is-hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgb(0 0 0 / .45); }
.teaser-btn:hover, .teaser-btn.is-hover { transform: translate(0, -2px); }
:is(.more-btn, .teaser-btn):is(:hover, .is-hover) span { transform: translateX(4px); }
.chip:hover, .chip.is-hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"]:hover, .chip[aria-pressed="true"].is-hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); color: var(--bg); border-color: var(--ink); }
.icon-btn:hover, .icon-btn.is-hover { background: var(--surface-2); color: var(--accent); }
.networks a:hover, .networks a.is-hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 10px 22px -12px rgb(0 0 0 / .35); }
:is(.networks a:hover, .networks a.is-hover)::after { transform: translate(2px, -2px); color: var(--accent); }
.socials a:hover, .socials a.is-hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgb(0 0 0 / .4); }
.card:hover .cover svg, .feature:hover .cover svg { transform: scale(1.06) rotate(-2deg); }
.cover svg { transition: transform .4s cubic-bezier(.2,.8,.2,1); }

/* Pressed settles back */
:is(.btn, .more-btn, .community-btn, .networks a, .socials a, .chip, .icon-btn):is(:active, .is-active) { transform: translateY(0) scale(.97); box-shadow: none; filter: brightness(.94); }

/* ===== Hover v2 for surfaces: cards, links, rows, fields, content blocks ===== */
.card[data-type="article"] { --c: var(--article); } .card[data-type="guide"] { --c: var(--guide); }
.card[data-type="system"] { --c: var(--system); } .card[data-type="video"] { --c: var(--accent); }
.feature, .link-card, .branch, .vcard { --c: var(--accent); }
.feature:has(.t-article) { --c: var(--article); } .feature:has(.t-guide) { --c: var(--guide); } .feature:has(.t-system) { --c: var(--system); }
.link-card.t-system { --c: var(--system); } .link-card.t-guide { --c: var(--guide); } .link-card.t-article { --c: var(--article); }
:is(.card, .feature, .link-card, .branch, .soc-row, .vcard, .search li a, .lang a, .toc a, .roadmap li, .path li, .table-wrap tr, .node, .bar-row, .stats div, .logo-avatar, .player, .play) { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .2s, background-color .2s, color .2s, filter .2s; }
.card h3, .feature h3 { transition: color .2s; }

/* Cards */
:is(.card, .feature):is(:hover, .is-hover) { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 22px 44px -24px color-mix(in srgb, var(--c) 70%, transparent); }
:is(.card, .feature):is(:hover, .is-hover) h3 { color: color-mix(in srgb, var(--c) 30%, var(--ink)); }
:is(.card, .feature).is-hover .cover svg { transform: scale(1.06) rotate(-2deg); }
:is(.card, .feature, .vcard, .link-card, .branch):is(:active, .is-active) { transform: translateY(-1px) scale(.99); box-shadow: none; }
.vcard:is(:hover, .is-hover) { transform: translateY(-4px); }
.vcard:is(:hover, .is-hover) .cover { box-shadow: 0 22px 44px -22px color-mix(in srgb, var(--accent) 70%, transparent); }
:is(.vcard, .card, .player):is(:hover, .is-hover) .play { transform: scale(1.12); box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 22%, transparent), 0 10px 30px -6px color-mix(in srgb, var(--accent) 60%, transparent); }
.player { cursor: pointer; }
:is(.card, .feature, .vcard, .link-card, .branch, .soc-row):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Link cards, system branches, social rows */
.link-card:is(:hover, .is-hover) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, var(--line)); box-shadow: 0 16px 32px -20px color-mix(in srgb, var(--c) 70%, transparent); }
.branch:is(:hover, .is-hover) { transform: translateY(-3px); background: color-mix(in srgb, var(--system) 12%, var(--surface-2)); box-shadow: 0 16px 30px -20px color-mix(in srgb, var(--system) 80%, transparent); }
.soc-row i { transition: transform .2s cubic-bezier(.2,.8,.2,1), color .2s; }
.soc-row:is(:hover, .is-hover) { background: var(--surface-2); }
.soc-row:is(:hover, .is-hover) i { transform: translate(3px, -3px); color: var(--accent); }
.soc-row:is(:hover, .is-hover) .soc-ico { background: var(--bg); transform: scale(1.06); }
.soc-ico { transition: transform .2s, background-color .2s; }

/* Small links */
.lang a:not([aria-current="true"]):is(:hover, .is-hover) { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.logo:hover .logo-avatar { transform: rotate(-8deg) scale(1.08); }
.footer .meta a { transition: color .2s; } .footer .meta a:hover { color: var(--accent); }
.search li a:is(:hover, :focus, .is-hover) { background: var(--surface-2); transform: translateX(4px); }
.search li a:is(:hover, :focus) b { color: var(--accent); }
.toc a:is(:hover, .is-hover) { color: var(--ink); border-color: var(--c, var(--accent)); padding-left: 18px; }

/* Fields */
.search input { caret-color: var(--accent); transition: background-color .2s; }
.search input:focus { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }

/* Content blocks: gentle, non-lifting feedback */
.table-wrap tbody tr:hover { background: var(--surface-2); }
.bar-row:hover span { color: var(--ink); } .bar-row:hover .bar i { filter: brightness(1.15); }
.node:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.node.human:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.stats div:hover { background: var(--surface-2); }
.roadmap li:hover { border-color: var(--muted); }
.rm-now li:hover { border-color: var(--accent); }
.path li:hover { border-color: var(--muted); }
.timeline li:hover .tl-dot { border-color: var(--accent); color: var(--ink); }
.ah-meta span, .cc-tags span, .tags span { transition: color .2s, border-color .2s; }

/* Avatar photo (logo 30, author 64, About 96) */
.avatar { padding: 2px; overflow: hidden; }
.avatar img, .photo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; position: relative; z-index: 1; }
.photo { padding: 3px; }
.photo::after { content: none; }
.logo-avatar { background: var(--surface-2); }
@media (max-width: 600px) { .logo { font-size: 17px; gap: 8px; } .logo-avatar { width: 28px; height: 28px; } .tools { gap: 2px; } .icon-btn { width: 34px; height: 34px; } }

/* ===== Empty board: ghost cards keep the page shape, panel explains + gives one action ===== */
.empty-board { position: relative; min-height: 560px; }
.ghost-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; -webkit-mask-image: linear-gradient(#000 20%, transparent 92%); mask-image: linear-gradient(#000 20%, transparent 92%); }
.ghost-card { display: grid; border: 1.5px dashed var(--line); border-radius: var(--radius); overflow: hidden; }
.ghost-card .g-cover { aspect-ratio: 16 / 9; background: repeating-linear-gradient(135deg, var(--surface) 0 12px, color-mix(in srgb, var(--surface-2) 70%, var(--surface)) 12px 24px); }
.ghost-card .g-body { padding: 20px 22px 24px; display: grid; gap: 10px; }
.g-line { height: 10px; border-radius: 6px; background: var(--surface-2); }
.empty-panel { position: absolute; left: 50%; top: 46%; translate: -50% -50%; width: min(540px, calc(100% - 32px)); display: grid; justify-items: center; gap: 12px; padding: 36px 32px 30px; text-align: center; border-radius: 28px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 40px 90px -40px rgb(0 0 0 / .55); }
.ep-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c, var(--accent)) 35%, transparent); }
.ep-ico::before { content: ""; width: 30px; height: 30px; background: var(--c, var(--accent)); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.empty-panel .ep-status { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ep-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); animation: rm-pulse 2.4s ease-in-out infinite; }
.empty-panel h2 { margin: 4px 0 0; font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -0.03em; line-height: 1.12; }
.empty-panel p { margin: 0 0 6px; color: var(--muted); font-size: 16px; max-width: 420px; }
.ep-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ep-also { display: grid; justify-items: center; gap: 8px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); width: 100%; }
.ep-also span { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ep-also div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.t-home { --c: var(--accent); --icon: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 20h9'/><path d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/></svg>"); }
@media (max-width: 820px) { .ghost-grid { grid-template-columns: 1fr; } .ghost-grid .ghost-card:nth-child(n+2) { display: none; } .empty-board { min-height: 600px; } .empty-panel { padding: 28px 22px 24px; } }

/* Empty board v2: inline in the page flow, no floating card */
.empty-board { min-height: 0; display: grid; gap: 40px; }
.empty-panel { order: -1; position: static; translate: none; width: auto; max-width: 640px; justify-items: start; text-align: left; gap: 14px; padding: 8px 0 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.empty-panel h2 { font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.035em; }
.empty-panel p { font-size: 18px; max-width: 540px; }
.ep-head { display: flex; align-items: center; gap: 14px; }
.ep-ico { width: 52px; height: 52px; border-radius: 16px; }
.ep-ico::before { width: 26px; height: 26px; }
.ep-actions { justify-content: flex-start; }
.ep-also { justify-items: start; border-top: 0; padding-top: 4px; margin-top: 6px; width: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ep-also div { justify-content: flex-start; }
.ghost-grid { -webkit-mask-image: linear-gradient(#000 0%, transparent 85%); mask-image: linear-gradient(#000 0%, transparent 85%); opacity: .8; }
@media (max-width: 820px) { .empty-board { min-height: 0; } .empty-panel { padding: 0; } }
.ep-status::before { box-shadow: none; animation: dot-blink 1.8s ease-in-out infinite; }
@keyframes dot-blink { 50% { opacity: .35; } }

/* ===== Inline text links: classic blue (tokens --link / --link-hover), only inside post text ===== */
:is(.prose, .teaser-text) :is(p, li, td, th, figcaption, blockquote) a:not(.btn, .chip, .more-btn, .link-card),
.ds-link { color: var(--link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; border-radius: 3px; transition: color .15s, text-decoration-color .15s, background-color .15s; }
:is(.prose, .teaser-text) :is(p, li, td, th, figcaption, blockquote) a:not(.btn, .chip, .more-btn, .link-card):hover,
.ds-link:hover, .ds-link.is-hover { color: var(--link-hover); text-decoration-color: currentColor; text-decoration-thickness: 2px; background: color-mix(in srgb, var(--link) 12%, transparent); }
:is(.prose, .teaser-text) :is(p, li, td, th, figcaption, blockquote) a:not(.btn, .chip, .more-btn, .link-card):focus-visible,
.ds-link.is-focus { outline: 2px solid var(--link); outline-offset: 2px; }
.prose sup.fn a { color: var(--link) !important; }
.prose sup.fn a:hover { color: var(--link-hover) !important; }

/* ===== Rich table: header row, zebra or dividers, highlighted row, mono tags ===== */
.table-wrap.rich { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.table-wrap.rich figcaption { padding: 0 16px 12px; }
.table-wrap.rich table { font-size: 14.5px; }
.table-wrap.rich th { background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 11px 16px; font: 600 10.5px/1.2 var(--mono); }
.table-wrap.rich td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table-wrap.rich tbody tr:last-child td { border-bottom: 0; }
.table-wrap.rich.zebra td { border-bottom: 0; }
.table-wrap.rich.zebra tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table-wrap.rich tr.is-highlight { background: color-mix(in srgb, var(--accent) 11%, transparent) !important; }
.table-wrap.rich tr.is-highlight td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.table-wrap.rich td.num { font-family: var(--mono); font-size: 13.5px; text-align: right; white-space: nowrap; }
.table-wrap.rich th.num { text-align: right; }
@media (max-width: 600px) { .table-wrap.rich th, .table-wrap.rich td { padding-left: 8px; padding-right: 8px; } }
.tbl-tag { display: inline-block; padding: 3px 8px; border-radius: 6px; font: 500 11px/1.3 var(--mono); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tbl-tag.ok { background: color-mix(in srgb, #30a46c 16%, transparent); color: #30a46c; }
.tbl-tag.warn { background: color-mix(in srgb, var(--article) 20%, transparent); color: color-mix(in srgb, var(--article) 75%, var(--ink)); }
.tbl-tag.off { background: color-mix(in srgb, #e5484d 14%, transparent); color: #e5484d; }

/* ===== Screenshot figure: rounded frame, subtle shadow, caption, works with light and dark shots ===== */
.shot { margin: 8px 0 32px; }
.shot-frame { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgb(0 0 0 / .45); }
.shot-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06), inset 0 0 0 1px rgb(255 255 255 / .04); pointer-events: none; }
.shot-frame img { display: block; width: 100%; height: auto; }
.shot figcaption { display: flex; gap: 8px; align-items: baseline; margin-top: 12px; }
.shot figcaption b { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ds-duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ds-panel, .flowchart { min-width: 0; }
@media (max-width: 900px) { .ds-duo { grid-template-columns: minmax(0, 1fr); } }
:is(.flowchart, .shot, .table-wrap) figcaption { margin-top: 10px; font: 400 13px/1.4 var(--mono); color: var(--muted); }

/* ===== Flow: one level only. Steps carry their role as a colored label + thin side line; no card, no lane boxes ===== */
.flowchart { margin: 8px 0 32px; font-family: var(--sans); }
.flowchart h4 { margin: 0 0 16px; font: 600 15px/1.3 var(--sans); }
.fl-track { display: flex; align-items: stretch; }
.fl-step { --c: var(--muted); position: relative; display: grid; gap: 5px; align-content: start; padding: 12px 16px 13px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: inset 3px 0 0 var(--c); }
.fl-role { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.fl-role::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.fl-step b { font-size: 15px; line-height: 1.25; }
.fl-step p { margin: 0 !important; font: 400 13.5px/1.5 var(--sans) !important; color: var(--muted); }
.fl-step.human { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.fl-step.decision { border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.fl-step.decision b::before { content: "◆ "; color: var(--accent); font-size: 12px; vertical-align: 1px; }
.fl-branches { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; }
.fl-branches span { font: 500 12px/1.3 var(--mono); color: var(--ink); }
.fl-branches span::before { content: "→ "; color: var(--accent); }
.fl-branches span.loop::before { content: "↺ "; }
.fl-arrow { flex: none; position: relative; background: var(--muted); }
.fl-arrow::after { content: ""; position: absolute; border: 5px solid transparent; }
/* left to right */
.fl-track.h { gap: 0; }
.fl-track.h .fl-step { flex: 1 1 0; min-width: 0; }
.fl-track.h .fl-arrow { width: 18px; height: 1.5px; align-self: center; margin: 0 5px 0 4px; }
.fl-track.h .fl-arrow::after { right: -3px; top: -4.25px; border-left: 7px solid var(--muted); border-right: 0; }
/* top to bottom: fits the post column, longer text */
.fl-track.v { flex-direction: column; max-width: 100%; }
.fl-track.v .fl-arrow { width: 1.5px; height: 22px; margin: 3px 0 3px 26px; }
.fl-track.v .fl-arrow::after { left: -4.25px; bottom: -3px; border-top: 7px solid var(--muted); border-bottom: 0; }
.fl-track.v .fl-step p { max-width: 60ch; }
.fl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.fl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.fl-legend i { width: 18px; height: 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.fl-legend i.human { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.fl-legend i.decision { border: 1.5px dashed var(--accent); }
.fl-legend .role { --c: var(--muted); gap: 6px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.fl-legend .role::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--c); }
.fl-legend .sep { width: 1px; height: 14px; background: var(--line); }
:is(.fl-step, .fl-legend .role).tone-system { --c: var(--system); } :is(.fl-step, .fl-legend .role).tone-guide { --c: var(--guide); }
:is(.fl-step, .fl-legend .role).tone-article { --c: var(--article); } :is(.fl-step, .fl-legend .role).tone-accent { --c: var(--accent); }
@media (max-width: 760px) {
  .fl-track.h { flex-direction: column; }
  .fl-track.h .fl-arrow { width: 1.5px; height: 22px; margin: 3px 0 3px 26px; align-self: flex-start; }
  .fl-track.h .fl-arrow::after { left: -4.25px; right: auto; top: auto; bottom: -3px; border: 5px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; }
}

/* ===== Branch tree: top-down, indented, fits 680 px and phones. Nodes reuse .fl-step (role label + side line) ===== */
.branch-tree { margin: 8px 0 32px; font-family: var(--sans); }
.branch-tree h4 { margin: 0 0 16px; font: 600 15px/1.3 var(--sans); }
.bt, .bt-kids { list-style: none; margin: 0; padding: 0; }
.bt-kids { position: relative; margin: 0 0 0 20px; padding: 0 0 0 24px; }
.bt-kids > li { position: relative; padding-top: 10px; }
.bt-kids > li::before { content: ""; position: absolute; left: -24px; top: 32px; width: 20px; height: 1.5px; background: var(--muted); }
.bt-kids > li::after { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; width: 1.5px; background: var(--muted); }
.bt-kids > li:last-child::after { bottom: auto; height: 33px; }
.bt-kids.merging > li:last-child::after { bottom: 0; height: auto; }
.bt-node { min-width: 0; padding: 10px 14px 11px 16px; }
.bt-node p { font-size: 13px !important; }
.bt-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bt-label { display: inline-block; padding: 3px 8px; border-radius: 6px; font: 600 11px/1.2 var(--mono); letter-spacing: .04em; background: var(--ink); color: var(--bg); white-space: nowrap; }
.bt-end { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font: 500 12px/1.3 var(--mono); color: var(--ink); }
.bt-end::before { content: "↺"; color: var(--accent); }
.bt-merge { position: relative; margin: 10px 0 0; padding-top: 14px; }
.bt-merge::before { content: ""; position: absolute; left: 20px; top: 0; height: 14px; width: 1.5px; background: var(--muted); }
.bt-merge::after { content: ""; position: absolute; left: 16.25px; top: 8px; border: 5px solid transparent; border-top: 7px solid var(--muted); border-bottom: 0; }
.bt-merge-tag { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bt-merge-tag::before { content: "⤵"; color: var(--accent); }
@media (max-width: 600px) {
  .bt-kids { margin-left: 12px; padding-left: 18px; }
  .bt-kids > li::before { left: -18px; width: 14px; }
  .bt-kids > li::after { left: -18px; }
  .bt-merge::before { left: 12px; } .bt-merge::after { left: 8.25px; }
}

/* ===== Infographics: big stat, comparison, metric rows with bars or pips, HIT / MISS tags ===== */
.ig { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.ig-num { font: 700 clamp(44px, 6vw, 64px)/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-big { display: grid; gap: 8px; align-content: start; padding: 20px 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.stat-big .cap { font-size: 14px; line-height: 1.35; color: var(--muted); }
.delta { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); font: 500 12px/1.2 var(--mono); color: var(--ink); white-space: nowrap; }
.delta b { font-weight: 700; } .delta.up b { color: var(--guide); } .delta.down b { color: var(--article); } .delta span { color: var(--muted); white-space: normal; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col { position: relative; display: grid; gap: 2px; align-content: start; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.cmp-col h5 { margin: 0 0 10px; font-size: 16px; line-height: 1.25; padding-right: 8px; }
.cmp-col.win { border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cmp-badge { justify-self: start; margin-bottom: 8px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 11px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.cmp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cmp-row span { color: var(--muted); } .cmp-row b { font: 600 14px/1.3 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metrics { display: grid; }
.metric { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.metric:first-child { border-top: 0; }
.metric .m-label { display: grid; gap: 2px; min-width: 0; }
.metric .m-label b { font-size: 15px; } .metric .m-label span { font-size: 13px; color: var(--muted); }
.metric .m-val { font: 600 14px/1.2 var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.metric .m-viz { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.metric .bar { flex: 1; min-width: 120px; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 14px; height: 14px; border-radius: 4px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.pips i.on { background: var(--c, var(--accent)); box-shadow: none; }
.hm { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font: 700 11px/1.2 var(--mono); letter-spacing: .06em; white-space: nowrap; }
.hm.hit { background: var(--ink); color: var(--bg); }
.hm.hit::before { content: "✓"; }
.hm.miss { border: 1.5px dashed var(--muted); color: var(--muted); padding: 1.5px 7.5px; }
.hm.miss::before { content: "✕"; }
.ig-sheet { display: grid; gap: 18px; padding: 24px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); }
.ig-sheet h4 { margin: 0; font-size: 17px; line-height: 1.3; }
.ig-sheet .ig-cap { font: 400 12.5px/1.45 var(--mono); color: var(--muted); }
.ds-ig { display: grid; gap: 22px; }
.ds-ig .ds-sub { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: -10px; }
@media (max-width: 600px) { .compare { grid-template-columns: 1fr; } .stat-row { grid-template-columns: 1fr; } .ig-sheet { padding: 18px; } }
@media (max-width: 600px) { .ds-matrix { grid-template-columns: 120px repeat(6, max-content); overflow-x: auto; padding-bottom: 6px; } .ds-panel { overflow: hidden; padding: 20px 16px; } }
.ds-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .ds-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ds-grid.four { grid-template-columns: minmax(0, 1fr); } }

/* ===== 2D diagram (flowchart + wireflow): CSS grid placement, SVG arrows drawn from real element positions ===== */
.dgm-fig { margin: 8px 0 32px; font-family: var(--sans); }
.dgm-fig h4 { margin: 0 0 14px; font: 600 15px/1.3 var(--sans); }
.dgm-frame { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 16px; }
.dgm { position: relative; display: grid; min-width: 640px; padding: 24px 44px 28px; column-gap: 28px; row-gap: 60px; align-items: center; }
.dgm-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.dg-edge { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; }
.dg-edge.loop { stroke: var(--accent); stroke-dasharray: 5 4; }
.dg-ah { fill: var(--muted); } .dg-ah.loop { fill: var(--accent); }
.dg-elabel { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 2px 7px; border-radius: 6px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); font: 500 11px/1.25 var(--mono); color: var(--ink); white-space: nowrap; }
.dg-elabel.loop { color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line)); }
.nd { position: relative; z-index: 2; justify-self: center; min-width: 0; }
.nd.step { --c: var(--muted); justify-self: stretch; display: grid; gap: 3px; padding: 10px 12px 11px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: inset 3px 0 0 var(--c); }
.nd.step.human { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.nd .nd-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.nd .nd-role { display: inline-flex; align-items: center; gap: 5px; font: 600 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.nd .nd-role::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.nd b { font-size: 13.5px; line-height: 1.25; }
.nd p { margin: 0 !important; font: 400 12.5px/1.4 var(--sans) !important; color: var(--muted); }
.nd.terminal { padding: 10px 22px; min-width: 150px; max-width: 100%; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); text-align: center; font-weight: 600; font-size: 14px; line-height: 1.25; }
.nd.decision { width: 216px; min-height: 160px; display: grid; place-items: center; padding: 0; text-align: center; }
.nd.decision svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.nd.decision polygon { fill: color-mix(in srgb, var(--accent) 8%, var(--surface)); stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.nd.decision b { position: relative; width: 46%; font-size: 13px; line-height: 1.25; }
.nd-group { --c: var(--system); position: relative; z-index: 0; align-self: stretch; justify-self: stretch; margin: 0 -14px -18px;border: 1.5px dashed color-mix(in srgb, var(--c) 55%, var(--line)); border-radius: 18px; background: color-mix(in srgb, var(--c) 6%, transparent); }
.nd-group > span { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); font: 600 10.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: color-mix(in srgb, var(--c) 75%, var(--ink)); white-space: nowrap; }
.nd-group > span { top: 13px; bottom: auto; max-width: calc(25% - 24px); white-space: normal; text-align: center; }
.nd.in-grp { margin-top: 46px; }
.nd-group.wide > span { max-width: calc(100% - 32px); }
.nd.tone-system { --c: var(--system); } .nd.tone-guide { --c: var(--guide); } .nd.tone-article { --c: var(--article); } .nd.tone-accent { --c: var(--accent); }
.dg-legend2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.dg-legend2 span { display: inline-flex; align-items: center; gap: 7px; }
.dg-legend2 i { flex: none; width: 20px; height: 13px; border: 1.5px solid var(--line); background: var(--surface); }
.dg-legend2 i.term { border-radius: 999px; border-color: var(--ink); }
.dg-legend2 i.step { border-radius: 4px; border-width: 1px; box-shadow: inset 3px 0 0 var(--muted); }
.dg-legend2 i.dec { width: 13px; height: 13px; transform: rotate(45deg); border-color: var(--accent); margin: 0 3px; }
.dg-legend2 i.grp { border-style: dashed; border-radius: 4px; border-color: color-mix(in srgb, var(--system) 55%, var(--line)); background: color-mix(in srgb, var(--system) 8%, transparent); }
.dg-legend2 i.hum { border-radius: 4px; border-width: 1px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.dg-legend2 i.cbtn { border-radius: 4px; border: 0; background: var(--accent); }
.dg-legend2 i.lp { height: 0; border: 0; border-top: 1.5px dashed var(--accent); background: none; }
.dg-legend2 .sep { width: 1px; height: 14px; background: var(--line); }
.dg-legend2 .role { gap: 6px; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.dg-legend2 .role::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--c); }
.dg-legend2 .role.tone-system { --c: var(--system); } .dg-legend2 .role.tone-guide { --c: var(--guide); } .dg-legend2 .role.tone-article { --c: var(--article); } .dg-legend2 .role.tone-accent { --c: var(--accent); } .dg-legend2 .role.tone-muted { --c: var(--muted); }

/* Wireflow: mini screen cards; arrows start at a specific button or row */
.wf-card { position: relative; z-index: 2; align-self: start; display: grid; gap: 7px; padding: 0 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 14px 30px -22px rgb(0 0 0 / .5); overflow: hidden; min-width: 0; }
.wf-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); font: 600 11px/1.2 var(--mono); color: var(--muted); }
.wf-bar::before { content: ""; width: 26px; height: 6px; flex: none; background: radial-gradient(circle, var(--line) 2.5px, transparent 3px) 0 0 / 10px 6px repeat-x; }
.wf-row, .wf-msg, .wf-list > span { margin: 0 10px; font-size: 12.5px; line-height: 1.4; }
.wf-msg { padding: 7px 9px; border-radius: 10px; background: var(--surface-2); }
.wf-msg.me { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); justify-self: end; max-width: 88%; }
.wf-meta { margin: 0 10px; font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.wf-input { display: flex; gap: 6px; align-items: center; margin: 2px 10px 0; }
.wf-field { flex: 1; min-width: 0; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); background: var(--bg); }
.wf-btn { flex: none; padding: 6px 11px; border-radius: 8px; font: 600 12px/1.2 var(--sans); background: var(--accent); color: var(--accent-ink); white-space: nowrap; }
.wf-btn.block { margin: 2px 10px 0; text-align: center; }
.wf-btn.ghost { background: var(--surface-2); color: var(--ink); }
.wf-tools { display: flex; gap: 5px; margin: 0 10px; }
.wf-tools i { width: 18px; height: 18px; border-radius: 5px; background: var(--surface-2); }
.wf-tools i.on { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); }
.wf-frame { margin: 0 10px; height: 64px; border-radius: 8px; border: 1px solid var(--line); background: linear-gradient(var(--surface-2) 0 0) 10px 10px / 45% 7px no-repeat, linear-gradient(var(--surface-2) 0 0) 10px 24px / 70% 5px no-repeat, linear-gradient(var(--surface-2) 0 0) 10px 35px / 60% 5px no-repeat, linear-gradient(color-mix(in srgb, var(--accent) 40%, var(--surface-2)) 0 0) 10px 48px / 28% 8px no-repeat, var(--bg); }
.wf-list { display: grid; gap: 4px; }
.wf-list > span { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.wf-list > span:first-child { border-top: 0; }
.wf-list em { font-style: normal; font: 500 11.5px/1.4 var(--mono); color: var(--muted); white-space: nowrap; }
.wf-add { color: var(--guide); } .wf-del { color: var(--article); }
.nd.step { align-self: stretch; }
.dgm-fig figcaption { margin-top: 10px; font: 400 13px/1.4 var(--mono); color: var(--muted); }
.wf-card { grid-template-columns: minmax(0, 1fr); }
.wf-input { flex-wrap: wrap; }
.wf-input .wf-field { flex: 1 1 90px; }
.wf-btn { white-space: normal; overflow-wrap: anywhere; }

/* ===== Batch 2: typography + motion ===== */
/* Type roles */
.t-title { margin: 0; font: 700 var(--fs-title)/1.06 var(--sans); letter-spacing: -0.04em; color: var(--ink); text-wrap: balance; }
.t-subtitle { margin: 10px 0 0; max-width: 620px; font: 400 var(--fs-subtitle)/1.45 var(--sans); color: var(--muted); text-wrap: pretty; }
.t-label { display: inline-block; margin: 0 0 12px; font: 600 var(--fs-label)/1.3 var(--accent-font); text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.t-accent { font-family: var(--accent-font); font-weight: 600; letter-spacing: -0.01em; }
/* Sections: larger gap, hairline divider */
.sec + .sec { margin-top: var(--section-gap); padding-top: calc(var(--section-gap) * .5); border-top: var(--hairline); }
/* Marker highlight: band behind the text with a hand-drawn edge (SVG mask), draws on when in view */
/* Marker highlight: inline, so a wrapped highlight is one background fragment per line (box-decoration-break: clone).
   The tint is a background that sweeps left to right per line (background-size); the text is never masked. */
.hl { color: inherit; padding: 0 .12em; border-radius: .2em; background-color: transparent; background-image: linear-gradient(in srgb to right, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 30%, transparent));
  background-repeat: no-repeat; background-position: 0 .08em; background-size: 100% 1.54em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.js .hl { background-size: 0% 1.54em; transition: background-size .9s cubic-bezier(.3,.7,.2,1); }
.js .hl.in { background-size: 100% 1.54em; }
/* Key takeaways */
.takeaways { margin: 8px 0 32px; padding: 22px 24px 20px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); font-family: var(--sans); }
.takeaways .t-label { margin-bottom: 10px; }
.takeaways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.takeaways li { position: relative; padding-left: 22px; font-size: 16px; line-height: 1.5; }
.takeaways li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
/* Checklist: the takeaways card, a checkbox per line (same size, tokens only). Copy icon button at the top right, beside the first line; the list keeps clear of it. */
.checklist { position: relative; }
.checklist ul { padding-right: 40px; }
.checklist .copy-btn { top: 20px; }
.checklist .ck-group + .ck-group { margin-top: 12px; } /* 4px grid, design system */
.checklist li::before { top: calc(.75em - 7px); left: 2px; width: 14px; height: 14px; background: transparent; border: 1px solid var(--muted); border-radius: 4px; box-sizing: border-box; } /* 4px grid, design system */
/* Stagger reveal for table rows and list items */
.js [data-stagger] > * { opacity: 0; transform: translateY(7px); transition: opacity .45s ease, transform .45s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i, 0) * 70ms); }
.js [data-stagger].in > * { opacity: 1; transform: none; }
/* Typed key line */
.typed-line { margin: 8px 0 28px; font: 600 clamp(20px, 2.4vw, 26px)/1.35 var(--accent-font); letter-spacing: -0.015em; color: var(--ink); text-wrap: balance; }
.tw-c { visibility: hidden; }
.tw-c.on { visibility: visible; }
.tw-caret { display: inline-block; width: 2px; height: 1.05em; margin: 0 1px -0.15em; background: var(--accent); }
.tw-caret.end { animation: caret-blink .8s steps(1) 4; animation-fill-mode: forwards; }
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Reduced motion (system setting or ?motion=reduce preview): final state at once */
@media (prefers-reduced-motion: reduce) {
  .js .hl { background-size: 100% 1.54em; transition: none; }
  .js [data-stagger] > * { opacity: 1; transform: none; transition: none; }
}
[data-motion="reduce"] .hl { background-size: 100% 1.54em !important; transition: none !important; }
[data-motion="reduce"] [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
/* Post sample */
.post-sample .prose > .sec h2 { margin-top: 0; }
.sample-list { margin: 8px 0 24px; padding-left: 22px; display: grid; gap: 8px; font-family: var(--sans); font-size: 16px; }
.ds-panel .ds-sub { display: block; font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 8px 0 0; }
.item-layout > * { min-width: 0; }

/* ===== Batch 3: A/B compare, metrics strip, playable card grid ===== */
.ab { margin: 8px 0 32px; padding: 32px 28px 24px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); font-family: var(--sans); font-variant-numeric: tabular-nums; text-align: center; display: grid; justify-items: center; }
.ab-kicker { display: inline-flex; align-items: center; gap: 8px; font: 500 11.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ab-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.ab .ab-title { margin: 16px 0 0; max-width: 17em; font: 700 clamp(26px, 3.4vw, 38px)/1.2 var(--sans); letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.ab-chip { padding: .04em .3em; border-radius: 8px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font: 600 .78em/1 var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.ab-req { margin-top: 18px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: 500 12.5px/1.2 var(--mono); }
.ab-fork { display: block; width: 100%; height: 44px; overflow: visible; }
.ab-fork path { fill: none; stroke: color-mix(in srgb, var(--muted) 55%, transparent); stroke-width: 1.5; stroke-dasharray: 3 6; vector-effect: non-scaling-stroke; transition: stroke .3s; }
.ab-fork path.on { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 7 6; animation: ab-march .9s linear infinite; }
@keyframes ab-march { to { stroke-dashoffset: -13; } }
.ab-tabs { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ab-tab { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); cursor: pointer; transition: border-color .2s, box-shadow .2s, color .2s, background-color .2s; }
.ab-tab b { font: 600 15.5px/1.25 var(--sans); }
.ab-tab small { grid-column: 2; font: 400 12px/1.3 var(--mono); color: var(--muted); }
.ab-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.ab-tab:hover { border-color: var(--muted); color: var(--ink); }
.ab-tab[aria-selected="true"] { color: var(--ink); border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.ab-tab[aria-selected="true"] .ab-dot { background: var(--accent); }
.ab-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.ab-panels { width: 100%; margin-top: 18px; }
.ab-ptitle { display: block; margin: 18px 0 4px; font: 600 var(--fs-label)/1.3 var(--accent-font); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.ab .ab-verdict { margin: 0 0 18px; font: 400 15.5px/1.5 var(--sans); color: var(--muted); }
.ab-ms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; text-align: left; }
.ab-m { container-type: inline-size; display: grid; align-content: start; gap: 8px; min-width: 0; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }
.ab-mlabel { font: 500 11px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ab-num { display: flex; align-items: center; gap: 8px; }
.ab .ab-num .hm { font-size: 10.5px; padding: 3px 7px; }
.ab .ab-num .hm.miss { padding: 1.5px 5.5px; }
.ab-num b { font: 700 clamp(26px, 19cqi, 44px)/1 var(--sans); letter-spacing: -.04em; color: var(--ink); }
.ab .ab-note { margin: 0 0 4px; font: 400 13px/1.4 var(--sans); color: var(--muted); }
.ab-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; font: 500 12px/1.3 var(--sans); color: var(--muted); }
.ab-row em { font: 500 12px/1.3 var(--mono); font-style: normal; }
.ab-row > span:first-child { overflow-wrap: anywhere; }
.ab-row .seg, .ab-row .lenbar { grid-column: 1 / -1; }
.ab-row.on { color: var(--ink); }
.seg { display: flex; gap: 3px; }
.seg i { flex: 1; height: 8px; border-radius: 2px; background: var(--surface-2); }
.lenbar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); }
.lenbar i { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--muted) 55%, transparent); }
.seg i.on { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.ab-row.on .seg i.on, .ab-row.on .lenbar i { background: var(--accent); }
.ab-cap { font: 400 11px/1.3 var(--mono); color: var(--muted); }
.ab-foot { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.ab .btn.btn { padding: 11px 20px; font: 600 14.5px/1.2 var(--sans); text-decoration: none; }
.ab .btn.outline.btn { color: var(--ink); }
.ab-meta { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 500 12px/1.2 var(--mono); }
.btn.outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.outline:hover, .btn.outline.is-hover { filter: none; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--muted); }
@media (max-width: 760px) {
  .ab { padding: 24px 16px 18px; }
  .ab-ms { grid-template-columns: minmax(0, 1fr); }
  .ab-tab { padding: 12px; }
  .ab-meta { margin-left: 0; }
}
.js .ab-ptitle { display: none; }
.js .ab-panels { display: grid; }
.js .ab-panel { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s; }
.js .ab-panel.on { opacity: 1; visibility: visible; }
.js .ab-panel .ab-num b, .js .ab-panel .ab-verdict { display: inline-block; transform: translateY(6px); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.js .ab-panel .ab-verdict { display: block; }
.js .ab-panel.on .ab-num b, .js .ab-panel.on .ab-verdict { transform: none; }
.js .ab-panel .seg i, .js .ab-panel .lenbar i { transition: background-color .3s; }
.js .ab-panel .lenbar i { transform-origin: left; transform: scaleX(.4); transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.js .ab-panel.on .lenbar i { transform: none; }
.m-target { font: 400 12px/1.3 var(--mono); color: var(--muted); }

.mstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 8px 0 32px; border-top: var(--hairline); border-bottom: var(--hairline); font-family: var(--sans); font-variant-numeric: tabular-nums; }
.mstrip > div { display: grid; gap: 6px; align-content: start; padding: 18px 18px 18px 0; min-width: 0; }
.mstrip > div + div { padding-left: 18px; border-left: var(--hairline); }
.mstrip b { white-space: nowrap; font: 700 clamp(26px, 3vw, 34px)/1 var(--sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.mstrip span { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
@media (max-width: 600px) { .mstrip > div + div { border-left: 0; padding-left: 0; } .mstrip > div { border-top: var(--hairline); padding-right: 0; } .mstrip > div:first-child { border-top: 0; } }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 8px 0 32px; font-family: var(--sans); }
.pcard { position: relative; display: grid; grid-template-rows: auto 1fr; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; min-width: 0; transition: box-shadow .2s, border-color .2s; }
.pcard:focus-within { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.pcard.open { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); grid-template-rows: auto; box-shadow: 0 24px 50px -30px rgb(0 0 0 / .5); }
.pcard-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.pcard-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.pcard.open .pcard-thumb { display: none; }
.pcard-body { display: grid; gap: 6px; align-content: start; padding: 14px 16px 16px; }
.pcard-body .t-label { margin: 0; }
.pcard-body h4 { margin: 0; font-size: 16px; line-height: 1.3; }
.pcard-body p { margin: 0 !important; font: 400 13.5px/1.45 var(--sans) !important; color: var(--muted); }
.pcard-btn { justify-self: start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 13px/1.2 var(--sans); cursor: pointer; transition: background-color .2s, border-color .2s; }
.pcard-btn:hover { border-color: var(--ink); }
.pcard-btn::before { content: "▶"; font-size: 10px; color: var(--accent); }
.pcard-btn[aria-expanded="true"]::before { content: "■"; }
.pcard-btn .when-open, .pcard-btn[aria-expanded="true"] .when-closed { display: none; }
.pcard-btn[aria-expanded="true"] .when-open { display: inline; }
.pcard-more { padding: 16px; display: grid; gap: 10px; align-content: start; }
.pcard.open .pcard-more { padding: 16px 16px 16px 0; animation: pc-in .3s ease; }
.pcard-more img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.pcard-more figcaption { font: 400 12.5px/1.4 var(--mono); color: var(--muted); }
@keyframes pc-in { from { opacity: 0; transform: translateY(6px); } }
.term { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: 400 12.5px/1.7 var(--mono); list-style: none; overflow-x: auto; box-shadow: inset 0 0 0 1px var(--line); }
.term li { white-space: pre-wrap; overflow-wrap: anywhere; } .term .ok { color: var(--guide); } .term .dim { color: var(--muted); }
.term-thumb { height: 100%; padding: 14px; background: var(--surface-2); display: grid; gap: 7px; align-content: start; }
.term-thumb i { height: 7px; border-radius: 4px; background: var(--line); } .term-thumb i:nth-child(1) { width: 70%; background: color-mix(in srgb, var(--accent) 60%, var(--line)); } .term-thumb i:nth-child(2) { width: 52%; } .term-thumb i:nth-child(3) { width: 64%; } .term-thumb i:nth-child(4) { width: 38%; background: color-mix(in srgb, var(--guide) 55%, var(--line)); }
@media (max-width: 700px) { .pcard.open { grid-template-columns: minmax(0, 1fr); } .pcard.open .pcard-more { padding: 0 16px 16px; } }
@media (prefers-reduced-motion: reduce) { .js .ab-panel, .js .ab-panel *, .ab-tab, .ab-fork path { transition: none !important; } .ab-fork path.on { animation: none; } .pcard.open .pcard-more { animation: none; } }
[data-motion="reduce"] .ab-panel, [data-motion="reduce"] .ab-panel *, [data-motion="reduce"] .ab-tab, [data-motion="reduce"] .ab-fork path { transition: none !important; }
[data-motion="reduce"] .ab-fork path.on { animation: none !important; }
[data-motion="reduce"] .pcard.open .pcard-more { animation: none !important; }

.prose .divider { border: 0; border-top: var(--hairline); margin: calc(var(--section-gap) * .5) 0; }

.prose .dgm { min-width: 0; padding: 18px 16px 22px; }

/* 2D diagram draw-on: hidden only until JS plays it (never with reduced motion or without JS). */
.dgm-pre .nd, .dgm-pre .nd-group, .dgm-pre .wf-card, .dgm-pre .dgm-svg, .dgm-pre .dg-elabel { opacity: 0; }


/* ===== Phone diagram (2D flowchart below 480px). Arrows and rails are CSS, so it reads without JS. ===== */
.dgm-fig .mflow:not(.always) { display: none; }
@media (max-width: 480px) { .dgm-fig:has(.mflow) .dgm-frame, .dgm-fig:has(.mflow) .dg-legend2 { display: none; } .dgm-fig .mflow:not(.always) { display: grid; } }
.ds-phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 400px)); gap: 16px; }
.mflow { --t0: 0; --arrow: var(--muted); display: grid; align-content: start; font-family: var(--sans); padding: 2px 0 4px; }
.mflow + .mflow { margin-top: 30px; } /* two independent chains in one figure, spaced like the nodes inside a chain */
.mf-n { position: relative; min-width: 0; }
.mf-term { justify-self: center; max-width: 100%; padding: 9px 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); font-weight: 600; font-size: 14px; line-height: 1.25; text-align: center; }
.mf-step { --c: var(--muted); display: grid; gap: 2px; padding: 10px 12px 11px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: inset 3px 0 0 var(--c); }
.mf-step.tone-system { --c: var(--system); } .mf-step.tone-guide { --c: var(--guide); } .mf-step.tone-accent { --c: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.mf-role { font: 600 10px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: color-mix(in srgb, var(--c) 78%, var(--ink)); }
.mf-step b { font-size: 14px; line-height: 1.25; }
.mflow .mf-step p { margin: 0; font: 400 12.5px/1.4 var(--sans); color: var(--muted); }
.mf-dec { justify-self: center; max-width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 16px 9px 13px; border-radius: 12px; border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.mf-dec b { font-size: 13.5px; line-height: 1.25; }
.mf-dia { flex: none; width: 11px; height: 11px; transform: rotate(45deg); border: 1.5px solid var(--accent); background: var(--surface); }
/* Spine arrows: every node after another gets a line and a head above it */
.mflow :is(.mf-term, .mf-step, .mf-dec, .mf-br, .mf-loop, .mf-fork, .mf-tree):not(:first-child) { margin-top: 30px; }
.mflow :is(.mf-term, .mf-step, .mf-dec, .mf-br, .mf-loop, .mf-fork, .mf-tree):not(:first-child)::before { content: ""; position: absolute; left: 50%; top: -27px; height: 20px; border-left: 1.5px solid var(--arrow); }
.mflow :is(.mf-term, .mf-step, .mf-dec, .mf-br, .mf-loop, .mf-fork, .mf-tree):not(:first-child)::after { content: ""; position: absolute; left: calc(50% - 4px); top: -8px; border: 4.75px solid transparent; border-top: 6px solid var(--arrow); border-bottom: 0; }
/* Branches: segmented switcher, one boxed lane at a time (all stacked without JS) */
.mf-br { display: grid; gap: 12px; }
.mf-tabs { display: none; }
.js .mf-tabs { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.mf-tab { display: grid; gap: 2px; padding: 7px 4px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; text-align: center; transition: background-color .2s, color .2s, box-shadow .2s; }
.mf-tab b { font: 700 13px/1.15 var(--sans); }
.mf-tab small { font: 400 10.5px/1.2 var(--mono); }
.mf-tab:hover { color: var(--ink); }
.mf-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1.5px var(--accent); }
.mf-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mf-lane { --c: var(--system); position: relative; display: grid; padding: 12px 8px 16px; border-radius: 16px; border: 1.5px dashed color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 5%, transparent); }
.mf-lname { justify-self: start; font: 600 10.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: color-mix(in srgb, var(--c) 75%, var(--ink)); }
.js .mf-lane:not(.on) { display: none; }
.js .mf-lname { display: none; }
.js .mf-lane { padding-top: 0; }
.js .mf-lane > .mf-lname + * { margin-top: 26px; }
.js .mf-lane > .mf-lname + *::before { top: -26px; height: 19px; }
/* A lane frame only around 2+ nodes: a single node sits plain in the switcher. */
.mf-lane.solo { border: 0; background: none; padding: 0; }
/* Decision outcomes: stem, bar, one labelled column per outcome */
.mf-outs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); gap: 6px; margin-top: 30px; }
.mf-outs::before { content: ""; position: absolute; left: 50%; top: -30px; height: 16px; border-left: 1.5px solid var(--arrow); }
.mf-col { position: relative; display: flex; flex-direction: column; align-items: center; }
.mf-col::after { content: ""; position: absolute; top: -14px; left: -3px; right: -3px; border-top: 1.5px solid var(--arrow); }
.mf-col:first-child::after { left: 50%; } .mf-col:last-child::after { right: 50%; } .mf-col:only-child::after { display: none; }
.mf-lbl { padding: 2px 8px; border-radius: 6px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); font: 500 11px/1.3 var(--mono); color: var(--ink); text-align: center; }
.mf-lbl::before { content: ""; position: absolute; left: 50%; top: -14px; height: 13px; border-left: 1.5px solid var(--arrow); }
.mf-lbl.loop { color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mf-col > :is(.mf-step, .mf-term, .mf-fork) { align-self: stretch; margin-top: 26px !important; }
.mf-col > :is(.mf-step, .mf-term, .mf-fork, .mf-back)::before { top: -23px !important; height: 16px !important; }
.mf-col > .mf-step { padding: 8px 8px 9px 11px; }
.mf-col > .mf-step b { font-size: 12px; }
.mf-col .mf-role { font-size: 8.5px; letter-spacing: .02em; }
.mf-loop:not(:first-child)::before { left: calc(50% - 7px) !important; } .mf-loop:not(:first-child)::after { left: calc(50% - 11px) !important; }
.mf-col > .mf-term { padding: 8px 10px; font-size: 12.5px; }
.mf-back { justify-self: end; margin-top: 14px; padding: 3px 9px; border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); font: 500 11px/1.3 var(--mono); text-align: right; }
.mf-col > .mf-back { align-self: stretch; margin-top: 26px; text-align: center; }
/* Loop: a dashed accent bracket from the way-back note up to the step it returns to */
.mf-loop { position: relative; display: grid; padding-right: 14px; }
.mf-bracket { position: absolute; right: 0; top: 24px; bottom: 11px; width: 11px; border: 1.5px dashed var(--accent); border-left: 0; border-radius: 0 10px 10px 0; }
.mf-bracket::after { content: ""; position: absolute; left: -6px; top: -5.5px; border: 4.75px solid transparent; border-right: 6px solid var(--accent); border-left: 0; }
/* Draw-on: each step wipes in top-down with its arrow; branches in parallel; loop last. JS only, not with reduced motion. */
.mflow.mf-pre .mf-n { clip-path: inset(-40px -24px 100% -24px); }
.mflow.mf-play .mf-n { animation: mf-wipe .42s cubic-bezier(.3,.7,.3,1) both; animation-delay: calc((var(--t0) + var(--t)) * 170ms); }
@keyframes mf-wipe { from { clip-path: inset(-40px -24px 100% -24px); } to { clip-path: inset(-40px -24px -40px -24px); } }
.mf-col > .mf-step { padding: 7px 5px 8px 8px; }
.mf-col > .mf-n { min-width: min-content; }
/* Ending outcomes: the note gets an arrow in, nothing out. Continuing outcomes: a tail down into the join bar, then one arrow on. */
.mf-col > .mf-back::before { content: ""; position: absolute; left: 50%; border-left: 1.5px solid var(--arrow); }
.mf-col > .mf-back::after { content: ""; position: absolute; left: calc(50% - 4px); top: -8px; border: 4.75px solid transparent; border-top: 6px solid var(--arrow); border-bottom: 0; }
.mf-tail { flex: 1 0 16px; width: 0; border-left: 1.5px solid var(--arrow); }
.mf-join { height: 2px; margin-bottom: -2px; }
.mf-join i { position: absolute; top: 0; border-top: 1.5px solid var(--arrow); }
.mflow .mf-join + .mf-n:not(:first-child) { margin-top: 27px; }
/* Parallel fork/join: label, bar, tasks side by side with stems, bar */
.mf-fork { display: grid; justify-items: center; }
.mf-plabel { position: relative; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font: 500 11px/1.3 var(--mono); color: var(--muted); text-align: center; }
.mf-plabel::after { content: ""; position: absolute; left: 50%; top: 100%; height: 12px; border-left: 1.5px solid var(--arrow); }
.mf-plabel + .mf-fbar { margin-top: 12px; }
.mf-fbar { justify-self: stretch; display: block; height: 4px; border-radius: 2px; background: var(--ink); }
.mf-ftasks { justify-self: stretch; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(min-content, 1fr); gap: 6px; padding: 14px 0; }
.mf-task { position: relative; display: grid; }
.mf-task > .mf-n { min-width: min-content; }
.mf-task::before, .mf-task::after { content: ""; position: absolute; left: 50%; height: 14px; border-left: 1.5px solid var(--arrow); }
.mf-task::before { top: -14px; } .mf-task::after { bottom: -14px; }
.mf-task .mf-step { padding: 8px 8px 9px 11px; }
.mf-task .mf-step b { font-size: 12.5px; }
/* Card covers with a header keep the image's own ratio: no crop, no kicker (the type label under the image says it). */
.card .cover.has-hero, .feature .cover.has-hero, .tag-list .grid .card .cover.has-hero { aspect-ratio: 1920 / 820; min-height: 0; }

/* ===== Copy icon button, toast, checklist card, code block ===== */
.copy-btn { position: absolute; top: 12px; right: 12px; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; /* 4px grid, design system */ background: transparent; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.copy-btn svg { grid-area: 1 / 1; width: 16px; height: 16px; /* 4px grid, design system */ transition: opacity .15s, transform .15s; }
.copy-btn .i-check { opacity: 0; transform: scale(.6); }
.copy-btn:hover, .copy-btn.is-hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.copy-btn.is-copied { color: var(--accent); }
.copy-btn.is-copied .i-copy { opacity: 0; transform: scale(.6); }
.copy-btn.is-copied .i-check { opacity: 1; transform: none; }
.ck-card { position: relative; margin: 8px 0 24px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-family: var(--sans); } /* 4px grid, design system */
.ck-card .copy-btn { top: 16px; }
.ck-card h4 { margin: 0 0 12px; padding-right: 40px; font: 600 16px/24px var(--sans); letter-spacing: -.01em; }
.ck-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 16px; line-height: 1.5; }
.ck-card li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.ck-card li::before { content: ""; width: 16px; height: 16px; margin-top: 4px; box-sizing: border-box; border: 1px solid var(--muted); border-radius: 4px; }
.code-block { position: relative; margin: 0 0 24px; min-width: 0; } /* 4px grid, design system */
.code-block .copy-btn { top: 16px; }
.code-block pre, .prose .code-block pre { margin: 0; padding: 20px 56px 20px 20px; border-radius: 16px; background: var(--surface-2); color: var(--ink); font: 400 14px/1.6 var(--mono); overflow-x: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 14px/1.2 var(--sans); white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
.toast::before { content: "\2713" / ""; color: var(--accent); font-weight: 700; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity .2s, transform .2s; }
.ds-copy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
/* Design page state row: each state is a label over its sample; wraps on narrow screens */
.ds-states { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.ds-states > div { display: grid; gap: 12px; align-content: start; }
.ds-states + .ds-states { margin-top: 24px; }
.ds-states .toast.is-visible { position: static; transform: none; }
.ds-applied { display: grid; gap: 16px; margin-top: 16px; }
.ds-states .h { font: 500 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ds-states .cell { display: flex; align-items: center; min-height: 52px; }
.ds-states .copy-btn { position: static; }
@media (max-width: 600px) { .ds-panel-label + .ds-states { margin-top: 16px; } }
