/* themes.css — blog.davestj.com
 * We port davestj.com's "Mission Control" design tokens as the default theme and add
 * two alternates. Every color is a CSS var keyed off <html data-theme="…">, so the
 * admin theme picker just changes that attribute. No third-party CSS.
 */

/* ── Theme 1: mission-control (DEFAULT) — dark terminal ── */
:root,
[data-theme='mission-control'] {
  --bg: #0a0e14;
  --bg-grad: radial-gradient(1200px 700px at 50% -8%, #10202b 0%, #0a0e14 55%);
  --surface: #0e141c;
  --surface-2: #131b25;
  --border: #1e2b38;
  --border-bright: #2a3f52;
  --text: #e6f0f5;
  --text-dim: #8ba0ae;
  --text-faint: #566875;
  --accent: #3ddc84;
  --accent-rgb: 61, 220, 132;
  --amber: #f5b301;
  --amber-rgb: 245, 179, 1;
  --danger: #ff5c5c;
  --link: #5fd0ff;
  --grid: rgba(61, 220, 132, 0.05);
  --scanline: rgba(0, 0, 0, 0.16);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), 0 8px 40px rgba(0, 0, 0, 0.5);

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --heading-font: var(--font-mono);

  --radius: 10px;
  --pill-radius: 4px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --show-scanlines: block;
  --show-grid: block;
  --uppercase-labels: uppercase;
  --label-spacing: 0.14em;
}

/* ── Theme 2: cinematic — near-black + electric violet ── */
[data-theme='cinematic'] {
  --bg: #060608;
  --bg-grad: radial-gradient(1100px 640px at 50% -6%, #1a1030 0%, #060608 58%);
  --surface: #0d0b12;
  --surface-2: #14111c;
  --border: #241d33;
  --border-bright: #3a2d55;
  --text: #f2edff;
  --text-dim: #a99fc0;
  --text-faint: #6b6284;
  --accent: #b06bff;
  --accent-rgb: 176, 107, 255;
  --amber: #ff8a3d;
  --amber-rgb: 255, 138, 61;
  --danger: #ff5c8a;
  --link: #c79bff;
  --grid: rgba(176, 107, 255, 0.04);
  --scanline: rgba(0, 0, 0, 0);
  --glow: 0 0 0 1px rgba(var(--accent-rgb), 0.2), 0 12px 60px rgba(60, 20, 90, 0.5);
  --heading-font: var(--font-display);
  --radius: 14px;
  --pill-radius: 40px;
  --show-scanlines: none;
  --show-grid: none;
  --uppercase-labels: none;
  --label-spacing: 0.02em;
}

/* ── Theme 3: editorial — light reading ── */
[data-theme='editorial'] {
  --bg: #f6f5f1;
  --bg-grad: none;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --border: #e0ddd4;
  --border-bright: #cfc9bb;
  --text: #1a1a1a;
  --text-dim: #4a4a44;
  --text-faint: #8a877c;
  --accent: #c2410c;
  --accent-rgb: 194, 65, 12;
  --amber: #a16207;
  --amber-rgb: 161, 98, 7;
  --danger: #b91c1c;
  --link: #0369a1;
  --grid: rgba(0, 0, 0, 0);
  --scanline: rgba(0, 0, 0, 0);
  --glow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
  --heading-font: var(--font-display);
  --radius: 8px;
  --pill-radius: 6px;
  --show-scanlines: none;
  --show-grid: none;
  --uppercase-labels: none;
  --label-spacing: 0.01em;
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before { /* CRT scanlines */
  content: ''; position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  display: var(--show-scanlines);
  background: repeating-linear-gradient(0deg, transparent 0 2px, var(--scanline) 2px 3px);
  opacity: 0.5;
}
body::after { /* grid backdrop */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  display: var(--show-grid);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg-grad);
}
body { background: var(--bg-grad, var(--bg)); background-attachment: fixed; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: rgba(var(--accent-rgb), 0.3); }

h1, h2, h3, h4 { font-family: var(--heading-font); line-height: 1.15; margin: 0 0 .5em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ── Terminal-style top nav ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 14, 20, 0.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
[data-theme='editorial'] .site-header { background: rgba(255, 255, 255, 0.85); }
.site-header .wrap { display: flex; align-items: center; gap: 1.5rem; height: 60px; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; color: var(--text); letter-spacing: -.01em; }
.brand .accent { color: var(--accent); }
.brand .cursor { display: inline-block; width: .5ch; height: .95em; background: var(--accent); margin-left: 2px; vertical-align: -1px; animation: blink 1.1s step-end infinite; }
.nav { margin-left: auto; display: flex; gap: 1.1rem; align-items: center; }
.nav a {
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-dim);
  text-transform: var(--uppercase-labels); letter-spacing: var(--label-spacing);
}
.nav a:hover { color: var(--accent); text-decoration: none; }
.status-line { font-family: var(--font-mono); font-size: .68rem; color: var(--text-faint); display: flex; align-items: center; gap: .4rem; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }

/* ── Layout: content + sidebar ── */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; padding: 40px 0 80px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.eyebrow { font-family: var(--font-mono); font-size: .72rem; color: var(--accent); text-transform: var(--uppercase-labels); letter-spacing: var(--label-spacing); }
.eyebrow::before { content: '▸ '; }

/* ── Post cards (list) ── */
.post-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 1.2rem; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.post-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--glow); }
.post-card h2 { font-size: 1.5rem; margin: .1rem 0 .4rem; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--accent); text-decoration: none; }
.post-meta { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: .6rem; }
.post-excerpt { color: var(--text-dim); font-size: .98rem; }
.type-badge { font-family: var(--font-mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .1em; padding: 2px 7px; border-radius: var(--pill-radius); border: 1px solid currentColor; }
.type-badge.podcast { color: var(--amber); }
.type-badge.vlogcast { color: var(--link); }
.type-badge.article { color: var(--accent); }

/* ── Single article ── */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 34px 40px; }
@media (max-width: 640px) { .article { padding: 24px 20px; } }
.article h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.article-body { font-size: 1.08rem; color: var(--text); }
.article-body p { margin: 0 0 1.2em; }
.article-body h2, .article-body h3 { margin-top: 1.6em; }
.article-body img { border-radius: var(--radius); margin: 1.4em 0; }
.article-body blockquote { border-left: 3px solid var(--accent); margin: 1.4em 0; padding: .4em 1.2em; color: var(--text-dim); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.article-body pre { background: #06090d; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: .85rem; }
.article-body code { font-family: var(--font-mono); font-size: .88em; }

/* ── Media players (podcast/vlogcast enclosures) ── */
.enclosure { margin: 1.6em 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.enclosure audio, .enclosure video { width: 100%; border-radius: 6px; }

/* ── Sidebar + ad slots ── */
.sidebar > * { margin-bottom: 1.4rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.panel h3 { font-family: var(--font-mono); font-size: .82rem; text-transform: var(--uppercase-labels); letter-spacing: var(--label-spacing); color: var(--text-dim); }
.ad-slot {
  border: 1px dashed var(--border-bright); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; min-height: 90px;
  color: var(--text-faint); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  background: var(--surface-2);
}

/* ── Buttons / badges ── */
.btn { font-family: var(--font-mono); font-size: .82rem; padding: 10px 20px; border-radius: var(--pill-radius); border: 1px solid var(--border-bright); background: transparent; color: var(--text); cursor: pointer; transition: all .18s var(--ease); }
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }
.site-footer .seal { color: var(--accent); }

/* ── Animations ── */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); } 70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
