/* =========================================================
   On A Budget — minimal blog theme
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #6b716d;
  --line: #e5eae6;
  --accent: #157d36;
  --accent-2: #4eb161;
  --accent-ink: #157d36;
  --accent-soft: #e9f5ed;
  --cta: #f0c14b;
  --cta-hover: #e5b232;
  --cta-ink: #111111;
  --cream: #f4f7f5;
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px -12px rgba(17, 17, 17, .12);
  --shadow-lg: 0 2px 4px rgba(17, 17, 17, .04), 0 24px 48px -24px rgba(17, 17, 17, .22);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --container: 1180px;
  --header-h: 68px;
  color-scheme: light;
}



/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
body.no-scroll { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
p { margin: 0; }
.icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-ink);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-primary .icon { transition: transform .2s; }
.btn-primary:hover .icon { transform: translateX(2px); }
.btn-cta { background: var(--cta); color: var(--cta-ink); font-weight: 600; }
.btn-cta:hover { background: var(--cta-hover); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--ink); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.tag {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 500; line-height: 1.4;
  transition: background-color .2s, color .2s;
}
a.tag:hover { background: var(--accent); color: #fff; }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  color: var(--muted); font-size: 13.5px;
}
.meta > span { display: inline-flex; align-items: center; gap: 6px; }

.vs {
  display: inline-block; margin: 0 .5em;
  font-size: .72em; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-2);
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }

.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { display: block; height: 30px; width: auto; }
.site-footer .logo img { height: 32px; }

.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  padding: 8px 12px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.menu-btn { display: none; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 70% at 85% 30%, rgba(78, 177, 97, .16), transparent 70%),
    linear-gradient(180deg, #f3faf5 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(21, 125, 54, .14) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 75%);
  mask-image: linear-gradient(90deg, transparent 35%, #000 75%);
}
.hero-inner {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  align-items: center; gap: clamp(40px, 6vw, 88px);
  padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 96px);
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 5px 14px 5px 5px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  transition: border-color .2s;
}
.hero-badge:hover { border-color: var(--accent-2); }
.hero-badge .icon { color: var(--accent); transition: transform .2s; }
.hero-badge:hover .icon { transform: translateX(2px); }
.badge-new {
  flex-shrink: 0; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.badge-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hero h1 {
  margin-top: 24px;
  font-family: var(--font-heading); font-weight: 800;
  font-size: clamp(38px, 4.4vw, 58px); line-height: 1.06; letter-spacing: -0.035em;
  color: var(--ink);
}
.hero .hl {
  color: var(--accent); white-space: nowrap;
  padding-bottom: .12em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cpath d='M2 9C60 3 140 2 298 6' fill='none' stroke='%234EB161' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") 0 100% / 100% .22em no-repeat;
}
.hero .br-sm { display: none; }
.lede { margin-top: 20px; max-width: 560px; font-size: 18px; line-height: 1.6; color: var(--ink-2); }

.hero-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 540px; margin-top: 32px; padding: 6px 6px 6px 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(21, 125, 54, .12), var(--shadow); }
.hero-search input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); }
.hero-search .btn { height: 44px; padding: 0 22px; }
.hero-search .btn-primary { background: var(--accent); color: #fff; }
.hero-search .btn-primary:hover { background: #106a2d; }

.hero-topics { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; }
.hero-topics > span { color: var(--muted); margin-right: 2px; }
.hero-topics a {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--ink-2);
  transition: border-color .2s, color .2s;
}
.hero-topics a:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats { display: flex; margin: 40px 0 0; padding: 0; }
.hero-stats > div { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line); }
.hero-stats > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-stats dt { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); }
.hero-stats dd { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }

/* stacked post cards */
.hero-visual { position: relative; height: 450px; }
.stack-card {
  position: absolute; border-radius: 20px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.stack-back { width: 60%; top: 56px; opacity: .96; }
.stack-back .hero-card-body { gap: 8px; justify-items: start; }
.stack-back strong { font-size: 15px; line-height: 1.3; color: var(--ink); }
.stack-1 { right: -2%; transform: rotate(6deg); }
.stack-2 { left: -2%; top: 84px; transform: rotate(-6deg); }
.hero-visual:hover .stack-1 { transform: rotate(10deg) translateX(14px); }
.hero-visual:hover .stack-2 { transform: rotate(-10deg) translateX(-14px); }

.hero-card { left: 50%; top: 0; width: 72%; transform: translateX(-50%); z-index: 2; }
.hero-card:hover { transform: translateX(-50%) translateY(-4px); }
.hero-card-media { position: relative; aspect-ratio: 16 / 11; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-card-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; }
.hero-card-label {
  position: absolute; left: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(17, 17, 17, .82); color: #fff; font-size: 12px; font-weight: 600;
  backdrop-filter: blur(6px);
}
.hero-card-body { display: grid; gap: 10px; padding: 18px 20px 20px; }
.hero-card h2 { font-size: 21px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.hero-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.hero-card-foot .versus { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card-foot .go {
  display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; transition: transform .2s;
}
.hero-card:hover .go { transform: translateX(3px); }

.float-chip {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  animation: bob 6s ease-in-out infinite;
}
.float-chip .icon { color: var(--accent); }
.float-a { left: -4%; bottom: 0; }
.float-b { right: -4%; top: 4%; animation-delay: -3s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

.versus-pill {
  display: inline-flex; align-items: center; flex-wrap: wrap;
  padding: 8px 16px; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  font-size: 14px; font-weight: 600;
}

/* ---------- posts grid ---------- */
.posts-section { padding-top: 88px; padding-bottom: 96px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-head h2 { font-family: var(--font-heading); font-weight: 700; font-size: clamp(28px, 3vw, 36px); letter-spacing: -0.02em; }
.section-head .muted { margin-top: 4px; font-size: 14px; }

.inline-search {
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px; width: 260px; max-width: 100%;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--muted); transition: border-color .2s;
}
.inline-search:focus-within { border-color: var(--ink); }
.inline-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14.5px; }

.chips { display: flex; gap: 8px; margin-bottom: 32px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: all .2s;
}
.chip span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 28px; }

.card { position: relative; display: flex; flex-direction: column; }
.card-media { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 11%; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; flex: 1; }
.card h3 { font-family: var(--font-heading); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -0.015em; }
.card h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s ease; }
.card:hover h3 a { background-size: 100% 1px; }
.card p { color: var(--ink-2); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted);
}
.card-foot .versus { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stretched::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.empty { text-align: center; padding: 64px 0; color: var(--muted); display: grid; justify-items: center; gap: 16px; }
.empty[hidden] { display: none; }

/* ---------- footer ---------- */
.site-footer { background: #000; color: #fff; padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 40px; padding-bottom: 40px; }
.footer-brand p { margin-top: 14px; max-width: 320px; color: #a3a3a3; font-size: 15px; }
.site-footer h4 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #8a8a8a; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer li a { font-size: 15px; color: #e5e5e5; transition: color .2s; }
.site-footer li a:hover { color: var(--accent-2); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 20px; padding-bottom: 28px; border-top: 1px solid #222;
  font-size: 13px; color: #8a8a8a;
}
.disclosure { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- search overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.search-overlay[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(20, 15, 10, .35); backdrop-filter: blur(4px); animation: fade .2s ease; }
.search-panel {
  position: relative; width: 100%; max-width: 620px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .25s ease;
}
.search-field { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: transparent; font: inherit; font-size: 17px; color: var(--ink); }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 52vh; overflow-y: auto; }
.search-results a { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; color: var(--muted); }
.search-results a:hover, .search-results a:focus-visible { background: var(--surface-2); }
.search-results img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; object-position: 50% 22%; background: #fff; border: 1px solid var(--line); }
.search-results span { flex: 1; display: grid; gap: 2px; min-width: 0; }
.search-results strong { color: var(--ink); font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-results small { font-size: 13px; }
.search-empty { padding: 24px; text-align: center; color: var(--muted); }
.search-hint { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
kbd { font: 500 11.5px var(--font-sans); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.99); } }

/* ---------- back to top / toast ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  background: var(--surface); border-color: var(--line); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   Post detail
   ========================================================= */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.post-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(32px, 6vw, 80px); align-items: center;
  padding-top: 48px; padding-bottom: 56px;
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.crumbs a:hover { color: var(--ink); }
.post-hero h1 {
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.03em;
}
.dek {
  margin-top: 20px; max-width: 560px;
  font-size: 19px; line-height: 1.55; color: var(--ink-2);
}
.byline { display: flex; align-items: center; gap: 14px; margin-top: 32px; }
.byline strong { display: block; font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.avatar {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 14px; letter-spacing: .02em;
}
.post-hero .versus-pill { margin-top: 28px; }
.post-hero-media { margin: 0; border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--cream); box-shadow: var(--shadow-lg); aspect-ratio: 2 / 3; }
.post-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.post-layout {
  display: grid; grid-template-columns: 220px minmax(0, 700px); justify-content: center; gap: 72px;
  padding-top: 56px; border-top: 1px solid var(--line);
}
.aside-sticky { position: sticky; top: calc(var(--header-h) + 32px); }
.aside-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.aside-sticky .share { margin-bottom: 0; margin-left: -10px; }
.aside-sticky .toc { margin-bottom: 36px; }

.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a {
  display: flex; gap: 10px; padding: 7px 0 7px 16px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.4; color: var(--muted);
  transition: color .2s, border-color .2s;
}
.toc a span { font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 1px; opacity: .7; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }

.toc-mobile { display: none; }

.share { display: flex; align-items: center; gap: 2px; }
.share .icon-btn.copied { color: var(--accent); }

/* prose */
.prose { font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.prose > * + *, .prose div > * + * { margin-top: 1.15em; }
.prose p { margin: 0; }
.prose b, .prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose h2 {
  margin-top: 2.4em; margin-bottom: .2em;
  font-family: var(--font-heading); font-weight: 700;
  font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.02em; color: var(--ink);
}
.prose h2:first-child { margin-top: 0; }
.prose img {
  width: 100%; max-width: 100%; margin: .6em auto 0;
  border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--line);
}
.prose > p:first-child::first-letter {
  float: left; font-family: var(--font-heading); font-weight: 700;
  font-size: 3.6em; line-height: .9; padding: .06em .12em 0 0; color: var(--accent);
}

/* at a glance */
.glance {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  margin: 48px 0 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.glance-item { display: flex; flex-direction: column; padding: 16px; min-width: 0; }
.glance-media { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: #fff; margin-bottom: 16px; border: 1px solid var(--line); }
.glance-media img { width: 100%; height: 100%; object-fit: contain; }
.glance-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.glance-item h3 { margin-top: 4px; font-family: var(--font-heading); font-weight: 700; font-size: 24px; }
.glance-item .muted { margin-top: 6px; font-size: 14.5px; line-height: 1.5; flex: 1; }
.glance-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.glance-vs {
  align-self: center; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: 0 0 0 6px var(--surface);
}

/* where to buy */
.buy { margin-top: 64px; padding: 32px; border-radius: calc(var(--radius) + 6px); background: var(--accent-soft); }
.buy h2 { font-family: var(--font-heading); font-weight: 700; font-size: 28px; letter-spacing: -0.02em; }
.buy > .muted { margin-top: 6px; font-size: 15px; }
.buy-list { display: grid; gap: 10px; margin-top: 22px; }
.buy-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.buy-item:hover { border-color: var(--cta); transform: translateY(-1px); box-shadow: var(--shadow); }
.buy-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--accent-ink); }
.buy-item > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.buy-item strong { font-weight: 600; }
.buy-item small { color: var(--muted); font-size: 13px; }
.buy-cta { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--cta); color: var(--cta-ink); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background-color .2s; }
.buy-item:hover .buy-cta { background: var(--cta-hover); }
.ad-note { display: flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--muted); }

.post-end {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line);
}
.post-end .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-end .share .muted { font-size: 14px; margin-right: 6px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; }
.post-nav-item {
  display: grid; gap: 8px; padding: 22px 24px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.post-nav-item:hover { border-color: var(--ink-2); box-shadow: var(--shadow); }
.post-nav-item small { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.post-nav-item strong { font-family: var(--font-heading); font-weight: 700; font-size: 19px; line-height: 1.3; }
.post-nav-item.next { text-align: right; }
.post-nav-item.next small { justify-content: flex-end; }

.related { padding-top: 88px; padding-bottom: 96px; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--accent-ink); }
.link-arrow:hover .icon { transform: translateX(2px); }
.link-arrow .icon { transition: transform .2s; }

.not-found { padding-top: 120px; padding-bottom: 160px; display: grid; justify-items: start; gap: 16px; }
.not-found h1 { font-family: var(--font-heading); font-weight: 700; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; }
.not-found .btn { margin-top: 12px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 700px); }
  .post-aside { display: none; }
  .toc-mobile {
    display: block; margin-bottom: 36px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  }
  .toc-mobile summary {
    display: flex; align-items: center; gap: 10px; padding: 14px 18px;
    list-style: none; cursor: pointer; font-weight: 500; font-size: 15px;
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile .chev { margin-left: auto; transition: transform .2s; }
  .toc-mobile[open] .chev { transform: rotate(180deg); }
  .toc-mobile .toc { padding: 0 18px 16px; }
}

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { height: 460px; max-width: 520px; width: 100%; margin-inline: auto; }
  .post-hero { grid-template-columns: minmax(0, 1fr) 280px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .site-header .logo img { height: 24px; }
  .container { padding-inline: 16px; }

  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav a { padding: 12px 8px; border-radius: 10px; font-size: 16px; }
  .site-header.menu-open .nav { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }
  .site-header.menu-open { border-bottom-color: var(--line); }

  .hero-inner { padding-top: 36px; padding-bottom: 48px; gap: 40px; }
  .hero .br-sm { display: inline; }
  .hero::before { -webkit-mask-image: linear-gradient(180deg, transparent 50%, #000); mask-image: linear-gradient(180deg, transparent 50%, #000); }
  .hero-search { padding-left: 14px; }
  .hero-search .btn { padding: 0 16px; }
  .hero-stats > div { padding-right: 16px; margin-right: 16px; }
  .hero-stats dt { font-size: 24px; }
  .hero-stats dd { font-size: 12.5px; }
  .hero-visual { height: 380px; }
  .hero-card { width: 82%; }
  .hero-card h2 { font-size: 18px; }
  .stack-back { width: 60%; }
  .float-a { left: 0; bottom: auto; top: 22%; }
  .float-b { display: none; }
  .lede { font-size: 16.5px; }

  .section-head { flex-direction: column; align-items: stretch; }
  .inline-search { width: 100%; }
  .posts-section { padding-top: 64px; }

  .grid { grid-template-columns: 1fr; gap: 36px; }

  .post-hero { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 40px; gap: 32px; }
  .post-hero-media { order: -1; aspect-ratio: 16 / 10; }
  .post-hero-media img { object-position: 50% 11%; }
  .crumbs { margin-bottom: 16px; }
  .dek { font-size: 18px; }
  .post-layout { padding-top: 36px; }

  .prose { font-size: 17px; }
  .glance { grid-template-columns: 1fr; padding: 4px; }
  .glance-vs { justify-self: center; margin: -6px 0; position: relative; z-index: 1; }
  .buy { padding: 22px 18px; }
  .buy-cta { font-size: 0; gap: 0; width: 36px; padding: 0; justify-content: center; }
  .buy-cta .icon { width: 18px; height: 18px; }

  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.next { text-align: left; }
  .post-nav-item.next small { justify-content: flex-start; }
  .post-nav > span:empty { display: none; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
