/* ============================================================
   Pavel Kerbel — blog / long-form
   Layers on top of style.css (same tokens: Geist, dark, blue).
   ============================================================ */

/* ---- shared narrow column for reading ---- */
.read { max-width: 760px; margin: 0 auto; padding: 0 var(--pad); position: relative; z-index: 2; }

/* ---- back link ---- */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text-mute);
  transition: color .2s var(--ease);
}
.backlink svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.backlink:hover { color: var(--accent); }
.backlink:hover svg { transform: translateX(-3px); }

/* ============================================================
   Blog index
   ============================================================ */
.blog-hero { padding-top: 128px; padding-bottom: 28px; }
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.02;
  margin: 18px 0 0;
  text-wrap: balance;
}
.blog-hero p {
  margin: 18px 0 0;
  color: var(--text-dim);
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.55;
  max-width: 54ch;
}

/* ============================================================
   Article
   ============================================================ */
.article { padding-top: 116px; padding-bottom: 24px; }

.article-head { border-bottom: 1px solid var(--line); padding-bottom: 34px; margin-bottom: 38px; }
.article-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.article-head h1 {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.04;
  margin: 16px 0 0;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.article-meta .sep { color: var(--line-strong); }
.article-lede {
  margin: 24px 0 0;
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* ---- prose ---- */
.prose { font-size: 16.5px; line-height: 1.75; color: var(--text-dim); }
.prose > * + * { margin-top: 22px; }
.prose p { margin: 0; text-wrap: pretty; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); font-style: italic; }

.prose h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--text);
  line-height: 1.2;
  margin-top: 52px;
  scroll-margin-top: 88px;
}
.prose h2 + p { margin-top: 16px; }
.prose h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 36px;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease);
}
.prose a:hover { text-decoration-color: var(--accent); }

.prose ul, .prose ol { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.prose li { position: relative; padding-left: 26px; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 6px; top: 12px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in oklch, var(--accent) calc(70% * var(--glow)), transparent);
}
.prose ol { counter-reset: li; }
.prose ol li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0; top: 1px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
.prose li > strong:first-child { color: var(--text); }

/* ---- inline + block code ---- */
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5px 6px;
  color: var(--text);
}
.prose pre {
  margin: 0;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--text-dim);
}

/* ---- blockquote / pull ---- */
.prose blockquote {
  margin: 0;
  padding: 4px 0 4px 22px;
  border-left: 2px solid var(--accent-line);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}

/* ---- figure / screenshot ---- */
.prose figure { margin: 0; }
.prose figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px -22px rgba(0,0,0,0.65);
}
.prose figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-faint);
  text-align: center;
}
.prose figcaption a { color: var(--text-mute); }

/* ---- callout ---- */
.callout {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in oklch, var(--accent) calc(8% * var(--glow)), transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in oklch, var(--surface) 70%, transparent), var(--bg-2));
  padding: 20px 22px;
}
.callout-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.callout p { margin: 0; font-size: 15px; color: var(--text-dim); line-height: 1.6; }

/* ---- tags (data-tags drives future filtering; chips link to /blog/?tag=) ---- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tag-chip {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--surface);
  transition: color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  box-shadow: 0 0 16px color-mix(in oklch, var(--accent) calc(14% * var(--glow)), transparent);
}

/* ---- decision table ---- */
.rule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.rule-table th, .rule-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.rule-table thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 500;
  background: color-mix(in oklch, var(--surface) 50%, transparent);
}
.rule-table tbody tr:last-child td { border-bottom: none; }
.rule-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }
.rule-table .accent-cell { color: var(--accent); font-family: var(--mono); font-size: 12.5px; }

/* ---- divider ---- */
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}

/* ---- end signature ---- */
.article-foot {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.article-foot .sig { font-size: 14px; color: var(--text-mute); }
.article-foot .sig b { color: var(--text); font-weight: 600; }

@media (max-width: 560px) {
  .prose { font-size: 16px; }
  .rule-table { font-size: 13.5px; }
  .rule-table th, .rule-table td { padding: 11px 12px; }
}
