/* =========================================================
   imransarwar.com — design system v3
   Modern editorial portfolio — Geist + Newsreader + Geist Mono
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --font-sans: "Geist", "Helvetica Neue", Helvetica, system-ui, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, monospace;

  --accent: #E85D3C;
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);
  --accent-ink: #1A0A05;
}

:root, [data-theme="dark"] {
  --bg: #0B0B0B;
  --bg-elev: #131313;
  --surface: #161616;
  --surface-2: #1c1c1c;
  --line: #232323;
  --line-strong: #2e2e2e;
  --ink: #F5F4F0;
  --ink-muted: #A8A6A0;
  --ink-dim: #6E6C66;
  --chip-bg: #1a1a1a;
  --bubble-user-bg: var(--accent);
  --bubble-user-ink: #1A0A05;
  --bubble-bot-bg: #1a1a1a;
  --bubble-bot-ink: #ededeb;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F7F6F2;
  --bg-elev: #FBFAF7;
  --surface: #FFFFFF;
  --surface-2: #F2F1EC;
  --line: #E6E4DC;
  --line-strong: #D5D2C8;
  --ink: #14130F;
  --ink-muted: #6A6862;
  --ink-dim: #9A988F;
  --chip-bg: #F2F1EC;
  --bubble-user-bg: var(--accent);
  --bubble-user-ink: #1A0A05;
  --bubble-bot-bg: #F2F1EC;
  --bubble-bot-ink: #14130F;
  color-scheme: light;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
}
body { overflow-x: hidden; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .container { padding: 0 20px; } }
.container > *,
.grid-2 > *,
.hero-grid > *,
.cap-grid > *,
.chat-grid > *,
.demo-grid > *,
.nba-grid > *,
.featured-grid > *,
.work-row > *,
.post-row > *,
.related .grid > * {
  min-width: 0;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
}
.brand-meta { display: flex; flex-direction: column; line-height: 1.1; }
.brand-meta b { font-weight: 600; font-size: 14px; }
.brand-meta span {
  font-size: 11px; color: var(--ink-muted);
  font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase;
}

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-muted);
  transition: color .15s, background .15s; font-weight: 500;
  cursor: pointer;
}
.nav-link:hover { color: var(--ink); }
.nav-link[data-active="true"] { color: var(--ink); background: var(--surface); }
.nav-link[data-active="true"]::before {
  content: ""; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
}

.nav-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-muted); border: 1px solid transparent;
  transition: all .15s;
}
.icon-btn:hover { color: var(--ink); background: var(--surface); border-color: var(--line); }

.cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-size: 13.5px; font-weight: 500;
  transition: transform .15s, opacity .15s;
  border: 0; cursor: pointer;
}
.cta:hover { opacity: .9; }
.cta-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.cta-ghost:hover { background: var(--surface); }
.cta-accent { background: var(--accent); color: var(--accent-ink); }

.menu-toggle { display: none; }

/* ---------- Footer ---------- */
.footer { margin-top: auto; border-top: 1px solid var(--line); padding: 32px 0; font-size: 13px; color: var(--ink-muted); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { cursor: pointer; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Common bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-muted);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.eyebrow.no-rule::before { display: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--chip-bg); border: 1px solid var(--line);
  font-size: 12px; color: var(--ink-muted);
  font-family: var(--font-mono); letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip.btn { cursor: pointer; transition: background .15s, color .15s; }
.chip.btn:hover { color: var(--ink); }

.divider { height: 1px; background: var(--line); width: 100%; }

.h-display {
  font-family: var(--font-serif); font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.02; color: var(--ink);
  overflow-wrap: break-word;
}
.h-display em { font-style: italic; color: var(--accent); }
.h-sans { font-family: var(--font-sans); letter-spacing: -0.02em; font-weight: 500; line-height: 1.15; overflow-wrap: break-word; }
.mono { font-family: var(--font-mono); }

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--line-strong); }

/* ---------- Chat bubble ---------- */
.bubble {
  max-width: 92%; padding: 12px 16px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-wrap: break-word;
}
.bubble.user {
  background: var(--bubble-user-bg); color: var(--bubble-user-ink);
  border-bottom-right-radius: 6px; align-self: flex-end;
}
.bubble.bot {
  background: var(--bubble-bot-bg); color: var(--bubble-bot-ink);
  border-bottom-left-radius: 6px; align-self: flex-start;
  border: 1px solid var(--line);
}
.bubble-time {
  font-size: 10.5px; margin-top: 6px; opacity: .55;
  font-family: var(--font-mono); letter-spacing: .04em; text-transform: uppercase;
}

/* ---------- Sections ---------- */
.section { padding: 96px 0; }
.section-tight { padding: 56px 0; }
@media (max-width: 720px) {
  .section { padding: 64px 0; }
  .section-tight { padding: 40px 0; }
  .container h1,
  .container h2,
  .container p {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    width: min(100%, calc(100vw - 40px)) !important;
  }
  .container p {
    width: 100%;
  }
  .container h1.h-display {
    font-size: clamp(34px, 10vw, 44px) !important;
  }
  .container h2.h-display {
    font-size: clamp(30px, 9vw, 42px) !important;
  }
}

/* ---------- Misc ---------- */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }

.grid-2 {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: start;
}
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; gap: 32px; } }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .35s ease both; }

.placeholder {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--ink) 4%, transparent) 0 1px,
      transparent 1px 14px),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* ---------- Hero / Home ---------- */
.hero-chips { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-title { font-size: clamp(48px, 7.5vw, 112px); margin: 0; max-width: 1100px; }
.hero-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px;
  margin-top: 56px; align-items: end;
}
.hero-lede {
  font-size: 19px; line-height: 1.55; color: var(--ink-muted);
  max-width: 560px; width: 100%; margin: 0;
  overflow-wrap: break-word;
}

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.stat-grid > div { background: var(--bg); padding: 20px 18px; }
.stat-grid .stat-n { font-family: var(--font-sans); font-size: 32px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
.stat-grid .stat-l { font-size: 12px; color: var(--ink-muted); margin-top: 4px; line-height: 1.35; overflow-wrap: break-word; }

@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .container h1,
  .container h2,
  .container p {
    max-width: 330px !important;
    width: 330px !important;
  }
  .hero-title {
    font-size: clamp(34px, 9vw, 38px) !important;
    max-width: 330px !important;
    width: 330px !important;
    white-space: normal !important;
  }
  .hero-grid { gap: 36px; margin-top: 40px; }
  .hero-lede {
    font-size: 16px;
    max-width: 330px !important;
    width: 330px !important;
    white-space: normal !important;
  }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 20px 0; overflow: hidden; background: var(--bg-elev);
}
.marquee-inner {
  display: flex; gap: 40px;
  animation: marquee 50s linear infinite;
  white-space: nowrap; width: max-content;
}
.marquee span.tech {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-muted); letter-spacing: .04em;
}
.marquee span.plus { color: var(--accent); margin-left: 40px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Selected work table ---------- */
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 40px; flex-wrap: wrap; gap: 16px;
}
.work-row {
  display: grid;
  grid-template-columns: 80px 1fr 1.2fr 100px 24px;
  gap: 24px; padding: 28px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline; cursor: pointer;
  transition: background .2s;
}
.work-row:first-child { border-top: 1px solid var(--line); }
.work-row:hover { background: var(--bg-elev); }
.work-row .work-n { color: var(--ink-dim); font-size: 12px; font-family: var(--font-mono); }
.work-row .work-title { font-size: 22px; }
.work-row .work-client { font-size: 12px; color: var(--ink-muted); margin-top: 4px; font-family: var(--font-mono); }
.work-row .work-desc { color: var(--ink-muted); font-size: 14px; max-width: 520px; }
.work-row .work-tags { display: flex; flex-direction: column; gap: 4px; }
.work-row .work-tag {
  font-size: 11px; color: var(--ink-dim); text-transform: uppercase;
  letter-spacing: .06em; font-family: var(--font-mono);
}
@media (max-width: 880px) {
  .work-row { grid-template-columns: 40px 1fr 24px; }
  .work-row > .work-desc, .work-row > .work-tags { display: none; }
}

/* ---------- Capabilities ---------- */
.cap-section {
  background: var(--bg-elev); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cap-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; }
.cap-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.cap-cards > div { background: var(--bg); padding: 24px; }
.cap-cards .cap-title { font-size: 18px; margin-bottom: 14px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.cap-cards ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cap-cards li { display: flex; align-items: baseline; gap: 10px; font-size: 13.5px; color: var(--ink-muted); }
.cap-cards li b { color: var(--accent); font-family: var(--font-mono); font-size: 10px; font-weight: 500; }
@media (max-width: 880px) { .cap-grid { grid-template-columns: 1fr; } .cap-cards { grid-template-columns: 1fr; } }

/* ---------- Resume chat ---------- */
.chat-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; }
.chat-sticky { position: sticky; top: 96px; align-self: start; }
.chat-intro { max-width: 420px; }
.chat-presets { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.chat-preset {
  text-align: left; padding: 12px 14px; font-size: 13.5px;
  color: var(--ink-muted); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%;
}
.chat-card {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  min-height: 540px;
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
}
.chat-body {
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  flex: 1; overflow-y: auto; max-height: 480px;
}
.chat-input-bar { padding: 16px; border-top: 1px solid var(--line); }
.chat-input-wrap {
  display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 6px 6px 14px; gap: 8px;
}
.chat-input-wrap input {
  flex: 1; border: 0; outline: none; background: transparent;
  font-size: 14px; padding: 8px 0; color: var(--ink);
}
.chat-send {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
}
.chat-suggestions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
@media (max-width: 880px) {
  .chat-grid { display: flex; flex-direction: column; gap: 28px; }
  .chat-sticky { display: contents; position: static; }
  .chat-intro { order: 1; max-width: 100%; }
  .chat-card { order: 2; min-height: 460px; }
  .chat-presets {
    order: 3;
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .chat-body { max-height: 340px; padding: 18px; }
}

/* ---------- Timeline ---------- */
.timeline-row {
  display: grid; grid-template-columns: 160px 1fr 1fr; gap: 24px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.timeline-row:first-child { border-top: 1px solid var(--line); }
.timeline-year { font-size: 12px; color: var(--ink-muted); letter-spacing: .04em; font-family: var(--font-mono); }
.timeline-title { font-size: 20px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.timeline-org { color: var(--ink-muted); font-size: 14px; }
@media (max-width: 720px) { .timeline-row { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- Models tabs ---------- */
.tabs-bar {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: sticky; top: 64px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}
.tabs-inner { display: flex; gap: 4px; padding: 10px 0; overflow-x: auto; }
.tab-btn {
  padding: 8px 14px; border-radius: 8px;
  white-space: nowrap; font-size: 13.5px;
  background: transparent; color: var(--ink-muted);
  border: 1px solid transparent;
  transition: all .15s; cursor: pointer;
}
.tab-btn[data-active="true"] {
  background: var(--surface); color: var(--ink);
  border-color: var(--line-strong);
}
.tab-btn[data-active="true"]::before {
  content: ""; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
}

/* ---------- Demo grid ---------- */
.demo-grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 48px; }
@media (max-width: 960px) { .demo-grid { grid-template-columns: 1fr; } }
.spec-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin-top: 28px;
}
.spec-grid > div { background: var(--bg); padding: 14px 16px; }
.spec-k {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-dim); text-transform: uppercase; letter-spacing: .08em;
}
.spec-v { font-size: 18px; margin-top: 4px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
@media (max-width: 560px) {
  .spec-grid { grid-template-columns: 1fr !important; }
  .spec-v { font-size: 16px; overflow-wrap: break-word; }
}

.demo-chat-card {
  padding: 0; min-height: 520px; display: flex; flex-direction: column;
}

.sample-card {
  text-align: left; padding: 14px 16px; cursor: pointer;
  display: block; width: 100%;
}
.sample-card .sample-text { font-size: 13.5px; color: var(--ink); }
.sample-card .sample-out {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); margin-top: 6px; letter-spacing: .04em;
}

/* ---------- Next-best-action ---------- */
.nba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
@media (max-width: 960px) { .nba-grid { grid-template-columns: 1fr; } }
.nba-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nba-form label { display: flex; flex-direction: column; gap: 6px; }
.nba-form label span {
  font-size: 11px; color: var(--ink-muted);
  font-family: var(--font-mono); letter-spacing: .04em;
}
.nba-form select {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
  min-width: 0; width: 100%;
}
@media (max-width: 560px) {
  .nba-form { grid-template-columns: 1fr; }
  .demo-chat-card { min-height: 440px; }
}

/* ---------- Tools ---------- */
.terminal {
  padding: 0; overflow: hidden; background: #0a0a0a;
  border-color: #222 !important;
}
.terminal-head {
  padding: 12px 18px; border-bottom: 1px solid #222;
  display: flex; align-items: center; gap: 8px; background: #0e0e0e;
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-title {
  flex: 1; text-align: center;
  font-family: var(--font-mono); font-size: 11px; color: #888;
}
.terminal-body {
  padding: 20px; min-height: 280px;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.7;
  color: #cfcfcf;
}
.terminal-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.bar-chart {
  display: flex; align-items: flex-end; gap: 24px;
  height: 220px; padding: 0 8px; border-bottom: 1px solid var(--line);
}
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bar-chart .bar-val { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }
.bar-chart .bar-fill {
  width: 100%; border-radius: 4px 4px 0 0;
  transition: height .6s ease-out;
}
@media (max-width: 560px) {
  .bar-chart { gap: 10px; padding: 0; }
}

.tools-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px;
}
.tool-card {
  padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 180px;
}
.tool-card .tool-status {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .1em;
}
.tool-card .tool-name { font-size: 22px; margin: 0; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.tool-card .tool-desc { color: var(--ink-muted); font-size: 13.5px; margin-top: 8px; line-height: 1.5; }
.tool-card .tool-cta {
  margin-top: auto; font-size: 13px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- Blog index ---------- */
.blog-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip { cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.filter-chip[data-active="true"] {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

.featured-grid {
  padding: 0; overflow: hidden; cursor: pointer;
  display: grid; grid-template-columns: 1.1fr 1fr;
}
.featured-cover {
  min-height: 360px; border-radius: 0;
  border: 0; border-right: 1px solid var(--line);
  background-size: cover; background-position: center;
  position: relative;
}
.featured-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--accent) 18%, transparent) 0%,
    transparent 45%,
    color-mix(in oklab, var(--bg) 35%, transparent) 100%);
  pointer-events: none;
}
.featured-cover.has-image { background-color: var(--surface-2); }
.featured-cover.has-image::before { display: none; }
.post-hero-img {
  aspect-ratio: 16 / 8;
  background-size: cover; background-position: center;
  border: 1px solid var(--line); border-radius: 10px;
  position: relative; overflow: hidden;
}
.post-hero-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
    transparent 60%,
    color-mix(in oklab, var(--bg) 65%, transparent) 100%);
  pointer-events: none;
}
.related-card { overflow: hidden; }
.related-card .related-thumb {
  height: 140px;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  margin: -22px -22px 0;
  border-bottom: 1px solid var(--line);
}
.featured-body {
  padding: 36px; display: flex; flex-direction: column; gap: 16px; justify-content: center;
}
.featured-meta { display: flex; gap: 10px; align-items: center; }
.featured-title { font-size: clamp(28px, 3.4vw, 44px); margin: 0; }
.featured-excerpt { color: var(--ink-muted); font-size: 16px; margin: 0; overflow-wrap: break-word; }
.featured-date {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
  letter-spacing: .04em; display: flex; gap: 14px; flex-wrap: wrap;
}
@media (max-width: 880px) { .featured-grid { grid-template-columns: 1fr; } .featured-cover { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); } }

.archive-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 8px;
}
.archive-head .h {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim);
  text-transform: uppercase; letter-spacing: .1em;
}

.post-row {
  display: grid;
  grid-template-columns: 80px 1.4fr 1fr 100px 80px 24px;
  gap: 24px; padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline; cursor: pointer;
  transition: background .15s;
}
.post-row.has-thumb {
  grid-template-columns: 48px 120px 1.4fr 1fr 100px 80px 24px;
  align-items: center;
}
.post-thumb {
  width: 120px; height: 76px;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px;
}
.post-thumb-placeholder {
  background:
    repeating-linear-gradient(135deg,
      color-mix(in oklab, var(--ink) 4%, transparent) 0 1px,
      transparent 1px 14px),
    var(--surface-2);
}
.post-row:hover { background: var(--bg-elev); }
.post-row .post-n { color: var(--ink-dim); font-size: 12px; font-family: var(--font-mono); }
.post-row .post-title { font-size: 19px; line-height: 1.3; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.post-row .post-excerpt { color: var(--ink-muted); font-size: 13px; margin-top: 6px; max-width: 520px; }
.post-row .post-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.post-row .post-mins { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
@media (max-width: 880px) {
  .post-row { grid-template-columns: 40px 1fr 24px; }
  .post-row.has-thumb { grid-template-columns: 40px 64px 1fr 24px; }
  .post-row.has-thumb .post-thumb { width: 64px; height: 48px; }
  .post-row.has-thumb > div:nth-child(4),
  .post-row.has-thumb > div:nth-child(5),
  .post-row.has-thumb > div:nth-child(6) { display: none; }
  .post-row:not(.has-thumb) > div:nth-child(3),
  .post-row:not(.has-thumb) > div:nth-child(4),
  .post-row:not(.has-thumb) > div:nth-child(5) { display: none; }
}
@media (max-width: 520px) {
  .featured-body { padding: 24px; }
  .featured-title { font-size: 30px; }
  .blog-filters {
    max-width: 330px;
    width: 330px;
  }
  .archive-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .post-row { gap: 12px; }
  .post-row.has-thumb { grid-template-columns: 30px 58px 1fr 20px; }
  .post-row.has-thumb .post-thumb { width: 58px; height: 44px; }
  .post-row .post-title { font-size: 16px; }
  .post-row .post-excerpt { display: none; }
}

/* ---------- Blog post (editorial) ---------- */
.post-shell { padding-top: 48px; }
.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-muted); font-size: 13px; margin-bottom: 32px;
  cursor: pointer;
}
.post-back:hover { color: var(--ink); }
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.post-h1 { font-size: clamp(38px, 5.5vw, 64px); margin: 0; letter-spacing: -0.025em; }
.post-lede {
  font-family: var(--font-serif); font-size: 22px; line-height: 1.5;
  color: var(--ink-muted); margin-top: 32px; max-width: 640px; font-style: italic;
  overflow-wrap: break-word;
}

.post-hero {
  margin-top: 56px;
}
.post-hero .placeholder { aspect-ratio: 16 / 8; }

.essay-section { margin-top: 56px; }
.essay-section .container { max-width: 760px; }
.essay-h2 {
  font-size: 32px; letter-spacing: -0.02em;
  margin: 0 0 20px; position: relative; padding-left: 20px;
  font-family: var(--font-serif); font-weight: 400; line-height: 1.15; color: var(--ink);
}
.essay-h2::before {
  content: ""; position: absolute; left: 0; top: 14px;
  width: 8px; height: 8px; background: var(--accent); display: inline-block;
}
.essay-h2 em { font-style: italic; color: var(--accent); }
.prose {
  font-size: 18px; line-height: 1.75; color: var(--ink);
  font-family: var(--font-serif); font-weight: 400;
  overflow-wrap: break-word;
}
.prose p { margin: 0 0 18px; }
.prose p:last-child { margin-bottom: 0; }
.prose em { font-style: italic; color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 50%, transparent); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--font-serif); font-weight: 400;
  letter-spacing: -0.02em; color: var(--ink);
  margin: 40px 0 16px;
}
.prose h2 { font-size: 30px; line-height: 1.15; }
.prose h3 { font-size: 24px; line-height: 1.2; }
.prose h4 { font-size: 20px; line-height: 1.25; }
.prose h2 em, .prose h3 em, .prose h4 em { color: var(--accent); font-style: italic; }
.prose blockquote {
  margin: 24px 0; padding: 16px 22px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  font-style: italic; color: var(--ink-muted);
}
.prose code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px;
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.55;
}
.prose pre code { border: 0; padding: 0; background: transparent; }
.prose img {
  border-radius: 10px; margin: 24px auto;
  border: 1px solid var(--line);
  display: block; max-width: min(100%, 520px); height: auto;
}
.prose .blog-author,
.prose .blog-author-avatar,
.prose .blog-author-info,
.prose .blog-navigation,
.prose .blog-nav-link { display: none !important; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

.steps-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; gap: 18px;
}
.steps-list li {
  display: grid; grid-template-columns: 48px 1fr; gap: 18px;
  padding: 20px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.steps-list .step-n {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); letter-spacing: .06em; padding-top: 2px;
}
.steps-list .step-title { font-size: 17px; margin-bottom: 4px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.steps-list .step-desc { color: var(--ink-muted); font-size: 15px; line-height: 1.55; }

.pull-quote { margin-top: 64px; }
.pull-quote .container { max-width: 1000px; }
.pull-quote blockquote {
  margin: 0; padding: 48px 56px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
}
.pull-quote .quote-text {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(24px, 3vw, 36px); margin: 0; line-height: 1.3;
  color: var(--ink); letter-spacing: -0.02em;
}
.pull-quote .quote-text em { font-style: italic; color: var(--accent); }
@media (max-width: 720px) {
  .pull-quote blockquote { padding: 28px 24px; }
  .post-shell { padding-top: 36px; }
  .post-h1 { font-size: clamp(34px, 11vw, 46px); }
  .post-lede { font-size: 19px; margin-top: 24px; }
  .post-hero { margin-top: 36px; }
  .essay-section { margin-top: 40px; }
  .prose { font-size: 17px; line-height: 1.7; }
  .prose h2 { font-size: 27px; }
  .prose h3 { font-size: 22px; }
  .steps-list li { grid-template-columns: 1fr; gap: 8px; padding: 18px; }
}

.bibliography { margin-top: 56px; }
.bibliography .container { max-width: 760px; }
.bib-row {
  padding-top: 24px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.bib-tags { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .1em; }
.bib-actions { display: flex; gap: 14px; }

.author-card { margin-top: 32px; }
.author-card .container { max-width: 760px; }
.author-card .card {
  padding: 28px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
}
.author-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 40%, #111));
  display: grid; place-items: center;
  color: var(--accent-ink); font-family: var(--font-mono); font-weight: 600; font-size: 22px;
  flex-shrink: 0;
}
.author-name { font-size: 18px; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.author-bio { color: var(--ink-muted); font-size: 14px; line-height: 1.5; margin-top: 4px; }

.related { margin-top: 80px; margin-bottom: 80px; }
.related .grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px;
}
.related-card {
  padding: 22px; cursor: pointer;
  display: flex; flex-direction: column; gap: 12px; min-height: 200px;
}
.related-card h3 { font-size: 18px; margin: 0; line-height: 1.3; font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; }
.related-card p { color: var(--ink-muted); font-size: 13px; margin: 0; line-height: 1.5; }
.related-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-dim); margin-top: auto; }
@media (max-width: 520px) {
  .author-card .card { align-items: flex-start; padding: 22px; }
  .author-card .cta { width: 100%; justify-content: center; }
  .related { margin-top: 56px; margin-bottom: 56px; }
}

/* ---------- Mobile menu ---------- */
@media (max-width: 880px) {
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 12px 20px; gap: 2px;
    box-shadow: 0 18px 36px color-mix(in oklab, #000 34%, transparent);
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - 64px));
    transition: opacity .18s ease, transform .25s ease, visibility .25s ease;
    visibility: hidden;
    z-index: 70;
  }
  .nav-links[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
  }
  .nav-link { padding: 12px 14px; font-size: 15px; }
  .menu-toggle { display: grid; }
  .nav .brand-meta span { display: none; }
  .cta.ask-cta { display: none; }
}

/* ---------- Tweaks panel (theme toggle only — minimal) ---------- */
.tweaks-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-muted);
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 18px color-mix(in oklab, var(--ink) 8%, transparent);
  transition: color .15s, border-color .15s;
}
.tweaks-fab:hover { color: var(--ink); border-color: var(--line-strong); }
.tweaks-panel {
  position: fixed; right: 20px; bottom: 72px; z-index: 60;
  width: 280px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; display: none;
  box-shadow: 0 10px 40px color-mix(in oklab, var(--ink) 18%, transparent);
}
.tweaks-panel[data-open="true"] { display: block; }
.tweaks-panel h4 {
  margin: 0 0 12px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-dim);
}
.tweaks-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tweaks-row.swatch button {
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line);
}
.tweaks-row.swatch button[data-active="true"] {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.tweaks-mode {
  flex: 1; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; color: var(--ink-muted);
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer; text-align: center;
}
.tweaks-mode[data-active="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 360px) {
  .container { padding: 0 16px; }
  .container h1,
  .container h2,
  .container p,
  .hero-title,
  .hero-lede,
  .blog-filters {
    max-width: calc(100vw - 32px) !important;
    width: calc(100vw - 32px) !important;
  }
  .brand-meta b { font-size: 13px; }
  .tweaks-panel { right: 12px; width: calc(100vw - 24px); }
}
