/*
 * The New Guard — Shared Styles
 * Used by: /archive/, /issues/*, /features/*
 * NOT used by: / (landing page has embedded styles)
 *
 * Brand tokens:
 *   --dark: #0A0A0F    --darker: #060609
 *   --subtle: #1A1A2E  --accent: #E94560
 *   --text: #E8E8EC    --muted: #8888A0
 *   --white: #FFFFFF
 */

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

:root {
  --dark: #0A0A0F;
  --darker: #060609;
  --subtle: #1A1A2E;
  --accent: #E94560;
  --accent-glow: rgba(233,69,96,0.3);
  --text: #E8E8EC;
  --muted: #8888A0;
  --white: #FFFFFF;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.3s; }
a:hover { opacity: 0.85; }

img { max-width: 100%; height: auto; }

/* ====== LAYOUT ====== */

.container { max-width: 720px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ====== NAV ====== */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between;
  transition: all 0.3s;
}
.nav.scrolled {
  background: rgba(10,10,15,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 32px;
  border-bottom: 1px solid rgba(233,69,96,0.08);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.nav-logo img { width: 28px; height: 28px; }
.nav-logo span {
  font-family: 'Space Mono', monospace;
  font-size: 14px; font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
}
.nav-links {
  display: flex; align-items: center; gap: 32px;
}
.nav-link {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 400;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  transition: color 0.3s;
}
.nav-link:hover, .nav-link-active { color: var(--accent); opacity: 1; }

/* Mobile nav */
.nav-mobile-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-mobile-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); transition: all 0.3s;
}
.nav-mobile-menu {
  display: none;
  position: fixed; top: 60px; left: 0; right: 0;
  background: rgba(6,6,9,0.98);
  backdrop-filter: blur(20px);
  padding: 24px 32px;
  flex-direction: column; gap: 20px;
  border-bottom: 1px solid rgba(233,69,96,0.1);
}
.nav-mobile-menu.open { display: flex; }
.nav-mobile-link {
  font-family: 'Space Mono', monospace;
  font-size: 13px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }
  .nav { padding: 16px 20px; }
  .nav.scrolled { padding: 12px 20px; }
}

/* ====== BUTTONS ====== */

.btn {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 12px 28px; border-radius: 6px;
  text-decoration: none; cursor: pointer;
  transition: all 0.3s;
}
.btn-nav {
  background: var(--accent); color: var(--white);
  padding: 10px 22px;
}
.btn-nav:hover {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px); opacity: 1;
}
.btn-accent {
  background: var(--accent); color: var(--white);
}
.btn-accent:hover {
  box-shadow: 0 0 30px var(--accent-glow);
  transform: translateY(-2px); opacity: 1;
}

/* ====== TAGS ====== */

.tag {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  padding: 6px 14px;
  border: 1px solid rgba(233,69,96,0.2);
  border-radius: 4px;
  background: rgba(233,69,96,0.05);
}

/* ====== ARTICLE HEADER (standard — issues) ====== */

.article-header {
  padding: 140px 0 48px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, rgba(233,69,96,0.06) 0%, transparent 60%);
}
.article-header .tag { margin-bottom: 20px; }
.article-header h1 {
  font-size: 40px; font-weight: 900;
  line-height: 1.1; color: var(--white);
  letter-spacing: -1px;
  max-width: 700px; margin: 0 auto 16px;
}
.article-header h1 span { color: var(--accent); }
.article-meta {
  font-family: 'Space Mono', monospace;
  font-size: 12px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase;
}

/* ====== FEATURE HEADER (wider, more dramatic — deep dives) ====== */

.feature-header {
  padding: 140px 0 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, rgba(233,69,96,0.1) 0%, transparent 60%);
}
.feature-header .tag { margin-bottom: 20px; }
.feature-header h1 {
  font-size: 44px; font-weight: 900;
  line-height: 1.1; color: var(--white);
  letter-spacing: -1.5px;
  max-width: 760px; margin: 0 auto 20px;
}
.feature-header h1 span { color: var(--accent); }
.feature-subtitle {
  font-size: 18px; color: var(--muted);
  max-width: 600px; margin: 0 auto 16px;
  line-height: 1.6;
}
.feature-header .article-meta a { color: var(--accent); }

/* ====== ARTICLE BODY ====== */

.article-body {
  padding: 48px 0;
}
.article-body p {
  font-size: 17px; line-height: 1.75;
  color: var(--text); margin-bottom: 20px;
}
.article-body strong { color: var(--white); font-weight: 700; }
.article-body em { font-style: italic; }
.article-body h2 {
  font-size: 28px; font-weight: 800;
  color: var(--white); margin: 8px 0 20px;
  letter-spacing: -0.5px; line-height: 1.2;
}
.article-body h3 {
  font-size: 20px; font-weight: 700;
  color: var(--white); margin: 32px 0 12px;
}
.article-body ul, .article-body ol {
  margin: 16px 0 24px 24px;
}
.article-body li {
  font-size: 16px; line-height: 1.7;
  color: var(--text); margin-bottom: 8px;
}
.article-body hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233,69,96,0.15), transparent);
  margin: 48px 0;
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px; margin: 32px 0;
  background: rgba(233,69,96,0.04);
  border-radius: 0 8px 8px 0;
}
.article-body blockquote p {
  font-size: 16px; color: var(--muted);
  margin-bottom: 0;
}

/* Section tags (emoji labels above h2) */
.section-tag {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}

/* ====== CODE BLOCKS ====== */

.article-body pre {
  background: var(--darker);
  border: 1px solid rgba(233,69,96,0.12);
  border-radius: 8px;
  padding: 20px 24px; margin: 24px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code {
  font-family: 'Space Mono', monospace;
  font-size: 13px; line-height: 1.65;
  color: var(--text);
  background: none; padding: 0; border: none;
}
.article-body code {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  background: rgba(233,69,96,0.08);
  color: var(--accent);
  padding: 2px 6px; border-radius: 4px;
}

/* Prism.js overrides — keep brand container, let Prism color the syntax */
.article-body pre[class*="language-"],
.article-body code[class*="language-"] {
  background: var(--darker);
  font-family: 'Space Mono', monospace;
  font-size: 13px; line-height: 1.65;
  text-shadow: none;
}
.article-body pre[class*="language-"] {
  border: 1px solid rgba(233,69,96,0.12);
  border-radius: 8px;
  padding: 20px 24px; margin: 24px 0;
}
/* Keep inline code styled as brand, not Prism */
.article-body :not(pre) > code {
  background: rgba(233,69,96,0.08);
  color: var(--accent);
  padding: 2px 6px; border-radius: 4px;
  font-size: 14px;
  text-shadow: none;
}

/* ====== MERMAID DIAGRAMS ====== */

.article-body pre.mermaid {
  background: transparent;
  border: none;
  padding: 24px 0;
  margin: 32px 0;
  text-align: center;
  overflow-x: auto;
}
.article-body pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* ====== TABLES ====== */

.article-body table {
  width: 100%; border-collapse: collapse;
  margin: 24px 0; font-size: 15px;
}
.article-body thead th {
  font-family: 'Space Mono', monospace;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid rgba(233,69,96,0.2);
}
.article-body tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(233,69,96,0.06);
  color: var(--text); vertical-align: top; line-height: 1.5;
}
.article-body tbody tr:hover { background: rgba(233,69,96,0.03); }
.article-body tbody td:first-child {
  font-weight: 600; color: var(--white); white-space: nowrap;
}

/* ====== CALLOUT BOX ====== */

.callout-box {
  background: linear-gradient(135deg, rgba(26,26,46,0.6), rgba(6,6,9,0.6));
  border: 1px solid rgba(233,69,96,0.15);
  border-radius: 12px;
  padding: 32px; margin: 32px 0;
}
.callout-box h3 {
  margin-top: 0;
}
.stat-highlight {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 56px; font-weight: 700;
  color: var(--accent); line-height: 1;
  margin-bottom: 8px;
}

/* ====== VIRAL ITEMS ====== */

.viral-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(233,69,96,0.06);
}
.viral-item:last-child { border-bottom: none; }
.viral-item p { margin-bottom: 0; font-size: 16px; }

/* ====== COMPANION CARD ====== */

.companion-card {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(26,26,46,0.6), rgba(6,6,9,0.6));
  border: 1px solid rgba(233,69,96,0.15);
  border-radius: 12px;
  padding: 20px 24px; margin: 32px 0;
  text-decoration: none; transition: all 0.3s;
}
.companion-card:hover {
  border-color: rgba(233,69,96,0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(233,69,96,0.08);
  opacity: 1;
}
.companion-icon { font-size: 28px; flex-shrink: 0; }
.companion-text h4 {
  font-size: 16px; font-weight: 700;
  color: var(--white); margin-bottom: 4px;
}
.companion-text p {
  font-size: 14px; color: var(--muted);
  margin: 0; line-height: 1.4;
}

/* ====== RELATED CONTENT ====== */

.related-content {
  padding: 48px 0;
  border-top: 1px solid rgba(233,69,96,0.08);
}
.related-content h3 {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}
.related-link {
  display: block; padding: 16px 0;
  border-bottom: 1px solid rgba(233,69,96,0.06);
  text-decoration: none; transition: padding-left 0.3s;
}
.related-link:hover { padding-left: 8px; opacity: 1; }
.related-title {
  font-size: 18px; font-weight: 600;
  color: var(--white); margin-bottom: 4px;
  transition: color 0.3s;
}
.related-link:hover .related-title { color: var(--accent); }
.related-desc { font-size: 14px; color: var(--muted); }

/* ====== ARCHIVE PAGES ====== */

.archive-header {
  padding: 140px 0 48px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 80%, rgba(233,69,96,0.06) 0%, transparent 60%);
}
.archive-header .tag { margin-bottom: 16px; }
.archive-header h1 {
  font-size: 40px; font-weight: 900;
  color: var(--white); letter-spacing: -1px;
  margin-bottom: 12px;
}
.archive-header p {
  font-size: 17px; color: var(--muted);
  max-width: 500px; margin: 0 auto;
}

.archive-list { padding: 32px 0 64px; }

.archive-item {
  display: block; position: relative;
  padding: 28px 48px 28px 0;
  border-bottom: 1px solid rgba(233,69,96,0.06);
  text-decoration: none;
  transition: padding-left 0.3s, background 0.3s;
}
.archive-item:hover {
  padding-left: 12px;
  background: rgba(233,69,96,0.02);
}
.archive-number {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.archive-number .date {
  color: var(--muted); font-weight: 400;
  margin-left: 12px;
}
.archive-title {
  font-size: 22px; font-weight: 700;
  color: var(--white); margin-bottom: 6px;
  transition: color 0.3s;
}
.archive-item:hover .archive-title { color: var(--accent); }
.archive-desc {
  font-size: 15px; color: var(--muted);
  line-height: 1.5;
}
.archive-arrow {
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 20px; color: var(--accent);
  opacity: 0; transition: opacity 0.3s, right 0.3s;
}
.archive-item:hover .archive-arrow { opacity: 1; right: 12px; }

/* ====== SUBSCRIBE SECTION ====== */

.subscribe-section {
  padding: 80px 0;
  text-align: center;
  background: radial-gradient(ellipse at 50% 50%, rgba(233,69,96,0.06) 0%, transparent 60%);
}
.subscribe-section h2 {
  font-size: 32px; font-weight: 800;
  color: var(--white); margin-bottom: 12px;
}
.subscribe-section p {
  font-size: 16px; color: var(--muted);
  margin-bottom: 28px;
}
.subscribe-form {
  display: flex; gap: 12px;
  max-width: 440px; margin: 0 auto;
}
.subscribe-form input[type="email"] {
  flex: 1; padding: 14px 18px;
  background: rgba(26,26,46,0.6);
  border: 1px solid rgba(233,69,96,0.2);
  border-radius: 6px;
  color: var(--text); font-family: 'Outfit', sans-serif;
  font-size: 15px; outline: none;
  transition: border-color 0.3s;
}
.subscribe-form input[type="email"]:focus {
  border-color: var(--accent);
}
.subscribe-form input[type="email"]::placeholder { color: var(--muted); }
.subscribe-msg {
  font-family: 'Space Mono', monospace;
  font-size: 13px; color: var(--accent);
  margin-top: 16px;
}

/* ====== FOOTER ====== */

.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(233,69,96,0.06);
  text-align: center;
}
.footer-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 12px;
}
.footer-logo img { width: 20px; height: 20px; opacity: 0.6; }
.footer-logo span {
  font-family: 'Space Mono', monospace;
  font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: 0.5px;
}
.footer-tagline {
  font-size: 13px; color: rgba(136,136,160,0.5);
}

/* ====== ANIMATIONS ====== */

.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1; transform: translateY(0);
}

/* ====== RESPONSIVE ====== */

@media (max-width: 768px) {
  .article-header { padding: 120px 0 36px; }
  .article-header h1 { font-size: 28px; }
  .feature-header { padding: 120px 0 40px; }
  .feature-header h1 { font-size: 28px; }
  .feature-subtitle { font-size: 16px; }
  .archive-header { padding: 120px 0 36px; }
  .archive-header h1 { font-size: 28px; }
  .article-body h2 { font-size: 22px; }
  .article-body pre { padding: 14px 16px; }
  .article-body pre code { font-size: 12px; }
  .article-body table { font-size: 13px; }
  .article-body thead th,
  .article-body tbody td { padding: 8px 10px; }
  .article-body tbody td:first-child { white-space: normal; }
  .callout-box { padding: 24px; }
  .stat-highlight { font-size: 42px; }
  .subscribe-form { flex-direction: column; }
  .companion-card { flex-direction: column; text-align: center; }
  .container, .container-wide { padding: 0 16px; }
}
