/* ============================================================
   Artificial Atheist — design system
   Light/dark via [data-theme]; reader scaling via [data-font]
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@700&family=Playfair+Display:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mark: 'Oxanium', sans-serif;

  --accent: #534AB7;
  --accent-soft: #7F77DD;
  --accent-bright: #C8B8FF;

  /* reader font scale — overridden by [data-font] below */
  --scale: 1;
  --fs-body: calc(17px * var(--scale));
  --fs-deck: calc(18px * var(--scale));
  --fs-h1: calc(34px * var(--scale));
  --fs-h2: calc(26px * var(--scale));
  --fs-card-title: calc(19px * var(--scale));
}

[data-font="sm"] { --scale: 0.9; }
[data-font="md"] { --scale: 1; }
[data-font="lg"] { --scale: 1.15; }

/* ---- Light theme (default) ---- */
:root,
[data-theme="light"] {
  --bg: #FAFAF8;
  --bg-raised: #FFFFFF;
  --bg-sub: #F0EEE8;
  --bg-tint: #EEEDFE;
  --border: #E8E6E0;
  --border-strong: #C8C4C0;
  --text: #1A1A1F;
  --text-soft: #5A5560;
  --text-mute: #67636F;
  --ticker-bg: #EEEDFE;
  --ticker-text: #534AB7;
  --footer-bg: #0E0E0F;
  --footer-text: #9E9AAA;
  --footer-mute: #8A8694;
  --ctrl-bg: #FFFFFF;
  --ctrl-border: #C8C4C0;
  --ctrl-icon: #3D3A4A;
  --img-frame: #E8E4F8;
  --mark-overlay: #7F77DD;
  --mark-stroke: #26215C;
  --mark-letter: #FFFFFF;
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #0E0E0F;
  --bg-raised: #141320;
  --bg-sub: #0A0A0B;
  --bg-tint: #141320;
  --border: #1E1D25;
  --border-strong: #2A2830;
  --text: #F2F0EA;
  --text-soft: #9E9AAA;
  --text-mute: #8A8694;
  --ticker-bg: #141320;
  --ticker-text: #C8B8FF;
  --footer-bg: #070708;
  --footer-text: #9E9AAA;
  --footer-mute: #8A8694;
  --ctrl-bg: #1A1827;
  --ctrl-border: #3D3A4A;
  --ctrl-icon: #C8B8FF;
  --img-frame: #1A1827;
  --mark-overlay: #C8B8FF;
  --mark-stroke: #AFA9EC;
  --mark-letter: #0E0E0F;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: var(--fs-body);
  transition: background 0.2s, color 0.2s;
}

a { color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ===================== Masthead ===================== */
.mast {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; max-width: 1080px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand svg { width: 56px; height: 56px; flex-shrink: 0; }
.brand-name {
  font-weight: 300; font-size: 15px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--text); line-height: 1.1;
}
.brand-sub {
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-mute); margin-top: 4px;
}
.controls { display: flex; align-items: center; gap: 6px; }
.ctrl {
  display: flex; align-items: center; justify-content: center;
  background: var(--ctrl-bg); border: 1px solid var(--ctrl-border);
  color: var(--ctrl-icon); border-radius: 4px; cursor: pointer;
  font-family: var(--font-body); font-weight: 700; line-height: 1;
}
.ctrl-icon { width: 38px; height: 38px; }
.ctrl-icon i { font-size: 18px; }
.ctrl-font-sm { padding: 6px 10px; font-size: 12px; }
.ctrl-font-lg { padding: 5px 10px; font-size: 17px; }
.ctrl[aria-pressed="true"] {
  border-color: var(--accent-soft); color: var(--accent);
  background: var(--bg-tint);
}
[data-theme="dark"] .ctrl[aria-pressed="true"] { color: var(--accent-bright); }
.ctrl-sep { width: 1px; height: 24px; background: var(--border-strong); margin: 0 6px; }

/* ===================== Subnav ===================== */
.subnav {
  background: var(--bg-sub); border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.subnav-inner {
  display: flex; align-items: center; justify-content: center; gap: 2rem;
  flex-wrap: wrap; padding: 0.7rem 1.5rem; max-width: 1080px; margin: 0 auto;
}
.subnav a {
  text-decoration: none; font-size: 13px; letter-spacing: 0.04em;
  color: var(--text-soft); display: flex; align-items: center; gap: 5px;
}
.subnav a:hover { color: var(--text); }
.subnav a i { font-size: 15px; }

/* ===================== Ticker ===================== */
.ticker {
  background: var(--ticker-bg); border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.ticker-inner {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1.5rem; max-width: 1080px; margin: 0 auto;
}
.ticker-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ticker-text); flex-shrink: 0;
}
.ticker-items { display: flex; gap: 1.5rem; overflow: hidden; white-space: nowrap; }
.ticker-item {
  font-size: 12px; color: var(--ticker-text);
  display: flex; align-items: center; gap: 5px; text-decoration: none;
}
.ticker-item .dot { color: var(--accent-soft); font-size: 8px; }

/* ===================== Tags ===================== */
.tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px;
}
.tag i { font-size: 13px; }

/* ===================== Homepage lead ===================== */
.lead {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem;
  padding: 2rem 0; border-bottom: 1px solid var(--border); margin-bottom: 2rem;
}
.lead-img {
  border-radius: 8px; overflow: hidden; background: var(--img-frame);
  min-height: 240px; display: flex;
}
.lead-img svg { width: 100%; height: 100%; }
.lead-content { display: flex; flex-direction: column; justify-content: center; }
.lead h1 {
  font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 500;
  line-height: 1.2; letter-spacing: -0.01em; margin: 0.75rem 0 1rem;
}
.lead h1 a { text-decoration: none; }
.lead-deck { font-size: var(--fs-deck); line-height: 1.7; color: var(--text-soft); margin-bottom: 1.5rem; }
.meta { display: flex; align-items: center; gap: 1.25rem; font-size: 13px; color: var(--text-mute); }
.meta i { font-size: 15px; vertical-align: -2px; margin-right: 3px; }
.read-link {
  margin-left: auto; font-size: 13px; font-weight: 500; color: var(--accent);
  text-decoration: none; display: flex; align-items: center; gap: 5px;
}
[data-theme="dark"] .read-link { color: var(--accent-bright); }

/* ===================== Topic artwork (icon + color) ===================== */
.art-field { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.art-rings { position: absolute; inset: 0; width: 100%; height: 100%; }
.art-icon { position: relative; z-index: 1; opacity: 0.9; }
/* icon scales to the container it sits in */
.lead-img .art-icon, .article-hero-img .art-icon { font-size: 84px; }
.card-img .art-icon { font-size: 40px; }
.list-thumb .art-icon { font-size: 24px; }

/* ===================== Section eyebrow ===================== */
.eyebrow {
  font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--text-mute); margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ''; width: 20px; height: 1px; background: var(--accent-soft); }

/* ===================== Card grid ===================== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-bottom: 2.5rem; }
.card {
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  background: var(--bg-raised); display: flex; flex-direction: column;
  text-decoration: none; color: inherit; transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-strong); }
.card-img { height: 120px; display: flex; }
.card-img svg { width: 100%; height: 100%; }
.card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card-title { font-family: var(--font-display); font-size: var(--fs-card-title); font-weight: 500; line-height: 1.3; }
.card-excerpt { font-size: 13px; line-height: 1.6; color: var(--text-soft); }
.card-meta { font-size: 11px; color: var(--text-mute); margin-top: auto; padding-top: 0.5rem; display: flex; align-items: center; gap: 8px; }
.card-meta i { font-size: 13px; }

/* ===================== Split (list + topics) ===================== */
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; text-decoration: none; color: inherit; }
.list-item:first-child { padding-top: 0; }
.list-thumb { width: 80px; height: 64px; border-radius: 6px; flex-shrink: 0; overflow: hidden; }
.list-thumb svg { width: 100%; height: 100%; }
.list-title { font-family: var(--font-display); font-size: 16px; font-weight: 500; line-height: 1.3; margin: 4px 0; }
.list-meta { font-size: 11px; color: var(--text-mute); }

.topics-col { display: flex; flex-direction: column; gap: 10px; }
.topic-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.1rem;
  background: var(--bg-raised); display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.topic-ic { width: 38px; height: 38px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.topic-ic i { font-size: 19px; }
.topic-name { font-size: 14px; font-weight: 500; }
.topic-count { font-size: 11px; color: var(--text-mute); }

/* ===================== About block ===================== */
.about-block {
  background: var(--bg-sub); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem 1.75rem; margin-bottom: 2.5rem;
}
.about-block h3 { font-family: var(--font-display); font-size: 20px; font-weight: 500; margin-bottom: 0.6rem; }
.about-block p { font-size: 15px; line-height: 1.7; color: var(--text-soft); }

/* ===================== Article page ===================== */
.article { max-width: 720px; margin: 0 auto; padding: 2.5rem 0; }
.article-hero-img { border-radius: 8px; overflow: hidden; background: var(--img-frame); height: 280px; margin-bottom: 2rem; display: flex; }
.article-hero-img svg { width: 100%; height: 100%; }
.article h1 {
  font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 500;
  line-height: 1.2; letter-spacing: -0.01em; margin: 0.75rem 0 1rem;
}
.article-meta { display: flex; align-items: center; gap: 1.25rem; font-size: 13px; color: var(--text-mute); padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.article-meta i { font-size: 15px; vertical-align: -2px; margin-right: 3px; }

.prose { font-size: var(--fs-body); line-height: 1.8; }
.prose h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 500; line-height: 1.3; margin: 2.25rem 0 1rem; }
.prose h3 { font-family: var(--font-display); font-size: calc(20px * var(--scale)); font-weight: 500; margin: 1.75rem 0 0.75rem; }
.prose p { margin: 0 0 1.25rem; color: var(--text); }
.prose ul, .prose ol { margin: 0 0 1.25rem 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose strong { font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 2px; }
[data-theme="dark"] .prose a { color: var(--accent-bright); }
.prose blockquote {
  border-left: 3px solid var(--accent-soft); padding-left: 1.25rem;
  margin: 1.5rem 0; font-family: var(--font-display); font-style: italic;
  font-size: calc(20px * var(--scale)); color: var(--text-soft);
}

/* ===================== Monetization slots ===================== */
.ad-slot {
  margin: 2rem 0; padding: 0.5rem; text-align: center; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 6px;
  color: var(--text-mute); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
}
.affiliate-disclosure {
  font-size: 12px; color: var(--text-mute); font-style: italic;
  border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 2.5rem;
}
.donate-cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-size: 13px; font-weight: 500; padding: 8px 16px; border-radius: 5px;
  margin-top: 1rem;
}
.donate-cta i { font-size: 15px; }

/* ===================== Related ===================== */
.related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }

/* ===================== Footer ===================== */
.footer { background: var(--footer-bg); margin-top: 3rem; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; padding: 2rem 1.5rem; max-width: 1080px; margin: 0 auto;
}
.footer-left { display: flex; align-items: center; gap: 14px; }
.footer-name { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--footer-text); }
.ai-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
  color: var(--footer-mute); border: 1px solid #2A2830; padding: 4px 9px; border-radius: 4px;
}
.ai-badge i { font-size: 13px; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { font-size: 11px; color: var(--footer-mute); text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-links a:hover { color: var(--footer-text); }

/* ===================== Topic archive ===================== */
.archive-head { padding: 2.5rem 0 1.5rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.archive-head h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 500; display: flex; align-items: center; gap: 12px; }

/* ===================== Responsive ===================== */
@media (max-width: 820px) {
  .lead { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .mast { flex-direction: column; gap: 1rem; align-items: flex-start; }
  .cards { grid-template-columns: 1fr; }
  .brand-name { font-size: 13px; letter-spacing: 0.2em; }
  .ticker-items { gap: 1rem; }
}
