/* Unicorn Bharat – public site styles */
:root {
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #eaecf8;
  --ink: #12163a;
  --ink-2: #3a4070;
  --muted: #5f678f;
  --line: #d8dcee;
  --brand: #1b2070;
  --brand-ink: #ffffff;
  --accent: #ff9a1f;
  --accent-ink: #1b1200;
  --link: #2226a6;
  --focus: #ff9a1f;
  --code-bg: #0e1428;
  --code-bar: #19213f;
  --code-ink: #dde4ff;
  --shadow: 0 1px 0 rgba(18, 22, 58, .04), 0 12px 28px -18px rgba(18, 22, 58, .35);
  --r-s: 6px; --r-m: 10px; --r-l: 20px;
  --f-ui: "Archivo", "Segoe UI", system-ui, -apple-system, "Noto Sans", sans-serif;
  --f-body: "Source Serif 4", "Iowan Old Style", Georgia, "Noto Serif", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 66px;
}
:root[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121a2e;
  --surface-2: #19233f;
  --ink: #eceffc;
  --ink-2: #c5cbe8;
  --muted: #95a1c9;
  --line: #26314f;
  --brand: #ffb43a;
  --brand-ink: #1b1200;
  --accent: #ffb43a;
  --link: #a8bcff;
  --code-bg: #080d1a;
  --code-bar: #121a31;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 14px 30px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--f-ui); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { top: 10px; }
.wrap { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.wrap-narrow { width: min(820px, calc(100% - 40px)); margin-inline: auto; }

/* ---------- buttons & chips ---------- */
.btn {
  font-family: var(--f-ui);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, color .15s, transform .15s;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink-2); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip small { font-weight: 500; opacity: .7; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: transparent; color: var(--ink); transition: background-color .15s;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.01em; font-stretch: 108%; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px;
  text-decoration-line: underline; text-decoration-color: transparent; text-decoration-thickness: 3px; text-underline-offset: 8px;
}
.nav a:hover { text-decoration-color: var(--accent); }
.nav a[aria-current="page"] { text-decoration-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 2px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); }
  .header-actions { margin-left: auto; }
}

/* ---------- hero ---------- */
.hero { padding: clamp(36px, 7vw, 88px) 0 clamp(28px, 5vw, 56px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 5.1rem); line-height: .98; letter-spacing: -.035em; font-weight: 850; font-stretch: 112%;
  margin: 0 0 22px; text-wrap: balance;
}
.hero p.lead { font-family: var(--f-body); font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-card { position: relative; display: block; text-decoration: none; color: inherit; }
.hero-card::before {
  content: ""; position: absolute; inset: 14px -14px -14px 14px; background: var(--accent); border-radius: 14px; z-index: 0;
}
.hero-card .frame { position: relative; z-index: 1; background: var(--surface); border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; transition: transform .2s; }
.hero-card:hover .frame { transform: translate(-3px, -3px); }
.hero-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-card .cap { padding: 14px 18px 16px; border-top: 2px solid var(--ink); }
.hero-card .cap b { display: block; font-size: 1.15rem; line-height: 1.25; font-weight: 750; letter-spacing: -.01em; }
.hero-card .cap span { color: var(--muted); font-size: 14px; }
.hero-card .tag { position: absolute; z-index: 2; right: 14px; top: 14px; background: var(--ink); color: var(--bg); padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-card { margin: 8px 14px 14px 0; } }
.topics { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }

/* ---------- sections ---------- */
.section { padding: clamp(30px, 5vw, 58px) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.025em; font-weight: 800; font-stretch: 106%; line-height: 1.08; }
.section-head p { margin: 4px 0 0; color: var(--muted); max-width: 46ch; }
.link-more { font-weight: 700; color: var(--ink); text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 5px; }

/* ---------- article cards ---------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 24px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card-cover { position: relative; display: block; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.card-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-cover img { transform: scale(1.03); }
.card-body { padding: 14px 2px 0; }
.card .kicker { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.card .kicker a { color: inherit; text-decoration: none; }
.card .kicker a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.card h3 { margin: 6px 0 8px; font-size: 1.28rem; line-height: 1.2; letter-spacing: -.015em; font-weight: 750; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole-card click */
.card p { margin: 0 0 10px; font-family: var(--f-body); font-size: 1rem; color: var(--ink-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { font-size: 13.5px; color: var(--muted); }
.card .bm { position: absolute; z-index: 3; top: 10px; right: 10px; background: color-mix(in srgb, var(--surface) 92%, transparent); border-radius: 999px; width: 38px; height: 38px; box-shadow: var(--shadow); }
.card .bm[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.card .bm[aria-pressed="true"] .icon { fill: currentColor; }
.card .kicker a, .card .bm { position: relative; z-index: 3; }
.card .bm { position: absolute; }
.badge-part { position: absolute; z-index: 2; left: 10px; bottom: 10px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }
.filters .grow { flex: 1; }
.inline-search { position: relative; min-width: 220px; }
.inline-search input { width: 100%; padding: 9px 14px 9px 38px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); }
.inline-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 17px; height: 17px; }
.more-wrap { text-align: center; margin-top: 34px; }
.empty { padding: 46px 20px; text-align: center; border: 2px dashed var(--line); border-radius: var(--r-l); color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: 6px; }

/* ---------- series cards ---------- */
.series-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
@media (max-width: 980px) { .series-grid { grid-template-columns: 1fr; } }
.series-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s;
}
.series-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.series-card .stack { display: flex; margin-bottom: 6px; padding-left: 0; }
.series-card .stack img { width: 92px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; border: 2px solid var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); margin-left: -22px; }
.series-card .stack img:first-child { margin-left: 0; }
.series-card h3 { margin: 0; font-size: 1.35rem; letter-spacing: -.02em; font-weight: 780; }
.series-card p { margin: 0; font-family: var(--f-body); color: var(--ink-2); font-size: 1rem; }
.series-card .parts { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: 14px; color: var(--muted); }

/* ---------- author strip ---------- */
.author-strip { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 26px; border-radius: var(--r-l); background: var(--surface); border: 1.5px solid var(--line); }
.author-strip img, .author-box img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); }
.author-strip h3, .author-box h3 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 780; }
.author-strip p, .author-box p { margin: 0 0 10px; font-family: var(--f-body); color: var(--ink-2); }
.social { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) { .author-strip { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { margin-top: 56px; background: #0d1233; color: #c9d0f0; padding: 46px 0 28px; }
:root[data-theme="dark"] .site-footer { background: #070c18; border-top: 1px solid var(--line); }
.site-footer a { color: #e9edff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }
.site-footer h4 { margin: 0 0 12px; font-size: 15px; color: #fff; font-weight: 750; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.site-footer p { margin: 0 0 12px; font-size: 15px; max-width: 38ch; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.footer-bottom { margin-top: 34px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: 14px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: #e9edff; font-size: inherit; text-align: left; }
.link-btn:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 4px; width: 0; background: var(--accent); z-index: 80; }
.crumbs { font-size: 14px; color: var(--muted); margin: 26px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.article-head h1 { font-size: clamp(2.1rem, 5vw, 3.7rem); line-height: 1.03; letter-spacing: -.03em; font-weight: 820; font-stretch: 108%; margin: 0 0 16px; text-wrap: balance; max-width: 20ch; }
.article-head .dek { font-family: var(--f-body); font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.45; color: var(--ink-2); max-width: 36em; margin: 0 0 22px; }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; font-size: 14.5px; color: var(--muted); }
.byline .who { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.byline .who img { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.byline .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 650; color: var(--ink); text-decoration: none; }
.share-btn:hover { border-color: var(--ink); }
.share-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.share-btn[aria-pressed="true"] .icon { fill: currentColor; }
.article-cover { margin: 28px 0 8px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 56px; align-items: start; margin-top: 26px; }
.article-layout.no-toc { grid-template-columns: minmax(0, 1fr); }
.article-layout.no-toc .toc { display: none; }
.toc { position: sticky; top: calc(var(--header-h) + 22px); font-size: 14.5px; max-height: calc(100vh - var(--header-h) - 44px); overflow: auto; padding-left: 16px; border-left: 3px solid var(--line); }
.toc h2 { margin: 0 0 10px; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.35; display: block; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.toc a.is-active { font-weight: 700; }
.toc li.l3 { padding-left: 12px; font-size: 13.5px; }
@media (max-width: 1040px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.prose { font-family: var(--f-body); font-size: clamp(1.07rem, 1.4vw, 1.19rem); line-height: 1.75; color: var(--ink); max-width: 700px; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 1.15em 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--f-ui); letter-spacing: -.02em; line-height: 1.15; scroll-margin-top: calc(var(--header-h) + 16px); position: relative; }
.prose h2 { font-size: 1.85rem; font-weight: 800; font-stretch: 104%; margin: 2.3em 0 .6em; }
.prose h3 { font-size: 1.35rem; font-weight: 750; margin: 1.9em 0 .5em; }
.prose h4 { font-size: 1.1rem; font-weight: 750; margin: 1.6em 0 .4em; }
.prose .anchor { margin-left: .45em; color: var(--muted); text-decoration: none; font-weight: 600; opacity: 0; font-size: .8em; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose a { text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 80%, transparent); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 1.1em 0; }
.prose li { margin: .45em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.2em; border-left: 4px solid var(--accent); color: var(--ink-2); font-style: italic; }
.prose hr { border: 0; border-top: 2px solid var(--line); margin: 2.6em 0; }
.prose img { border-radius: 10px; margin: 1.6em auto; border: 1px solid var(--line); }
.prose code:not(pre code) { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); padding: .14em .4em; border-radius: 5px; border: 1px solid var(--line); word-break: break-word; }
.prose strong { font-weight: 700; }
.prose .table-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--f-ui); font-size: .93rem; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 750; }
.prose tr:last-child td { border-bottom: 0; }

.codeblock { margin: 1.7em 0; border-radius: 10px; overflow: hidden; background: var(--code-bg); border: 1px solid #1f2a4d; font-family: var(--f-mono); }
.codeblock-bar { display: flex; justify-content: space-between; align-items: center; padding: 7px 8px 7px 16px; background: var(--code-bar); color: #9fb0e8; font-size: 12.5px; font-family: var(--f-ui); font-weight: 650; }
.codeblock-copy { background: transparent; border: 1px solid #34426f; color: #cfd8ff; padding: 3px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.codeblock-copy:hover { background: #26325d; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: .86rem; line-height: 1.65; tab-size: 4; }
.codeblock code { font-family: var(--f-mono); color: var(--code-ink); background: none; border: 0; padding: 0; font-size: inherit; }
.hljs-comment, .hljs-quote { color: #7080b2; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag { color: #ffb43a; }
.hljs-string, .hljs-regexp, .hljs-addition { color: #86e3b5; }
.hljs-number, .hljs-symbol, .hljs-bullet { color: #ff9fae; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #8fb6ff; }
.hljs-title.class_, .hljs-type, .hljs-built_in, .hljs-class .hljs-title { color: #c9adff; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-params { color: #9fd8ff; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #ffd27f; }
.hljs-name, .hljs-tag { color: #ff9fae; }
.hljs-deletion { color: #ff8a8a; }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }

.series-box { margin: 28px 0 0; padding: 18px 20px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); max-width: 700px; }
.series-box h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 780; }
.series-box .sub { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.series-box ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.series-box li a { display: flex; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.series-box li a:hover { background: var(--surface-2); }
.series-box li a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.series-box li .n { min-width: 1.4em; color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 44px 0 0; max-width: 700px; }
.pager a { display: block; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--ink); }
.pager small { display: block; color: var(--muted); font-weight: 650; font-size: 13px; margin-bottom: 4px; }
.pager b { font-size: 1.02rem; line-height: 1.25; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }
.author-box { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 46px; padding: 22px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); max-width: 700px; }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }

/* ---------- comments ---------- */
.comments { max-width: 700px; margin-top: 56px; }
.comments h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
.comment { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.comment .av { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 800; }
.comment .who { font-weight: 750; } .comment time { color: var(--muted); font-size: 13.5px; margin-left: 8px; }
.comment p { margin: 4px 0 0; font-family: var(--f-body); font-size: 1.03rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment .reply { margin-top: 12px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 10px 10px 0; }
.comment .reply b { font-size: 14px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; font-size: 14.5px; }
.form input, .form textarea, .form select { padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 450; width: 100%; }
.form input:focus, .form textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--ink); }
.form textarea { min-height: 120px; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form .hint { font-size: 13.5px; color: var(--muted); font-weight: 450; }
.notice { padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: 15px; border: 1.5px solid; }
.notice.ok { background: color-mix(in srgb, #1fa971 14%, var(--surface)); border-color: #1fa971; }
.notice.err { background: color-mix(in srgb, #e5484d 12%, var(--surface)); border-color: #e5484d; }
.comment-form-wrap { margin-top: 30px; padding: 22px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.comment-form-wrap h3 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 780; }

/* ---------- related + generic page ---------- */
.related { margin-top: 64px; }
.page-head { padding: clamp(30px, 6vw, 64px) 0 10px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -.03em; font-weight: 830; font-stretch: 108%; line-height: 1.03; }
.page-head p { margin: 0; font-family: var(--f-body); color: var(--ink-2); font-size: 1.2rem; max-width: 40em; }
.page-body { padding: 18px 0 30px; }
.page-body .prose { max-width: 760px; }
.page-body .updated { color: var(--muted); font-size: 14px; margin-top: 30px; }

/* ---------- search overlay ---------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 30, .55); backdrop-filter: blur(3px); display: none; align-items: start; justify-content: center; padding: 9vh 16px 16px; }
.overlay.is-open { display: flex; }
.search-box { width: min(680px, 100%); background: var(--surface); border-radius: 16px; border: 2px solid var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; }
.search-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search-top input { flex: 1; border: 0; background: transparent; font-size: 18px; outline: none; font-weight: 550; }
.search-top kbd { font-family: var(--f-ui); font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--muted); }
.search-results { max-height: 60vh; overflow: auto; padding: 8px; }
.search-results a { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface-2); }
.search-results img { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.search-results b { display: block; line-height: 1.25; }
.search-results span { color: var(--muted); font-size: 13.5px; }
.search-note { padding: 22px; color: var(--muted); text-align: center; }

/* ---------- support widget ---------- */
.support-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand); color: var(--brand-ink); border: 3px solid var(--bg); box-shadow: 0 10px 28px -6px rgba(10, 14, 50, .55);
  display: grid; place-items: center; transition: transform .15s, background-color .15s;
}
.support-fab:hover { transform: scale(1.06); background: var(--accent); color: var(--accent-ink); }
.support-fab .icon { width: 26px; height: 26px; }
.support-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 71; width: min(380px, calc(100vw - 24px)); height: min(560px, calc(100vh - 120px));
  background: var(--surface); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55);
  display: none; flex-direction: column; overflow: hidden;
}
.support-panel.is-open { display: flex; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.support-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--brand); color: var(--brand-ink); }
.support-head b { font-size: 16px; } .support-head small { display: block; opacity: .85; font-size: 12.5px; }
.support-head .icon-btn { margin-left: auto; color: inherit; width: 34px; height: 34px; }
.support-head .icon-btn:hover { background: rgba(255, 255, 255, .18); }
.support-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bot { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--ink); color: var(--bg); border-bottom-right-radius: 4px; align-self: flex-end; }
.msg a { color: var(--link); font-weight: 650; }
.msg.me a { color: inherit; }
.msg.typing { display: inline-flex; gap: 4px; align-items: center; }
.msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .15s; } .msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; background: var(--bg); }
.quick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 13.5px; font-weight: 600; }
.quick button:hover { border-color: var(--ink); }
.support-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: var(--surface); }
.support-form input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 14px; background: var(--bg); }
.support-form button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; }
.support-form button:hover { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px) { .support-panel { right: 8px; bottom: 84px; width: calc(100vw - 16px); height: min(70vh, 560px); } .support-fab { right: 14px; bottom: 14px; } }

/* ---------- cookie banner & toast ---------- */
.consent {
  position: fixed; left: 20px; bottom: 20px; z-index: 75; width: min(430px, calc(100vw - 110px)); padding: 16px 18px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); display: none;
}
.consent.is-open { display: block; }
.consent p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; }
.consent .row { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) { .consent { left: 10px; right: 78px; width: auto; bottom: 10px; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 650; z-index: 95; font-size: 14.5px; }

/* ---------- skeleton / misc ---------- */
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: sh 1.3s infinite; border-radius: 8px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.notfound { text-align: center; padding: 90px 0 40px; }
.notfound h1 { font-size: clamp(4rem, 14vw, 9rem); margin: 0; line-height: .9; font-weight: 900; font-stretch: 120%; letter-spacing: -.05em; }
.notfound p { font-family: var(--f-body); font-size: 1.2rem; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { .site-header, .site-footer, .support-fab, .support-panel, .consent, .toc, .comments, .progress { display: none !important; } }

/* ---- home band ---- */
.band { margin: 36px 0 8px; padding: 34px 0; background: var(--surface); border-block: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat { padding: 16px 18px; border-radius: 14px; background: var(--surface-2); }
.stat b { display: block; font: 800 clamp(26px, 4vw, 38px)/1.1 var(--f-ui); color: var(--brand); letter-spacing: -.02em; }
:root[data-theme="dark"] .stat b { color: var(--accent); }
.stat span { font: 600 13.5px var(--f-ui); color: var(--muted); }
.why { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.why-n { font: 800 13px var(--f-mono, monospace); color: var(--accent); letter-spacing: .08em; }
.why-item h3 { margin: 6px 0 6px; font: 750 18px/1.25 var(--f-ui); }
.why-item p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
@media (max-width: 860px) { .stats, .why { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .why { grid-template-columns: 1fr; } }
