/* ══════════════════════════════════════════════════════════════════
   THE BLOG — Finance-Tech Design System
   Navy & electric-blue palette · Space Grotesk display / Inter body /
   JetBrains Mono for data-flavored details
══════════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --ink:          #0a0e17;
  --ink-2:        #2b3547;
  --ink-soft:     #66738a;
  --surface:        #eef1f7;
  --surface-2:      #e1e6f0;
  --card:         #ffffff;
  --accent:         #2f6fed;
  --accent-light:      #6ea1ff;
  --accent-deep:    #1c4fc4;
  --signal:       #22c55e;
  --line:         rgba(10, 14, 23, 0.10);
  --line-accent:    rgba(47, 111, 237, 0.32);
  --on-ink:       #eef3ff;
  --on-ink-soft:  rgba(238, 243, 255, 0.66);

  --radius:       4px;
  --radius-lg:    6px;
  --radius-pill:  99px;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", monospace;

  --shadow-sm:    0 1px 2px rgba(10,14,23,.06), 0 1px 4px rgba(10,14,23,.05);
  --shadow-md:    0 10px 26px rgba(10,14,23,.10), 0 3px 8px rgba(10,14,23,.06);
  --shadow-lg:    0 28px 64px rgba(10,14,23,.22), 0 8px 20px rgba(10,14,23,.10);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--ink-2);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Faint technical grid — a quiet nod to chart paper, not a texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image:
    linear-gradient(var(--ink) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 70%);
}

img { display: block; width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

::selection { background: var(--accent-light); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--signal));
  z-index: 1000;
  transition: width .1s linear;
}

/* ── Layout ── */
.container        { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.container.narrow { max-width: 720px; }

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

.post-grid.reveal-group .post-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.post-grid.reveal-group.is-visible .post-card { opacity: 1; transform: none; }
.post-grid.reveal-group .post-card:nth-child(1) { transition-delay: .02s; }
.post-grid.reveal-group .post-card:nth-child(2) { transition-delay: .09s; }
.post-grid.reveal-group .post-card:nth-child(3) { transition-delay: .16s; }
.post-grid.reveal-group .post-card:nth-child(4) { transition-delay: .23s; }
.post-grid.reveal-group .post-card:nth-child(5) { transition-delay: .30s; }
.post-grid.reveal-group .post-card:nth-child(6) { transition-delay: .37s; }
.post-grid.reveal-group .post-card:nth-child(n+7) { transition-delay: .42s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .post-grid.reveal-group .post-card {
    opacity: 1 !important; transform: none !important; transition: none !important;
  }
  * { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ── Signature: gilded frame (gallery-label brackets) ── */
.frame {
  position: relative;
  isolation: isolate;
}
.frame::before, .frame::after {
  content: "";
  position: absolute;
  width: 30px; height: 30px;
  z-index: 3;
  opacity: 0;
  transition: opacity .55s var(--ease), transform .55s var(--ease);
  pointer-events: none;
}
.frame::before {
  top: -9px; left: -9px;
  border-top: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  transform: translate(7px, 7px);
}
.frame::after {
  bottom: -9px; right: -9px;
  border-bottom: 1.5px solid var(--accent);
  border-right: 1.5px solid var(--accent);
  transform: translate(-7px, -7px);
}
.frame:hover::before, .frame:hover::after,
.frame.is-framed::before, .frame.is-framed::after {
  opacity: 1;
  transform: none;
}

/* ────────────────────────────────────────────
   HEADER
──────────────────────────────────────────── */
/* ────────────────────────────────────────────
   TICKER — scrolling status strip above header
──────────────────────────────────────────── */
.ticker {
  background: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--line-accent);
  position: relative;
}
.ticker-track {
  display: inline-flex;
  gap: 2.5rem;
  padding: 0.45rem 0;
  animation: tickerScroll 28s linear infinite;
  will-change: transform;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .03em;
  color: var(--on-ink-soft);
  text-transform: uppercase;
}
.ticker-item::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--signal);
  flex-shrink: 0;
}
.ticker-item strong { color: var(--accent-light); font-weight: 600; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.site-header {
  background: rgba(238, 241, 247, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-accent);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center;
  padding: 1.1rem 0;
  gap: 2.75rem;
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  flex-shrink: 0;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1.15rem;
  display: inline-flex;
  align-items: center;
}
.site-logo::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 7px; height: 7px;
  background: var(--signal);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 rgba(34,197,94,.55);
  animation: livePulseSm 2.4s ease-out infinite;
}
@keyframes livePulseSm {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.site-nav {
  display: flex; gap: 0.35rem; flex-wrap: wrap;
  margin-left: auto;
}
.site-nav a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  padding: 0.4rem 0.85rem;
  transition: color 0.25s var(--ease-soft);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%; right: 50%; bottom: 0.15rem;
  height: 1px;
  background: var(--accent);
  transition: left .3s var(--ease), right .3s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { left: 0.85rem; right: 0.85rem; }

/* ────────────────────────────────────────────
   HERO (Featured post) — dark ink band
──────────────────────────────────────────── */
.hero {
  background: var(--ink);
  color: var(--on-ink);
  padding: 5.5rem 0 5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(238,243,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,243,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 75% 20%, black 0%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 45% 40% at 78% 15%, rgba(47,111,237,.30), transparent 65%),
    radial-gradient(ellipse 35% 35% at 15% 85%, rgba(34,197,94,.10), transparent 70%);
  animation: heroDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes heroDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.06); }
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 4.5rem; align-items: center;
  position: relative;
}
.hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3;
  border: 1px solid rgba(110,161,255,.28);
}
.hero-image img { width: 100%; height: 100%; object-fit: cover; }

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-light); margin-bottom: 1.1rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.hero-kicker::before {
  content: ""; display: block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 rgba(34,197,94,.6);
  animation: livePulse 2s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--on-ink);
  margin-bottom: 1.15rem;
}
.hero-text h1 a { transition: color 0.3s var(--ease-soft); background-image: linear-gradient(var(--accent-light), var(--accent-light)); background-size: 0% 1px; background-repeat: no-repeat; background-position: left bottom; }
.hero-text h1 a:hover { color: var(--accent-light); }
.hero-excerpt {
  font-size: 1.0625rem; color: var(--on-ink-soft);
  line-height: 1.75; margin-bottom: 2rem;
  max-width: 48ch;
}
.hero-meta {
  display: flex; align-items: center; gap: 1.1rem;
  margin-bottom: 2.1rem;
}
.hero-meta time { font-family: var(--font-mono); font-size: 0.78rem; color: var(--on-ink-soft); letter-spacing: .01em; }

/* ────────────────────────────────────────────
   SECTION LABELS
──────────────────────────────────────────── */
.posts-section { padding: 5rem 0 5.5rem; }
.section-header {
  display: flex; align-items: center; gap: 1.25rem;
  margin-bottom: 2.75rem;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-deep);
  white-space: nowrap;
  display: flex; align-items: center; gap: 0.55rem;
}
.section-label::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 rgba(34,197,94,.55);
  animation: livePulse 2s ease-out infinite;
  flex-shrink: 0;
}
.section-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line-accent), transparent);
}

/* ────────────────────────────────────────────
   POST GRID & CARDS
──────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 2rem;
}
.post-grid--sm { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }

.post-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease), border-color .4s;
  display: flex; flex-direction: column;
  position: relative;
  cursor: pointer;
}
.post-card::before {
  content: "";
  position: absolute;
  top: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--accent);
  transition: left .45s var(--ease), right .45s var(--ease);
  z-index: 2;
}
.post-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
  border-color: var(--line-accent);
}
.post-card:hover::before { left: 0; right: 0; }

.card-image { display: block; flex-shrink: 0; overflow: hidden; }
.card-image img {
  height: 210px; object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.post-card:hover .card-image img { transform: scale(1.045); }

.card-body { padding: 1.5rem 1.5rem 1.65rem; flex: 1; display: flex; flex-direction: column; }
.card-body .tag { margin-bottom: 0.75rem; }
.card-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem; line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.card-body h3 a { transition: color 0.2s var(--ease-soft); }
.card-body h3 a:hover { color: var(--accent-deep); }
/* Stretched link: makes the whole card clickable via the title link,
   without needing to nest an <a> around the entire card markup. */
.card-body h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.card-body .tag {
  position: relative;
  z-index: 2;
}
.card-body p {
  font-size: 0.875rem; color: var(--ink-soft);
  line-height: 1.7; flex: 1;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.card-footer time { font-size: 0.72rem; color: var(--ink-soft); letter-spacing: .02em; }
.card-read {
  font-size: 0.72rem; font-weight: 700; letter-spacing: .04em;
  color: var(--accent-deep);
  display: flex; align-items: center; gap: 0.3rem;
  transition: gap 0.2s var(--ease-soft), color .2s;
}
.post-card:hover .card-read { gap: 0.55rem; color: var(--accent); }

/* ────────────────────────────────────────────
   TAG / BADGE
──────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-deep);
  background: transparent;
  border: 1px solid var(--line-accent);
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-pill);
  transition: background .25s var(--ease-soft), color .25s, border-color .25s;
}
.tag:hover { background: var(--accent); color: var(--card); border-color: var(--accent); }

.hero .tag, .page-hero .tag {
  color: var(--accent-light);
  border-color: rgba(110,161,255,.4);
}
.hero .tag:hover, .page-hero .tag:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }

/* ────────────────────────────────────────────
   BUTTONS
──────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent);
  color: var(--on-ink);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.03em;
  overflow: hidden;
  transition: background .3s var(--ease-soft), transform .25s var(--ease-soft), box-shadow .3s;
}
.btn::after {
  content: "";
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  transition: left .7s var(--ease);
}
.btn:hover { background: var(--accent-deep); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:hover::after { left: 130%; }
.btn:active { transform: translateY(0); }

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transform: scale(0);
  animation: rippleOut .6s var(--ease-soft);
  pointer-events: none;
}
@keyframes rippleOut {
  to { transform: scale(2.6); opacity: 0; }
}

.btn-outline {
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-accent);
  box-shadow: none;
}
.btn-outline::after { display: none; }
.btn-outline:hover { background: var(--card); border-color: var(--accent); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ────────────────────────────────────────────
   POST DETAIL
──────────────────────────────────────────── */
.post-full { padding: 4.5rem 0 5.5rem; }

.post-header { margin-bottom: 2.75rem; }
.post-header .tag { margin-bottom: 1.15rem; }
.post-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 1.25rem;
}
.post-excerpt {
  font-family: var(--font-display);
  font-size: 1.3rem; color: var(--ink-2);
  font-style: italic; line-height: 1.6;
  margin-bottom: 1.5rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
}
.post-byline {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.post-byline time { font-size: 0.85rem; color: var(--ink-soft); letter-spacing: .01em; }
.post-byline .dot { color: var(--accent); font-size: 1.2rem; line-height: 1; }

.post-cover {
  margin: 2.75rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.post-cover img { max-height: 520px; object-fit: cover; }

.post-body {
  font-size: 1.09rem; line-height: 1.85;
  color: var(--ink-2);
}
.post-body p { margin-bottom: 1.6rem; }
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.85rem; line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 2.75rem 0 1rem;
}
.post-body h3 {
  font-size: 1.2rem; font-weight: 700;
  color: var(--ink);
  margin: 2rem 0 0.75rem;
}
.post-body blockquote {
  margin: 2.25rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--ink-2);
}
.post-body a { color: var(--accent-deep); text-decoration: underline; text-decoration-color: var(--line-accent); text-underline-offset: 2px; }
.post-body a:hover { text-decoration-color: var(--accent); }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1.5rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 0.15em 0.45em;
  border-radius: 3px;
}

/* Back link */
.post-back {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: .03em;
  color: var(--ink-soft);
  margin-bottom: 2.25rem;
  transition: color 0.25s var(--ease-soft), gap .25s var(--ease-soft);
}
.post-back:hover { color: var(--accent-deep); gap: 0.7rem; }

/* ────────────────────────────────────────────
   CATEGORY PAGE — dark band, matches hero
──────────────────────────────────────────── */
.page-hero {
  padding: 4.5rem 0 3.5rem;
  background: var(--ink);
  color: var(--on-ink);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(238,243,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(238,243,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 20% 100%, black 0%, transparent 75%);
  pointer-events: none;
}
.page-hero::after {
  content: "";
  position: absolute; inset: -20%;
  background: radial-gradient(ellipse 50% 55% at 15% 100%, rgba(47,111,237,.24), transparent 70%);
  animation: heroDrift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
.page-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; position: relative; }
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--on-ink);
}
.page-hero p { color: var(--on-ink-soft); margin-top: 0.5rem; font-size: 0.9375rem; }
.page-hero .post-back { color: var(--on-ink-soft); }
.page-hero .post-back:hover { color: var(--accent-light); }

/* ────────────────────────────────────────────
   RELATED POSTS
──────────────────────────────────────────── */
.related-posts {
  border-top: 1px solid var(--line);
  padding: 4.5rem 0;
  background: var(--surface-2);
}

/* ────────────────────────────────────────────
   PAGINATION
──────────────────────────────────────────── */
.pagination {
  display: flex; gap: 0.85rem; align-items: center; justify-content: center;
  margin-top: 3.5rem;
}
.pagination span { font-size: 0.8rem; color: var(--ink-soft); padding: 0 0.5rem; letter-spacing: .02em; }

/* ────────────────────────────────────────────
   FOOTER — dark bookend
──────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line-accent);
  padding: 3.5rem 0 3rem;
  background: var(--ink);
  color: var(--on-ink-soft);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem; align-items: start;
}
.footer-brand .site-logo { font-size: 1.25rem; margin-bottom: 0.65rem; color: var(--on-ink); }
.footer-brand p { font-size: 0.85rem; color: var(--on-ink-soft); max-width: 32ch; line-height: 1.7; }
.site-footer .site-nav a { color: var(--on-ink-soft); }
.site-footer .site-nav a:hover { color: var(--on-ink); }
.footer-copy {
  font-size: 0.72rem; color: rgba(238,243,255,.4);
  margin-top: 2rem; padding-top: 1.75rem;
  border-top: 1px solid rgba(238,243,255,.12);
  grid-column: 1 / -1;
  letter-spacing: .02em;
}

/* ────────────────────────────────────────────
   MISC
──────────────────────────────────────────── */
.empty-state {
  color: var(--ink-soft); font-style: italic;
  padding: 2rem 0; text-align: center;
  grid-column: 1 / -1;
}

/* ────────────────────────────────────────────
   RESPONSIVE — tablet & mobile
──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container { padding: 0 1.75rem; }
  .hero { padding: 4rem 0 3.5rem; }
  .hero-inner { gap: 3rem; }
  .post-grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.6rem; }
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2.25rem; }
  .hero-image { order: -1; aspect-ratio: 16/9; max-height: 320px; }
}

@media (max-width: 768px) {
  .container { padding: 0 1.35rem; }
  .header-inner { padding: 0.85rem 0; gap: 1.25rem; flex-wrap: wrap; }
  .site-nav { gap: 0.1rem; }
  .site-nav a { padding: 0.35rem 0.6rem; font-size: 0.72rem; }

  .hero { padding: 3rem 0 2.5rem; }
  .hero-text h1 { font-size: 2.05rem; }
  .hero-excerpt { font-size: 1rem; }

  .posts-section { padding: 3.25rem 0 3.5rem; }
  .post-grid { grid-template-columns: 1fr; }

  .post-full { padding: 3rem 0 3.5rem; }
  .post-header h1 { font-size: 2rem; }
  .post-excerpt { font-size: 1.1rem; }

  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { margin-bottom: .5rem; }
  .site-footer .site-nav { flex-direction: row !important; align-items: flex-start !important; }

  .page-hero-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .container { padding: 0 1.15rem; }
  .site-logo { font-size: 1.3rem; }
  .hero-text h1 { font-size: 1.8rem; }
  .card-body { padding: 1.25rem 1.25rem 1.4rem; }
  .post-header h1 { font-size: 1.75rem; }
  .btn { padding: 0.7rem 1.4rem; font-size: 0.76rem; }
}

@media (max-width: 480px) {
  .hero-image { aspect-ratio: 4/3; max-height: 240px; }
  .post-full { padding: 2.5rem 0 3rem; }
  .post-header h1 { font-size: 1.6rem; }
  .post-excerpt { font-size: 1rem; padding-left: 1rem; }
  .frame::before, .frame::after { width: 20px; height: 20px; }
}

/* ════════════════════════════════════════════════════════════════
   BLOCK RENDERER  –  public post page
════════════════════════════════════════════════════════════════ */

.post-blocks { margin-top: 2.75rem; }

/* Every block shares base spacing */
.pb { margin-bottom: 2.1rem; }
.pb:last-child { margin-bottom: 0; }

/* ── Text (Quill output) ─────────────────────────────────────── */
.pb-text {
  font-size: 1.09rem;
  line-height: 1.85;
  color: var(--ink-2);
}
.pb-text p  { margin-bottom: 1.4rem; }
.pb-text p:last-child { margin-bottom: 0; }
.pb-text h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.85rem; line-height: 1.25;
  letter-spacing: -0.015em; color: var(--ink);
  margin: 2.75rem 0 .9rem;
}
.pb-text h3 {
  font-size: 1.2rem; font-weight: 700;
  color: var(--ink); margin: 2rem 0 .65rem;
}
.pb-text strong { color: var(--ink); }
.pb-text em     { font-style: italic; }
.pb-text a      { color: var(--accent-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-accent); }
.pb-text a:hover { text-decoration-color: var(--accent); }
.pb-text ul, .pb-text ol { padding-left: 1.5rem; margin-bottom: 1.4rem; }
.pb-text li { margin-bottom: .35rem; }
.pb-text blockquote {
  margin: 1.85rem 0;
  padding: 1.1rem 1.6rem;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--ink-2);
}

/* ── Heading ─────────────────────────────────────────────────── */
.pb-heading h1, .pb-heading h2, .pb-heading h3, .pb-heading h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.pb-heading h1 { font-size: clamp(2rem, 5vw, 2.85rem); }
.pb-heading h2 { font-size: clamp(1.5rem, 3vw, 2.15rem); }
.pb-heading h3 { font-size: 1.45rem; }
.pb-heading h4 { font-size: 1.2rem; }

/* ── Image ───────────────────────────────────────────────────── */
.pb-image {
  margin-left: calc(-1 * clamp(0px, 5vw, 3rem));
  margin-right: calc(-1 * clamp(0px, 5vw, 3rem));
}
.pb-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.pb-image figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: .75rem;
}

/* ── Pull quote — signature big gold mark ───────────────────── */
.pb-quote {
  position: relative;
  margin: 2.75rem 0;
  padding: 2rem 2.25rem 2rem 3rem;
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
}
.pb-quote::before {
  content: "“";
  position: absolute;
  top: -0.35rem; left: 0.75rem;
  font-family: var(--font-display);
  font-size: 5.5rem;
  font-weight: 700;
  color: var(--accent);
  opacity: .35;
  line-height: 1;
}
.pb-quote p {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.45;
  color: var(--ink);
  font-style: italic;
  margin: 0;
}
.pb-quote cite {
  display: block;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--accent-deep);
}
.pb-quote cite::before { content: "— "; }

/* ── Video ───────────────────────────────────────────────────── */
.pb-video {
  margin-left: calc(-1 * clamp(0px, 5vw, 3rem));
  margin-right: calc(-1 * clamp(0px, 5vw, 3rem));
}
.pb-video-frame {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  box-shadow: var(--shadow-lg);
}
.pb-video-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.pb-video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: .85rem; color: var(--on-ink);
  background: linear-gradient(135deg, #16130f 0%, #2a2319 100%);
}
.pb-video-play {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(110,161,255,.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--accent-light);
  border: 1.5px solid rgba(110,161,255,.4);
  transition: background .25s, transform .25s var(--ease-soft);
}
.pb-video-frame:hover .pb-video-play { background: rgba(110,161,255,.24); transform: scale(1.06); }
.pb-video-label { font-size: .85rem; opacity: .7; font-weight: 500; letter-spacing: .02em; }
.pb-video-external {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--on-ink); font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Gallery ─────────────────────────────────────────────────── */
.pb-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .85rem;
  margin-left: calc(-1 * clamp(0px, 5vw, 3rem));
  margin-right: calc(-1 * clamp(0px, 5vw, 3rem));
}
.pb-gallery-item { margin: 0; }
.pb-gallery-link { display: block; overflow: hidden; border-radius: var(--radius); }
.pb-gallery-link img {
  height: 200px; object-fit: cover;
  transition: transform .5s var(--ease);
}
.pb-gallery-link:hover img { transform: scale(1.05); }
.pb-gallery-item figcaption {
  font-size: .76rem; color: var(--ink-soft);
  font-style: italic; margin-top: .35rem; padding: 0 .2rem;
}

/* ── Code block ──────────────────────────────────────────────── */
.pb-code {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #16130f;
  border: 1px solid rgba(110,161,255,.15);
}
.pb-code-lang {
  display: inline-block;
  padding: .4rem 1rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-light);
  background: #0f0d0a;
  border-bottom: 1px solid rgba(110,161,255,.15);
  width: 100%;
}
.pb-code pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.7;
}
.pb-code pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: #ece4d3;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}
.pb-code-copy {
  position: absolute; top: .65rem; right: .8rem;
  background: rgba(110,161,255,.1);
  color: var(--accent-light);
  border: 1px solid rgba(110,161,255,.2);
  border-radius: 3px;
  padding: .25rem .7rem;
  font-size: .75rem; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.pb-code-copy:hover { background: rgba(110,161,255,.2); color: var(--on-ink); }

/* ── Divider ─────────────────────────────────────────────────── */
.pb-divider { padding: .6rem 0; }
.pb-divider hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--line-accent), transparent);
}

/* ── Raw HTML ─────────────────────────────────────────────────── */
.pb-html { font-size: 1rem; line-height: 1.7; color: var(--ink-2); }

/* ── Lightbox ────────────────────────────────────────────────── */
#pb-lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  align-items: center; justify-content: center;
}
#pb-lightbox.lb-open { display: flex; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(22,19,15,.92);
  backdrop-filter: blur(6px);
}
.lb-img {
  position: relative; z-index: 1;
  max-width: 90vw; max-height: 88vh;
  border-radius: var(--radius);
  box-shadow: 0 25px 60px rgba(0,0,0,.6);
  object-fit: contain;
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; z-index: 2;
  background: rgba(110,161,255,.12);
  color: var(--on-ink); border: 1px solid rgba(110,161,255,.25); cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.25rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(110,161,255,.24); }
.lb-close { top: 1rem; right: 1rem; font-size: 1rem; }
.lb-prev  { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ── Responsive tweaks ───────────────────────────────────────── */
@media (max-width: 768px) {
  .pb-image, .pb-video, .pb-gallery {
    margin-left: 0; margin-right: 0;
  }
  .pb-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pb-gallery-link img { height: 140px; }
  .pb-quote { padding: 1.75rem 1.25rem 1.75rem 1.85rem; }
  .pb-quote::before { font-size: 4rem; }
}

/* ════════════════════════════════════════════════════════════════
   AD SLOTS
════════════════════════════════════════════════════════════════ */

.ad-slot {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-accent);
  background: var(--surface-2);
}

.ad-badge {
  position: absolute;
  top: 0.7rem; left: 0.7rem;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(238, 241, 247, 0.88);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-accent);
}

.ad-media { display: block; width: 100%; height: 100%; }
.ad-media img, .ad-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-embed { width: 100%; }

.ad-sound-toggle {
  position: absolute;
  bottom: 0.7rem; right: 0.7rem;
  z-index: 3;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-accent);
  background: rgba(10,14,23,.55);
  color: var(--on-ink);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background .2s var(--ease-soft), transform .2s var(--ease-soft);
}
.ad-sound-toggle:hover { background: rgba(10,14,23,.75); transform: scale(1.08); }

/* Banner layout — full-width horizontal placement (homepage below hero,
   article top/bottom). aspect-ratio lives on the outer .ad-slot itself
   (not the inner .ad-media) so it gives child elements a real height to
   resolve percentages against — this is what makes .ad-media's
   height:100% actually mean something, instead of collapsing to the
   image's raw intrinsic size and overflowing.
   Recommended source image: 1200×300px (4:1), or 2400×600 for retina. */
.ad-slot--banner {
  margin: 3rem auto;
  max-width: 1160px;
  width: 100%;
  aspect-ratio: 4 / 1;
}
.ad-slot--banner .ad-media--video { position: relative; height: 100%; }
.ad-slot--banner .ad-media--video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Card layout — sized to sit as one item inside the post grid.
   Recommended source image: 800×620px (~4:3.1). */
.ad-slot--card {
  aspect-ratio: 4 / 3.1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .4s var(--ease), transform .4s var(--ease);
}
.ad-slot--card:hover { box-shadow: var(--shadow-md); transform: translateY(-5px); }
.ad-slot--card .ad-media { height: 100%; }
.ad-slot--card .ad-media--video { position: relative; height: 100%; padding-bottom: 0; }
.ad-slot--card .ad-media--video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Per-ad custom size, set via inline style when an ad has explicit
   display_width/display_height — inline style naturally overrides the
   class-level aspect-ratio above since it's more specific. */
.ad-slot[style*="aspect-ratio"] { margin-left: auto; margin-right: auto; }

@media (max-width: 768px) {
  .ad-slot--banner { margin: 2rem auto; aspect-ratio: 16 / 9; }
}