/* =====================================================================
   Abhishekar Raju — Blog reader (v2) · Light editorial theme + dark mode
   ===================================================================== */
:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f4f1ea;
  --ink: #1b1a18;
  --ink-2: #3d3a35;
  --muted: #6f6a61;
  --line: #e7e2d8;
  --line-2: #d9d2c4;
  --accent: #c8372d;
  --accent-ink: #a52a21;
  --accent-soft: #fbeae7;
  --code-bg: #f6f4ef;
  --code-ink: #24292f;
  --shadow: 0 1px 2px rgba(27,26,24,.04), 0 8px 24px -12px rgba(27,26,24,.12);
  --shadow-lg: 0 2px 4px rgba(27,26,24,.04), 0 24px 48px -24px rgba(27,26,24,.22);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  --measure: 700px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #121110;
  --surface: #1a1917;
  --surface-2: #23211e;
  --ink: #ece8e1;
  --ink-2: #cfc9bf;
  --muted: #9a9389;
  --line: #2e2b27;
  --line-2: #3a3631;
  --accent: #f0675b;
  --accent-ink: #ff8a80;
  --accent-soft: #3a1f1c;
  --code-bg: #1e1d1b;
  --code-ink: #e6e1d9;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 48px -24px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body.rd {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
:where(.rd) a { color: inherit; }
.rd img { max-width: 100%; height: auto; }
.rd ::selection { background: var(--accent-soft); color: var(--ink); }
.rd :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top bar ---------- */
.rd-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.rd-top.scrolled { border-bottom-color: var(--line); }
.rd-top .wrap { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 48px; height: 48px; flex: none; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 10px -4px rgba(0,0,0,.35); }
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-name em { font-style: italic; color: var(--accent); font-weight: 500; }
.rd-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.rd-nav a, .icon-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2); text-decoration: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); transition: background .15s, color .15s;
}
.rd-nav a:hover, .icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn { width: 38px; padding: 0; justify-content: center; }
.icon-btn svg { width: 18px; height: 18px; }
.rd-nav .nav-cta { background: var(--ink); color: var(--paper); }
.rd-nav .nav-cta:hover { background: var(--accent); color: #fff; }
.theme-ico-dark { display: none; }
:root[data-theme="dark"] .theme-ico-dark { display: block; }
:root[data-theme="dark"] .theme-ico-light { display: none; }
@media (max-width: 760px) {
  .rd-nav .hide-sm { display: none; }
  .brand-name { font-size: 18px; }
  .rd-top .wrap { gap: 8px; }
}

/* ---------- Buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; font: 600 14.5px/1 var(--sans); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: all .18s ease;
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-dark:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font: 500 13.5px/1 var(--sans); cursor: pointer; white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .n { font-size: 11.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tag { display: inline-flex; font: 600 11.5px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); text-decoration: none; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.meta .dot::before { content: "·"; margin-right: 14px; color: var(--line-2); }

/* ---------- Listing: masthead ---------- */
.masthead { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.masthead h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 6.2vw, 76px); line-height: 1.02; letter-spacing: -.025em; margin: 14px 0 16px; }
.masthead h1 em { color: var(--accent); font-style: italic; }
.masthead p { font-family: var(--serif); font-size: clamp(18px, 2vw, 21px); color: var(--ink-2); max-width: 640px; margin: 0; line-height: 1.5; }
.mast-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.mast-stats div { display: flex; flex-direction: column; }
.mast-stats b { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.mast-stats span { font-size: 12.5px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Featured + series ---------- */
.feature-row { display: grid; grid-template-columns: 1.65fr 1fr; gap: 28px; padding: 36px 0 12px; }
@media (max-width: 900px) { .feature-row { grid-template-columns: 1fr; } }
.feature {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 360px; padding: 36px;
  border-radius: 20px; text-decoration: none; overflow: hidden; isolation: isolate; color: #fff;
  background: #1b1a18;
}
.feature::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 400px at 110% -10%, rgba(200,55,45,.85), transparent 60%),
    radial-gradient(600px 300px at -10% 120%, rgba(240,140,60,.35), transparent 60%),
    linear-gradient(160deg, #23211e, #121110);
}
.feature .big-num { position: absolute; right: 28px; top: 10px; font: 500 italic 150px/1 var(--serif); color: rgba(255,255,255,.08); letter-spacing: -.04em; pointer-events: none; }
.feature .kicker { color: #ffb4ab; }
.feature h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -.02em; margin: 14px 0 12px; max-width: 18ch; }
.feature p { color: rgba(255,255,255,.78); font-size: 16.5px; margin: 0 0 18px; max-width: 56ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feature .meta { color: rgba(255,255,255,.65); }
.feature .meta .dot::before { color: rgba(255,255,255,.35); }
.feature .read-cta { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.feature .read-cta svg { transition: transform .2s; }
.feature:hover .read-cta svg { transform: translateX(4px); }

.series-card {
  display: flex; flex-direction: column; padding: 28px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.series-card h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; margin: 12px 0 8px; }
.series-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #e8833a); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 10px 0 20px; font-variant-numeric: tabular-nums; }
.day-grid { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin-bottom: 24px; }
.day-grid a { aspect-ratio: 1; border-radius: 2px; background: var(--accent); opacity: .8; transition: transform .12s, opacity .12s; }
.day-grid a:nth-child(n+31) { opacity: .65; } .day-grid a:nth-child(n+61) { opacity: .5; }
.day-grid a:hover { opacity: 1 !important; transform: scale(1.6); }
.day-grid span { aspect-ratio: 1; border-radius: 2px; background: var(--surface-2); }
.series-card .btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

/* ---------- Toolbar ---------- */
.toolbar { position: sticky; top: 68px; z-index: 30; background: var(--paper); padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
.toolbar .wrap { display: flex; gap: 16px; align-items: center; }
.search { position: relative; flex: 0 1 340px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search input {
  width: 100%; height: 42px; padding: 0 44px 0 40px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font: 400 15px var(--sans); transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 0; border-color: var(--ink-2); box-shadow: 0 0 0 4px var(--surface-2); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 6px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
@media (max-width: 760px) { .toolbar .wrap { flex-direction: column; align-items: stretch; } .search { flex-basis: auto; } }

/* ---------- Grid ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 34px 0 6px; }
.list-head h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -.015em; margin: 0; }
.list-head span { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 36px; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.card { position: relative; display: flex; flex-direction: column; padding: 26px 0 28px; border-bottom: 1px solid var(--line); text-decoration: none; }
.card .card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card .day { font: 500 italic 15px/1 var(--serif); color: var(--muted); }
.card .day b { font-style: normal; font-weight: 600; color: var(--accent); }
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.22; letter-spacing: -.012em; margin: 0 0 10px; transition: color .15s; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card:hover h3 { color: var(--accent); }
.card p { color: var(--ink-2); font-size: 15px; line-height: 1.55; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; font-size: 13px; }
.card .like-pill { position: relative; z-index: 2; margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 12.5px var(--sans); cursor: pointer; transition: all .15s; }
.card .like-pill:hover { color: var(--accent); border-color: var(--accent); }
.card .like-pill.liked { color: #fff; background: var(--accent); border-color: var(--accent); }
.card .like-pill svg { width: 13px; height: 13px; }
.card .cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; margin-bottom: 18px; background: var(--surface-2); }
.empty { padding: 80px 0; text-align: center; color: var(--muted); }
.empty h3 { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--ink); margin: 0 0 6px; }
.load-more { display: flex; justify-content: center; padding: 44px 0 20px; }
mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

/* skeleton */
.sk { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.rd-foot { margin-top: 72px; border-top: 1px solid var(--line); padding: 44px 0 56px; color: var(--muted); font-size: 14px; }
.rd-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: center; }
.rd-foot .brand-name { color: var(--ink); font-size: 19px; }
.rd-foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.rd-foot a { text-decoration: none; }
.rd-foot a:hover { color: var(--accent); }

/* ---------- Article ---------- */
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), #e8833a); pointer-events: none; }
.art-head { max-width: 860px; margin: 0 auto; padding: 56px 24px 8px; text-align: center; }
.crumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.art-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 5.2vw, 60px); line-height: 1.06; letter-spacing: -.025em; margin: 18px 0 18px; text-wrap: balance; }
.art-head .dek { font-family: var(--serif); font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; color: var(--ink-2); margin: 0 auto 26px; max-width: 680px; text-wrap: pretty; }
.byline { display: inline-flex; align-items: center; gap: 12px; text-align: left; }
.byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px -4px rgba(0,0,0,.35); }
.byline b { display: block; font-size: 15px; color: var(--ink); }
.byline .meta { font-size: 13.5px; }
.art-cover { max-width: 1080px; margin: 36px auto 0; padding: 0 24px; }
.art-cover img { width: 100%; border-radius: 18px; box-shadow: var(--shadow-lg); }
.art-topics { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.art-topics a { text-decoration: none; }

.art-layout { display: grid; grid-template-columns: 64px minmax(0, var(--measure)) 260px; gap: 48px; justify-content: center; max-width: 1180px; margin: 44px auto 0; padding: 0 24px; }
@media (max-width: 1180px) { .art-layout { grid-template-columns: minmax(0, var(--measure)) 240px; } .share-rail { display: none !important; } }
@media (max-width: 960px) { .art-layout { grid-template-columns: minmax(0, 1fr); max-width: calc(var(--measure) + 48px); } .toc-col { display: none; } }

.share-rail { position: sticky; top: 110px; align-self: start; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.share-rail .lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; transform: rotate(180deg); margin-bottom: 6px; }
.round {
  width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; transition: all .15s;
}
.round:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.round svg { width: 18px; height: 18px; }
.round.liked { background: var(--accent); border-color: var(--accent); color: #fff; }
.like-count { font: 600 13px var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }

.toc-col { position: sticky; top: 110px; align-self: start; max-height: calc(100vh - 130px); overflow: auto; scrollbar-width: thin; }
.toc-title { font: 600 12px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 4px 0 14px; display: flex; justify-content: space-between; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.4; color: var(--muted); text-decoration: none; transition: color .15s, border-color .15s; }
.toc li.lvl3 a { padding-left: 30px; font-size: 13px; }
.toc li a:hover { color: var(--ink); }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
.toc-mobile { display: none; margin: 0 0 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toc-mobile summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile .toc { padding: 0 18px 14px; }
@media (max-width: 960px) { .toc-mobile.has-items { display: block; } }
.side-card { margin-top: 28px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.side-card .kicker { font-size: 11px; }
.side-card p { font-size: 13.5px; color: var(--muted); margin: 8px 0 12px; }

/* ---------- Prose ---------- */
.prose { font-family: var(--serif); font-size: 20px; line-height: 1.72; color: var(--ink); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.05em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.05em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); color: var(--ink); letter-spacing: -.015em; line-height: 1.25; scroll-margin-top: 96px; }
.prose h2 { font-size: 1.42em; font-weight: 700; margin: 2.1em 0 .6em; }
.prose h3 { font-size: 1.14em; font-weight: 650; margin: 1.7em 0 .45em; }
.prose h4 { font-size: 1em; font-weight: 650; margin: 1.4em 0 .4em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose strong, .prose b { font-weight: 650; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 1em 0; }
.prose li { margin: .38em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); }
.prose blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); font-style: italic; color: var(--ink-2); font-size: 1.08em; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em auto; width: 40%; }
.prose img { display: block; margin: 1.6em auto; border-radius: 12px; cursor: zoom-in; }
.prose code { font-family: var(--mono); font-size: .8em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: .1em .38em; }
.prose .center { text-align: center; }
.prose .lead::first-letter { float: left; font-size: 3.6em; line-height: .86; padding: .06em .1em 0 0; color: var(--accent); font-weight: 500; }

.prose pre, .prose .code-wrap pre {
  position: relative; margin: 0; padding: 18px 20px; overflow-x: auto; border-radius: 12px;
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--line);
  font: 400 14px/1.65 var(--mono); tab-size: 4; white-space: pre;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.code-wrap { position: relative; margin: 1.5em 0; }
.code-wrap .code-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 16px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--surface-2); font: 500 12px var(--sans); color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.code-wrap .code-bar + pre { border-radius: 0 0 12px 12px; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 500 12px var(--sans); cursor: pointer; text-transform: none; letter-spacing: 0; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn svg { width: 13px; height: 13px; }
.prose .kw { color: #cf222e; } .prose .cm { color: #6e7781; font-style: italic; } .prose .fn { color: #8250df; } .prose .num { color: #0550ae; } .prose .str { color: #0a3069; }
:root[data-theme="dark"] .prose .kw { color: #ff7b72; } :root[data-theme="dark"] .prose .cm { color: #8b949e; } :root[data-theme="dark"] .prose .fn { color: #d2a8ff; } :root[data-theme="dark"] .prose .num { color: #79c0ff; }

.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 650; color: var(--ink); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.prose td p, .prose th p { margin: 0; } .prose td p + p { margin-top: .5em; }
.prose td ul, .prose td ol { margin: .3em 0; }

.prose .callout { margin: 1.6em 0; padding: 18px 22px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.prose .callout > :first-child { margin-top: 0; } .prose .callout > * + * { margin-top: .6em; }
.prose .callout strong:first-child { color: var(--ink); }
.prose .callout-tip { border-left-color: #2f9e6b; } .prose .callout-warn { border-left-color: #d98b1c; } .prose .callout-info { border-left-color: #3b7dd8; }
.prose .key-term { font-weight: 650; }
.prose .step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; margin: 1.3em 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.prose .step-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 15px var(--sans); }
.prose .step-body > :first-child { margin-top: 5px; } .prose .step-body > * + * { margin-top: .55em; }
.prose .step-title { display: block; color: var(--ink); font-size: 17px; }
.prose .step + .step { margin-top: .8em; }

/* Article end */
.art-end { margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.clap { display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 15px var(--sans); cursor: pointer; transition: all .2s; }
.clap svg { width: 20px; height: 20px; color: var(--accent); transition: transform .3s cubic-bezier(.3,1.8,.5,1); }
.clap:hover { border-color: var(--accent); }
.clap.liked { background: var(--accent); border-color: var(--accent); color: #fff; }
.clap.liked svg { color: #fff; transform: scale(1.15); }
.clap.pop svg { animation: pop .5s ease; }
@keyframes pop { 40% { transform: scale(1.5); } }
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }

.series-box { margin-top: 40px; padding: 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.series-box .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.series-box h3 { font-family: var(--serif); font-size: 24px; font-weight: 500; margin: 8px 0 14px; letter-spacing: -.01em; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 600px) { .pn { grid-template-columns: 1fr; } }
.pn a { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; transition: all .15s; background: var(--paper); }
.pn a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pn a.next { text-align: right; }
.pn small { font: 600 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pn span { font-family: var(--serif); font-size: 17px; line-height: 1.3; }
.pn .ph { visibility: hidden; }

.related { max-width: 1180px; margin: 72px auto 0; padding: 0 24px; }
.related h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -.015em; margin: 0 0 4px; }

.comments { margin-top: 52px; }
.comments h2 { font-family: var(--serif); font-weight: 500; font-size: 28px; margin: 0 0 18px; }
.c-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.c-form textarea { grid-column: 1 / -1; min-height: 110px; resize: vertical; }
.c-form input, .c-form textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--sans); }
.c-form input:focus, .c-form textarea:focus { outline: 0; border-color: var(--ink-2); }
.c-form .row-end { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.c-form .hint { font-size: 12.5px; color: var(--muted); }
@media (max-width: 600px) { .c-form { grid-template-columns: 1fr; } }
.c-list { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.c-item { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 15px var(--sans); color: #fff; }
.c-item b { font-size: 15px; } .c-item time { color: var(--muted); font-size: 12.5px; margin-left: 8px; }
.c-item p { margin: 4px 0 0; font-size: 15.5px; color: var(--ink-2); white-space: pre-wrap; }

/* ---------- Misc ---------- */
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 50; opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .2s; box-shadow: var(--shadow); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 14px var(--sans); box-shadow: var(--shadow-lg); transition: all .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(15,14,13,.88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; opacity: 0; pointer-events: none; transition: opacity .2s; }
.lightbox.show { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.state { max-width: 640px; margin: 80px auto; padding: 0 24px; text-align: center; color: var(--muted); }
.state h1 { font-family: var(--serif); font-weight: 500; color: var(--ink); font-size: 36px; margin: 0 0 10px; }
.fade-in { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* Studio formatting classes */
.prose .tc-red { color: #c8372d; } .prose .tc-blue { color: #2b5fa6; } .prose .tc-green { color: #217a4f; } .prose .tc-amber { color: #a86411; } .prose .tc-purple { color: #7343b3; } .prose .tc-gray { color: var(--muted); }
:root[data-theme="dark"] .prose .tc-red { color: #ff8a80; } :root[data-theme="dark"] .prose .tc-blue { color: #8ab4f8; } :root[data-theme="dark"] .prose .tc-green { color: #7ad3a3; } :root[data-theme="dark"] .prose .tc-amber { color: #f3b35c; } :root[data-theme="dark"] .prose .tc-purple { color: #c3a6f5; }
.prose mark, .prose .hl-yellow { background: #fff1a8; color: inherit; border-radius: 3px; padding: 0 .12em; } .prose .hl-green { background: #d4f3df; } .prose .hl-blue { background: #dbe8fb; } .prose .hl-pink { background: #fbdbe6; }
:root[data-theme="dark"] .prose mark, :root[data-theme="dark"] .prose .hl-yellow { background: #5a4c12; } :root[data-theme="dark"] .prose .hl-green { background: #1d4a31; } :root[data-theme="dark"] .prose .hl-blue { background: #1e3557; } :root[data-theme="dark"] .prose .hl-pink { background: #55233a; }
.prose td.shade-1, .prose th.shade-1 { background: #fbeae7; } .prose td.shade-2, .prose th.shade-2 { background: #e6f4ec; } .prose td.shade-3, .prose th.shade-3 { background: #e8f0fb; } .prose td.shade-4, .prose th.shade-4 { background: #fdf1df; } .prose td.shade-5, .prose th.shade-5 { background: #f0ede6; }
:root[data-theme="dark"] .prose [class*="shade-"] { background: var(--surface-2) !important; }
.prose td[data-formula] { font-variant-numeric: tabular-nums; font-weight: 600; }
.prose ul.checklist { list-style: none; padding-left: .2em; } .prose ul.checklist li { position: relative; padding-left: 1.7em; }
.prose ul.checklist li::before { content: ""; position: absolute; left: 0; top: .32em; width: 1em; height: 1em; border: 2px solid var(--line-2); border-radius: 4px; }
.prose ul.checklist li.done::before { background: var(--accent); border-color: var(--accent); } .prose ul.checklist li.done::after { content: "✓"; position: absolute; left: .18em; top: .02em; color: #fff; font: 700 .8em var(--sans); }
.prose ul.checklist li.done { color: var(--muted); text-decoration: line-through; }
.prose .video { position: relative; aspect-ratio: 16/9; margin: 1.6em 0; border-radius: 12px; overflow: hidden; background: #000; } .prose .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose figure { margin: 1.6em 0; } .prose figure img { margin: 0 auto; } .prose figcaption { text-align: center; font: 400 14px/1.5 var(--sans); color: var(--muted); margin-top: 10px; }
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .masthead { padding: 32px 0 22px; }
  .mast-stats { gap: 18px 26px; } .mast-stats b { font-size: 26px; }
  .feature { min-height: 300px; padding: 26px; } .feature .big-num { font-size: 110px; }
  .art-head { padding: 34px 18px 4px; } .art-layout { padding: 0 18px; margin-top: 30px; }
  .prose { font-size: 18.5px; line-height: 1.68; }
  .prose pre { font-size: 13px; padding: 14px 16px; }
  .art-end { flex-direction: column; align-items: stretch; } .clap { justify-content: center; }
  .rd-top .wrap { height: 60px; } .toolbar { top: 60px; }
  .related { padding: 0 18px; }
}
.prose td a, .prose th a { color: inherit; text-decoration: none; } .prose td a:hover, .prose th a:hover { color: var(--accent); text-decoration: underline; }
@media print {
  .rd-top, .share-rail, .toc-col, .toc-mobile, .art-end, .series-box, .related, .comments, .rd-foot, .to-top, .read-progress { display: none !important; }
  .art-layout { display: block; margin: 0; } body.rd { background: #fff; } .prose { font-size: 12pt; }
}
