/* ==========================================================================
   onllm.dev blog - "The blog."
   Shares the design language of the landing page: ink field, paper sheets,
   a single dye that tints the whole studio.
   ========================================================================== */

@property --dye { syntax: '<color>'; inherits: true; initial-value: #a873ff; }
@property --dye-deep { syntax: '<color>'; inherits: true; initial-value: #522aa8; }
@property --dye-light { syntax: '<color>'; inherits: true; initial-value: #e2d1ff; }

:root {
  --ink: #090c18;
  --ink-2: #0e1324;
  --ink-3: #151b31;
  --ink-line: rgba(220, 228, 255, .10);
  --on-ink: #eef0f7;
  --on-ink-2: #a3a9c2;
  --on-ink-3: #828aa4;
  --paper: #efece5;
  --paper-2: #e6e2d8;
  --paper-3: #f7f5f0;
  --paper-line: rgba(20, 22, 32, .12);
  --on-paper: #11131b;
  --on-paper-2: #4d5163;
  --on-paper-3: #7d8193;

  --dye: #a873ff;
  --dye-deep: #522aa8;
  --dye-light: #e2d1ff;

  --f-sans: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Instrument Serif', 'Times New Roman', serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --e-out: cubic-bezier(.16, 1, .3, 1);
  --e-inout: cubic-bezier(.65, 0, .35, 1);
  --e-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: .22s;
  --t-med: .55s;
  --t-slow: 1.1s;

  --rail: 88px;
  --pad: clamp(20px, 4.4vw, 72px);
  --maxw: 1440px;

  transition: --dye .9s var(--e-inout), --dye-deep .9s var(--e-inout), --dye-light .9s var(--e-inout);
}

html[data-dye="violet"]     { --dye: #a873ff; --dye-deep: #522aa8; --dye-light: #e2d1ff; }
html[data-dye="cobalt"]     { --dye: #4d6bff; --dye-deep: #1f33b0; --dye-light: #b9c6ff; }
html[data-dye="periwinkle"] { --dye: #8f97ff; --dye-deep: #3f3fb0; --dye-light: #dadcff; }
html[data-dye="ember"]      { --dye: #ff6a3d; --dye-deep: #a8331a; --dye-light: #ffcdb9; }
html[data-dye="saffron"]    { --dye: #f2b134; --dye-deep: #7d5200; --dye-light: #ffe2a4; }
html[data-dye="rose"]       { --dye: #ff5a8a; --dye-deep: #9c1d4b; --dye-light: #ffc6d7; }

/* Semantic surface tokens. Everything below reads these, or the ink tokens
   they alias, so a theme switch is a token swap. */
:root {
  --bg: var(--ink);
  --fg: var(--on-ink);
  --fg-2: var(--on-ink-2);
  --fg-3: var(--on-ink-3);
  --line: var(--ink-line);
  --card: var(--ink-3);
  --body-text: #d4d8e6;
  --code-bg: #060912;
  --code-fg: #c8cede;
  --strong: #fff;
  --raise: rgba(255,255,255,.03);
  --raise-2: rgba(255,255,255,.06);
  --mark-stop: #20263f;
  --grid-line: rgba(255,255,255,.02);
  --shade: rgba(0,0,0,.9);
  --danger: #ff8b9a;
  --live: #3fbf6a;
  --beta: #e9a93a;
  --danger-bg: rgba(255,90,108,.12);
  --on-dye: #090c18;
  --btn-hover-bg: #fff;
  --btn-hover-fg: #090c18;
  --rail-glass: rgba(9,12,24,.92);
  --bar-glass-a: rgba(9,12,24,.85);
  --bar-glass-b: rgba(9,12,24,.55);
}

html[data-theme="light"] {
  --ink: #f6f5f1;
  --ink-2: #eef0f6;
  --ink-3: #e9eaf0;
  --ink-line: rgba(20, 22, 32, .14);
  --on-ink: #11131b;
  --on-ink-2: #444957;
  --on-ink-3: #646979;
  --paper: #efece5;
  --paper-2: #e6e2d8;
  --paper-3: #f7f5f0;

  --body-text: #33384a;
  --code-bg: #eceef3;
  --code-fg: #2b3040;
  --strong: #090c18;
  --raise: rgba(20,22,32,.035);
  --raise-2: rgba(20,22,32,.06);
  --mark-stop: #c9c3d6;
  --grid-line: rgba(20,22,32,.035);
  --shade: rgba(31,35,48,.18);
  --danger: #b0223c;
  --live: #1e8f4b;
  --beta: #9a6400;
  --danger-bg: rgba(176,34,60,.09);
  --on-dye: #fff;
  --btn-hover-bg: #090c18;
  --btn-hover-fg: #f6f5f1;
  --rail-glass: rgba(246,245,241,.92);
  --bar-glass-a: rgba(246,245,241,.9);
  --bar-glass-b: rgba(246,245,241,.65);
}

/* Light mode needs deeper dye values for text and filled surfaces. */
html[data-theme="light"][data-dye="violet"]     { --dye: #6b3fd4; --dye-deep: #4a2596; --dye-light: #4c2699; }
html[data-theme="light"][data-dye="cobalt"]     { --dye: #3a54d6; --dye-deep: #1f33b0; --dye-light: #2b3fb8; }
html[data-theme="light"][data-dye="periwinkle"] { --dye: #4a55c9; --dye-deep: #33359a; --dye-light: #3b3cae; }
html[data-theme="light"][data-dye="ember"]      { --dye: #b8401c; --dye-deep: #8f2e17; --dye-light: #9c321a; }
html[data-theme="light"][data-dye="saffron"]    { --dye: #8f6200; --dye-deep: #6b4700; --dye-light: #7d5200; }
html[data-theme="light"][data-dye="rose"]       { --dye: #c22a5e; --dye-deep: #8c1a43; --dye-light: #9c1d4b; }

*, *::before, *::after { box-sizing: border-box; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--dye); color: #fff; }
:focus-visible { outline: 2px solid var(--dye); outline-offset: 3px; border-radius: 4px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--dye); color: #fff; padding: 10px 14px; border-radius: 10px; transition: top .2s; }
.skip:focus { top: 12px; }

.mono { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; }
.dash { display: inline-block; width: 28px; height: 1px; background: currentColor; opacity: .45; vertical-align: middle; margin: 0 10px; }
.eyebrow { margin: 0 0 22px; color: var(--dye); }
em { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.icon { display: inline-block; vertical-align: middle; flex: none; }

/* ---------- rail (desktop) ---------- */
.rail { display: none; }
@media (min-width: 1024px) {
  body { padding-left: var(--rail); }
  .rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail); z-index: 60;
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    padding: 26px 0 22px; background: var(--rail-glass); border-right: 1px solid var(--line);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .rail-logo img { width: 30px; height: 30px; border-radius: 8px; transition: transform .6s var(--e-spring); }
  .rail-logo:hover img { transform: rotate(-12deg) scale(1.08); }
  .rail { row-gap: 24px; }
  .rail > .rail-controls { flex-shrink: 0; gap: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
  .rail-nav { display: flex; flex: 1; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 1.5vh, 16px); }
  .rail-nav a {
    position: relative; writing-mode: vertical-rl; transform: rotate(180deg);
    font-size: 14px; letter-spacing: .02em; color: var(--fg-3); transition: color .3s;
  }
  .rail-nav a::after {
    content: ''; position: absolute; right: -14px; top: 0; width: 1px; height: 100%;
    background: var(--dye); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--e-out);
  }
  .rail-nav a:hover { color: var(--fg); }
  .rail-nav a.is-on { color: var(--fg); }
  .rail-nav a.is-on::after { transform: scaleY(1); }
  .rail-start {
    writing-mode: vertical-rl; transform: rotate(180deg);
    font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
    color: var(--fg-2); padding: 14px 0 0; border-bottom: 1px solid var(--line); transition: color .3s;
  }
  .rail-start:hover { color: var(--dye); }
  .mbar, .menu { display: none !important; }
}

@media (min-width: 1024px) and (max-height: 800px) {
  .rail { row-gap: 12px; padding-top: 16px; padding-bottom: 16px; }
  .rail > .rail-controls { gap: 24px; padding-bottom: 12px; }
  .rail .rail-nav { gap: 4px; }
  .rail .rail-nav a { font-size: 13px; }
  .rail-start { font-size: 9.5px; letter-spacing: .14em; }
}

/* Dye */
.vat { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-3); }
.vat-dot {
  position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--dye);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--dye) 22%, transparent), 0 0 24px color-mix(in oklab, var(--dye) 60%, transparent);
  transition: transform .5s var(--e-spring);
}
.vat-dot::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed color-mix(in oklab, var(--dye) 55%, transparent); animation: spin 9s linear infinite; }
.vat:hover .vat-dot { transform: scale(1.18); }
.vat:active .vat-dot { transform: scale(.85); }
.vat.is-dipping .vat-dot { animation: dip .7s var(--e-out); }
@keyframes dip { 0% { transform: scale(1); } 35% { transform: scale(.55) translateY(4px); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
.dye-wash { position: fixed; z-index: 130; width: 40px; height: 40px; border-radius: 50%; pointer-events: none; background: var(--dye); mix-blend-mode: color; opacity: .55; transform: translate(-50%, -50%) scale(0); animation: wash 1s var(--e-out) forwards; }
@keyframes wash { to { transform: translate(-50%, -50%) scale(90); opacity: 0; } }

/* ---------- mobile bar + menu ---------- */
.mbar {
  position: fixed; inset: 0 0 auto 0; z-index: 70; height: 62px; padding: 0 16px 0 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(var(--bar-glass-a), var(--bar-glass-b)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: transform .5s var(--e-out);
}
.mbar.is-hidden { transform: translateY(-100%); }
.mbar-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.03em; font-size: 18px; }
.mbar-logo img { border-radius: 7px; }
.mbar-logo i { font-family: var(--f-serif); font-weight: 400; color: var(--dye); }
.mbar-actions { display: flex; align-items: center; gap: 8px; }
.vat--bar { width: 44px; height: 44px; justify-content: center; }
.vat--bar .vat-dot { width: 18px; height: 18px; }
.mbar-menu { width: 44px; height: 44px; display: grid; place-content: center; gap: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.mbar-menu span:not(.sr) { display: block; width: 18px; height: 1.5px; background: var(--fg); transition: transform .45s var(--e-out); }
.mbar-menu[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.25px) rotate(45deg); }
.mbar-menu[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }
.menu {
  position: fixed; inset: 0; z-index: 65; background: var(--bg); padding: 96px 24px 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  clip-path: circle(0 at calc(100% - 38px) 31px); transition: clip-path .8s var(--e-inout);
}
.menu[hidden] { display: flex; visibility: hidden; }
.menu.is-open { clip-path: circle(150% at calc(100% - 38px) 31px); visibility: visible; }
.menu { gap: 24px; overflow-y: auto; }
.menu > * { flex-shrink: 0; }
.menu-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.menu-controls .theme-toggle { margin-left: 0; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a { display: flex; align-items: baseline; gap: 16px; font-size: clamp(2.2rem, 10vw, 3.4rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.12; padding: 6px 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(30px); transition: opacity .6s var(--e-out), transform .7s var(--e-out), color .2s; }
.menu.is-open nav a { opacity: 1; transform: none; }
.menu nav a:nth-child(2) { transition-delay: .05s; } .menu nav a:nth-child(3) { transition-delay: .1s; } .menu nav a:nth-child(4) { transition-delay: .15s; } .menu nav a:nth-child(5) { transition-delay: .2s; } .menu nav a:nth-child(6) { transition-delay: .25s; color: var(--dye); }
.menu nav small { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--fg-3); font-weight: 400; }
.menu-foot { display: flex; flex-direction: column; gap: 18px; color: var(--fg-2); }
.vat--menu { flex-direction: row; gap: 14px; font-size: 11px; color: var(--fg-2); min-height: 44px; }
.vat--menu b { color: var(--dye); font-weight: 500; }
.menu-cta { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 500; font-size: 1.1rem; border-bottom: 1px solid var(--dye); width: fit-content; padding-bottom: 4px; }

/* ==========================================================================
   Shared shells
   ========================================================================== */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.sec-kicker { color: var(--fg-3); }

/* Reveal motion (progressive enhancement) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--e-out), transform 1s var(--e-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ==========================================================================
   BLOG LISTING
   ========================================================================== */
.blog-hero { position: relative; overflow: hidden; padding: clamp(96px, 16vh, 180px) 0 clamp(40px, 7vh, 72px); background: radial-gradient(120% 90% at 75% 20%, var(--ink-2), var(--ink) 70%); }
.blog-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(46% 60% at 84% 12%, color-mix(in oklab, var(--dye) 16%, transparent), transparent 70%);
}
.blog-hero .wrap { position: relative; }
.blog-hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; color: var(--fg-3); margin-bottom: clamp(36px, 8vh, 90px); }
.blog-hero h1 {
  margin: 0; font-weight: 600; letter-spacing: -.055em; line-height: .9;
  font-size: clamp(3.4rem, 10vw, 9rem);
}
.blog-hero h1 em { color: var(--dye-light); font-size: 1.06em; }
.blog-hero-lede { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-top: 28px; }
.blog-hero-lede p { max-width: 44ch; margin: 0; color: var(--fg-2); font-size: clamp(1.02rem, 1.35vw, 1.2rem); }
.blog-count { color: var(--fg-3); white-space: nowrap; }
.blog-count b { color: var(--fg); font-weight: 500; }

.blog-body { padding: clamp(40px, 7vh, 80px) 0 clamp(84px, 14vh, 150px); background: var(--bg); }

/* Featured card */
.feature {
  position: relative; display: block; border-radius: 24px; overflow: hidden; isolation: isolate;
  padding: clamp(26px, 3.4vw, 54px);
  background:
    radial-gradient(90% 130% at 88% 12%, color-mix(in oklab, var(--dye) 34%, transparent), transparent 62%),
    linear-gradient(150deg, var(--ink-3), var(--ink-2) 60%, var(--ink));
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .7s var(--e-out), box-shadow .6s;
  margin-bottom: clamp(44px, 7vh, 84px);
}
.feature::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 39px, var(--grid-line) 39px 40px);
  -webkit-mask: linear-gradient(115deg, #000, transparent 58%); mask: linear-gradient(115deg, #000, transparent 58%);
}
.feature:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 45%, transparent), 0 46px 90px -50px color-mix(in oklab, var(--dye-deep) 80%, transparent); }
.feature-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: clamp(28px, 5vh, 60px); }
.feature-badge { display: inline-flex; align-items: center; gap: 9px; color: var(--dye-light); }
.feature-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--dye); box-shadow: 0 0 0 0 var(--dye); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--dye) 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.feature-title { margin: 0; max-width: 20ch; font-size: clamp(2.1rem, 5.4vw, 4.6rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; color: var(--fg); }
.feature:hover .feature-title { color: var(--dye-light); }
.feature-title, .feature-excerpt { transition: color .35s; }
.feature-excerpt { max-width: 52ch; margin: 22px 0 0; color: var(--fg-2); font-size: clamp(1rem, 1.3vw, 1.15rem); }
.feature-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: clamp(26px, 4vh, 48px); }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; color: var(--fg-3); }
.feature-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }
.feature-cta { display: inline-flex; align-items: center; gap: 12px; font-weight: 500; color: var(--fg); }
.feature-cta i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--dye); color: #fff; font-style: normal; transition: transform .5s var(--e-out); }
.feature:hover .feature-cta i { transform: translateX(4px) rotate(-8deg); }

/* Grid */
.posts-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; color: var(--fg-3); }
.posts-head h2 { margin: 0; font-size: .82rem; font-family: var(--f-mono); font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-2); }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }

.post-card {
  position: relative; display: flex; flex-direction: column; min-height: 300px;
  padding: clamp(22px, 2.4vw, 34px) clamp(18px, 2.2vw, 32px);
  border-bottom: 1px solid var(--line);
  transition: background-color .45s var(--e-out);
  cursor: pointer;
}
.posts-grid .post-card { border-right: 1px solid var(--line); }
.posts-grid .post-card:nth-child(3n) { border-right: 0; }
.post-card:hover { background: color-mix(in oklab, var(--dye) 7%, transparent); }
.post-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: 2px;
  background: var(--dye); transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--e-out);
}
.post-card:hover::before { transform: scaleX(1); }
.post-card-index { color: var(--fg-3); margin-bottom: auto; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--fg-3); margin: 26px 0 14px; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.post-title { margin: 0 0 12px; font-size: clamp(1.32rem, 1.85vw, 1.72rem); font-weight: 500; letter-spacing: -.015em; line-height: 1.3; overflow-wrap: anywhere; color: var(--fg); }
.post-title a { display: inline; background-image: linear-gradient(var(--dye-light), var(--dye-light)); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .5s var(--e-out), color .3s; }
.post-card:hover .post-title a { color: var(--dye-light); background-size: 100% 1px; }
.post-excerpt { margin: 0 0 22px; color: var(--fg-2); font-size: 1.0625rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 9px; color: var(--fg-3); font-size: .82rem; transition: color .3s, gap .4s var(--e-out); }
.post-card:hover .post-cta { color: var(--dye); gap: 13px; }
.post-cta i { font-style: normal; }

/* Empty state */
.empty-state { text-align: center; padding: clamp(60px, 12vh, 120px) 20px; max-width: 520px; margin: 0 auto; }
.empty-state .empty-glyph { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 26px; color: var(--dye); box-shadow: inset 0 0 0 1px var(--line), 0 0 60px -18px var(--dye); }
.empty-state h2 { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.04em; font-weight: 600; }
.empty-state p { margin: 0 0 26px; color: var(--fg-2); }
.empty-state a { display: inline-flex; align-items: center; gap: 9px; color: var(--dye-light); border-bottom: 1px solid var(--dye); padding-bottom: 3px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: clamp(48px, 8vh, 84px); }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 44px; height: 44px; padding: 0 16px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-2);
  transition: color .25s, box-shadow .25s, background-color .25s, transform .4s var(--e-spring);
}
.pagination a:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--dye); transform: translateY(-2px); }
.pagination span.current { background: var(--dye); color: #fff; box-shadow: none; }

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.progress { position: fixed; left: var(--rail); right: 0; top: 0; height: 2px; z-index: 80; background: transparent; pointer-events: none; }
.progress i { display: block; height: 100%; width: 100%; transform: scaleX(var(--p, 0)); transform-origin: left; background: linear-gradient(90deg, var(--dye-deep), var(--dye), var(--dye-light)); }
@media (max-width: 1023px) { .progress { left: 0; top: 62px; } }

.article-wrap { background: var(--bg); padding: clamp(92px, 14vh, 150px) 0 clamp(70px, 12vh, 120px); position: relative; overflow: clip; }
.article-wrap::before {
  content: ''; position: absolute; left: 50%; top: -10vh; width: min(120vw, 1100px); height: 70vh; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 30%, color-mix(in oklab, var(--dye) 13%, transparent), transparent 70%);
  pointer-events: none;
}
.article-col { position: relative; width: calc(100% - 2 * var(--pad)); max-width: 750px; margin: 0 auto; padding: 0; }
.article-col--wide { max-width: 980px; }
.back-link { display: inline-flex; align-items: center; gap: 9px; color: var(--fg-3); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: clamp(28px, 5vh, 48px); transition: color .25s, gap .4s var(--e-out); }
.back-link:hover { color: var(--dye-light); gap: 13px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 16px; color: var(--fg-3); margin-bottom: 28px; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.article-meta .tag { color: var(--dye-light); }
.article-title { margin: 0 0 30px; font-size: clamp(2rem, 4.2vw, 3.5rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.1; color: var(--fg); text-wrap: balance; overflow-wrap: anywhere; }
.article-dek { margin: 0 0 34px; color: var(--fg-2); font-size: clamp(1.1875rem, 1.5vw, 1.3125rem); line-height: 1.65; }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: clamp(36px, 6vh, 60px); color: var(--fg-3); }
.article-byline b { color: var(--fg); font-weight: 500; }

/* Article body */
.article-body { font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: clamp(1.1875rem, 1.4vw, 1.25rem); line-height: 1.7; color: var(--body-text); overflow-wrap: anywhere; font-kerning: normal; }
.article-body > * { max-width: 72ch; }
.article-body em { font-family: inherit; font-weight: inherit; letter-spacing: normal; }
.article-body iframe, .article-body video { max-width: 100%; }
.article-body :is(h1, h2, h3, h4) { scroll-margin-top: 90px; }
.article-body :is(ul, ol) :is(ul, ol) { margin-top: .6em; margin-bottom: .6em; }
.article-body p { margin: 0 0 1.5em; }
.article-body h1, .article-body h2, .article-body h3, .article-body h4 { color: var(--fg); font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.article-body h1 { font-size: clamp(1.85rem, 3.4vw, 2.6rem); margin: 2.1em 0 .65em; }
.article-body h2 { font-size: clamp(1.6rem, 2.8vw, 2.15rem); margin: 2em 0 .6em; }
.article-body h3 { font-size: clamp(1.3rem, 2.1vw, 1.6rem); margin: 1.9em 0 .5em; }
.article-body h4 { font-size: 1.15rem; margin: 1.7em 0 .45em; }
.article-body h1 em, .article-body h2 em, .article-body h3 em { color: var(--dye-light); font-size: 1.06em; }
/* Keep the opening sentence on the same baseline as the rest of the article. */
.article-body a { color: var(--dye-light); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--dye) 60%, transparent); transition: color .25s, text-decoration-color .25s; }
.article-body a:hover { color: var(--strong); text-decoration-color: var(--dye); }
.article-body strong { color: var(--strong); font-weight: 600; }
.article-body em { color: var(--fg); }
.article-body ul, .article-body ol { margin: 0 0 1.6em; padding-left: 1.4em; }
.article-body li { margin: 0 0 .55em; padding-left: .2em; }
.article-body li::marker { color: var(--dye); }
.article-body hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.article-body img { width: 100%; max-width: 100%; border-radius: 16px; margin: 2.4em 0; box-shadow: 0 36px 80px -44px rgba(0,0,0,.9); }

/* Pull quote */
.article-body blockquote {
  position: relative; margin: 2.4em 0; padding: .2em 0 .2em clamp(22px, 3vw, 38px);
  border-left: 2px solid var(--dye); color: var(--fg);
  font-family: var(--f-serif); font-style: italic; font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.3;
}
.article-body blockquote p { margin: 0; max-width: none; }
.article-body blockquote p::first-letter { font-size: inherit; float: none; padding: 0; color: inherit; }

/* Code */
.article-body code {
  font-family: var(--f-mono); font-size: .86em; padding: .14em .42em; border-radius: 6px;
  background: color-mix(in oklab, var(--dye) 16%, var(--ink-3)); color: var(--dye-light);
}
.article-body pre {
  position: relative; margin: 2.2em 0; padding: 22px clamp(18px, 2.4vw, 28px);
  background: var(--code-bg); border-radius: 16px; overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -46px var(--shade);
  font-size: .9375rem; line-height: 1.7;
}
.article-body pre::before { content: ''; position: absolute; left: 20px; top: 18px; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in oklab, var(--dye) 70%, transparent); box-shadow: 14px 0 0 color-mix(in oklab, var(--dye) 35%, transparent), 28px 0 0 color-mix(in oklab, var(--dye) 18%, transparent); }
.article-body pre code { display: block; padding: 1.3em 0 0; background: none; color: var(--code-fg); font-size: inherit; overflow-x: auto; }
.article-body pre code::selection { background: var(--dye-deep); }

/* Tables */
.article-body .table-scroll { margin: 2.2em 0; overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.article-body table { width: 100%; border-collapse: collapse; font-size: 1rem; min-width: 420px; }
.article-body th, .article-body td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.article-body th { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--dye-light); font-weight: 500; background: var(--raise); }
.article-body tr:last-child td { border-bottom: 0; }
.article-body tbody tr { transition: background-color .25s; }
.article-body tbody tr:hover { background: color-mix(in oklab, var(--dye) 6%, transparent); }

/* End mark + actions */
.article-end { display: flex; align-items: center; gap: 14px; margin: 3em 0 0; color: var(--fg-3); }
.article-end::before, .article-end::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.article-end i { width: 7px; height: 7px; border-radius: 50%; background: var(--dye); }

.article-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: clamp(36px, 6vh, 56px); padding: 20px 0; border-top: 1px solid var(--line);
}
.article-actions .group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.share-label { color: var(--fg-3); margin-right: 4px; }
.share-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .25s, box-shadow .25s, background-color .25s, transform .4s var(--e-spring);
}
.share-btn:hover { color: #fff; background: var(--dye); box-shadow: none; transform: translateY(-2px); }
.share-btn svg { width: 17px; height: 17px; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .25s, box-shadow .25s, background-color .25s;
}
.copy-btn:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--dye); }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn.copied { background: var(--dye); color: #fff; box-shadow: none; }
.like-btn {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px; border-radius: 999px;
  color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: .86rem;
  transition: color .25s, box-shadow .25s, background-color .25s, transform .35s var(--e-spring);
}
.like-btn:hover { color: var(--fg); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 55%, transparent); }
.like-btn.liked { color: var(--dye-light); background: color-mix(in oklab, var(--dye) 14%, transparent); box-shadow: inset 0 0 0 1px var(--dye); }
.like-btn.liked svg { fill: var(--dye-light); stroke: var(--dye-light); }
.like-count { color: inherit; font-size: 10.5px; opacity: .8; }

/* ==========================================================================
   Reactions (post)
   ========================================================================== */
.reactions-section { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.reactions-display { display: flex; flex-wrap: wrap; gap: 8px; }
.reaction-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px;
  border-radius: 999px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer; transition: transform .35s var(--e-spring), box-shadow .25s, background-color .25s;
}
.reaction-pill:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 55%, transparent); }
.reaction-pill.mine { background: color-mix(in oklab, var(--dye) 18%, transparent); box-shadow: inset 0 0 0 1px var(--dye); }
.reaction-pill__emoji { font-size: 17px; line-height: 1; }
.reaction-pill__count { font-family: var(--f-mono); font-size: 12px; color: var(--fg-2); }
.reaction-pill.mine .reaction-pill__count { color: var(--fg); }
.reaction-add-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px;
  color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .25s, box-shadow .25s, background-color .25s;
}
.reaction-add-btn:hover, .reaction-add-btn.active { color: var(--dye-light); box-shadow: inset 0 0 0 1px var(--dye); background: color-mix(in oklab, var(--dye) 10%, transparent); }
.reaction-add-btn svg { flex: none; }
.reactions-picker {
  display: none; align-items: center; gap: 2px; position: absolute; bottom: calc(100% + 10px); left: 0; z-index: 20;
  padding: 7px 9px; border-radius: 999px; background: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -20px rgba(0,0,0,.8);
  animation: pickerPop .25s var(--e-spring);
}
.reactions-picker.open { display: inline-flex; }
@keyframes pickerPop { from { opacity: 0; transform: scale(.86) translateY(8px); } to { opacity: 1; transform: none; } }
.reaction-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; transition: transform .25s var(--e-spring), background-color .2s; }
.reaction-btn:hover { transform: scale(1.32) translateY(-6px); }
.reaction-btn:active { transform: scale(1.1); }
.reaction-btn.active { background: color-mix(in oklab, var(--dye) 22%, transparent); }

/* ==========================================================================
   Subscribe + comments shell
   ========================================================================== */
.post-subscribe {
  margin-top: clamp(44px, 7vh, 70px); padding: clamp(26px, 3.4vw, 40px); border-radius: 20px;
  background: linear-gradient(150deg, var(--ink-3), var(--ink-2));
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -60px color-mix(in oklab, var(--dye-deep) 90%, transparent);
}
.post-subscribe h4 { margin: 0 0 8px; font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--fg); letter-spacing: -.01em; }
.post-subscribe p { margin: 0 0 20px; color: var(--fg-2); font-size: .95rem; }
.post-subscribe form { display: flex; gap: 8px; max-width: 460px; padding: 6px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.post-subscribe input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0 16px; font-size: 16px; }
.post-subscribe button {
  height: 44px; padding: 0 20px; border-radius: 999px; background: var(--dye); color: #fff; font-weight: 500; white-space: nowrap;
  transition: background-color .25s, color .25s, transform .4s var(--e-spring);
}
.post-subscribe button:hover { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.subscribe-message { margin-top: 12px; padding: 11px 14px; border-radius: 12px; font-size: .88rem; }
.subscribe-message.success { background: color-mix(in oklab, var(--dye) 16%, transparent); color: var(--dye-light); }
.subscribe-message.error { background: var(--danger-bg); color: var(--danger); }
.auth-error { margin-top: 24px; padding: 12px 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: .9rem; }

/* Comments (comments.js renders into this shell) */
.comments-section { margin-top: clamp(44px, 7vh, 70px); padding-top: clamp(32px, 5vh, 48px); border-top: 1px solid var(--line); color: var(--fg); }
.comments-header { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.comments-title { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -.04em; }
.comments-count { color: var(--fg-3); font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.comments-auth { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; margin-bottom: 22px; border-radius: 14px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); }
.comments-auth-prompt { color: var(--fg-2); font-size: .93rem; }
.google-signin-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--paper-3); color: #1f2330; font-size: .9rem; font-weight: 500; transition: transform .35s var(--e-spring), background-color .25s; }
.google-signin-btn:hover { background: #fff; transform: translateY(-1px); }
.google-signin-btn svg { width: 18px; height: 18px; }
.user-info { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.user-avatar, .user-avatar-placeholder { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.user-avatar-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--dye), var(--dye-deep)); color: #fff; font-weight: 600; font-size: 13px; }
.user-name { color: var(--fg); font-size: .9rem; }
.logout-link { color: var(--fg-3); font-size: .82rem; transition: color .25s; }
.logout-link:hover { color: var(--dye-light); }
.comment-form { margin-bottom: 30px; }
.comment-form-inner { display: flex; gap: 12px; }
.comment-form-content { flex: 1; min-width: 0; }
.comment-textarea { width: 100%; min-height: 104px; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font-size: 15px; resize: vertical; transition: box-shadow .25s, background-color .25s; }
.comment-textarea::placeholder { color: var(--fg-3); }
.comment-textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--dye); background: var(--raise-2); }
.comment-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.comment-submit-btn, .comment-cancel-btn { padding: 10px 20px; border-radius: 999px; font-size: .86rem; font-weight: 500; transition: background-color .25s, color .25s, box-shadow .25s; }
.comment-submit-btn { background: var(--dye); color: #fff; }
.comment-submit-btn:hover:not(:disabled) { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.comment-submit-btn:disabled { opacity: .55; cursor: not-allowed; }
.comment-cancel-btn { color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); }
.comment-cancel-btn:hover { box-shadow: inset 0 0 0 1px var(--dye); }
.comments-list { display: flex; flex-direction: column; gap: 22px; }
.comment { display: flex; gap: 12px; }
.comment-avatar { flex: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author { color: var(--fg); font-weight: 600; font-size: .9rem; }
.comment-time, .comment-edited { color: var(--fg-3); font-size: .78rem; }
.comment-content { color: var(--body-text); font-size: .95rem; line-height: 1.6; overflow-wrap: anywhere; }
.comment-content p { margin: 0; }
.comment-actions { display: flex; gap: 16px; margin-top: 8px; }
.comment-action-btn { color: var(--fg-3); font-size: .8rem; transition: color .25s; }
.comment-action-btn:hover { color: var(--dye-light); }
.comment-replies { display: flex; flex-direction: column; gap: 16px; margin: 16px 0 0 22px; padding-left: 16px; border-left: 1px solid var(--line); }
.reply-form { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--raise); }
.reply-form .comment-textarea, .edit-form .comment-textarea { min-height: 82px; }
.edit-form { margin-top: 8px; }
.comments-empty { padding: 40px 20px; text-align: center; color: var(--fg-2); }
.comments-empty-icon { font-size: 40px; margin-bottom: 14px; }
.comments-loading { display: flex; justify-content: center; padding: 40px; }
.loading-spinner { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--dye); animation: spin 1s linear infinite; }
.comment-error { margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font-size: .88rem; }

/* Related posts */
.related-posts { margin-top: clamp(48px, 8vh, 80px); padding-top: clamp(32px, 5vh, 48px); border-top: 1px solid var(--line); }
.related-posts > h3 { margin: 0 0 24px; font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 600; letter-spacing: -.04em; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.related-card { display: block; padding: 22px; border-radius: 16px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--line); transition: transform .5s var(--e-out), box-shadow .4s, background-color .4s; }
.related-card:hover { transform: translateY(-3px); background: color-mix(in oklab, var(--dye) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 45%, transparent); }
.related-card-meta { color: var(--fg-3); font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; }
.related-card-title { color: var(--fg); font-size: 1.12rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.25; margin-bottom: 8px; }
.related-card:hover .related-card-title { color: var(--dye-light); }
.related-card-excerpt { color: var(--fg-2); font-size: .88rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Not found */
.not-found { position: relative; background: var(--bg); padding: clamp(120px, 22vh, 220px) 0; text-align: center; }
.not-found .code { font-family: var(--f-serif); font-style: italic; font-size: clamp(4rem, 14vw, 9rem); line-height: 1; color: var(--dye); }
.not-found h1 { margin: 16px 0 12px; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.04em; font-weight: 600; }
.not-found p { margin: 0 auto 30px; max-width: 44ch; color: var(--fg-2); }
.not-found a { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 24px; border-radius: 999px; background: var(--dye); color: #fff; font-weight: 500; }
.not-found a i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); font-style: normal; }

/* Products we've shipped */
.blog-products { background: var(--ink-2); border-top: 1px solid var(--line); padding: clamp(56px, 9vh, 100px) 0 clamp(64px, 10vh, 120px); }
.products-head { max-width: 640px; margin-bottom: clamp(28px, 4.5vh, 48px); }
.products-head .eyebrow { margin: 0 0 14px; color: var(--dye); }
.products-head h2 { margin: 0; font-size: clamp(1.8rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
.products-head h2 em { font-family: var(--f-serif); font-style: italic; font-weight: 400; color: var(--dye-light); }
.products-sub { margin: 14px 0 0; color: var(--fg-2); font-size: 1.02rem; }
.products-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card {
  display: flex; flex-direction: column; gap: 10px; min-height: 210px;
  padding: 22px 22px 20px; border-radius: 18px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .5s var(--e-out), box-shadow .45s, background-color .45s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 45%, transparent), 0 26px 50px -34px var(--dye-deep); }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.product-top img { border-radius: 9px; }
.status { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.status.is-live { color: var(--live, #3fbf6a); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--live, #3fbf6a) 40%, transparent); }
.status.is-beta { color: var(--beta, #e9a93a); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--beta, #e9a93a) 40%, transparent); }
.product-card h3 { margin: 0; font-size: 1.16rem; font-weight: 600; letter-spacing: -.03em; }
.product-card p { margin: 0 0 4px; color: var(--fg-2); font-size: .93rem; line-height: 1.5; }
.product-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--fg-3); transition: color .3s, gap .4s var(--e-out); }
.product-card:hover .product-cta { color: var(--dye-light); gap: 12px; }

/* ==========================================================================
   FOOTER (mirrors the landing page)
   ========================================================================== */
.foot { position: relative; background: var(--bg); padding: clamp(80px, 14vh, 150px) var(--pad) 28px; overflow: hidden; border-top: 1px solid var(--line); }
.foot-top { display: grid; grid-template-columns: 1fr 1.2fr; gap: 6vw; max-width: var(--maxw); margin: 0 auto; }
.foot-news h2 { margin: 0; font-size: clamp(2rem, 3.6vw, 3.4rem); letter-spacing: -.045em; font-weight: 600; }
.foot-news > p { color: var(--fg-2); max-width: 36ch; }
.news { display: flex; gap: 8px; margin-top: 22px; max-width: 460px; padding: 6px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.news input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0 16px; font-size: 16px; }
.news button { height: 46px; padding: 0 20px; border-radius: 999px; background: var(--dye); color: #fff; font-weight: 500; white-space: nowrap; transition: transform .4s var(--e-spring), background-color .3s, color .3s; }
.news button:hover { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.news-msg { min-height: 1.4em; color: var(--dye-light); font-size: 14px; }
.news-msg.is-bad { color: var(--danger); }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.foot-cols div { display: flex; flex-direction: column; gap: 10px; }
.foot-cols h3 { margin: 0 0 8px; color: var(--fg-3); font-weight: 400; }
.foot-cols a { color: var(--fg-2); width: fit-content; transition: color .25s, transform .4s var(--e-out); }
.foot-cols a:hover { color: var(--fg); transform: translateX(4px); }
.foot-mark {
  max-width: var(--maxw); margin: clamp(70px, 11vh, 130px) auto 4vh; font-weight: 700; letter-spacing: -.07em; line-height: .8; white-space: nowrap;
  font-size: clamp(5rem, 21vw, 24rem); color: transparent; user-select: none;
  background: radial-gradient(circle at 50% 50%, var(--dye-light) 0, var(--dye) 18%, var(--mark-stop) 42%);
  -webkit-background-clip: text; background-clip: text;
}
.foot-mark i { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.03em; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; max-width: var(--maxw); margin: 0 auto; color: var(--fg-3); padding-top: 20px; border-top: 1px solid var(--line); font-size: 10.5px; }
.foot-bottom p { margin: 0; }
.foot-bottom a:hover { color: var(--dye); }


/* ---------- Light mode refinements ---------- */
html[data-theme="light"] .feature {
  background:
    radial-gradient(90% 130% at 88% 12%, color-mix(in oklab, var(--dye) 16%, transparent), transparent 62%),
    linear-gradient(150deg, #ffffff, var(--paper-3) 55%, var(--paper-2));
  box-shadow: inset 0 0 0 1px var(--line), 0 24px 60px -42px rgba(31,35,48,.35);
}
html[data-theme="light"] .feature:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 40%, transparent), 0 36px 70px -44px rgba(31,35,48,.4); }
html[data-theme="light"] .post-card:hover { background: color-mix(in oklab, var(--dye) 5%, transparent); }
html[data-theme="light"] .post-subscribe {
  background: linear-gradient(150deg, #ffffff, var(--paper-3));
  box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -48px rgba(31,35,48,.3);
}
html[data-theme="light"] .google-signin-btn { background: #fff; box-shadow: inset 0 0 0 1px rgba(20,22,32,.14); color: #1f2330; }
html[data-theme="light"] .google-signin-btn:hover { background: var(--paper-3); }
html[data-theme="light"] .article-body img { box-shadow: 0 30px 60px -44px rgba(31,35,48,.45); }
html[data-theme="light"] .article-body code { background: color-mix(in oklab, var(--dye) 10%, var(--paper-2)); }
html[data-theme="light"] .article-body pre { box-shadow: inset 0 0 0 1px var(--line), 0 24px 50px -40px rgba(31,35,48,.32); }
html[data-theme="light"] .article-body pre code::selection { background: color-mix(in oklab, var(--dye) 30%, transparent); }
html[data-theme="light"] .not-found a, html[data-theme="light"] .feature-cta i { color: var(--on-dye); }
html[data-theme="light"] .menu { background: var(--ink); }
html[data-theme="light"] .foot-mark { background: radial-gradient(circle at 50% 50%, var(--dye) 0, color-mix(in oklab, var(--dye) 70%, #fff) 14%, var(--mark-stop) 44%); -webkit-background-clip: text; background-clip: text; }
html[data-theme="light"] .reactions-picker { background: #fff; box-shadow: inset 0 0 0 1px var(--line), 0 20px 50px -24px rgba(31,35,48,.35); }

/* Filled dye surfaces need dark ink in dark mode, white ink in light mode. */
::selection { color: var(--on-dye); }
.skip, .feature-cta i, .pagination span.current, .share-btn:hover,
.copy-btn.copied, .post-subscribe button, .comment-submit-btn,
.not-found a, .news button { color: var(--on-dye); }
.post-subscribe button:hover, .news button:hover,
.comment-submit-btn:hover:not(:disabled) { color: var(--btn-hover-fg); }
.feature-title, .feature-excerpt, .related-card-title { overflow-wrap: anywhere; }
.article-meta, .article-byline, .back-link { font-size: 12px; letter-spacing: .1em; line-height: 1.7; }
.related-card-title { letter-spacing: -.015em; line-height: 1.35; }
.related-card-excerpt { font-size: 1rem; line-height: 1.65; }
.article-body th { font-size: .8125rem; letter-spacing: .06em; }
.article-body blockquote { line-height: 1.5; }
.article-body blockquote p + p { margin-top: 1em; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: var(--fg-3); box-shadow: inset 0 0 0 1px var(--line);
  transition: color .25s, background-color .25s, box-shadow .25s, transform .4s var(--e-spring);
}
.theme-toggle:hover { color: var(--dye); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--dye) 55%, transparent); transform: translateY(-1px); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.rail-controls { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.theme-toggle--menu { width: auto; height: 40px; padding: 0 14px; border-radius: 999px; display: inline-flex; gap: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
@media (min-width: 1024px) {
  .theme-toggle--bar, .theme-toggle--menu { display: none; }
}

/* Desktop editorial frame; the prose measure stays independent of the canvas. */
.article-sidebar { display: none; }
@media (min-width: 1100px) {
  .article-wrap { overflow: visible; padding-top: 72px; }
  .article-col { max-width: 1200px; width: calc(100% - 64px); }
  .article-header { max-width: 1100px; }
  .article-title { font-size: clamp(3rem, 4.2vw, 4.25rem); text-wrap: pretty; }
  .article-dek { max-width: 850px; }
  .article-byline { margin-bottom: 64px; }
  .article-reading { display: grid; grid-template-columns: minmax(180px, 220px) minmax(0, 750px) minmax(0, 1fr); gap: 36px; align-items: start; }
  .article-body { min-width: 0; font-size: 20px; line-height: 1.7; }
  .article-body > :first-child { margin-top: 0; }
  .article-sidebar { display: block; align-self: stretch; min-width: 0; }
  .article-sidebar-inner { position: sticky; top: 36px; max-height: calc(100vh - 72px); overflow-y: auto; scrollbar-width: thin; padding-right: 16px; }
  .article-toc[hidden] { display: none; }
  .article-toc h2 { margin: 0 0 18px; color: var(--fg-2); font-weight: 400; }
  .article-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
  .article-toc a { display: block; margin-left: -1px; border-left: 2px solid transparent; padding: 8px 0 8px 15px; font-size: 13px; line-height: 1.5; color: var(--fg-2); transition: color .2s, border-color .2s; }
  .article-toc .toc-sub a { padding-left: 26px; font-size: 12px; }
  .article-toc a:hover, .article-toc a[aria-current] { color: var(--dye-light); border-color: var(--dye-light); }
  .sidebar-meta { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--fg-2); }
  .sidebar-meta > .mono { font-size: 10px; color: var(--fg-3); }
  .sidebar-meta p { font-size: 13px; line-height: 1.8; margin: 12px 0 18px; }
  .sidebar-meta .copy-btn { padding: 0 12px; font-size: 9px; letter-spacing: .06em; }
  .sidebar-discuss { display: flex; gap: 8px; align-items: center; margin-top: 18px; font-size: 12px; color: var(--fg-2); }
  .sidebar-discuss:hover { color: var(--dye-light); }
  .article-body > :is(pre, .table-scroll, figure), .article-body > p:has(> img:only-child) { width: calc(100% + min(8vw, 110px)); max-width: none; }
  .article-body > blockquote { margin-left: -24px; padding-left: 24px; }
  .article-end, .article-actions, .reactions-section { margin-left: 256px; }
  .post-subscribe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 48px; align-items: center; margin-top: 64px; }
  .post-subscribe h4 { grid-column: 1; }
  .post-subscribe p { grid-column: 1; margin-bottom: 0; }
  .post-subscribe form { grid-column: 2; grid-row: 1 / 3; width: 100%; max-width: none; }
  .post-subscribe .subscribe-message { grid-column: 1 / -1; }
  .related-card { padding: 32px; }
  .related-card-title { font-size: 1.5rem; }
  .comments-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 28px; }
  .comments-list > .comments-empty { grid-column: 1 / -1; }
}
@media (min-width: 1100px) and (max-width: 1279px) {
  .article-reading { grid-template-columns: 180px minmax(0, 750px); gap: 24px; }
  .article-body > :is(pre, .table-scroll, figure), .article-body > p:has(> img:only-child) { width: 100%; }
  .article-end, .article-actions, .reactions-section { margin-left: 204px; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .posts-grid .post-card:nth-child(3n) { border-right: 1px solid var(--line); }
  .posts-grid .post-card:nth-child(2n) { border-right: 0; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  body { padding-top: 62px; }
  .blog-hero { padding-top: clamp(56px, 10vh, 96px); }
  .article-wrap { padding-top: clamp(48px, 9vh, 84px); }
  .foot-top { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .blog-hero h1 { font-size: clamp(2.9rem, 15vw, 4.6rem); }
  .blog-hero-top { margin-bottom: 40px; }
  .blog-hero-top > span:last-child { display: none; }
  .feature { border-radius: 20px; }
  .feature-title { font-size: clamp(1.9rem, 8.6vw, 2.7rem); }
  .feature-excerpt { font-size: 1.0625rem; line-height: 1.65; }
  .posts-grid { grid-template-columns: minmax(0, 1fr); }
  .posts-grid .post-card, .posts-grid .post-card:nth-child(3n) { border-right: 0; }
  .products-grid { grid-template-columns: minmax(0, 1fr); }
  .product-card { min-height: 0; }
  .post-card { min-height: 0; padding: 24px 4px; }
  .article-actions { flex-direction: column; align-items: flex-start; }
  .post-subscribe form { max-width: none; }
  .post-subscribe form { flex-direction: column; border-radius: 16px; padding: 10px; }
  .post-subscribe input { padding: 10px 12px; }
  .post-subscribe button { height: 46px; }
  .related-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .news { flex-direction: column; border-radius: 20px; padding: 10px; }
  .news input { padding: 10px 12px; }
  .news button { height: 46px; }
  .foot-bottom { flex-direction: column; }
  .comments-auth { align-items: flex-start; }
  .comment-replies { margin-left: 12px; padding-left: 12px; }
  .reactions-picker { left: 0; right: auto; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  .feature:hover, .post-card:hover, .related-card:hover, .pagination a:hover { transform: none; }
}
