/* DIS Editorial — Dark Authority + Gold
   Perceptual engineering: hierarchy in <200ms, space as structure,
   proportional system (1.333 perfect fourth), gold = earned knowledge */

:root {
  /* Surfaces — depth through luminance steps */
  --bg: #09090B;
  --bg-raised: #111113;
  --bg-elevated: #19191D;
  --surface: #222226;
  --surface-hover: #2A2A2F;

  /* Borders — barely there, space does the work */
  --border: rgba(255,255,255,0.06);
  --border-visible: rgba(255,255,255,0.10);

  /* Text — 4 levels of hierarchy */
  --text-primary: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-tertiary: #63636E;
  --text-ghost: #3F3F46;

  /* Gold — the accent. Earned knowledge, not alarm */
  --gold: #C9A84C;
  --gold-dim: #A08A3E;
  --gold-bright: #E2C563;
  --gold-surface: rgba(201,168,76,0.08);
  --gold-glow: rgba(201,168,76,0.15);

  /* Signal — semantic only, used sparingly */
  --signal-urgent: #E54D42;

  /* Modular scale — perfect fourth (1.333) */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.333rem;   /* 21px */
  --text-xl: 1.777rem;   /* 28px */
  --text-2xl: 2.369rem;  /* 38px */
  --text-3xl: 3.157rem;  /* 50px */

  /* Spacing — powers of 2 from 0.5rem base */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Motion — single tempo, 300ms beat */
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --duration-fast: 150ms;
  --duration: 300ms;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 20px rgba(201,168,76,0.1);
}

/* === RESET + BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-secondary);
  font-family: 'Barlow', sans-serif;
  font-size: var(--text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
a:hover { color: var(--gold-bright); }

/* === PROGRESS BAR === */
.progress-bar {
  position: fixed; top: 0; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* === ALERT STRIP === */
.alert-strip {
  background: var(--gold-surface);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 10px var(--space-lg);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.alert-strip a {
  color: var(--gold-bright);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === MASTHEAD === */
.masthead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.masthead-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.masthead-date, .masthead-tagline {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}
.masthead-logo-row {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}
.site-name-link { text-decoration: none; }
.site-name {
  font-family: 'Libre Baskerville', serif;
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
}
.site-name span { color: var(--gold); }
.site-descriptor {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  max-width: 500px;
  margin: 0 auto;
}

/* === NAV === */
.nav-strip {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  gap: 0;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 14px 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease);
  border-bottom: 2px solid transparent;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.nav-item:hover {
  color: var(--text-primary);
  border-bottom-color: var(--gold);
  text-decoration: none;
}

/* === INDEX — HOMEPAGE === */
.index-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-2xl);
  align-items: start;
}

/* Section heading — gold rule, not border */
.section-heading {
  font-family: 'Libre Baskerville', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.section-heading-tag {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--gold-dim);
  padding: 2px 8px;
  border-radius: 2px;
}

/* Featured article — first child gets hero treatment */
.article-item:first-child {
  grid-template-columns: 1fr;
  padding: var(--space-lg);
  background: var(--bg-raised);
  border: 1px solid var(--border-visible);
  border-radius: 6px;
  margin-bottom: var(--space-md);
}
.article-item:first-child .article-title {
  font-size: var(--text-xl);
  line-height: 1.2;
}
.article-item:first-child .article-deck {
  font-size: var(--text-sm);
  -webkit-line-clamp: 3;
  color: var(--text-secondary);
}

/* Article items */
.article-item {
  display: grid;
  grid-template-columns: 1fr;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
  transition: all var(--duration-fast) var(--ease);
}
.article-item:last-child { border-bottom: none; }
.article-item:hover .article-title { color: var(--gold); }

.article-cat {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--gold-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}
.article-title-link { text-decoration: none; }
.article-title {
  font-family: 'Libre Baskerville', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.01em;
  transition: color var(--duration-fast) var(--ease);
}
.article-deck {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 55ch;
}
.article-meta {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-ghost);
  margin-top: var(--space-sm);
  letter-spacing: 0.03em;
}
.meta-sep { margin: 0 6px; }

/* Article images — when present */
.article-img {
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.article-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.9);
  transition: filter var(--duration) var(--ease);
}
.article-item:hover .article-img img { filter: brightness(1); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  padding: var(--space-lg) 0;
}
.pagination-btn {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-sm);
  color: var(--gold);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--border-visible);
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease);
}
.pagination-btn:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  text-decoration: none;
}

/* === SIDEBAR === */
.sidebar-module {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: var(--space-lg);
  overflow: hidden;
}
.sidebar-head {
  padding: var(--space-md);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--gold-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.sidebar-body { padding: var(--space-md); }
.sidebar-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  line-height: 1.55;
}
.sidebar-footnote {
  font-size: var(--text-xs);
  color: var(--text-ghost);
  margin-top: var(--space-sm);
  text-align: center;
  font-family: 'DM Mono', monospace;
}

/* Audit CTA box — the primary conversion element */
.audit-box {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-raised));
  border: 1px solid var(--gold-dim);
  padding: var(--space-lg) var(--space-md);
  border-radius: 6px;
  text-align: center;
  box-shadow: var(--shadow-gold);
}
.audit-box-hed {
  font-family: 'Libre Baskerville', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  line-height: 1.25;
}
.audit-box-sub {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.audit-btn {
  display: block;
  background: var(--gold);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  transition: all var(--duration-fast) var(--ease);
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.audit-btn:hover {
  background: var(--gold-bright);
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
  text-decoration: none;
  color: var(--bg);
}

.newsletter-btn {
  display: block;
  width: 100%;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-visible);
  padding: 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  text-align: center;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease);
}
.newsletter-btn:hover {
  background: var(--surface-hover);
  border-color: var(--gold-dim);
  color: var(--text-primary);
  text-decoration: none;
}

.benchmark-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.benchmark-row:last-child { border-bottom: none; }
.bm-label { font-size: var(--text-xs); color: var(--text-tertiary); }
.bm-value {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

/* === FOOTER === */
.footer-bar {
  background: var(--bg);
  color: var(--text-ghost);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  font-size: var(--text-xs);
  font-family: 'DM Mono', monospace;
  border-top: 1px solid var(--border);
  letter-spacing: 0.03em;
}
.footer-bar a {
  color: var(--text-tertiary);
  text-decoration: none;
}
.footer-bar a:hover { color: var(--gold); }

/* === LIGHT MODE === */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FAFAF9;
    --bg-raised: #FFFFFF;
    --bg-elevated: #F5F5F0;
    --surface: #EBEBEB;
    --surface-hover: #E0E0DA;
    --border: rgba(0,0,0,0.06);
    --border-visible: rgba(0,0,0,0.10);
    --text-primary: #1A1A1A;
    --text-secondary: #555555;
    --text-tertiary: #888888;
    --text-ghost: #BBBBBB;
    --gold: #997A2E;
    --gold-dim: #7A622A;
    --gold-bright: #B8922E;
    --gold-surface: rgba(153,122,46,0.06);
    --gold-glow: rgba(153,122,46,0.12);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-gold: 0 0 20px rgba(153,122,46,0.08);
  }
  .article-img img { filter: brightness(1); }
}

/* === MANUAL TOGGLE SUPPORT === */
html[data-theme="light"] {
  --bg: #FAFAF9;
  --bg-raised: #FFFFFF;
  --bg-elevated: #F5F5F0;
  --surface: #EBEBEB;
  --surface-hover: #E0E0DA;
  --border: rgba(0,0,0,0.06);
  --border-visible: rgba(0,0,0,0.10);
  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-ghost: #BBBBBB;
  --gold: #997A2E;
  --gold-dim: #7A622A;
  --gold-bright: #B8922E;
  --gold-surface: rgba(153,122,46,0.06);
  --gold-glow: rgba(153,122,46,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-gold: 0 0 20px rgba(153,122,46,0.08);
}
html[data-theme="dark"] {
  --bg: #09090B;
  --bg-raised: #111113;
  --bg-elevated: #19191D;
  --surface: #222226;
  --surface-hover: #2A2A2F;
  --border: rgba(255,255,255,0.06);
  --border-visible: rgba(255,255,255,0.10);
  --text-primary: #F4F4F5;
  --text-secondary: #A1A1AA;
  --text-tertiary: #63636E;
  --text-ghost: #3F3F46;
  --gold: #C9A84C;
  --gold-dim: #A08A3E;
  --gold-bright: #E2C563;
  --gold-surface: rgba(201,168,76,0.08);
  --gold-glow: rgba(201,168,76,0.15);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .index-wrap { grid-template-columns: 1fr; gap: var(--space-xl); }
  .post-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
  .sidebar { order: -1; }
  .masthead-tagline { display: none; }
  .site-name { font-size: var(--text-2xl); }
}
@media (max-width: 600px) {
  .index-wrap { padding: var(--space-lg) var(--space-md); }
  .masthead-inner { padding: 0 var(--space-md); }
  .article-item:first-child { padding: var(--space-md); }
  .article-item:first-child .article-title { font-size: var(--text-lg); }
  .post-content-area { padding: var(--space-lg) var(--space-md); }
}

/* === HOMEPAGE HERO === */
.home-hero {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: var(--space-xl) var(--space-lg);
}
.home-hero-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}
.home-hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: var(--space-md);
}
.home-hero-title {
  font-family: 'Libre Baskerville', serif;
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
}
.home-hero-title span {
  color: var(--gold);
  display: inline-block;
}
.home-hero-deck {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto var(--space-lg);
}
.home-hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.home-hero-btn {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 3px;
  text-decoration: none;
  transition: transform 0.12s, background 0.12s, border-color 0.12s;
}
.home-hero-btn.primary {
  background: var(--gold);
  color: var(--bg);
}
.home-hero-btn.primary:hover {
  background: var(--gold-bright);
  color: var(--bg);
  transform: translateY(-1px);
}
.home-hero-btn.ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-visible);
}
.home-hero-btn.ghost:hover {
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}
.home-hero-proof {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  flex-wrap: wrap;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.proof-item {
  text-align: center;
}
.proof-num {
  font-family: 'Libre Baskerville', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gold);
}
.proof-lbl {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* === AUDIENCE ENTRY CARDS === */
.audience-entry {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  padding: var(--space-lg);
}
.audience-entry-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.audience-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.audience-card:hover {
  border-color: var(--gold-dim);
  background: var(--surface);
}
.audience-card-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.audience-card-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.audience-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.audience-card-cta {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-top: 4px;
}
@media (max-width: 640px) {
  .audience-entry-inner { grid-template-columns: 1fr; }
}

/* === CORNERSTONE MOAT === */
.cornerstone-moat {
  background: var(--bg);
  padding: var(--space-xl) var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.moat-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.moat-label {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  text-align: center;
}
.moat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.moat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, transform 0.15s;
}
.moat-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.moat-card-tier {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.moat-card-title {
  font-family: 'Libre Baskerville', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.moat-card-deck {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.moat-card-deck strong {
  color: var(--gold-bright);
}
@media (max-width: 800px) {
  .moat-grid { grid-template-columns: 1fr; }
  .home-hero-proof { gap: 28px; }
  .home-hero-ctas { flex-direction: column; align-items: center; }
  .home-hero-btn { width: 100%; max-width: 320px; text-align: center; }
}
