/* ═══════════════════════════════════════
   TOKENS
═══════════════════════════════════════ */
:root {
  --bg:         #0b0906;
  --bg-card:    #0f0c08;
  --border:     rgba(180,145,80,0.16);
  --border-hov: rgba(180,145,80,0.42);
  --gold:       #c4924a;
  --gold-light: #e0b97a;
  --gold-dim:   rgba(196,146,74,0.5);
  --gold-bg:    rgba(196,146,74,0.06);
  --text-head:  #f0e8d8;
  --text-body:  #b0a08a;
  --text-muted: #685848;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sc:    'Cormorant SC', Georgia, serif;
  --font-body:  'EB Garamond', Georgia, serif;
  --ease:       cubic-bezier(0.25,0.46,0.45,0.94);
  --wrap:       820px;
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 18px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* ═══════════════════════════════════════
   SVG BACKGROUND
═══════════════════════════════════════ */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.site-bg svg {
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 100%;
}

/* ═══════════════════════════════════════
   AMBIENT
═══════════════════════════════════════ */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1000; opacity: 0.55;
}

/* ═══════════════════════════════════════
   LAYOUT
═══════════════════════════════════════ */
.wrap {
  position: relative; z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 2.5rem;
}

/* ═══════════════════════════════════════
   NAV
═══════════════════════════════════════ */
nav {
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid var(--border);
  background: rgba(11,9,6,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 0 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.55rem; font-weight: 400;
  color: var(--text-head);
  transition: color .25s var(--ease);
}
.nav-logo:hover { color: var(--gold-light); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a {
  font-family: var(--font-sc);
  font-size: .72rem; letter-spacing: .13em;
  color: var(--text-muted); text-transform: uppercase;
  transition: color .25s var(--ease);
}
.nav-links a:hover { color: var(--gold-light); }
.nav-links a.active {
  color: var(--gold-light);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 1px;
}
.nav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-burger span {
  display: block; width: 22px; height: 1px;
  background: var(--text-muted); transition: background .2s;
}
.nav-burger:hover span { background: var(--gold-light); }
.nav-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-burger span { transition: transform .25s var(--ease), opacity .2s, background .2s; }
.nav-mobile {
  display: none; flex-direction: column;
  border-top: 1px solid var(--border);
  background: rgba(11,9,6,.97);
  padding: 1.2rem 2.5rem 1.5rem; gap: 1.1rem;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  font-family: var(--font-sc);
  font-size: .78rem; letter-spacing: .14em;
  color: var(--text-muted); text-transform: uppercase;
  transition: color .2s;
}
.nav-mobile a:hover { color: var(--gold-light); }

/* ═══════════════════════════════════════
   SHARED COMPONENTS
═══════════════════════════════════════ */
.section-label {
  font-family: var(--font-sc);
  font-size: .62rem; letter-spacing: .22em;
  color: var(--gold); text-transform: uppercase;
  margin-bottom: 1.4rem;
  display: flex; align-items: center; gap: 1rem;
}
.section-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.gold-rule { width: 36px; height: 1px; background: var(--gold); margin-bottom: 2rem; }
.page-heading {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem,4vw,2.8rem);
  font-weight: 300; color: var(--text-head);
  line-height: 1.18; letter-spacing: -.01em; margin-bottom: .8rem;
  animation: fade-up .85s var(--ease) .1s both;
}
.page-sub {
  font-size: 1rem; font-style: italic; color: var(--text-body);
  animation: fade-up .85s var(--ease) .22s both;
}
.page-hero { padding: 5rem 0 3.5rem; }

/* ═══════════════════════════════════════
   ARTICLE LIST ITEM
═══════════════════════════════════════ */
.article-item {
  display: grid; grid-template-columns: 1fr auto;
  align-items: start; gap: 1.5rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; position: relative;
  transition: border-color .3s var(--ease);
  text-decoration: none;
  color: inherit;
  display: grid;
}
.article-item:first-child { border-top: 1px solid var(--border); }
.article-item::after {
  content: '→';
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%) translateX(-8px);
  color: var(--gold); opacity: 0;
  font-family: var(--font-serif); font-size: 1rem;
  transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.article-item:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.article-item:hover { border-color: var(--border-hov); }
.article-item:hover .ai-title { color: var(--gold-light); }
.ai-inner { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 1.5rem; }
.ai-tag {
  display: inline-block;
  font-family: var(--font-sc); font-size: .55rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-dim); border: 1px solid rgba(196,146,74,.2);
  padding: .2rem .55rem; margin-bottom: .5rem;
}
.ai-title {
  font-family: var(--font-serif);
  font-size: 1.15rem; font-weight: 400;
  color: var(--text-head); line-height: 1.3; margin-bottom: .3rem;
  transition: color .25s var(--ease);
}
.ai-excerpt { font-size: .87rem; color: var(--text-muted); line-height: 1.6; }
.ai-meta {
  font-family: var(--font-sc);
  font-size: .6rem; letter-spacing: .14em;
  color: var(--text-muted); text-transform: uppercase;
  white-space: nowrap; padding-top: .2rem; text-align: right;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 2.2rem 2.5rem;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-logo { font-family: var(--font-serif); font-size: 1.1rem; color: var(--text-muted); }
.footer-copy { font-family: var(--font-sc); font-size: .58rem; letter-spacing: .14em; color: var(--text-muted); text-transform: uppercase; }
.footer-links { display: flex; gap: 2rem; list-style: none; }
.footer-links a { font-family: var(--font-sc); font-size: .58rem; letter-spacing: .13em; color: var(--text-muted); text-transform: uppercase; transition: color .2s; }
.footer-links a:hover { color: var(--gold); }

/* ═══════════════════════════════════════
   ANIMATIONS + REVEAL
═══════════════════════════════════════ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ═══════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════ */
.hero { padding: 7rem 0 5rem; }
.hero-rule { width: 36px; height: 1px; background: var(--gold); margin-bottom: 2.5rem; animation: fade-up .8s var(--ease) .1s both; }
.hero-heading { font-family: var(--font-serif); font-size: clamp(1.9rem,5vw,3.15rem); font-weight: 300; line-height: 1.18; color: var(--text-head); letter-spacing: -.01em; max-width: 640px; animation: fade-up .9s var(--ease) .2s both; }
.hero-heading em { font-style: italic; color: var(--gold-light); }
.hero-sub { margin-top: 1.4rem; font-size: 1.05rem; font-style: italic; color: var(--text-body); max-width: 500px; animation: fade-up .9s var(--ease) .35s both; }

.section-featured { padding-bottom: 3.5rem; border-bottom: 1px solid var(--border); }
.featured-card { padding: 2.2rem 0; display: block; position: relative; }
.featured-card::before { content: ''; position: absolute; left: -2.5rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, transparent, var(--gold), transparent); opacity: 0; transition: opacity .4s var(--ease); }
.featured-card:hover::before { opacity: 1; }
.featured-card:hover .feat-title { color: var(--gold-light); }
.feat-kicker { font-family: var(--font-sc); font-size: .62rem; letter-spacing: .18em; color: var(--gold-dim); text-transform: uppercase; margin-bottom: .9rem; }
.feat-title { font-family: var(--font-serif); font-size: clamp(1.5rem,3.5vw,2.1rem); font-weight: 400; line-height: 1.22; color: var(--text-head); letter-spacing: -.01em; margin-bottom: .7rem; transition: color .25s var(--ease); }
.feat-excerpt { font-size: .97rem; font-style: italic; color: var(--text-body); max-width: 560px; line-height: 1.65; }
.feat-date { margin-top: 1.1rem; font-family: var(--font-sc); font-size: .62rem; letter-spacing: .15em; color: var(--text-muted); text-transform: uppercase; }

.section-latest { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
.section-topics-strip { padding: 3rem 0 3rem; }
.topics-strip { display: flex; flex-wrap: wrap; gap: .6rem; }
.topic-pill { font-family: var(--font-sc); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border); padding: .45rem 1rem; border-radius: 1px; transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease); }
.topic-pill:hover { color: var(--gold-light); border-color: var(--border-hov); background: var(--gold-bg); }

/* ═══════════════════════════════════════
   ARTICLES PAGE
═══════════════════════════════════════ */
.filter-bar { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: 1.6rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: .5rem; }
.filter-btn { font-family: var(--font-sc); font-size: .6rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border); background: none; padding: .4rem .9rem; cursor: pointer; border-radius: 1px; transition: color .2s, border-color .2s, background .2s; }
.filter-btn:hover { color: var(--gold-light); border-color: var(--border-hov); }
.filter-btn.active { color: var(--gold-light); border-color: var(--gold); background: var(--gold-bg); }
.articles-list { padding-bottom: 5rem; }

/* ═══════════════════════════════════════
   TOPICS PAGE
═══════════════════════════════════════ */
.topics-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 1px; border: 1px solid var(--border); background: var(--border); margin-bottom: 5rem; }
.topic-card { background: var(--bg); padding: 2rem 1.8rem; cursor: pointer; transition: background .25s var(--ease); display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; }
.topic-card:hover { background: var(--bg-card); }
.topic-card:hover .tc-name { color: var(--gold-light); }
.tc-icon { font-size: 1.4rem; margin-bottom: .4rem; line-height: 1; }
.tc-name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 400; color: var(--text-head); transition: color .25s var(--ease); }
.tc-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.tc-count { margin-top: auto; padding-top: 1rem; font-family: var(--font-sc); font-size: .58rem; letter-spacing: .16em; color: var(--gold-dim); text-transform: uppercase; }

/* ═══════════════════════════════════════
   ABOUT PAGE
═══════════════════════════════════════ */
.about-body { display: grid; grid-template-columns: 1fr 260px; gap: 5rem; padding-bottom: 5rem; border-top: 1px solid var(--border); padding-top: 3rem; }
.about-prose h2 { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 400; color: var(--text-head); margin: 2.5rem 0 .9rem; letter-spacing: -.01em; }
.about-prose h2:first-child { margin-top: 0; }
.about-prose p { font-size: .97rem; line-height: 1.85; color: var(--text-body); margin-bottom: 1.2rem; }
.about-prose strong { color: var(--text-head); font-weight: 500; }
.about-prose blockquote { border-left: 2px solid var(--gold); padding: .5rem 0 .5rem 1.6rem; margin: 1.8rem 0; font-style: italic; color: var(--text-body); font-size: 1rem; }
.about-prose a { color: var(--gold); transition: color .2s; }
.about-prose a:hover { color: var(--gold-light); }
.about-aside {}
.aside-card { border: 1px solid var(--border); padding: 1.6rem; margin-bottom: 1.2rem; }
.aside-label { font-family: var(--font-sc); font-size: .58rem; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; margin-bottom: 1rem; }
.aside-card p { font-size: .82rem; color: var(--text-muted); line-height: 1.65; }
.aside-card a { color: var(--gold); transition: color .2s; }
.aside-card a:hover { color: var(--gold-light); }
.aside-topic-list { display: flex; flex-direction: column; }
.aside-topic-item { font-family: var(--font-sc); font-size: .63rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); padding: .35rem 0; border-bottom: 1px solid var(--border); transition: color .2s; }
.aside-topic-item:last-child { border-bottom: none; }
.aside-topic-item:hover { color: var(--gold); }

/* ═══════════════════════════════════════
   ARTICLE (SINGLE) PAGE
═══════════════════════════════════════ */
.article-back-bar { padding: 2.2rem 0 0; display: flex; align-items: center; justify-content: space-between; }
.back-btn { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-sc); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); background: none; border: none; cursor: pointer; transition: color .2s; text-decoration: none; }
.back-btn:hover { color: var(--gold); }
.share-btn { font-family: var(--font-sc); font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); background: none; border: 1px solid var(--border); padding: .35rem .8rem; cursor: pointer; border-radius: 1px; transition: color .2s, border-color .2s; }
.share-btn:hover { color: var(--gold); border-color: var(--border-hov); }
.article-header { padding: 3rem 0; border-bottom: 1px solid var(--border); }
.art-kicker { font-family: var(--font-sc); font-size: .62rem; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; margin-bottom: 1.2rem; }
.art-title { font-family: var(--font-serif); font-size: clamp(1.75rem,4.5vw,3rem); font-weight: 300; line-height: 1.13; color: var(--text-head); letter-spacing: -.015em; margin-bottom: 1rem; }
.art-sub { font-size: 1.05rem; font-style: italic; color: var(--text-body); margin-bottom: 1.4rem; max-width: 580px; }
.art-meta { font-family: var(--font-sc); font-size: .6rem; letter-spacing: .16em; color: var(--text-muted); text-transform: uppercase; }
.article-layout { display: grid; grid-template-columns: 1fr 210px; gap: 4.5rem; padding: 3rem 0 5rem; align-items: start; }
.article-prose { font-size: 1.05rem; line-height: 1.87; color: var(--text-body); }
.article-prose h2 { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400; color: var(--text-head); margin: 2.8rem 0 .9rem; letter-spacing: -.01em; }
.article-prose h3 { font-family: var(--font-serif); font-size: 1.12rem; font-weight: 500; color: var(--text-head); margin: 2rem 0 .6rem; }
.article-prose p { margin-bottom: 1.4rem; }
.article-prose strong { color: var(--text-head); font-weight: 500; }
.article-prose blockquote { border-left: 2px solid var(--gold); margin: 2.2rem 0; padding: .5rem 0 .5rem 1.8rem; font-style: italic; color: var(--text-body); font-size: 1.08rem; }
.article-prose hr { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.article-sidebar { position: sticky; top: 88px; }
.sidebar-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-label { font-family: var(--font-sc); font-size: .58rem; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; margin-bottom: 1rem; }
.sidebar-tag { display: inline-block; margin: 0 .35rem .45rem 0; font-family: var(--font-sc); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); border: 1px solid var(--border); padding: .25rem .6rem; transition: color .2s, border-color .2s; text-decoration: none; }
.sidebar-tag:hover { color: var(--gold); border-color: var(--border-hov); }
.related-item { padding: .7rem 0; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; display: block; }
.related-item:last-child { border-bottom: none; }
.related-item:hover .ri-title { color: var(--gold-light); }
.ri-title { font-family: var(--font-serif); font-size: .92rem; color: var(--text-head); line-height: 1.3; margin-bottom: .2rem; transition: color .25s var(--ease); }
.ri-date { font-family: var(--font-sc); font-size: .55rem; letter-spacing: .13em; color: var(--text-muted); text-transform: uppercase; }

/* ═══════════════════════════════════════
   OVERFLOW / WORD BREAK (sidebar fix)
═══════════════════════════════════════ */
.article-sidebar,
.article-sidebar * {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
}
.ri-title     { overflow-wrap: break-word; }
.sidebar-tag  { white-space: normal; word-break: break-word; }
.aside-card p { overflow-wrap: break-word; }
.aside-card a { word-break: break-all; }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

/* ── Tablet (≤ 900px) ── */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr 180px;
    gap: 3rem;
  }
  .about-body {
    grid-template-columns: 1fr 220px;
    gap: 3rem;
  }
}

/* ── Mobile (≤ 700px) ── */
@media (max-width: 700px) {
  /* layout */
  .wrap, .nav-inner, .footer-inner { padding: 0 1.2rem; }

  /* nav */
  .nav-links  { display: none; }
  .nav-burger { display: flex; }

  /* hero */
  .hero { padding: 3.5rem 0 2.5rem; }
  .page-hero { padding: 3rem 0 2rem; }

  /* article list items — stack date below */
  .article-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .article-item::after { display: none; }
  .ai-meta { text-align: left; padding-top: 0; }

  /* article single page */
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 0 3rem;
  }
  .article-sidebar {
    position: static;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    /* show sidebar as two columns on mid-size mobile */
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .sidebar-section {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  .article-header { padding: 2rem 0; }
  .article-back-bar { padding: 1.5rem 0 0; }

  /* about */
  .about-body {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2rem;
  }
  .about-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .aside-card { margin-bottom: 0; }

  /* topics grid */
  .topics-grid { grid-template-columns: 1fr 1fr; }

  /* filter bar — allow scroll */
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 1.2rem; -webkit-overflow-scrolling: touch; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  /* featured card — remove left bar (no room) */
  .featured-card::before { display: none; }

  /* footer */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .8rem; }
  .footer-links { flex-wrap: wrap; gap: 1.2rem; }
}

/* ── Small mobile (≤ 480px) ── */
@media (max-width: 480px) {
  .article-sidebar { grid-template-columns: 1fr; }
  .about-aside     { grid-template-columns: 1fr; }
  .topics-grid     { grid-template-columns: 1fr; }
  .share-btn       { display: none; } /* avoid cramping back bar */
}

/* ── Very small (≤ 360px) ── */
@media (max-width: 360px) {
  html { font-size: 16px; }
  .nav-logo { font-size: 1.3rem; }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -200px;
  left: -9999px;
  background: var(--gold);
  color: var(--bg);
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.skip-link:focus {
  position: absolute;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  clip: auto;
  overflow: visible;
  opacity: 1;
}
