/* seethefnords.com — public site
   Deep indigo + warm amber. Single column. Mobile-first. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #fafafa;
  --bg-card: #f4f3f0;
  --bg-hover: #eeedea;
  --text: #1a1a1a;
  --text-soft: #555;
  --text-muted: #888;
  --accent: #b8942e;
  --accent-dim: rgba(184,148,46,0.15);
  --indigo: #1e2a4a;
  --indigo-light: #2d3d66;
  --line: #e0ddd8;
  --line-soft: #eae8e3;
  --radius: 8px;
  --max-w: 720px;
}

/* Dark mode — deep indigo, warm amber accents */
html.dark {
  --bg: #0f1524;
  --bg-card: #182038;
  --bg-hover: #1e2844;
  --text: #e0dcd4;
  --text-soft: #a8a198;
  --text-muted: #706860;
  --accent: #d4ad3a;
  --accent-dim: rgba(212,173,58,0.12);
  --indigo: #0c1120;
  --indigo-light: #152040;
  --line: #2a3450;
  --line-soft: #1e2844;
}

/* System preference — apply dark if no saved pref */
@media (prefers-color-scheme: dark) {
  html:not(.light) {
    --bg: #0f1524;
    --bg-card: #182038;
    --bg-hover: #1e2844;
    --text: #e0dcd4;
    --text-soft: #a8a198;
    --text-muted: #706860;
    --accent: #d4ad3a;
    --accent-dim: rgba(212,173,58,0.12);
    --indigo: #0c1120;
    --indigo-light: #152040;
    --line: #2a3450;
    --line-soft: #1e2844;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.wrap--wide { max-width: 1200px; }

/* ── HEADER ─────────────────────────────────── */

.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  padding: 18px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.site-brand:hover { text-decoration: none; }
.site-mark { font-size: 22px; color: var(--accent); }
.site-wordmark {
  font: 600 17px/1 'IBM Plex Mono', monospace;
  letter-spacing: -0.02em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
}
.site-nav a {
  font: 500 14px/1 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}
.site-nav a:hover { color: #fff; text-decoration: none; }
.theme-toggle {
  border: 0; background: none;
  font-size: 18px; cursor: pointer;
  color: rgba(255,255,255,0.6);
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s;
  line-height: 1;
}
.theme-toggle:hover { color: #fff; }
/* Solid header pages */
.site-header--solid .theme-toggle { color: rgba(255,255,255,0.6); }
.site-header--solid .theme-toggle:hover { color: #fff; }

.nav-toggle {
  display: none;
  border: 0; background: none;
  font-size: 24px; cursor: pointer;
  color: #fff; padding: 4px;
}

/* ── HERO ───────────────────────────────────── */

.hero {
  position: relative;
  width: 100%;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--indigo);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 62%;
  opacity: 0.88;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,42,74,0.15) 0%, rgba(30,42,74,0.75) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 0 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}
.hero h1 {
  font: 800 clamp(32px, 5vw, 56px)/1.05 'IBM Plex Sans', sans-serif;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.03em;
}
.hero-sub {
  font: 400 clamp(16px, 2vw, 19px)/1.5 'IBM Plex Sans', sans-serif;
  color: rgba(255,255,255,0.78);
  max-width: 480px;
  margin: 0 0 8px;
}
.hero-tag {
  font: 500 14px/1.4 'IBM Plex Mono', monospace;
  color: var(--accent);
}

/* ── ARTICLE LIST ───────────────────────────── */

.articles-section { padding: 48px 0 32px; }
.section-label {
  font: 700 12px/1 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 24px;
}

/* ── READING LIST (table of contents) ────────── */

.reading-intro {
  font: 400 16px/1.65 'IBM Plex Sans', sans-serif;
  color: var(--text-soft);
  margin: 0 0 32px;
}

.question-header {
  font: 700 clamp(18px, 2.5vw, 22px)/1.25 'IBM Plex Sans', sans-serif;
  color: var(--text);
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.question-header:first-of-type { margin-top: 0; }

.reading-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  counter-reset: none;
}
.reading-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.5;
}
.reading-list li:last-child { border-bottom: none; }
.reading-list li a {
  text-decoration: none;
  color: var(--text);
}
.reading-list li a:hover { text-decoration: underline; }
.reading-list li a strong {
  font: 600 16px/1.35 'IBM Plex Sans', sans-serif;
}
.reading-desc {
  font: 400 15px/1.5 'IBM Plex Sans', sans-serif;
  color: var(--text-soft);
}

/* Upcoming / coming soon articles */
.reading-list li.is-upcoming {
  opacity: 0.45;
}
.upcoming-title {
  font: 600 16px/1.35 'IBM Plex Sans', sans-serif;
  color: var(--text-muted);
}

/* ── SUBSCRIBE ──────────────────────────────── */

.subscribe-section {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.subscribe-section h2 {
  font: 700 22px/1.2 'IBM Plex Sans', sans-serif;
  margin: 0 0 6px;
}
.subscribe-section p {
  color: var(--text-soft);
  margin: 0 0 20px;
  font-size: 15px;
}
.subscribe-form {
  display: flex;
  gap: 10px;
  max-width: 420px;
}
.subscribe-form input[type="email"] {
  flex: 1;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: 400 15px 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.subscribe-form input:focus { border-color: var(--accent); }
html.dark .subscribe-form input[type="email"] { background: var(--bg-card); border-color: var(--line); }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 999px;
  font: 600 14px/1 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  border: 0;
  text-decoration: none;
  transition: background 0.12s;
}
.btn--primary { background: var(--indigo); color: #fff; }
.btn--primary:hover { background: var(--indigo-light); text-decoration: none; }

/* ── FOOTER ─────────────────────────────────── */

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

.desktop-icon-link {
  display: inline-block;
  margin-top: 16px;
  opacity: 0.3;
  transition: opacity 0.2s;
  text-decoration: none;
}
.desktop-icon-link:hover { opacity: 0.7; text-decoration: none; }
.desktop-icon-link svg { width: 28px; height: 28px; }

/* ── ARTICLE PAGE ───────────────────────────── */

.article-page { max-width: var(--max-w); }
.article-page h1 {
  font: 800 clamp(28px, 4vw, 42px)/1.1 'IBM Plex Sans', sans-serif;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.article-byline {
  font: 500 14px/1 'IBM Plex Mono', monospace;
  color: var(--text-muted);
  margin: 0 0 28px;
}
.article-page h2 { font: 700 21px/1.25 'IBM Plex Sans', sans-serif; margin: 34px 0 12px; }
.article-page h3 { font: 700 17px/1.3 'IBM Plex Sans', sans-serif; margin: 24px 0 8px; }
.article-page p { margin: 0 0 16px; font-size: 17px; line-height: 1.72; }
.article-page strong { color: var(--text); }
.article-page em { color: var(--text-soft); }
.article-page blockquote {
  margin: 20px 0; padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic; color: var(--text-soft);
}
.article-page blockquote p { margin-bottom: 8px; }
.article-page blockquote p:last-child { margin-bottom: 0; }
.article-page ul, .article-page ol { margin: 12px 0 18px; padding-left: 24px; }
.article-page li { margin-bottom: 6px; font-size: 17px; line-height: 1.65; }
.article-page hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.article-page table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.article-page thead th { text-align: left; padding: 10px 12px; background: var(--bg-card); border-bottom: 2px solid var(--line); font: 600 12px 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.article-page tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.article-page sup { font-size: 0.72em; vertical-align: super; }
.article-page sup a { text-decoration: none; color: var(--accent); }
.article-back {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 14px/1 'IBM Plex Sans', sans-serif;
  color: var(--text-muted); text-decoration: none; margin-bottom: 28px;
}
.article-back:hover { color: var(--text); text-decoration: none; }
.editorial-credit {
  margin-top: 40px; padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 400 13px/1.6 'IBM Plex Mono', monospace;
  color: var(--text-muted);
}
.article-loading { color: var(--text-muted); font: 400 15px 'IBM Plex Mono', monospace; }

/* Footnotes — bidirectional jumping */
.fn-ref { font-size: 0.72em; vertical-align: super; line-height: 0; }
.fn-ref a { text-decoration: none; color: var(--accent); padding: 0 1px; }
.fn-ref a:hover { text-decoration: underline; }
.footnotes-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.footnote-item { font-size: 14.5px; line-height: 1.6; color: var(--text-soft); margin-bottom: 12px; }
.fn-back { text-decoration: none; color: var(--accent); font-weight: 600; margin-right: 4px; }
.fn-back:hover { text-decoration: underline; }
.fn-highlight { background: var(--accent-dim); border-radius: 3px; transition: background 0.3s; }
html { scroll-behavior: smooth; }

/* ── PROSE PAGES (about, fnords, store) ─────── */

.prose-section { padding: 56px 0; }
.prose-section--header {
  padding-top: 100px; /* clear absolute header */
}
.prose { max-width: var(--max-w); }
.prose h1 { font: 800 clamp(28px, 4vw, 42px)/1.1 'IBM Plex Sans', sans-serif; margin: 0 0 20px; }
.prose h2 { font: 700 20px/1.25 'IBM Plex Sans', sans-serif; margin: 32px 0 12px; }
.prose p { margin: 0 0 16px; font-size: 17px; line-height: 1.7; }
.prose p.quiet { color: var(--text-soft); font-size: 15px; }

/* non-hero pages need solid header */
.site-header--solid {
  position: relative;
  background: var(--indigo);
  padding: 16px 0;
}
.site-header--solid + .prose-section { padding-top: 40px; }

/* ── MOBILE ─────────────────────────────────── */

@media (max-width: 640px) {
  html { font-size: 16px; }
  .hero { min-height: 380px; }
  .hero-content { padding-bottom: 32px; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; right: 20px;
    background: var(--indigo); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius); padding: 14px 18px; gap: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3); z-index: 100;
  }
  .nav-toggle { display: block; }
  .subscribe-form { flex-direction: column; }
}
