/* ==========================================================================
   prasannamalode.in — shared design system
   Warm editorial palette, Lora + DM Sans, dark mode via [data-theme] or system.
   ========================================================================== */

:root {
  --bg: #faf8f4;
  --bg-2: #f3efe8;
  --surface: #ffffff;
  --surface-2: #f7f4ee;
  --ink: #1a1814;
  --ink-2: #2a2620;
  --muted: #6f695e;
  --muted-2: #9a9388;
  --border: #e8e2d9;
  --border-2: #d9d2c7;
  --accent: #1a5276;
  --accent-2: #154360;
  --accent-light: #d6eaf8;
  --accent-tint: #eaf2fb;
  --on-accent: #ffffff;
  --ok: #1e7f4f;
  --ok-bg: #dff5ea;
  --warn: #a35a00;
  --warn-bg: #fff1dc;
  --bad: #b3261e;
  --bad-bg: #fde7e5;
  --code-bg: #1e2433;
  --code-fg: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(26, 24, 20, .06), 0 1px 6px rgba(26, 24, 20, .04);
  --shadow-md: 0 6px 24px rgba(26, 24, 20, .09), 0 2px 6px rgba(26, 24, 20, .05);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 960px;
  --max-read: 700px;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14151a;
    --bg-2: #1a1c22;
    --surface: #1e2028;
    --surface-2: #242730;
    --ink: #ecebe6;
    --ink-2: #d9d7d0;
    --muted: #a09b91;
    --muted-2: #7c776e;
    --border: #2c2f39;
    --border-2: #3a3e4a;
    --accent: #7db8e8;
    --accent-2: #9ccbf2;
    --accent-light: #1d3a52;
    --accent-tint: #1b2b3b;
    --on-accent: #0f1117;
    --ok: #6fd39c;
    --ok-bg: #18342a;
    --warn: #f0b35a;
    --warn-bg: #3b2c14;
    --bad: #f28b82;
    --bad-bg: #3d1f1d;
    --code-bg: #0f1117;
    --code-fg: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14151a;
  --bg-2: #1a1c22;
  --surface: #1e2028;
  --surface-2: #242730;
  --ink: #ecebe6;
  --ink-2: #d9d7d0;
  --muted: #a09b91;
  --muted-2: #7c776e;
  --border: #2c2f39;
  --border-2: #3a3e4a;
  --accent: #7db8e8;
  --accent-2: #9ccbf2;
  --accent-light: #1d3a52;
  --accent-tint: #1b2b3b;
  --on-accent: #0f1117;
  --ok: #6fd39c;
  --ok-bg: #18342a;
  --warn: #f0b35a;
  --warn-bg: #3b2c14;
  --bad: #f28b82;
  --bad-bg: #3d1f1d;
  --code-bg: #0f1117;
  --code-fg: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-light); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 1000; transition: top .15s; }
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap-read { max-width: var(--max-read); margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.eyebrow { font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head .eyebrow { margin: 0; }
.section-head a { font-size: .86rem; font-weight: 500; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.08rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--serif); font-size: .95rem; font-weight: 700; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; }
.nav-links a { display: inline-block; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: .9rem; font-weight: 500; text-decoration: none; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"], .nav-links a.active { color: var(--accent); background: var(--accent-tint); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; transition: all .15s; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); border-color: var(--border); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.menu-btn { display: none; }
@media (max-width: 720px) {
  .menu-btn { display: grid; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 62px; flex-direction: column; align-items: stretch; padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-size: .92rem; font-weight: 500; text-decoration: none; border: 1px solid transparent; transition: all .18s; white-space: nowrap; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--on-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--muted); padding: 9px 12px; }
.btn-ghost:hover { color: var(--accent); background: var(--accent-tint); }
.btn-sm { padding: 7px 12px; font-size: .82rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Tags / pills ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-tint); color: var(--accent); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; line-height: 1.4; }
.pill { display: inline-block; background: var(--surface); color: var(--ink-2); font-size: .8rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); }
.pill-accent { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-light); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: border-color .18s, transform .18s, box-shadow .18s; position: relative; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; line-height: 1.35; margin: 10px 0 8px; color: var(--ink); }
.card p { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: .78rem; color: var(--muted-2); }
.card-meta .dot::before { content: "·"; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Feature card (tools) */
.tool-card { display: flex; gap: 16px; align-items: flex-start; }
.tool-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-tint); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.tool-card h3 { margin-top: 0; font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.tool-card .cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .84rem; font-weight: 600; color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; letter-spacing: -.015em; font-weight: 700; margin-bottom: 14px; }
.hero .role { color: var(--accent); font-weight: 600; font-size: 1.02rem; margin-bottom: 14px; }
.hero .lede { color: var(--muted); font-size: 1.05rem; max-width: 560px; margin-bottom: 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.portrait { width: 176px; height: 176px; border-radius: 50%; overflow: hidden; border: 4px solid var(--surface); box-shadow: var(--shadow-md); background: var(--surface-2); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 720px) {
  .hero { padding: 44px 0 28px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { width: 132px; height: 132px; order: -1; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 20px 14px; text-align: center; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat-value { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1.1; }
.stat-label { font-size: .74rem; color: var(--muted); margin-top: 4px; letter-spacing: .02em; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(3, 1fr); } .stat { border-bottom: 1px solid var(--border); } .stat:nth-child(3n) { border-right: 0; } .stat:nth-child(4), .stat:nth-child(5) { border-bottom: 0; } }
@media (max-width: 460px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat:nth-child(3n) { border-right: 1px solid var(--border); } .stat:nth-child(2n) { border-right: 0; } .stat:nth-child(4) { border-bottom: 1px solid var(--border); } .stat:nth-child(5) { grid-column: span 2; } }

/* ---------- Series banner ---------- */
.series-banner { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: linear-gradient(135deg, #1a5276 0%, #123a55 100%); color: #fff; border-radius: var(--radius); padding: 28px 30px; }
.series-banner .eyebrow { color: rgba(255,255,255,.75); margin-bottom: 8px; }
.series-banner h3 { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.25; margin-bottom: 8px; }
.series-banner p { color: rgba(255,255,255,.85); font-size: .95rem; max-width: 560px; }
.series-banner .btn { background: #fff; color: #1a5276; border-color: #fff; }
.series-banner .btn:hover { background: #f1f5f9; color: #123a55; }
@media (max-width: 720px) { .series-banner { grid-template-columns: 1fr; } }

/* ---------- Article list (articles page) ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 18px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; height: 42px; }
.search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; background: none; border: 0; outline: 0; height: 100%; font-size: .95rem; color: var(--ink); }
.search input::placeholder { color: var(--muted-2); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .8rem; font-weight: 500; transition: all .15s; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.list { display: flex; flex-direction: column; gap: 12px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; color: inherit; text-decoration: none; transition: border-color .18s, box-shadow .18s; }
.row:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-sm); }
.row h3 { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1.35; margin: 8px 0 6px; }
.row p { color: var(--muted); font-size: .9rem; }
.row-meta { font-size: .78rem; color: var(--muted-2); text-align: right; white-space: nowrap; line-height: 1.7; }
.row-series { font-size: .74rem; color: var(--accent); font-weight: 600; margin-left: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
@media (max-width: 600px) { .row { grid-template-columns: 1fr; gap: 8px; } .row-meta { text-align: left; } }

/* ---------- Article page ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 200; transition: width .1s linear; }
.article-head { padding: 56px 0 28px; }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4.2vw, 2.6rem); line-height: 1.18; letter-spacing: -.01em; font-weight: 700; margin: 16px 0 14px; }
.article-head .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .86rem; color: var(--muted); align-items: center; }
.article-head .meta .avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: top; }
.article-head .lede { font-size: 1.1rem; color: var(--muted); line-height: 1.6; margin-top: 18px; font-family: var(--serif); font-style: italic; }
.article-layout { display: grid; grid-template-columns: minmax(0, var(--max-read)) 220px; gap: 56px; justify-content: center; }
@media (max-width: 1020px) { .article-layout { grid-template-columns: minmax(0, var(--max-read)); } .toc-side { display: none; } }
.toc-side { position: sticky; top: 90px; align-self: start; font-size: .84rem; }
.toc-side .eyebrow { margin-bottom: 10px; }
.toc-side ol { list-style: none; border-left: 1px solid var(--border); }
.toc-side a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.45; }
.toc-side a:hover { color: var(--ink); text-decoration: none; }
.toc-side a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-inline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 32px; }
.toc-inline .eyebrow { margin-bottom: 8px; }
.toc-inline ol { padding-left: 20px; font-size: .9rem; }
.toc-inline li { margin: 4px 0; }
@media (min-width: 1021px) { .toc-inline { display: none; } }

.prose { font-size: 1.06rem; line-height: 1.8; color: var(--ink-2); }
.prose > * + * { margin-top: 1.2em; }
.prose p:first-of-type::first-letter { font-family: var(--serif); font-weight: 700; }
.prose h2 { font-family: var(--serif); font-size: 1.55rem; line-height: 1.25; color: var(--ink); margin-top: 2.2em; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.15rem; font-weight: 600; color: var(--ink); margin-top: 1.8em; scroll-margin-top: 90px; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose a { text-decoration: underline; text-decoration-color: var(--accent-light); text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .45em 0; }
.prose li::marker { color: var(--accent); }
.prose blockquote { border-left: 3px solid var(--accent); padding: 14px 22px; margin: 1.6em 0; background: var(--accent-tint); border-radius: 0 10px 10px 0; font-family: var(--serif); font-style: italic; font-size: 1.08rem; color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.4em 0; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.prose pre { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm); padding: 16px 20px; overflow-x: auto; font-size: .86rem; line-height: 1.65; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--accent); font-weight: 600; background: var(--accent-tint); }
.prose img { border-radius: var(--radius-sm); }
.prose .callout { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 14px 20px; font-size: .96rem; }

.series-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 32px; }
.series-box .eyebrow { margin-bottom: 8px; }
.series-box strong { display: block; font-family: var(--serif); font-size: 1.05rem; margin-bottom: 8px; }
.series-box ol { list-style: none; counter-reset: part; display: grid; gap: 4px; }
.series-box li { counter-increment: part; font-size: .88rem; display: flex; gap: 10px; align-items: baseline; }
.series-box li::before { content: counter(part, decimal-leading-zero); font-family: var(--mono); font-size: .72rem; color: var(--muted-2); min-width: 20px; }
.series-box li.current a { color: var(--ink); font-weight: 600; }
.series-box li.current::after { content: "you are here"; font-size: .7rem; color: var(--muted-2); margin-left: auto; white-space: nowrap; }

.article-foot { margin-top: 56px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share .label { font-size: .84rem; color: var(--muted); margin-right: 6px; }
.author-card { display: flex; gap: 18px; align-items: center; padding: 26px 0; }
.author-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: top; flex-shrink: 0; }
.author-card .name { font-weight: 600; font-size: 1rem; }
.author-card .role { color: var(--muted); font-size: .88rem; }
.author-card p { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.pager a { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; color: inherit; text-decoration: none; transition: border-color .18s; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .dir { font-size: .74rem; color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.pager .title { font-family: var(--serif); font-size: .98rem; font-weight: 600; margin-top: 6px; line-height: 1.35; }
.pager .next { text-align: right; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager .next { text-align: left; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 200px 1fr; gap: 44px; align-items: start; }
@media (max-width: 720px) { .about-grid { grid-template-columns: 1fr; gap: 24px; } }
.about-grid .portrait { width: 200px; height: 200px; border-radius: 20px; }
@media (max-width: 720px) { .about-grid .portrait { width: 140px; height: 140px; } }
.about h2 { font-family: var(--serif); font-size: 2rem; font-weight: 700; margin-bottom: 6px; }
.about .role { color: var(--muted); font-size: 1rem; margin-bottom: 18px; }
.about p { color: var(--ink-2); margin-bottom: 14px; font-size: 1rem; }
.quote-block { border-left: 3px solid var(--accent); padding: 8px 18px; margin: 20px 0; font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.timeline { list-style: none; border-left: 2px solid var(--border); margin: 12px 0 0 6px; }
.timeline li { position: relative; padding: 0 0 22px 24px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline .when { font-size: .76rem; color: var(--muted-2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.timeline .what { font-weight: 600; margin-top: 2px; }
.timeline .where { color: var(--muted); font-size: .92rem; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { .principles { grid-template-columns: 1fr; } }
.principle { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.principle .num { font-family: var(--mono); font-size: .74rem; color: var(--accent); }
.principle h4 { font-family: var(--serif); font-size: 1.05rem; margin: 6px 0 6px; }
.principle p { color: var(--muted); font-size: .88rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 34px 0 40px; font-size: .84rem; color: var(--muted); }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
.footer .brand { font-size: 1rem; }

/* ---------- Tool pages ---------- */
.tool-head { padding: 48px 0 24px; }
.tool-head h1 { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.2; margin: 12px 0 10px; }
.tool-head p { color: var(--muted); font-size: 1.02rem; max-width: 640px; }
.tool-head .note { margin-top: 12px; font-size: .84rem; color: var(--muted-2); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-family: var(--serif); font-size: 1.25rem; margin-bottom: 6px; }
.panel h3 { font-size: 1rem; font-weight: 600; margin: 18px 0 8px; }
.panel .hint { color: var(--muted); font-size: .88rem; margin-bottom: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }
.sticky-col { position: sticky; top: 84px; }
@media (max-width: 820px) { .sticky-col { position: static; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .84rem; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: .78rem; color: var(--muted-2); }
.input, .select, .textarea { width: 100%; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; font-size: .94rem; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.textarea.mono { font-family: var(--mono); font-size: .82rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.range { width: 100%; accent-color: var(--accent); }
.q { padding: 14px 0; border-bottom: 1px solid var(--border); }
.q:last-child { border-bottom: 0; }
.q-text { font-size: .95rem; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.q-sub { font-size: .82rem; color: var(--muted); margin-top: -6px; margin-bottom: 10px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { padding: 7px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); font-size: .82rem; color: var(--muted); transition: all .15s; }
.choice:hover { border-color: var(--accent); color: var(--accent); }
.choice.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.metric .k { font-size: .74rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.metric .v { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--accent); line-height: 1.15; margin-top: 4px; }
.metric .s { font-size: .78rem; color: var(--muted-2); margin-top: 2px; }
.metric.ok .v { color: var(--ok); } .metric.warn .v { color: var(--warn); } .metric.bad .v { color: var(--bad); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); } .badge-bad { background: var(--bad-bg); color: var(--bad); } .badge-muted { background: var(--surface-2); color: var(--muted); }
.bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.bar.ok > span { background: var(--ok); } .bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.score-row { display: grid; grid-template-columns: 170px 1fr 56px; gap: 12px; align-items: center; padding: 8px 0; font-size: .9rem; }
.score-row .n { text-align: right; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .score-row { grid-template-columns: 1fr 48px; } .score-row .lbl { grid-column: 1 / -1; } }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data th { color: var(--muted); font-weight: 600; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; }
table.data td.num { font-family: var(--mono); font-size: .82rem; }
.reco { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.reco:last-child { border-bottom: 0; }
.reco .pri { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--on-accent); background: var(--accent); }
.reco .pri.p1 { background: var(--bad); } .reco .pri.p2 { background: var(--warn); } .reco .pri.p3 { background: var(--ok); }
.reco strong { display: block; color: var(--ink); }
.reco span { color: var(--muted); font-size: .86rem; }
.gauge { display: grid; place-items: center; }
.gauge svg { width: 220px; height: 130px; overflow: visible; }
.output { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm); padding: 18px 20px; font-family: var(--mono); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 520px; overflow: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: .88rem; opacity: 0; pointer-events: none; transition: all .25s; z-index: 300; box-shadow: var(--shadow-md); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.shift-grid { display: grid; grid-template-columns: 150px repeat(24, 1fr); gap: 2px; font-size: .7rem; }
.shift-grid .hdr { color: var(--muted-2); text-align: center; font-family: var(--mono); }
.shift-grid .lbl { font-size: .8rem; font-weight: 500; padding-right: 8px; display: flex; align-items: center; }
.shift-grid .cell { height: 26px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); }
.shift-grid .cell.on { background: var(--accent); border-color: var(--accent); }
.shift-grid .cell.on.night { background: var(--accent-2); }
.shift-grid .cov { height: 14px; border-radius: 3px; }
.shift-grid .cov.c0 { background: var(--bad); } .shift-grid .cov.c1 { background: var(--ok); } .shift-grid .cov.c2 { background: var(--warn); }
@media (max-width: 720px) { .shift-grid { grid-template-columns: 90px repeat(24, 1fr); } .shift-grid .lbl { font-size: .7rem; } }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease both; }
.fade-up.d1 { animation-delay: .06s; } .fade-up.d2 { animation-delay: .12s; } .fade-up.d3 { animation-delay: .18s; }

/* ---------- Print ---------- */
@media print {
  .nav, .footer, .progress, .toc-side, .share, .pager, .actions, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { font-size: 11pt; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Home redesign ---------- */
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.hero-eyebrow .name { color: var(--ink); }
.hero-eyebrow .sep { color: var(--accent); font-weight: 700; }
.proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.proof .pill { font-size: .78rem; padding: 6px 12px; }
.proof .pill b { color: var(--accent); font-weight: 700; margin-right: 4px; }
.featured { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 800px) { .featured { grid-template-columns: 1fr; } }
.featured-main { display: flex; flex-direction: column; justify-content: flex-start; gap: 24px; padding: 28px 30px; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: inherit; text-decoration: none; position: relative; overflow: hidden; transition: border-color .18s, transform .18s, box-shadow .18s; }
.featured-main::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 100% 0%, var(--accent-tint) 0%, transparent 55%); pointer-events: none; }
.featured-main:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.featured-main > * { position: relative; }
.featured-main .kicker { display: flex; align-items: center; gap: 10px; }
.featured-main .kicker .new { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ok); }
.featured-main h3 { font-family: var(--serif); font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.2; font-weight: 700; margin: 0 0 12px; color: var(--ink); }
.featured-main p { color: var(--muted); font-size: 1.02rem; max-width: 48ch; }
.featured-main .read-on { color: var(--accent); font-weight: 600; }
.featured-main .featured-body { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.featured-main .card-meta { margin-top: 18px; }
.featured-side { display: grid; gap: 16px; }
.featured-side .card { display: flex; flex-direction: column; justify-content: center; padding: 18px 20px; }
.featured-side .card h3 { font-size: 1rem; margin-bottom: 6px; }
.featured-side .card p { font-size: .86rem; }
.featured-side .card .card-meta { margin-top: 10px; }
.featured-side .card .eyebrow { margin-bottom: 8px; font-size: .68rem; }
.stats-caption { font-size: .82rem; color: var(--muted-2); margin-top: 10px; text-align: center; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: .86rem; font-weight: 500; text-decoration: none; transition: all .15s; }
.topic:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.topic .n { font-family: var(--mono); font-size: .7rem; color: var(--muted-2); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.cta-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 32px; }
.cta-band h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.cta-band p { color: var(--muted); max-width: 52ch; }
.cta-band .actions { margin: 0; }
@media (max-width: 720px) { .cta-band { grid-template-columns: 1fr; padding: 24px; } }
