/* FayPOS Blog
   Brand: near-black ground, lime accent, Inter + Instrument Serif italic + JetBrains Mono.
   Per-post colour comes from [data-theme] (see /assets/themes.css): --accent, --accent-2,
   --accent-ink, --accent-rgb. Everything accent-coloured reads those variables. */

:root {
  --bg: #050505;
  --surface: #0d0e0c;
  --surface-2: #141512;
  --surface-3: #1b1c19;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4ef;
  --body: #d4d4cd;
  --muted: #a3a39d;
  --dim: #6d6d68;

  --accent: #a3e635;
  --accent-2: #c7f23d;
  --accent-ink: #101508;
  --accent-rgb: 163, 230, 53;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: rgba(var(--accent-rgb), 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------- small type ---------- */
.kicker, .mono-label {
  font: 500 12px/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 22px; color: var(--text); font-family: var(--sans); font-weight: 600; letter-spacing: 0.14em; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7); flex: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); letter-spacing: -0.01em; }
.meta { color: var(--dim); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.draft { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.4); padding: 1px 6px; border-radius: 4px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 18px;
  padding: 16px 24px; border-radius: 5px; border: 1px solid transparent;
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
}
.btn .arrow { font-size: 1.15em; transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translate(2px, -2px); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); }
.btn-dark { background: #0b0d08; color: #fff; }
.btn-dark:hover { background: #1c2014; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 11px 16px; font-size: 14px; gap: 12px; }
.btn.done { border-color: var(--accent); color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 32px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand img { border-radius: 8px; }
.brand-name { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.brand-sub { font: 500 14px var(--mono); color: var(--dim); margin-left: -4px; }
.main-nav { display: flex; gap: 6px; margin: 0 auto; }
.main-nav a {
  position: relative; padding: 8px 12px; text-decoration: none;
  color: var(--muted); font-size: 15px; white-space: nowrap; transition: color 0.2s;
}
.main-nav a:hover, .main-nav a[aria-current] { color: var(--text); }
.main-nav a::after {
  content: ""; position: absolute; left: 50%; bottom: -2px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--accent); opacity: 0; transform: translateY(4px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.main-nav a:hover::after, .main-nav a[aria-current]::after { opacity: 1; transform: none; }

/* ---------- motifs (hero + card covers) ---------- */
[class*="motif-"] { position: relative; isolation: isolate; }
[class*="motif-"]::before, [class*="motif-"]::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
[class*="motif-"]::after {
  background: radial-gradient(60% 70% at 85% 10%, rgba(var(--accent-rgb), 0.20), transparent 70%),
              radial-gradient(40% 50% at 0% 100%, rgba(var(--accent-rgb), 0.07), transparent 70%);
}
.motif-grid::before {
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.13) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(75% 90% at 75% 20%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(75% 90% at 75% 20%, #000 20%, transparent 75%);
}
.motif-dots::before {
  background-image: radial-gradient(rgba(var(--accent-rgb), 0.45) 1.2px, transparent 1.6px);
  background-size: 18px 18px;
  mask-image: linear-gradient(200deg, #000 10%, transparent 65%);
  -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 65%);
}
.motif-stripes::before {
  background-image: repeating-linear-gradient(-45deg, rgba(var(--accent-rgb), 0.12) 0 2px, transparent 2px 16px);
  mask-image: linear-gradient(210deg, #000 5%, transparent 60%);
  -webkit-mask-image: linear-gradient(210deg, #000 5%, transparent 60%);
}
.motif-rings::before {
  background-image: repeating-radial-gradient(circle at 92% 8%, transparent 0 22px, rgba(var(--accent-rgb), 0.16) 22px 23px);
  mask-image: radial-gradient(80% 90% at 92% 8%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(80% 90% at 92% 8%, #000 15%, transparent 70%);
}

/* ---------- hero ---------- */
.hero { padding: clamp(64px, 11vw, 140px) 0 clamp(48px, 7vw, 88px); overflow: hidden; }
.display {
  margin: 0; font-weight: 500; color: var(--text);
  font-size: clamp(52px, 9vw, 124px); line-height: 0.95; letter-spacing: -0.065em;
}
.display em { letter-spacing: -0.02em; padding-right: 0.06em; }
.display-md { font-size: clamp(44px, 7vw, 92px); }
.lede { max-width: 640px; margin: 28px 0 0; color: var(--muted); font-size: clamp(18px, 1.6vw, 22px); line-height: 1.55; }
.hero .btn { margin-top: 36px; }

.topic-chips { list-style: none; padding: 0; margin: 44px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.topic-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none;
  font-size: 15px; color: var(--text); background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
.topic-chip:hover { border-color: rgba(var(--accent-rgb), 0.6); background: rgba(var(--accent-rgb), 0.08); transform: translateY(-1px); }
.topic-chip .count { font: 500 12px var(--mono); color: var(--dim); }

/* ---------- sections + grid ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.section-title { margin: 0; font-weight: 500; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.04em; }
.featured { margin: 0 0 clamp(56px, 8vw, 96px); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.related, .post-nav { margin-top: clamp(56px, 8vw, 96px); }
main > .wrap:last-child, main > .related:last-child { padding-bottom: clamp(72px, 10vw, 120px); }

/* ---------- cards ---------- */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s;
}
.card:hover { border-color: rgba(var(--accent-rgb), 0.45); transform: translateY(-3px); box-shadow: 0 24px 60px -30px rgba(var(--accent-rgb), 0.45); }
.card-link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.card-cover { height: 190px; background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden; }
.card-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; opacity: 0.85; transition: transform 0.6s var(--ease); }
/* "contain" covers (mockups, transparent PNGs) sit on top of the theme pattern, shown whole */
.card-cover .cover-img.fit-contain {
  z-index: 0; opacity: 1; inset: 14px 16px 6px; width: calc(100% - 32px); height: calc(100% - 20px);
  object-fit: contain; object-position: center bottom;
  filter: drop-shadow(0 18px 30px rgba(var(--accent-rgb), 0.22));
}
.card:hover .cover-img { transform: scale(1.03); }
.card-cover .chip, .card-flag { z-index: 1; }
.theme-icon {
  position: absolute; right: 22px; top: 50%; width: 112px; height: 112px; transform: translateY(-50%);
  color: var(--accent); opacity: 0.55; filter: drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.45));
  transition: opacity 0.4s, transform 0.5s var(--ease);
}
.card:hover .theme-icon { opacity: 0.85; transform: translateY(-50%) rotate(-4deg) scale(1.04); }
.card-big .theme-icon { width: clamp(150px, 18vw, 220px); height: auto; aspect-ratio: 1; right: 50%; transform: translate(50%, -50%); }
.card-big:hover .theme-icon { transform: translate(50%, -50%) rotate(-3deg) scale(1.04); }
.card-cover .chip { position: absolute; left: 18px; bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 999px;
  background: rgba(5, 5, 5, 0.7); border: 1px solid rgba(var(--accent-rgb), 0.35);
  font: 500 11px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-2);
  backdrop-filter: blur(6px);
}
.chip .dot { width: 6px; height: 6px; }
.card-flag { position: absolute; right: 18px; top: 16px; font: 500 11px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); padding: 5px 9px; border-radius: 4px; }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-title { margin: 0; font-weight: 600; font-size: 21px; line-height: 1.25; letter-spacing: -0.025em; }
.card-title em { font-size: 1.12em; }
.card-summary { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; font-size: 13px; }

.card-big { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 380px; }
.card-big .card-cover { height: auto; min-height: 240px; border-bottom: 0; border-right: 1px solid var(--line); }
.card-big .card-body { padding: clamp(28px, 4vw, 52px); justify-content: center; gap: 18px; }
.card-big .card-title { font-size: clamp(30px, 3.4vw, 46px); font-weight: 500; letter-spacing: -0.045em; line-height: 1.05; }
.card-big .card-summary { font-size: 17px; -webkit-line-clamp: 4; }
.card-big .meta { margin-top: 8px; }

.pager { display: flex; align-items: center; justify-content: space-between; margin-top: 40px; }
.empty { padding: 64px 0; color: var(--muted); }
.empty a { color: var(--accent); }

/* ---------- tags ---------- */
.tag-cloud, .tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud { padding-bottom: 32px; }
.tag {
  display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); text-decoration: none; font: 500 13px var(--mono); color: var(--muted);
  transition: color 0.2s, border-color 0.2s;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }
.tag .count { color: var(--dim); }

/* ---------- post ---------- */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7); }

.wrap-post { max-width: 960px; }
.hero-post { padding-top: clamp(48px, 8vw, 104px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; gap: 10px; margin-bottom: 36px; font: 500 13px var(--mono); color: var(--dim); }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.post-title { margin: 0; font-weight: 500; font-size: clamp(40px, 6.4vw, 80px); line-height: 1.02; letter-spacing: -0.055em; max-width: 16ch; text-wrap: balance; }
.post-title em { letter-spacing: -0.015em; }
.byline { display: flex; align-items: center; gap: 14px; margin-top: 40px; }
.byline strong { display: block; font-weight: 600; font-size: 15px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 18px; }
/* hero with a cover image: text left, image right on wide screens; image below the text on narrow ones */
.hero-post.has-cover .wrap-post { max-width: var(--wrap); }
.hero-post.has-cover { padding-bottom: clamp(32px, 5vw, 64px); }
.hero-cover { margin: 0; position: relative; }
.hero-cover img { display: block; width: 100%; height: auto; margin: 0 auto; }
.cover-contain .hero-cover img { max-height: 540px; object-fit: contain; filter: drop-shadow(0 30px 60px rgba(var(--accent-rgb), 0.25)); }
.cover-cover .hero-cover img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
@media (min-width: 1000px) {
  .hero-post.has-cover .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: center; }
  .hero-post.has-cover .post-title { font-size: clamp(40px, 4.6vw, 68px); }
}
@media (max-width: 999px) {
  .hero-cover { margin-top: 40px; }
  .cover-contain .hero-cover img { max-height: min(80vw, 420px); width: auto; max-width: 100%; }
}

.post-layout { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; gap: 56px; padding-top: clamp(40px, 6vw, 72px); }
.toc { display: none; }
@media (min-width: 1180px) {
  .post-layout:has(.toc) { grid-template-columns: 220px minmax(0, 720px) 220px; }
  .toc { display: block; position: sticky; top: 112px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; }
}
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; border-left: 1px solid var(--line); }
.toc ol ol { margin: 4px 0 6px; border: 0; }
.toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--dim); font-size: 14px; line-height: 1.4; text-decoration: none; transition: color 0.2s, border-color 0.2s; }
.toc ol ol a { padding-left: 28px; font-size: 13px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }

/* prose */
.prose { font-size: 18px; line-height: 1.75; color: var(--body); min-width: 0; }
.prose > * + * { margin-top: 1.3em; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl, .prose blockquote, .prose table, .prose figure { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; position: relative; }
.prose h2 { font-size: 32px; margin-top: 2.2em; font-weight: 500; letter-spacing: -0.04em; }
.prose h3 { font-size: 23px; margin-top: 1.8em; }
.prose h4 { font-size: 19px; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.heading-anchor { margin-left: 10px; color: var(--dim); text-decoration: none; opacity: 0; transition: opacity 0.2s; font-weight: 400; }
.prose :is(h2, h3, h4):hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { font-size: 1.12em; line-height: 1; color: var(--text); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), 0.4); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose ol li::marker { font: 500 0.85em var(--mono); }
.prose hr { border: 0; height: 1px; background: var(--line-strong); margin: 3em 0; }
.prose mark { background: rgba(var(--accent-rgb), 0.22); color: var(--text); padding: 0 3px; border-radius: 3px; }
.prose del { color: var(--dim); }
.prose kbd, .prose .keys kbd {
  font: 500 0.78em var(--mono); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong);
  border-bottom-width: 2px; background: var(--surface-2); color: var(--text);
}
.prose img { border-radius: 12px; border: 1px solid var(--line); }
.prose figure { margin-left: 0; margin-right: 0; }
.prose figcaption { margin-top: 10px; font-size: 14px; color: var(--dim); text-align: center; }
.prose blockquote {
  margin-left: 0; margin-right: 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-size: 1.45em; line-height: 1.4; color: var(--text);
}
.prose blockquote p { margin: 0; }
.prose dt { color: var(--text); font-weight: 600; }
.prose dd { margin: 0.2em 0 0.9em 1.2em; }

.prose :not(pre) > code {
  font: 0.84em var(--mono); padding: 2px 6px; border-radius: 5px;
  background: rgba(var(--accent-rgb), 0.1); color: var(--accent-2); border: 1px solid rgba(var(--accent-rgb), 0.18);
  overflow-wrap: anywhere;
}
.prose .highlight {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface) !important;
  overflow: hidden; font-size: 14.5px; line-height: 1.7;
}
.prose .highlight pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-family: var(--mono); tab-size: 2; }
.prose .highlight code { font-family: var(--mono); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.code-head .mono-label { font-size: 11px; color: var(--accent); }
.code-head .copy { font: 500 12px var(--mono); color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 5px; padding: 4px 10px; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.code-head .copy:hover, .code-head .copy.done { color: var(--accent); border-color: var(--accent); }

.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
@media (max-width: 720px) { .prose table { display: block; overflow-x: auto; white-space: nowrap; } }
.prose thead th { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); text-align: left; }
.prose th, .prose td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.prose .admonition, .prose details {
  --tone: var(--accent); --tone-rgb: var(--accent-rgb);
  border: 1px solid rgba(var(--tone-rgb), 0.3); background: rgba(var(--tone-rgb), 0.06);
  border-radius: 12px; padding: 18px 22px; font-size: 16.5px;
}
.prose .admonition > * + *, .prose details > * + * { margin: 0.7em 0 0; }
.prose .admonition-title, .prose details summary {
  margin: 0; font: 600 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--tone);
  display: flex; align-items: center; gap: 10px;
}
.prose .admonition-title::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.prose details summary { cursor: pointer; list-style: none; }
.prose details summary::-webkit-details-marker { display: none; }
.prose details summary::before { content: "+"; font-size: 16px; width: 10px; }
.prose details[open] summary::before { content: "−"; }
.prose .admonition.warning, .prose .admonition.caution, .prose details.warning { --tone: #f5b942; --tone-rgb: 245, 185, 66; }
.prose .admonition.danger, .prose .admonition.error, .prose details.danger { --tone: #fb7185; --tone-rgb: 251, 113, 133; }
.prose .admonition.info, .prose .admonition.note { --tone: var(--accent-2); }

.prose .task-list-item { list-style: none; margin-left: -1.4em; }
.prose .task-list-control { display: inline-flex; vertical-align: -3px; margin-right: 10px; }
.prose .task-list-control input { position: absolute; opacity: 0; pointer-events: none; }
.prose .task-list-indicator { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--line-strong); display: inline-grid; place-items: center; }
.prose input:checked + .task-list-indicator { background: var(--accent); border-color: var(--accent); }
.prose input:checked + .task-list-indicator::after { content: ""; width: 5px; height: 9px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }

.prose .footnote { font-size: 15px; color: var(--muted); }
.prose .footnote hr { margin: 3em 0 1.5em; }
.prose .footnote-ref a, .prose .footnote-backref { text-decoration: none; font-family: var(--mono); font-size: 0.8em; }

.post-foot { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; margin-top: 3.2em !important; padding-top: 28px; border-top: 1px solid var(--line); }

/* ---------- figures, galleries, viewer ---------- */
.gallery-zoom { all: unset; display: block; cursor: zoom-in; border-radius: 14px; }
.gallery-zoom:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prose .figure { text-align: center; }
.prose .figure img { margin: 0 auto; }
.prose .figure-portrait img { max-height: min(78vh, 640px); width: auto; }
.prose .figure figcaption, .gallery figcaption { font-size: 14px; line-height: 1.5; color: var(--muted); margin-top: 12px; }
.gallery figcaption strong { color: var(--text); }

.prose .gallery { position: relative; margin-top: 1.8em; }
.gallery-track {
  display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 0; padding: 6px 2px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; outline: none;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.gallery-track.is-dragging img { pointer-events: none; }
.gallery-slide {
  flex: 0 0 auto; margin: 0; scroll-snap-align: center; width: min(250px, 66vw);
  opacity: 0.5; transform: scale(0.96); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.gallery-slide.is-active, .gallery.is-single .gallery-slide { opacity: 1; transform: none; }
.gallery-slide:first-child { margin-left: calc(50% - min(125px, 33vw)); }
.gallery-slide:last-child { margin-right: calc(50% - min(125px, 33vw)); }
.prose .gallery-slide img {
  width: 100%; height: auto; border-radius: 18px; border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px -28px rgba(var(--accent-rgb), 0.5), 0 0 0 6px #0c0d0b;
}
.gallery-slide figcaption { text-align: center; padding: 0 4px; }

.gallery-bar { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.gallery-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong);
  transition: border-color 0.2s, color 0.2s, opacity 0.2s, transform 0.2s var(--ease);
}
.gallery-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.gallery-btn:active:not(:disabled) { transform: scale(0.94); }
.gallery-btn:disabled { opacity: 0.3; cursor: default; }
.gallery-dots { display: flex; gap: 6px; }
.gallery-dot { width: 7px; height: 7px; padding: 0; border-radius: 99px; border: 0; background: var(--line-strong); cursor: pointer; transition: width 0.3s var(--ease), background 0.2s; }
.gallery-dot[aria-current="true"] { width: 22px; background: var(--accent); }
.gallery-count { display: none; min-width: 52px; text-align: center; }
@media (max-width: 560px) {
  .prose .gallery { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .gallery-dots { display: none; }
  .gallery-count { display: inline; }
}

html.lightbox-open { overflow: hidden; }
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(3, 3, 3, 0.94); color: var(--text); overflow: hidden;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.lightbox[open] { display: flex; flex-direction: column; animation: lb-in 0.25s var(--ease); }
@keyframes lb-in { from { opacity: 0; } }
.lightbox-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; overscroll-behavior: contain; }
.lightbox-track::-webkit-scrollbar { display: none; }
.lightbox-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 64px 16px 8px; min-height: 0; }
.lightbox-slide img { max-width: 100%; max-height: calc(100dvh - 190px); width: auto; height: auto; border-radius: 16px; border: 1px solid var(--line-strong); }
.lightbox-slide figcaption { font-size: 15px; color: var(--muted); text-align: center; max-width: 560px; }
.lightbox-slide figcaption strong { color: var(--text); }
.lightbox-bar { margin: 0 0 22px; }
.lightbox-bar .gallery-count { display: inline; }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong);
}
.lightbox-close:hover { border-color: var(--accent); color: var(--accent); }

.post-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.prose .tag-list { padding: 0; }
.prose .tag-list li + li { margin-top: 0; }
.prose .tag-list a { text-decoration: none; color: var(--muted); }

/* TL;DR + FAQ (answer-first blocks that AI answer engines like to quote) */
.prose .tldr {
  border: 1px solid rgba(var(--accent-rgb), 0.35); border-radius: 14px; padding: 22px 26px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.03));
  font-size: 17px; margin-bottom: 2.4em;
}
.prose .tldr-title { margin: 0 0 10px; font: 600 12px var(--mono); letter-spacing: 0.16em; color: var(--accent); }
.prose .tldr ul { margin: 0; }
.prose .tldr li { color: var(--text); }
.prose .faq { margin-top: 3em; }
.prose .faq h2 { margin-top: 0; }
.prose .faq-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.prose .faq-item:first-of-type { margin-top: 0.6em; border-top: 1px solid var(--line); }
.prose .faq-item h3 { margin: 0; font-size: 19px; }
.prose .faq-answer { margin-top: 0.5em; color: var(--body); }
.prose .faq-answer > * { margin: 0; }
.prose .faq-answer > * + * { margin-top: 0.8em; }

/* author */
.author-link { text-decoration: none; }
.author-link:hover strong { color: var(--accent); }
.byline .author-link { display: block; font-size: 15px; }
.byline strong { display: inline; }
.byline-role { color: var(--muted); }
.avatar { object-fit: cover; flex: none; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.avatar-xl { width: 96px; height: 96px; font-size: 40px; }
.author-box {
  display: flex; gap: 18px; align-items: center; margin-top: 2em !important; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none !important; color: var(--text) !important; transition: border-color 0.25s;
}
.author-box:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.author-box > span:last-child { display: flex; flex-direction: column; gap: 4px; line-height: 1.3; }
.author-box strong { font-size: 19px; }
.author-role { color: var(--muted); font-size: 15px; }
.author-hero { display: flex; align-items: center; gap: 28px; }
.author-hero .kicker { margin-bottom: 10px; }
.author-bio p { margin: 0; }
.author-links { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 1016px; }
.post-nav-item { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--surface); transition: border-color 0.25s; }
.post-nav-item:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.post-nav-item .mono-label { color: var(--accent); }
.post-nav-item strong { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; line-height: 1.3; }
.post-nav-item.next { text-align: right; grid-column: 2; }

/* ---------- CTA band + footer (match faypos.com) ---------- */
.cta-band { background: var(--accent); color: #0b0d08; padding: clamp(80px, 12vw, 140px) 0; text-align: center; position: relative; overflow: hidden; }
.cta-band::after { content: ""; position: absolute; width: 26px; height: 26px; border: 2px solid #3a4d10; border-radius: 50%; right: 23%; top: 52%; }
.kicker-dark { color: #1e2a07; font-family: var(--mono); font-weight: 500; font-size: 12px; }
.cta-band h2 { margin: 0 0 40px; font-weight: 500; font-size: clamp(48px, 7vw, 96px); line-height: 0.98; letter-spacing: -0.06em; }
.cta-band em { color: #0b0d08; }

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 28px; }
.footer-inner { display: flex; align-items: flex-start; gap: 48px; }
.footer-line { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.footer-nav { display: flex; gap: 28px; margin-left: auto; }
.footer-nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-nav a:hover { color: var(--text); }
.footer-base { display: flex; justify-content: space-between; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font: 12px var(--mono); color: var(--dim); }

/* ---------- responsive ---------- */
@media (max-width: 1060px) {
  .header-inner { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 14px; }
  .header-cta { margin-left: auto; }
  .main-nav { order: 3; width: calc(100% + 2 * var(--gutter)); margin: 8px calc(-1 * var(--gutter)) 0; padding: 0 calc(var(--gutter) - 12px) 6px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 820px) {
  .card-big { grid-template-columns: 1fr; }
  .card-big .card-cover { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-inner { flex-wrap: wrap; gap: 24px; }
  .footer-nav { margin-left: 0; width: 100%; }
  .footer-base { flex-direction: column; gap: 6px; }
  .cta-band::after { display: none; }
}
@media (max-width: 560px) {
  .brand-sub { display: none; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-item.next { grid-column: 1; text-align: left; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 27px; }
  .prose .highlight { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); border-radius: 0; border-left: 0; border-right: 0; }
  .pager .mono-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
