/* ============================================================
   OptionsPassport — Dark Editorial Theme
   Fonts: DM Serif Display / Source Serif 4 / JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@300;400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  --bg-base:        #0c0c0e;
  --bg-surface:     #131316;
  --bg-raised:      #1a1a1f;
  --bg-overlay:     #212128;

  --border-subtle:  rgba(255,255,255,0.06);
  --border-mid:     rgba(255,255,255,0.11);
  --border-strong:  rgba(255,255,255,0.18);

  --text-primary:   #e8e0d0;
  --text-secondary: #9e9888;
  --text-muted:     #5e5a52;
  --text-inverse:   #0c0c0e;

  --gold:           #c9a55a;
  --gold-dim:       rgba(201,165,90,0.18);
  --gold-glow:      rgba(201,165,90,0.08);
  --teal:           #2ecfbe;
  --teal-dim:       rgba(46,207,190,0.15);
  --crimson:        #c94a4a;
  --crimson-dim:    rgba(201,74,74,0.15);

  --font-display:   'DM Serif Display', Georgia, serif;
  --font-body:      'Source Serif 4', Georgia, serif;
  --font-mono:      'JetBrains Mono', 'Courier New', monospace;
  --font-ui:        'Outfit', system-ui, sans-serif;

  --radius-sm:      3px;
  --radius-md:      6px;
  --radius-lg:      12px;

  --shadow-card:    0 2px 20px rgba(0,0,0,0.5);
  --shadow-deep:    0 8px 40px rgba(0,0,0,0.7);

  --max-width:      1200px;
  --content-width:  720px;
  --sidebar-width:  260px;
  --gutter:         clamp(1.25rem, 4vw, 2.5rem);

  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 17px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.78;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 9999;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-primary); }

::selection { background: var(--gold-dim); color: var(--text-primary); }

/* ── Typography Scale ──────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; font-family: var(--font-ui); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
h6 { font-size: 0.85rem; font-family: var(--font-ui); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }

p { margin-bottom: 1.5rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; color: var(--text-primary); }
em, i { font-style: italic; }

blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.75rem 0 0.75rem 1.5rem;
  margin: 2rem 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-style: italic;
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-ui);
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 3rem 0;
  position: relative;
}

hr::after {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-base);
  padding: 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.6rem;
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  color: var(--teal);
}

pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Layout Utilities ──────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,12,14,0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo__mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold) 0%, #a07a30 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  color: #0c0c0e;
  font-style: italic;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.site-logo__mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
}

.site-logo__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.site-logo__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.site-logo__tagline {
  font-family: var(--font-ui);
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__link {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.site-nav__link--active {
  color: var(--gold);
}

.site-nav__cta {
  margin-left: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--gold);
  color: #0c0c0e !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-nav__cta:hover {
  background: #e0bc70;
  color: #0c0c0e !important;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.nav-toggle:hover { border-color: var(--gold); color: var(--gold); }
.nav-toggle svg { display: block; }

/* ── Hero / Index ──────────────────────────────────────────── */
.index-hero {
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.index-hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

.index-hero__label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.index-hero__label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.index-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 5rem);
  line-height: 1.08;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 1.5rem;
}

.index-hero__title em {
  color: var(--gold);
  font-style: italic;
}

.index-hero__description {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 52ch;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.index-hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn--primary {
  background: var(--gold);
  color: #0c0c0e;
}

.btn--primary:hover {
  background: #e0bc70;
  color: #0c0c0e;
  box-shadow: 0 4px 20px rgba(201,165,90,0.3);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-mid);
}

.btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Post Grid ─────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
  margin-bottom: 5rem;
}

/* Featured (first post) */
.post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.post-card--featured:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-deep);
}

.post-card--featured .post-card__image-wrap {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.post-card--featured .post-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}

.post-card--featured:hover .post-card__image-wrap img {
  transform: scale(1.03);
}

.post-card--featured .post-card__body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card--featured .post-card__title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
}

/* Regular cards */
.post-card {
  grid-column: span 4;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.post-card__image-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-raised);
}

.post-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4,0,0.2,1);
}

.post-card:hover .post-card__image-wrap img {
  transform: scale(1.04);
}

.post-card__image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 2rem;
  font-style: italic;
}

.post-card__body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.post-card__tag {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background var(--transition);
}

.post-card__tag:hover { background: rgba(201,165,90,0.28); color: var(--gold); }

.post-card__tag--teal {
  color: var(--teal);
  background: var(--teal-dim);
}

.post-card__tag--teal:hover { background: rgba(46,207,190,0.25); color: var(--teal); }

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
  transition: color var(--transition);
}

.post-card:hover .post-card__title,
.post-card--featured:hover .post-card__title { color: var(--gold); }

.post-card__excerpt {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.post-card__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.post-card__author-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
}

.post-card__author:hover { color: var(--text-primary); }

.post-card__date-read {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ── Section Dividers ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-header__title {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.section-header__line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.section-header__accent {
  color: var(--gold);
}

/* ── Single Post Layout ─────────────────────────────────────── */
.post-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}

.post-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.3;
}

.post-hero__breadcrumb {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-hero__breadcrumb a { color: var(--text-muted); }
.post-hero__breadcrumb a:hover { color: var(--gold); }
.post-hero__breadcrumb span { color: var(--text-muted); }

.post-hero__tags { margin-bottom: 1.25rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.post-tag {
  font-family: var(--font-ui);
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background var(--transition);
}

.post-tag:hover { background: rgba(201,165,90,0.28); color: var(--gold); }

.post-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  max-width: 22ch;
}

.post-hero__subtitle {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 60ch;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.post-hero__byline {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.post-hero__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-secondary);
}

.post-hero__author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-mid);
}

.post-hero__author-info { line-height: 1.3; }

.post-hero__author-name {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.post-hero__author-role {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.post-hero__meta {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.post-hero__meta-sep {
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  display: inline-block;
}

/* ── Post Cover Image ───────────────────────────────────────── */
.post-cover {
  margin: 0 0 0 0;
  aspect-ratio: 21/8;
  overflow: hidden;
  border-bottom: 1px solid var(--border-subtle);
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Post Content Layout (with sidebar TOC) ─────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem var(--gutter) 5rem;
  align-items: start;
}

/* ── Post Content ───────────────────────────────────────────── */
.post-content {
  min-width: 0;
}

/* Ghost card styles within post content */
.post-content .kg-card { margin: 2.5rem 0; }

.post-content .kg-image-card img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.post-content .kg-image-card figcaption,
.post-content .kg-embed-card figcaption {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
  letter-spacing: 0.04em;
}

.post-content .kg-width-wide {
  margin-left: -5%;
  margin-right: -5%;
}

.post-content .kg-width-full {
  margin-left: -8%;
  margin-right: -8%;
}

/* Ghost Gallery */
.post-content .kg-gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-content .kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Callout / Bookmark cards */
.post-content .kg-callout-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.post-content .kg-callout-emoji {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.post-content .kg-callout-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.post-content .kg-bookmark-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
  transition: border-color var(--transition);
}

.post-content .kg-bookmark-card:hover { border-color: var(--border-mid); }

.post-content .kg-bookmark-container {
  display: flex;
  text-decoration: none;
}

.post-content .kg-bookmark-content {
  padding: 1rem 1.25rem;
  flex: 1;
}

.post-content .kg-bookmark-title {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.post-content .kg-bookmark-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.post-content .kg-bookmark-metadata {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-content .kg-bookmark-icon {
  width: 16px;
  height: 16px;
}

.post-content .kg-bookmark-thumbnail {
  flex-shrink: 0;
  width: 140px;
}

.post-content .kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Toggle card */
.post-content .kg-toggle-card {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-content .kg-toggle-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.post-content .kg-toggle-content {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
}

/* Article body typography */
.post-content p {
  font-size: 1rem;
  line-height: 1.82;
  margin-bottom: 1.6rem;
  color: var(--text-primary);
}

.post-content h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.post-content h3 {
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.post-content h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.post-content ul, .post-content ol {
  margin: 0 0 1.6rem 1.5rem;
  color: var(--text-primary);
}

.post-content li {
  margin-bottom: 0.5rem;
  line-height: 1.78;
}

.post-content li::marker { color: var(--gold); }

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.post-content th {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.post-content td {
  border: 1px solid var(--border-subtle);
  padding: 0.7rem 1rem;
  color: var(--text-secondary);
  vertical-align: top;
}

.post-content tr:hover td { background: var(--bg-raised); }

/* Custom callout boxes (matching article style) */
.callout-box {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  position: relative;
}

.callout-box--gold {
  border-left: 3px solid var(--gold);
  background: var(--gold-glow);
}

.callout-box--teal {
  border-left: 3px solid var(--teal);
  background: var(--teal-dim);
}

.callout-box--crimson {
  border-left: 3px solid var(--crimson);
  background: var(--crimson-dim);
}

.callout-box__label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.callout-box--gold .callout-box__label { color: var(--gold); }
.callout-box--teal .callout-box__label { color: var(--teal); }
.callout-box--crimson .callout-box__label { color: var(--crimson); }

.callout-box p { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 0; }

/* ── Sidebar TOC ────────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-mid) transparent;
}

.post-sidebar::-webkit-scrollbar { width: 3px; }
.post-sidebar::-webkit-scrollbar-track { background: transparent; }
.post-sidebar::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 2px; }

.toc {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.toc__label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc__item { margin: 0; }

.toc__link {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1.4;
  text-decoration: none;
}

.toc__link:hover {
  color: var(--text-secondary);
  border-left-color: var(--border-mid);
  background: var(--bg-raised);
}

.toc__link--active {
  color: var(--gold) !important;
  border-left-color: var(--gold) !important;
  background: var(--gold-glow) !important;
}

.toc__link--h3 { padding-left: 1.25rem; }
.toc__link--h4 { padding-left: 2rem; font-size: 0.7rem; }

/* TOC Progress */
.toc__progress {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.toc__progress-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.toc__progress-bar {
  height: 2px;
  background: var(--bg-overlay);
  border-radius: 1px;
  overflow: hidden;
}

.toc__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  border-radius: 1px;
  width: 0%;
  transition: width 0.2s ease;
}

/* Sidebar Author Card */
.sidebar-author {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  text-align: center;
}

.sidebar-author__img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-mid);
  margin: 0 auto 0.75rem;
}

.sidebar-author__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.sidebar-author__bio {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* ── Post Footer ────────────────────────────────────────────── */
.post-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2.5rem;
  margin-top: 3rem;
}

.post-footer__disclaimer {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--crimson);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.post-footer__disclaimer-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crimson);
  margin-bottom: 0.5rem;
}

.post-footer__disclaimer p {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.post-footer__tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* Related posts */
.related-posts { margin: 4rem 0; }

.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* ── Subscribe / CTA Strip ──────────────────────────────────── */
.subscribe-strip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
}

.subscribe-strip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.subscribe-strip__label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.subscribe-strip__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subscribe-strip__desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.subscribe-form__input {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  width: 220px;
  outline: none;
  transition: border-color var(--transition);
}

.subscribe-form__input:focus { border-color: var(--gold); }
.subscribe-form__input::placeholder { color: var(--text-muted); }

/* ── Tags / Categories ──────────────────────────────────────── */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  transition: all var(--transition);
}

.tag-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

.tag-pill__count {
  background: var(--bg-overlay);
  border-radius: 100px;
  padding: 0.1rem 0.45rem;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 0;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  text-decoration: none;
  transition: all var(--transition);
}

.pagination__btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pagination__info {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0 1rem;
}

/* ── Site Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  margin-top: 5rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.site-footer__brand { max-width: 280px; }

.site-footer__brand-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.site-footer__col-title {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.site-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__links a {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.site-footer__links a:hover { color: var(--gold); }

.site-footer__bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer__copyright {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.site-footer__disclaimer-text {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  color: var(--text-muted);
  max-width: 60ch;
  text-align: right;
  line-height: 1.55;
}

.site-footer__markets {
  display: flex;
  gap: 0.5rem;
}

.market-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 0.15rem 0.4rem;
}

/* ── Reading Progress Bar ───────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 200;
}

.reading-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--teal) 100%);
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--gold);
}

/* ── Error Pages ─────────────────────────────────────────────── */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 4rem var(--gutter);
}

.error-page__code {
  font-family: var(--font-mono);
  font-size: 5rem;
  color: var(--border-mid);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page__title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.error-page__desc {
  font-family: var(--font-body);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ── Utilities ───────────────────────────────────────────────── */
.u-gold    { color: var(--gold); }
.u-teal    { color: var(--teal); }
.u-muted   { color: var(--text-muted); }
.u-mono    { font-family: var(--font-mono); }
.u-display { font-family: var(--font-display); }
.u-ui      { font-family: var(--font-ui); }
.u-italic  { font-style: italic; }
.u-caps    { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78em; font-family: var(--font-ui); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .post-grid { gap: 1rem; }
  .post-card { grid-column: span 6; }
  .post-card--featured { grid-template-columns: 1fr; }
  .post-card--featured .post-card__image-wrap { aspect-ratio: 16/7; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-sidebar {
    position: static;
    max-height: none;
    order: -1;
  }

  .toc { display: none; }

  .subscribe-strip {
    grid-template-columns: 1fr;
  }

  .subscribe-form { width: 100%; }
  .subscribe-form__input { flex: 1; width: auto; }

  .related-posts__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .post-card { grid-column: span 12; }
  .post-card--featured { grid-column: 1 / -1; }
  .site-nav { display: none; }
  .site-nav.is-open { display: flex; flex-direction: column; position: fixed; inset: 64px 0 0; background: var(--bg-base); padding: 2rem var(--gutter); z-index: 99; border-top: 1px solid var(--border-subtle); }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 2rem; }
  .site-footer__brand { max-width: 100%; }
  .site-footer__bottom { flex-direction: column; text-align: center; }
  .site-footer__disclaimer-text { text-align: center; }
  .related-posts__grid { grid-template-columns: 1fr; }
}

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.anim-fade-up {
  animation: fadeUp 0.5s cubic-bezier(0.4,0,0.2,1) both;
}

.anim-delay-1 { animation-delay: 0.08s; }
.anim-delay-2 { animation-delay: 0.16s; }
.anim-delay-3 { animation-delay: 0.24s; }
.anim-delay-4 { animation-delay: 0.32s; }
