/* ============================================================
   slavikdev.com — v4 "carte blanche"
   Dark compiler-room editorial. One accent. Mono annotations.
   ============================================================ */

:root {
  --bg: #0c0d0a;
  --bg2: #121310;
  --panel: #151612;
  --ink: #f2f1ea;
  --dim: #91927f;
  --faint: #7e7f70;
  --line: rgba(242, 241, 234, 0.12);
  --line-soft: rgba(242, 241, 234, 0.07);
  --accent: #6fe3ff;
  --accent-ink: var(--accent);
  --display: "Archivo", "Helvetica Neue", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #0c0d0a; }

/* ---- light theme (toggle via Tweaks) ---- */
body.theme-light {
  --bg: #f4f2e8;
  --bg2: #ebe8db;
  --panel: #f9f8f1;
  --ink: #17180f;
  --dim: #686a58;
  --faint: #9a9b8b;
  --line: rgba(23, 24, 15, 0.16);
  --line-soft: rgba(23, 24, 15, 0.08);
  --accent-ink: color-mix(in oklab, var(--accent), black 48%);
}
body.theme-light .grain { opacity: 0.03; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 72px);
}

/* ---- grain overlay ---- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.no-grain .grain { display: none; }

/* ============================================================
   masthead
   ============================================================ */
.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 92%, transparent), color-mix(in srgb, var(--bg) 55%, transparent) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.masthead-name {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.masthead-nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 36px);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.masthead-nav a { color: var(--ink); opacity: 0.85; font-weight: 500; transition: opacity 0.2s, color 0.2s; }
.masthead-nav a:hover { opacity: 1; color: var(--accent-ink); }
.masthead-nav .idx { color: var(--faint); margin-right: 5px; }

/* ============================================================
   hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}
#heroGrid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  -webkit-mask-image: radial-gradient(125% 105% at 62% 38%, #000 48%, transparent 92%);
  mask-image: radial-gradient(125% 105% at 62% 38%, #000 48%, transparent 92%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(to bottom, transparent, var(--bg) 85%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(36px, 6vh, 80px);
}

.boot {
  font-family: var(--mono);
  font-size: clamp(11.5px, 1.05vw, 14px);
  color: var(--dim);
  line-height: 2;
  margin-bottom: clamp(28px, 4.5vh, 56px);
}
.boot .p { color: var(--faint); }
.boot .v { color: var(--ink); }
.boot .a { color: var(--accent-ink); }
.boot-line {
  opacity: 0;
  transform: translateY(8px);
  animation: bootIn 0.5s ease forwards;
}
.boot-line:nth-child(1) { animation-delay: 0.15s; }
.boot-line:nth-child(2) { animation-delay: 0.55s; }
.boot-line:nth-child(3) { animation-delay: 0.95s; }
.boot-line:nth-child(4) { animation-delay: 1.35s; }
.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  vertical-align: text-bottom;
  background: var(--accent-ink);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes bootIn { to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

.hero h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(44px, 8.6vw, 152px);
  line-height: 0.96;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.hero h1 .h1-line {
  display: block;
  opacity: 0;
  transform: translateY(40px);
  animation: bootIn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.hero h1 .h1-line:nth-child(1) { animation-delay: 0.25s; }
.hero h1 .h1-line:nth-child(2) { animation-delay: 0.45s; }
.hero h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: lowercase;
  letter-spacing: 0;
  color: var(--accent-ink);
  font-size: 0.92em;
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: clamp(28px, 4.5vh, 52px);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  letter-spacing: 0.05em;
}
.hero-foot .scroll-cue { color: var(--faint); animation: cueBob 2.2s ease-in-out infinite; }
@keyframes cueBob { 50% { transform: translateY(5px); } }

/* ============================================================
   ticker
   ============================================================ */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 14px 0;
  background: var(--bg);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 36s linear infinite;
}
.ticker span {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  padding-right: 18px;
}
.ticker .tick-sep { color: var(--accent-ink); }
@keyframes tick { to { transform: translateX(-50%); } }

/* ============================================================
   sections — shared
   ============================================================ */
section.block { padding: clamp(80px, 12vh, 160px) 0; position: relative; }

.sec-kicker {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 18px;
}
.sec-kicker .sec-no { color: var(--faint); margin-right: 12px; }

h2.sec-title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(38px, 5.6vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  margin-bottom: clamp(32px, 5vh, 64px);
}
h2.sec-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: lowercase;
  color: var(--dim);
}

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   01 — platform engineering
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}
.work-copy p {
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.65;
  color: var(--ink);
  max-width: 56ch;
}
.work-copy p + p { margin-top: 1.2em; color: var(--dim); }
.work-copy strong { font-weight: 700; color: var(--ink); }
.work-copy a { color: var(--ink); border-bottom: 1px solid var(--accent-ink); transition: color 0.2s; }
.work-copy a:hover { color: var(--accent-ink); }

.focus-list {
  list-style: none;
  margin-top: clamp(28px, 4vh, 44px);
  border-top: 1px solid var(--line);
}
.focus-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--dim);
}
.focus-list .fi { color: var(--faint); font-size: 12px; }
.focus-list .fl { color: var(--ink); letter-spacing: 0.04em; }

/* paved road pipeline */
.pipe-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  padding: clamp(20px, 2.4vw, 36px);
}
.pipe-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
}
.pipe-title .ok { color: var(--accent-ink); }
.pipe {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.pipe-stage {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  font-family: var(--mono);
  font-size: 14px;
}
.pipe-stage .node {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
  justify-self: center;
  position: relative;
}
.pipe-stage .node::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--accent-ink);
  opacity: 0;
  animation: nodePing 5s ease-out infinite;
  animation-delay: var(--d, 0s);
}
.pipe-stage .node::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  background: var(--accent-ink);
  opacity: 0;
  animation: nodeFill 5s ease-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes nodePing {
  0% { opacity: 0; transform: scale(0.4); }
  6% { opacity: 0.9; }
  18% { opacity: 0; transform: scale(1.7); }
  100% { opacity: 0; }
}
@keyframes nodeFill {
  0% { opacity: 0; }
  5% { opacity: 1; }
  60% { opacity: 1; }
  78% { opacity: 0.15; }
  100% { opacity: 0.15; }
}
.pipe-stage .st-name { color: var(--ink); letter-spacing: 0.06em; }
.pipe-stage .st-meta { color: var(--faint); font-size: 12px; }
.pipe-rail {
  width: 1.5px;
  height: 18px;
  background: var(--line);
  margin-left: 6.2px;
  position: relative;
  overflow: hidden;
}
.pipe-rail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -100%;
  height: 100%;
  background: var(--accent-ink);
  animation: railDrop 5s linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes railDrop {
  0% { top: -100%; }
  8% { top: 100%; }
  100% { top: 100%; }
}
.pipe-caption {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ============================================================
   02 — miri
   ============================================================ */
.miri { background: var(--bg2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.miri-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}
.miri-copy p {
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.65;
  max-width: 52ch;
}
.miri-copy p + p { margin-top: 1.2em; color: var(--dim); }
.miri-copy a { color: var(--ink); border-bottom: 1px solid var(--accent-ink); transition: color 0.2s; }
.miri-copy a:hover { color: var(--accent-ink); }

.miri-links {
  display: flex;
  gap: 28px;
  margin-top: clamp(28px, 4vh, 44px);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.05em;
}
.miri-links a {
  color: var(--accent-ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.miri-links a:hover { border-color: var(--accent-ink); }

/* code window */
.code-window {
  border: 1px solid var(--line);
  background: #0a0b08;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.code-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  color: #777868;
}
.code-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(242, 241, 234, 0.12); }
.code-bar .fname { margin-left: 8px; letter-spacing: 0.06em; }
.code-window pre {
  padding: clamp(18px, 2vw, 28px);
  font-family: var(--mono);
  font-size: clamp(13px, 1.1vw, 15.5px);
  line-height: 1.75;
  overflow-x: auto;
  color: #f2f1ea;
}
.code-window .ck { color: var(--accent); }
.code-window .cf { color: #9ecbff; }
.code-window .cc { color: #777868; font-style: italic; }
.code-window .cn { color: #ffc66d; }

/* paintball duel — mythbusters × nvidia homage */
.duel2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(40px, 6vh, 72px);
}
.duel2-side {
  border: 1px solid var(--line);
  background: #0a0b08;
  border-radius: 6px;
  padding: 14px 16px 16px;
}
.duel2-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #91927f;
  margin-bottom: 12px;
}
.duel2-meta {
  color: #5b5c50;
  text-transform: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.duel2-meta.done { color: var(--accent); }
.duel2-side canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
}
.duel2-caption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* ============================================================
   03 — writing
   ============================================================ */
.post-list { border-top: 1px solid var(--line); }
.post-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(16px, 2.4vw, 40px);
  padding: clamp(20px, 2.6vh, 30px) 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding-left 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.post-row::before {
  content: "";
  position: absolute;
  left: -100%;
  top: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(to right, transparent, color-mix(in srgb, var(--accent-ink) 7%, transparent));
  transition: left 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
}
.post-row:hover { padding-left: 14px; }
.post-row:hover::before { left: 0; }
.post-idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}
.post-title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(19px, 2.1vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.005em;
  transition: color 0.2s;
}
.post-row:hover .post-title { color: var(--accent-ink); }
.post-tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 13px;
  white-space: nowrap;
}
.post-arrow {
  font-family: var(--mono);
  font-size: 18px;
  color: var(--faint);
  transition: transform 0.3s, color 0.2s;
}
.post-row:hover .post-arrow { transform: translateX(6px); color: var(--accent-ink); }

/* post thumbnail (home + category lists) */
.post-row:has(.post-thumb) { grid-template-columns: 44px 116px minmax(0, 1fr) auto auto; }
.post-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  align-self: center;
  background: var(--panel);
  border: 1px solid var(--line-soft);
}
.post-thumb image-slot { display: block; width: 100%; height: 100%; }
.post-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.writing-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 26px;
}
.writing-foot a {
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: var(--accent-ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.writing-foot a:hover { border-color: var(--accent-ink); }

/* ============================================================
   04 — beyond
   ============================================================ */
.beyond { background: var(--bg2); border-top: 1px solid var(--line-soft); }
.beyond-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: stretch;
}
.beyond-card {
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: clamp(22px, 2.6vw, 40px);
  transition: border-color 0.25s, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.beyond-card:hover { border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent); transform: translateY(-4px); }
.beyond-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}
.beyond-head h3 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 34px);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.beyond-head .where {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
}
.beyond-card:hover .where { color: var(--accent-ink); }
.filmstrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.filmstrip .strip-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.filmstrip > * { transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.filmstrip > *:nth-child(odd) { transform: rotate(-1.2deg); }
.filmstrip > *:nth-child(even) { transform: rotate(1.2deg) translateY(6px); }
.beyond-card:hover .filmstrip > * { transform: none; }
.pizza-media { display: flex; justify-content: center; padding: 6px 0 2px; }
.pizza-img {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.beyond-card .blurb {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  line-height: 1.7;
}

/* ============================================================
   footer
   ============================================================ */
.footer {
  padding: clamp(90px, 14vh, 180px) 0 40px;
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.footer h2 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(52px, 9vw, 160px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -0.015em;
}
.footer h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: lowercase;
  color: var(--accent-ink);
}
.footer-sub {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--dim);
  max-width: 60ch;
  line-height: 1.8;
}
.footer-mail {
  display: inline-block;
  margin-top: 36px;
  font-family: var(--mono);
  font-size: clamp(16px, 2vw, 26px);
  color: var(--ink);
  border-bottom: 2px solid var(--accent-ink);
  padding-bottom: 4px;
  transition: color 0.2s;
}
.footer-mail:hover { color: var(--accent-ink); }
.footer-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: clamp(60px, 9vh, 110px);
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.04em;
}
.footer-base nav { display: flex; gap: 24px; }
.footer-base a { color: var(--dim); transition: color 0.2s; }
.footer-base a:hover { color: var(--accent-ink); }

/* ============================================================
   motion off
   ============================================================ */
body.no-motion .ticker-track,
body.no-motion .pipe-stage .node::after,
body.no-motion .pipe-stage .node::before,
body.no-motion .pipe-rail::after,
body.no-motion .scroll-cue,
body.no-motion .caret { animation: none; }
body.no-motion .pipe-stage .node::before { opacity: 0.4; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track, .pipe-stage .node::after, .pipe-stage .node::before,
  .pipe-rail::after, .scroll-cue, .caret, .boot-line, .hero h1 .h1-line { animation: none; }
  .boot-line, .hero h1 .h1-line { opacity: 1; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   responsive
   ============================================================ */
@media (max-width: 1000px) {
  .work-grid, .miri-grid, .beyond-grid, .duel2 { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .post-row:has(.post-thumb) { grid-template-columns: 40px 92px minmax(0, 1fr) auto; }
  .post-tag { display: none; }
}
/* portrait is hidden below 760px (see home-fx.js) — hero hugs its content under the
   masthead instead of stretching to full height, so there's no dead top/bottom gap. */
@media (max-width: 759px) {
  .hero { min-height: auto; justify-content: flex-start; }
  .hero-inner {
    padding-top: calc(env(safe-area-inset-top, 0px) + 120px);
    padding-bottom: clamp(40px, 8vh, 72px);
  }
}
@media (max-width: 640px) {
  .masthead-nav .nav-label { display: none; }
  .hero h1 { font-size: clamp(40px, 11.5vw, 64px); }
  .post-row { grid-template-columns: minmax(0, 1fr) auto; }
  .post-row:has(.post-thumb) { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .post-idx { display: none; }
  .filmstrip { grid-template-columns: repeat(2, 1fr); }
  .hero-foot .hf-mid { display: none; }
}

/* ============================================================
   01 — platform lifecycle loop (closed-circuit, replaces pipeline)
   ============================================================ */
.lc-panel { display: flex; flex-direction: column; }
.lc-title {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
}
.lc-title .ok { color: var(--accent-ink); display: inline-flex; gap: 7px; align-items: center; }
.lc-loopglyph { display: inline-block; animation: lcSpin 3.6s linear infinite; }
@keyframes lcSpin { to { transform: rotate(360deg); } }

.lc-stage-area { position: relative; height: 364px; }
.lc-track { position: absolute; left: 0; top: 0; overflow: visible; }
.lc-base { fill: none; stroke: var(--line); stroke-width: 1.5; }
.lc-flow,
.lc-flow-glow {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 46 614;
  animation: lcFlow 5.5s linear infinite;
}
.lc-flow { stroke-width: 2.4; filter: drop-shadow(0 0 5px var(--accent)); }
.lc-flow-glow { stroke-width: 9; opacity: 0.16; filter: blur(2.5px); }
@keyframes lcFlow {
  from { stroke-dashoffset: 46; }
  to   { stroke-dashoffset: -614; }
}

.lc-node {
  fill: var(--bg);
  stroke: var(--faint);
  stroke-width: 1.4;
  transform-box: fill-box;
  transform-origin: center;
  animation: lcNode 5.5s linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes lcNode {
  0%   { fill: var(--accent); stroke: var(--accent); transform: scale(2); }
  13%  { fill: var(--accent); stroke: var(--accent); transform: scale(1); }
  30%  { fill: var(--bg);     stroke: var(--faint);  transform: scale(1); }
  100% { fill: var(--bg);     stroke: var(--faint);  transform: scale(1); }
}

.lc-labels { position: absolute; inset: 0; }
.lc-label {
  position: absolute;
  left: 56px;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.lc-name {
  font-family: var(--mono);
  font-size: 14.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
  animation: lcName 5.5s linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes lcName {
  0%   { color: var(--accent-ink); text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 65%, transparent); }
  16%  { color: var(--accent-ink); text-shadow: 0 0 0 transparent; }
  34%  { color: var(--ink); }
  100% { color: var(--ink); }
}
.lc-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  margin-left: auto;
  white-space: nowrap;
}
.lc-caption {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
}

body.no-motion .lc-flow,
body.no-motion .lc-flow-glow,
body.no-motion .lc-node,
body.no-motion .lc-name,
body.no-motion .lc-loopglyph { animation: none; }
body.no-motion .lc-node { fill: var(--accent); stroke: var(--accent); }
body.no-motion .lc-flow { stroke-dashoffset: 0; }

@media (prefers-reduced-motion: reduce) {
  .lc-flow, .lc-flow-glow, .lc-node, .lc-name, .lc-loopglyph { animation: none; }
  .lc-node { fill: var(--accent); stroke: var(--accent); }
  .lc-flow { stroke-dashoffset: 0; }
}
/* ============================================================
   slavikdev.com v4 — blog page chrome (category + post pages)
   layers on top of styles/home-v4.css
   ============================================================ */

.page-main { padding-top: clamp(88px, 9vh, 116px); }

/* breadcrumbs */
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}
.crumbs ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "\203A"; color: var(--faint); }
.crumbs a {
  color: var(--accent-ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.crumbs a:hover { border-color: var(--accent-ink); }

.back-link {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.back-link:hover { border-color: var(--accent-ink); }

/* ============================================================
   category page
   ============================================================ */
.cat-head { padding-bottom: clamp(28px, 4vh, 48px); }
.cat-head h1 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(48px, 7.5vw, 128px);
  line-height: 0.96;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  margin-top: 14px;
}
.cat-head h1 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: lowercase;
  color: var(--dim);
}
.cat-desc {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.8;
  color: var(--dim);
  max-width: 62ch;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: clamp(28px, 4vh, 44px) 0 clamp(36px, 6vh, 64px);
}
.cat-pill {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 18px;
  transition: color 0.2s, border-color 0.2s;
}
.cat-pill:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.cat-pill.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* stacked title + excerpt inside the shared .post-row */
.post-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.post-excerpt {
  font-family: var(--display);
  font-stretch: 100%;
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 72ch;
}

.cat-foot {
  padding: clamp(48px, 8vh, 90px) 0 clamp(70px, 10vh, 120px);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
}

/* ============================================================
   post page
   ============================================================ */
.article-head { max-width: 980px; }
.article-title {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(34px, 4.8vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin-top: 16px;
  text-wrap: balance;
}
.article-lede {
  margin-top: 26px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.6;
  color: var(--dim);
  max-width: 62ch;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: clamp(26px, 4vh, 40px);
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.article-meta .am-sep { color: var(--faint); }
.article-meta a { color: var(--accent-ink); }

.article-cover { margin: clamp(32px, 5vh, 56px) 0; }
.article-cover img {
  display: block;
  width: auto;            /* cap at the image's intrinsic size — never upscale */
  max-width: 100%;        /* but scale down to fit narrow screens */
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line-soft);
}

.article-body {
  max-width: 68ch;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 19px;
  line-height: 1.75;
  letter-spacing: 0.003em;
  overflow-wrap: break-word;
  padding-bottom: clamp(50px, 8vh, 90px);
}
.article-body p { margin: 0 0 1.45em; text-wrap: pretty; }
.article-body h2 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 800;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 2.4em 0 0.9em;
  scroll-margin-top: 100px;
  text-wrap: balance;
}
.article-body h2 .h2-no {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.62em;
  color: var(--accent-ink);
  margin-right: 14px;
  letter-spacing: 0.1em;
}
.article-body a {
  color: var(--ink);
  border-bottom: 1px solid var(--accent-ink);
  transition: color 0.2s;
}
.article-body a:hover { color: var(--accent-ink); }
.article-body strong { font-weight: 600; }
.article-body code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}
.article-body ul { margin: 0 0 1.5em; padding-left: 1.2em; }
.article-body li { margin-bottom: 0.5em; }
.article-body li::marker { color: var(--accent-ink); }
.article-body .code-window { margin: 2.2em 0; }
.article-body .code-window pre { font-size: 14px; }

.pullquote {
  margin: 2.6em 0;
  padding: 1.4em 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}
.pullquote .pq-mark { color: var(--accent-ink); font-style: normal; }

/* author + next-up */
.article-foot { max-width: 720px; padding-bottom: clamp(70px, 10vh, 120px); }
.author-card {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 22px 24px;
}
.author-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}
.author-name { font-weight: 700; font-size: 16px; }
.author-bio {
  margin-top: 4px;
  font-size: 14px;
  color: var(--dim);
  line-height: 1.55;
}
.author-links {
  margin-top: 8px;
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 12.5px;
}
.author-links a { color: var(--accent-ink); }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.post-nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  transition: border-color 0.2s, transform 0.3s;
}
.post-nav a:hover { border-color: var(--accent-ink); transform: translateY(-2px); }
.post-nav .pn-label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.post-nav .pn-title {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .post-nav { grid-template-columns: 1fr; }
  .author-card { align-items: flex-start; }
  /* masthead is ~64px tall — keep just a small gap below it (overrides the desktop clamp) */
  .page-main { padding-top: 76px; }
}

@media (max-width: 600px) {
  .article-body {
    font-size: 17.5px;
    line-height: 1.72;
  }
  .article-body .highlight pre,
  .article-body pre.highlight,
  .article-body pre:not(.highlight) { padding: 16px 14px; }
  .article-body .highlight code,
  .article-body pre.highlight code,
  .article-body pre:not(.highlight) > code { font-size: 13px; }
  .article-body div.highlighter-rouge,
  .article-body figure.highlight,
  .article-body pre:not(.highlight) {
    margin-left: calc(-1 * clamp(20px, 4vw, 72px));
    margin-right: calc(-1 * clamp(20px, 4vw, 72px));
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}

/* ============================================================
   markdown article body — real post content (kramdown output)
   layers on top of .article-body from the pages section above
   ============================================================ */
.article-body h3 {
  font-family: var(--display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  margin: 2em 0 0.7em;
  scroll-margin-top: 100px;
  text-wrap: balance;
}
.article-body > p:first-child { margin-top: 0; }
.article-body ol { margin: 0 0 1.5em; padding-left: 1.3em; }
.article-body ol li { margin-bottom: 0.5em; }
.article-body ol li::marker { color: var(--accent-ink); font-family: var(--mono); font-size: 0.85em; }
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 2.2em 0;
  border: 1px solid var(--line-soft);
}
.article-body figure { margin: 2.2em 0; }
.article-body figure img { margin: 0; }
.article-body figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
}
.article-body hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 2.6em 0;
}
.article-body blockquote {
  margin: 2.4em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--accent-ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.4;
  color: var(--ink);
}
.article-body blockquote p { margin: 0 0 0.5em; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 15.5px;
}
.article-body th, .article-body td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.article-body th {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}

/* fenced code blocks (kramdown + rouge) — dark "code window" matching the
   homepage .code-window: chrome lives on the outer container, with a title bar
   (three dots + a language label) drawn via ::before */
.article-body div.highlighter-rouge,
.article-body figure.highlight {
  position: relative;
  margin: 2.2em 0;
  background: #0a0b08;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
/* title bar: three faint dots on the left + a mono language label */
.article-body div.highlighter-rouge::before,
.article-body figure.highlight::before {
  content: "code";
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #777868;
  text-indent: 56px;
  background:
    radial-gradient(circle, rgba(242, 241, 234, 0.12) 4.5px, transparent 5px) 16px 50% / 9px 9px no-repeat,
    radial-gradient(circle, rgba(242, 241, 234, 0.12) 4.5px, transparent 5px) 33px 50% / 9px 9px no-repeat,
    radial-gradient(circle, rgba(242, 241, 234, 0.12) 4.5px, transparent 5px) 50px 50% / 9px 9px no-repeat;
}
/* per-language labels for the title bar */
.article-body div.language-miri::before { content: "example.mi"; }
.article-body div.language-mi::before { content: "example.mi"; }
.article-body div.language-rust::before { content: "main.rs"; }
.article-body div.language-bash::before,
.article-body div.language-sh::before,
.article-body div.language-shell::before { content: "shell"; }
.article-body div.language-yaml::before,
.article-body div.language-yml::before { content: "yaml"; }
.article-body div.language-js::before,
.article-body div.language-javascript::before { content: "javascript"; }
.article-body div.language-ts::before,
.article-body div.language-typescript::before { content: "typescript"; }
.article-body div.language-json::before { content: "json"; }
.article-body div.language-ruby::before,
.article-body div.language-rb::before { content: "ruby"; }
.article-body div.language-python::before,
.article-body div.language-py::before { content: "python"; }
.article-body div.language-html::before { content: "html"; }
.article-body div.language-css::before { content: "css"; }
.article-body div.language-toml::before { content: "toml"; }
.article-body div.language-diff::before { content: "diff"; }
.article-body div.language-octave::before,
.article-body div.language-matlab::before { content: "octave"; }
.article-body div.language-plaintext::before,
.article-body div.language-text::before { content: "text"; }
.article-body .highlight,
.article-body pre.highlight {
  background: transparent;
  border: 0;
  border-radius: 0;
}
.article-body .highlight pre,
.article-body pre.highlight {
  margin: 0;
  padding: clamp(16px, 2vw, 24px);
  overflow-x: auto;
  background: transparent;
}
.article-body .highlight code,
.article-body pre.highlight code {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  background: none;
  border: 0;
  padding: 0;
  color: #f2f1ea;
}

/* fallback for fenced blocks with no Rouge lexer (e.g. ```miri) — kramdown
   emits a bare <pre><code class="language-…"> with no .highlighter-rouge
   wrapper. Give it the same dark "code window" chrome so it never renders as
   raw per-line inline-code boxes. site.js upgrades .language-miri blocks into
   the full highlighted structure; this is the no-JS / unknown-language floor. */
.article-body pre:not(.highlight) {
  margin: 2.2em 0;
  padding: clamp(16px, 2vw, 24px);
  background: #0a0b08;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow-x: auto;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.article-body pre:not(.highlight) > code {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  background: none;
  border: 0;
  padding: 0;
  white-space: pre;
  color: #f2f1ea;
}

/* rouge token colors — accent-tuned dark palette */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cd, .highlight .cs { color: #777868; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt, .highlight .kc { color: var(--accent); }
.highlight .o, .highlight .ow { color: var(--accent); }
.highlight .nf, .highlight .nb, .highlight .nc, .highlight .nn { color: #9ecbff; }
.highlight .nt { color: #9ecbff; }
.highlight .na, .highlight .nv, .highlight .vi { color: #d6d5c4; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .se, .highlight .sb, .highlight .sd, .highlight .sx, .highlight .sr { color: #c0e88a; }
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .il, .highlight .m { color: #ffc66d; }
.highlight .p, .highlight .pi { color: #b6b6a6; }
.highlight .gd { color: #f08080; }
.highlight .gi { color: var(--accent); }
.highlight .err { color: #f2f1ea; }
.highlight .gp { color: #777868; }

/* inline code already styled in pages section; ensure contrast in lists */
.article-body li code { font-size: 0.85em; }

/* lede + body wrap consistency on post page */
.page-main .wrap { max-width: 1480px; }

/* ============================================================
   misc — share row, category desc links, page chrome
   ============================================================ */
.cat-desc p { margin: 0 0 0.9em; }
.cat-desc p:last-child { margin-bottom: 0; }
.cat-desc a { color: var(--accent-ink); border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.cat-desc a:hover { border-color: var(--accent-ink); }

.article-share { max-width: 720px; margin-top: 28px; }
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.share-label { color: var(--faint); }
.share a {
  color: var(--accent-ink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.share a:hover { border-color: var(--accent-ink); }

.post-comments { max-width: 720px; margin-top: clamp(40px, 6vh, 72px); }

/* keep page-main article sections from doubling top padding */
.page-main > section + section { padding-top: 0; }
