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

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #ff0000;
  --secondary: #8b00ff;
  --ink: #261717;
  --ink-light: #3d2222;
  --surface: rgba(38, 23, 23, 0.72);
  --glass-bg: rgba(255,255,255,0.10);
  --glass-bg-strong: rgba(255,255,255,0.16);
  --glass-border: rgba(255,255,255,0.18);
  --glass-blur: 15px;
  --text: #f5e6e6;
  --text-muted: #c9a8a8;
  --text-dim: #a08080;
  --font: 'Space Mono', 'Courier New', monospace;
  --radius: 0px;
  --max-content: 780px;
  --max-wide: 1200px;
  --header-h: 64px;
  --transition: 0.18s ease;
}

html {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  background: var(--ink);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(139,0,255,0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(255,0,0,0.18) 0%, transparent 60%),
    var(--ink);
  overflow-x: hidden;
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--secondary); }

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

/* ── Glass utility ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

.glass-section {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  padding: 2rem;
  margin: 2rem 0;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(38,23,23,0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
}

.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}
.brand:hover { color: var(--primary); }
.brand img { border-radius: 4px; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.6rem 0.65rem;
  white-space: nowrap;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--primary); }

.header-ctas {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── CTA buttons ── */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.1rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  border-radius: var(--radius);
}

.cta-signup {
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--primary);
}
.cta-signup:hover {
  background: #cc0000;
  border-color: #cc0000;
  color: #fff;
}

.cta-login {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.cta-login:hover {
  background: rgba(255,0,0,0.12);
  color: var(--primary);
}

.hero-cta {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  padding: 0 1.5rem;
}

/* ── Hero ── */
.hero {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  padding-top: var(--header-h);
}

.hero-media {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.hero-img, .hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-img-placeholder {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(139,0,255,0.3) 0%, rgba(255,0,0,0.2) 100%);
}

.hero-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 2.5rem;
  background: rgba(38,23,23,0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--glass-border);
}

.hero-copy h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0.75rem 0;
  letter-spacing: -0.02em;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 420px;
  line-height: 1.7;
}

/* ── Eyebrow ── */
.eyebrow {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--secondary);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

/* ── Layout: content-section ── */
.content-section {
  display: flex;
  flex-direction: row;
  max-width: var(--max-wide);
  margin: 0 auto;
  width: 100%;
  padding: 2.5rem 1.25rem;
  gap: 2rem;
}

/* Sidebar to the left */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  order: -1;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  align-self: flex-start;
}

.sidebar h3 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.sidebar nav dl {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar nav dt { list-style: none; }
.sidebar nav a {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  min-height: 36px;
  display: flex;
  align-items: center;
}
.sidebar nav a:hover {
  color: var(--primary);
  border-left-color: var(--primary);
}

.stage-badge {
  margin-top: 1rem;
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--secondary);
  color: var(--secondary);
}

/* ── Content body (figure) ── */
.content-body {
  flex: 1;
  min-width: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  padding: 2rem 2.25rem;
}

/* ── Article hero image ── */
.article-hero {
  margin: -2rem -2.25rem 1.5rem;
  overflow: hidden;
  max-height: 340px;
}

.article-hero-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
}

/* ── Page headers ── */
.topic-header, .article-header, .inner-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

.topic-header h1, .article-header h1, .inner-header h1 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 0.5rem 0;
  letter-spacing: -0.02em;
}

/* ── Byline ── */
.byline {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

.byline time { color: var(--text-muted); }

/* ── Breadcrumb ── */
.breadcrumb {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* ── Page content typography ── */
.page-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text);
  max-width: var(--max-content);
}

.page-content h2 { font-size: 1.35rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text); letter-spacing: -0.01em; }
.page-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--text-muted); }
.page-content p { margin-bottom: 1.1rem; }
.page-content ul, .page-content ol { margin: 0 0 1.1rem 1.3rem; }
.page-content li { margin-bottom: 0.4rem; }
.page-content a { color: var(--primary); text-decoration: underline; }
.page-content a:hover { color: var(--secondary); }
.page-content strong { color: var(--text); font-weight: 700; }
.page-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; font-size: 0.9rem; }
.page-content th { background: rgba(139,0,255,0.18); color: var(--text); padding: 0.6rem 0.85rem; text-align: left; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--glass-border); }
.page-content td { padding: 0.55rem 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06); color: var(--text-muted); }
.page-content tr:hover td { background: rgba(255,255,255,0.04); }
.page-content blockquote { border-left: 3px solid var(--primary); padding: 0.5rem 1rem; margin: 1rem 0; color: var(--text-muted); font-style: normal; }

/* ── Child pages: card list ── */
.child-pages {
  max-width: var(--max-wide);
  margin: 1rem auto 2rem;
  padding: 2rem 1.25rem;
}

.child-pages h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.card-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding: 0;
}

.card {
  background: rgba(255,0,0,0.07);
  border: 1px solid var(--glass-border);
  transition: background var(--transition), border-color var(--transition);
  animation: fadeSlideIn 0.4s both;
  animation-delay: calc(var(--i, 0) * 0.07s);
}

.card:hover {
  background: rgba(255,0,0,0.13);
  border-color: rgba(255,0,0,0.4);
}

.card a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  min-height: 80px;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.card small {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: block;
}

/* ── Author article ── */
.author-section {
  margin-top: 2rem;
}

.author-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.author-credentials {
  font-size: 0.8rem;
  color: var(--secondary);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.author-bio {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ── Footer ── */
.site-footer {
  margin-top: auto;
  background: rgba(20,12,12,0.92);
  border-top: 1px solid var(--glass-border);
}

/* footer has nav as direct child, nav has .footer-inner as direct child article div */
.footer-nav {
  width: 100%;
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 2rem;
  padding: 2.5rem 1.25rem 1.5rem;
}

.footer-brand .brand {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  display: inline-block;
}

.footer-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
  max-width: 220px;
}

.footer-col small.eyebrow {
  margin-bottom: 0.75rem;
}

.footer-col dl {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.footer-col dt { list-style: none; }
.footer-col a {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.3rem 0;
  min-height: 32px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary); }

.rg-notice {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.footer-bottom {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
}

.copyright {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

/* ── Main layout spacer ── */
.topic-main, .article-main, .inner-main {
  padding-top: var(--header-h);
  flex: 1;
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Parallax placeholder (JS-enhanced) ── */
.hero-media { will-change: transform; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .hero {
    flex-direction: column;
  }
  .hero-media {
    height: 40vh;
    min-height: 220px;
  }
  .hero-copy {
    border-left: none;
    border-top: 1px solid var(--glass-border);
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 680px) {
  .content-section {
    flex-direction: column;
    padding: 1.25rem 1rem;
  }
  .sidebar {
    width: 100%;
    position: static;
    order: 0;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .content-body {
    padding: 1.25rem 1rem;
  }
  .article-hero {
    margin: -1.25rem -1rem 1rem;
    max-height: 200px;
  }
  .article-hero-img {
    height: 200px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.5rem 1rem 1rem;
  }
  .header-nav {
    display: none;
  }
  .header-inner {
    gap: 0.75rem;
  }
  .hero-copy h1 {
    font-size: 1.5rem;
  }
  .child-pages {
    padding: 1.25rem 1rem;
  }
  .card-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 375px) {
  html { font-size: 16px; }
  .cta { font-size: 0.7rem; padding: 0 0.75rem; }
  .hero-copy { padding: 1.5rem 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-media { will-change: auto; }
}

a[data-cta],button[aria-controls]{min-height:44px;min-width:44px;box-sizing:border-box}main p a{text-decoration:underline}