/* ============================================
   THE UNCONSCIOUS CONSUMER — Stylesheet
   ============================================ */

/* --- DESIGN TOKENS — Warm Scholar palette --- */
:root {
  --navy: #1A1816;
  --navy-mid: #2A2420;
  --navy-light: #C4531A;
  --navy-pale: #FAE8E1;
  --accent: #C4531A;
  --accent-hover: #A8421A;
  --substack-orange: #C4531A;

  --bg: #F5F0E8;
  --bg-2: #EDE8DF;
  --surface: #FFFFFF;
  --border: #D4CFC7;
  --border-subtle: #E8E3DA;

  --text-primary: #1A1816;
  --text-secondary: #6B6560;
  --text-muted: #9A948E;
  --text-inverse: #F5F0E8;

  --tag-cp-bg: #FAE8E1;
  --tag-cp-color: #C4531A;
  --tag-be-bg: #FAE8E1;
  --tag-be-color: #C4531A;
  --tag-ux-bg: #FAE8E1;
  --tag-ux-color: #C4531A;
  --tag-uc-bg: #FAE8E1;
  --tag-uc-color: #C4531A;

  --radius: 12px;
  --radius-sm: 6px;
  --radius-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);

  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --header-h: 44px;
  --discovery-bar-h: 50px;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-2: #161b22;
  --surface: #1c2128;
  --border: #30363d;
  --border-subtle: #21262d;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-inverse: #0d1117;

  --navy-pale: #2C1508;
  --tag-cp-bg: #2C1508;
  --tag-cp-color: #E87040;
  --tag-be-bg: #2C1508;
  --tag-be-color: #E87040;
  --tag-ux-bg: #2C1508;
  --tag-ux-color: #E87040;
  --tag-uc-bg: #2C1508;
  --tag-uc-color: #E87040;
}

/* --- READING PROGRESS BAR --- */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: calc(var(--progress, 0) * 1%);
  height: 2px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  transition: background var(--transition), color var(--transition);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- UTILITIES --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) { .container { padding: 0 40px; } }
@media (min-width: 1200px) { .container { padding: 0 48px; } }

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.section-desc {
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 540px;
}
.section-header { margin-bottom: 40px; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-substack {
  background: var(--substack-orange);
  color: #fff;
  padding: 9px 18px;
  font-size: 13px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: opacity 0.3s ease;
}
.btn-substack:hover { background: #A8421A; transform: translateY(-1px); }
.site-header.shrink .btn-substack {
  opacity: 0;
  pointer-events: none;
}
.btn-substack-large {
  display: inline-flex;
  align-items: center;
  background: var(--substack-orange);
  color: #fff;
  padding: 16px 32px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(196,83,26,0.4);
  transition: all var(--transition);
}
.btn-substack-large:hover { background: #A8421A; transform: translateY(-2px); box-shadow: 0 8px 30px rgba(196,83,26,0.5); }

/* --- TAGS --- */
.card-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-cp { background: var(--tag-cp-bg); color: var(--tag-cp-color); }
.tag-be { background: var(--tag-be-bg); color: var(--tag-be-color); }
.tag-ux { background: var(--tag-ux-bg); color: var(--tag-ux-color); }
.tag-uc { background: var(--tag-uc-bg); color: var(--tag-uc-color); }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: #1A1816;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: height 0.3s ease;
}
.site-header.scrolled {
  box-shadow: var(--shadow-sm);
}
.site-header.shrink {
  height: 44px;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
  padding: 0 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 768px) { .header-inner { padding: 0 40px; } }
@media (min-width: 1200px) { .header-inner { padding: 0 48px; } }
.logo {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.logo-main {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #F5F0E8;
  line-height: 1.1;
  transition: font-size 0.3s ease;
}
.site-header.shrink .logo-main {
  font-size: 12px;
}
.main-nav {
  display: none;
}
.nav-link {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(245,240,232,0.65);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: #F5F0E8;
  background: rgba(255,255,255,0.1);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(245,240,232,0.65);
  border: 1px solid rgba(255,255,255,0.2);
  transition: all var(--transition);
}
.theme-toggle:hover { color: #F5F0E8; background: rgba(255,255,255,0.1); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
.menu-toggle {
  display: none;
}

/* ============================================
   DISCOVERY BAR (Layer 2)
   ============================================ */
.discovery-bar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: var(--discovery-bar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  transition: top 0.3s ease;
}
.site-header.shrink ~ .discovery-bar {
  top: 44px;
}
.discovery-bar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 8px;
  padding: 0 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) { .discovery-bar-inner { padding: 0 40px; } }
@media (min-width: 1200px) { .discovery-bar-inner { padding: 0 48px; } }
.discovery-bar-inner::-webkit-scrollbar {
  height: 4px;
}
.discovery-bar-inner::-webkit-scrollbar-track {
  background: transparent;
}
.discovery-bar-inner::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 2px;
}
.discovery-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-2);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.discovery-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.discovery-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
.discovery-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.discovery-search-toggle {
  background: transparent;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--text-secondary);
  margin-left: auto;
  flex-shrink: 0;
}
.discovery-search-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.discovery-search-input-wrapper {
  display: none;
  position: fixed;
  top: var(--header-h);
  right: 24px;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  height: var(--discovery-bar-h);
}
@media (min-width: 768px) { .discovery-search-input-wrapper { right: 40px; } }
@media (min-width: 1200px) { .discovery-search-input-wrapper { right: 48px; } }
.discovery-search-input-wrapper.active {
  display: flex;
  align-items: center;
}
.discovery-search-input {
  border: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  width: 250px;
  font-family: var(--font-sans);
}
.discovery-search-input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
  margin-top: calc(var(--header-h) + var(--discovery-bar-h));
  background: #0F0B09;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(196,83,26,0.10) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}
.hero-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-scroll-hint { position: relative; z-index: 1; }

/* ── Dark hero text overrides ── */
.hero .hero-eyebrow  { color: #C4531A; }
.hero .hero-title    { color: #F5F0E8; }
.hero .hero-title em { color: #C4531A; }
.hero .hero-desc     { color: rgba(245,240,232,0.70); }
.hero .hero-meta-item strong  { color: #F5F0E8; }
.hero .hero-meta-item span    { color: rgba(245,240,232,0.42); }
.hero .hero-meta-divider      { background: rgba(245,240,232,0.14); }
.hero-scroll-hint span        { color: rgba(245,240,232,0.38); }
.hero .scroll-line            { background: linear-gradient(to bottom, rgba(245,240,232,0.25), transparent); }

/* ── Dark hero buttons ── */
.hero .btn-primary {
  background: #C4531A;
  color: #fff;
  box-shadow: 0 4px 20px rgba(196,83,26,0.35);
}
.hero .btn-primary:hover { background: #A8421A; }
.hero .btn-outline {
  color: rgba(245,240,232,0.75);
  border-color: rgba(245,240,232,0.22);
}
.hero .btn-outline:hover { border-color: #C4531A; color: #C4531A; }

/* ── Featured article link ── */
.hero-featured-link {
  font-size: 12px;
  color: rgba(245,240,232,0.42);
  margin-top: -36px;
  margin-bottom: 36px;
  min-height: 16px;
}
.hero-featured-link a {
  color: rgba(245,240,232,0.42);
  text-decoration: none;
  transition: color 0.2s;
}
.hero-featured-link a:hover { color: #C4531A; }
.featured-arrow { color: #C4531A; }

/* ── Mobile: reduce image prominence ── */
@media (max-width: 767px) {
  .hero-bg-layer { opacity: 0.25; }
}

.hero-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.12;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.hero-title em {
  color: var(--accent);
  font-style: italic;
}
.hero-desc {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 520px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-meta-item {
  display: flex;
  flex-direction: column;
}
.hero-meta-item strong {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-serif);
  color: var(--text-primary);
}
.hero-meta-item span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero-meta-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}
/* Hero card stack */
.hero-visual { display: flex; justify-content: center; }
.hero-card-stack {
  position: relative;
  width: 320px;
  height: 260px;
}
.hero-card {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
}
.hero-card p {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  color: var(--text-primary);
}
.hero-card-1 {
  width: 280px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}
.hero-card-2 {
  width: 260px;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  z-index: 2;
  opacity: 0.85;
}
.hero-card-3 {
  width: 240px;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%) rotate(4deg);
  z-index: 1;
  opacity: 0.65;
}
.hero-card-stack:hover .hero-card-2 { transform: translateX(-50%) rotate(-6deg) translateY(-8px); }
.hero-card-stack:hover .hero-card-3 { transform: translateX(-50%) rotate(7deg) translateY(-16px); }
/* Scroll hint */
.hero-scroll-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 60px;
  opacity: 0.5;
}
.hero-scroll-hint span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--border), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ============================================
   FEATURED ARTICLES
   ============================================ */
.featured-section {
  padding: 80px 0;
  background: var(--bg-2);
}
.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 900px) {
  .featured-grid { grid-template-columns: 1.4fr 1fr; }
}
.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.featured-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.featured-card-img {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-card-img-text { font-size: 64px; }
.featured-card-img--text { align-items: flex-end; padding: 24px; }
.featured-card-img--photo { position: relative; overflow: hidden; }
.featured-card-img-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.featured-card-img--photo .featured-card-img-overlay { position: relative; z-index: 2; }
.featured-card-img--photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.2) 60%, transparent 100%); z-index: 1; }
.featured-card-img-overlay { display: flex; flex-direction: column; gap: 8px; }
.featured-card-img-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.7);
}
.featured-card-img-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: #F5F0E8;
}
.featured-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.featured-card-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
.featured-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.card-date { font-size: 12px; color: var(--text-muted); }
.card-read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--transition);
}
.card-read-more:hover { color: var(--accent-hover); }
.featured-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.featured-card-small .featured-card-body { padding: 24px; }
.featured-card-small .featured-card-title { font-size: 1.1rem; }

/* ============================================
   SUBSTACK BANNER
   ============================================ */
.substack-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  padding: 80px 0;
  overflow: hidden;
  position: relative;
}
.substack-banner::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(196,83,26,0.15) 0%, transparent 70%);
}
.substack-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: flex-start;
}
@media (min-width: 768px) {
  .substack-inner { flex-direction: row; align-items: center; justify-content: space-between; }
}
.substack-text { max-width: 560px; }
.substack-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--substack-orange);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.substack-text h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: #fff;
  line-height: 1.25;
  margin-bottom: 12px;
}
.substack-text p { color: rgba(255,255,255,0.75); font-size: 15px; line-height: 1.65; }
.substack-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.substack-note { font-size: 12px; color: rgba(255,255,255,0.5); }

/* ============================================
   ARTICLES SECTION (INFINITE SCROLL)
   ============================================ */
.articles-section { padding: 80px 0; }
.articles-header {
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 768px) {
  .articles-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 640px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .articles-grid { grid-template-columns: repeat(3, 1fr); } }

/* Article Card */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  animation: cardIn 0.4s ease both;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.article-card-cover {
  height: 180px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0;
}
.article-card-cover svg {
  width: 100%;
  height: 100%;
  display: block;
}
.category-hero {
  width: 100%;
  height: 220px;
  overflow: hidden;
  margin-bottom: 40px;
  border-radius: 12px;
}
.category-hero.hidden { display: none; }
.category-hero svg {
  width: 100%;
  height: 100%;
  display: block;
}
.category-hero-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #C4531A;
  text-transform: uppercase;
  margin-bottom: 8px;
  margin-top: 32px;
}
.category-hero-label.hidden { display: none; }
.article-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.article-card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  flex: 1;
}
.article-card-excerpt {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}
.article-card-date { font-size: 12px; color: var(--text-muted); }
.article-card-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

/* Loader */
.load-more-zone { padding: 48px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.loader { display: flex; gap: 8px; }
.loader-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 0.6s ease-in-out infinite;
}
.loader-dot:nth-child(2) { animation-delay: 0.1s; }
.loader-dot:nth-child(3) { animation-delay: 0.2s; }
.loader.hidden { display: none; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.no-more-articles {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-section {
  padding: 80px 0;
  background: var(--bg-2);
}
.about-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px;
}
@media (min-width: 900px) {
  .about-inner { grid-template-columns: 280px 1fr; gap: 80px; align-items: start; }
}
.about-avatar {
  margin-bottom: 28px;
}
.about-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}
.about-credentials {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}
.credential-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.credential-item svg { color: var(--accent); flex-shrink: 0; }
.about-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  border: 1px solid var(--border);
}
.social-linkedin { color: #0a66c2; }
.social-linkedin:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.social-substack { color: var(--substack-orange); }
.social-substack:hover { background: var(--substack-orange); color: #fff; border-color: var(--substack-orange); }
.about-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 28px;
}
.about-body p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.about-body em { color: var(--text-primary); font-style: italic; }
.about-body strong { color: var(--text-primary); font-weight: 600; }
.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 36px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.highlight-icon { font-size: 24px; flex-shrink: 0; line-height: 1; }
.highlight-item strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.highlight-item p { font-size: 13.5px; color: var(--text-secondary); }

/* ============================================
   BOOKS SECTION
   ============================================ */
.books-section { padding: 80px 0; }
.books-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .books-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .books-grid { grid-template-columns: repeat(4, 1fr); } }
.book-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.book-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-lg); }
.book-spine {
  height: 140px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.book-spine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
}
.book-spine-title {
  font-family: var(--font-serif);
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.book-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.book-info h3 { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.book-author { font-size: 12px; color: var(--accent); font-weight: 500; }
.book-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-top: 4px; }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 64px 0 0;
}
[data-theme="dark"] .site-footer { background: var(--bg-2); border-top: 1px solid var(--border); }
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 1.5fr 1fr; }
}
.footer-brand .logo-main {
  font-size: 19px;
  color: #fff;
  display: block;
  margin-bottom: 12px;
}
.footer-brand p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 24px; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  transition: all var(--transition);
}
.footer-social a:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.4); }
.footer-links { display: flex; gap: 48px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-bottom: 6px;
}
.footer-col a { font-size: 14px; color: rgba(255,255,255,0.55); transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0;
}
.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

/* ============================================
   ARTICLE PAGE
   ============================================ */

.article-page-main {
  padding-top: 104px;
  padding-bottom: 80px;
  min-height: 70vh;
}

.article-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 640px) {
  .article-container { padding: 0 40px; }
}

.article-loading {
  display: flex;
  justify-content: center;
  padding: 80px 0;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */

.article-back {
  display: inline-block;
  font-size: 13px;
  color: #6B6560;
  text-decoration: none;
  margin-bottom: 32px;
  transition: color var(--transition);
}
.article-back:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-header { margin-bottom: 0; }
.article-header .card-tag { margin-bottom: 16px; }

/* Hero image integrated with article header */
.article-hero {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 32px;
}
.article-hero-img {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
}
.article-header--has-hero .article-back { margin-bottom: 24px; }
.article-header--has-hero .article-header-text { }

/* Card cover photo (replaces SVG for articles with coverImage) */
.article-card-cover--photo { background: #1A1816; }
.article-card-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.article-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: #1A1816;
  margin: 0 0 20px;
}

.article-excerpt {
  font-family: var(--font-sans);
  font-size: 19px;
  font-style: italic;
  color: #6B6560;
  line-height: 1.6;
  margin-bottom: 24px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #9A948E;
  margin-bottom: 40px;
}
.article-dot { opacity: 0.5; }

.article-header-divider {
  border: none;
  border-top: 1px solid #D4CFC7;
  margin: 0 0 40px;
}

/* ===== BODY ===== */

.article-body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.8;
  color: #1A1816;
}

.article-body p { margin: 0 0 24px; }

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  color: #1A1816;
  margin-top: 48px;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: #1A1816;
  margin-top: 36px;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
  margin: 0 0 24px;
}
.article-body li { margin-bottom: 0.5em; }

.article-body blockquote {
  border-left: 3px solid #C4531A;
  padding: 4px 0 4px 20px;
  color: #6B6560;
  font-style: italic;
  margin: 32px 0;
}
.article-body blockquote p { margin: 0; }

/* Images stripped by JS — re-add with class="book-cover" or class="data-viz" in articles.json */
.article-body img,
.article-body .book-cover {
  display: block;
  max-width: 280px;
  height: auto;
  margin: 32px auto;
  border-radius: 4px;
}
.article-body .data-viz {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 32px auto;
}
.article-body figcaption {
  font-size: 12px;
  text-align: center;
  color: #6B6560;
  font-style: italic;
  margin: -20px auto 32px;
  max-width: 480px;
}

.article-body a {
  color: #C4531A;
  text-decoration: none;
}
.article-body a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-body strong {
  font-weight: 600;
  color: #1A1816;
}

/* ===== ENDING ===== */

.article-ending-divider {
  border: none;
  border-top: 1px solid #D4CFC7;
  margin: 48px 0 40px;
}

.continue-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9A948E;
  margin: 0 0 20px;
}

.related-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .related-cards { grid-template-columns: 1fr; }
}

.related-card {
  display: block;
  background: #FFFFFF;
  border: 1px solid #D4CFC7;
  border-radius: 8px;
  padding: 20px;
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}
.related-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.related-card .card-tag { margin-bottom: 8px; }

.related-card-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: #1A1816;
  line-height: 1.4;
  margin: 0 0 4px;
}

.related-card-excerpt {
  font-size: 13px;
  color: #6B6560;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card-link {
  display: block;
  font-size: 13px;
  color: #C4531A;
  text-decoration: none;
  margin-top: 12px;
}

.article-footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ===== SUBSTACK CTA (articles without local content) ===== */

.article-subscribe-cta {
  margin: 48px 0;
  padding: 48px 40px;
  background: #FFFFFF;
  border: 1px solid #D4CFC7;
  border-radius: 12px;
  text-align: center;
}
.subscribe-cta-inner { max-width: 480px; margin: 0 auto; }
.substack-icon-lg {
  color: #C4531A;
  margin-bottom: 16px;
}
.article-subscribe-cta h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #1A1816;
  margin: 0 0 12px;
}
.article-subscribe-cta p {
  color: #6B6560;
  line-height: 1.7;
  margin: 0 0 24px;
}
.substack-note {
  display: block;
  font-size: 0.8rem;
  color: #9A948E;
  margin-top: 12px;
}

/* ===== DARK MODE ===== */

[data-theme="dark"] .article-title,
[data-theme="dark"] .article-body h2,
[data-theme="dark"] .article-body h3,
[data-theme="dark"] .article-body strong,
[data-theme="dark"] .related-card-title,
[data-theme="dark"] .article-subscribe-cta h2 {
  color: var(--text-primary);
}

[data-theme="dark"] .article-body {
  color: var(--text-primary);
}

[data-theme="dark"] .article-excerpt,
[data-theme="dark"] .article-body blockquote,
[data-theme="dark"] .article-body figcaption,
[data-theme="dark"] .related-card-excerpt,
[data-theme="dark"] .article-subscribe-cta p {
  color: var(--text-secondary);
}

[data-theme="dark"] .article-back,
[data-theme="dark"] .article-meta-row,
[data-theme="dark"] .continue-label,
[data-theme="dark"] .substack-note {
  color: var(--text-muted);
}

[data-theme="dark"] .article-header-divider,
[data-theme="dark"] .article-ending-divider {
  border-top-color: var(--border);
}

[data-theme="dark"] .related-card {
  background: var(--surface);
  border-color: var(--border);
}

[data-theme="dark"] .article-subscribe-cta {
  background: var(--surface);
  border-color: var(--border);
}
