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

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

:root {
  --bg-primary: #000000;
  --bg-card: #121212;
  --bg-elevated: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-muted: #888888;
  --accent-red: #e50914;
  --accent-gold: #c9a84c;
  --accent-blue: #4fc3f7;
  --accent-glow: rgba(229, 9, 20, 0.4);
  --border-subtle: #222222;
  --border-accent: #e50914;
  --nav-width: 220px;
  --font-main: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --radius-card: 18px;
  --transition-fast: 150ms ease;
  --transition-mid: 300ms ease;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body.dark-oled {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

.content-area {
  margin-left: var(--nav-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
}

/* ========================================
   SIDE NAV (footer element, left fixed)
   ======================================== */

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--bg-card);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.nav-brand-section {
  padding: 28px 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 2px solid var(--accent-red);
  border-radius: 10px;
  text-decoration: none;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.brand-mark:hover,
.brand-mark:focus-visible {
  box-shadow: 0 0 10px var(--accent-glow);
  border-color: var(--accent-gold);
}

.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.brand-logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent-red);
  letter-spacing: 0.05em;
}

.nav-links-section {
  flex: 1;
  padding: 16px 0;
}

.nav-dl {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-dl dt {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  min-height: 44px;
  border-left: 3px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
  background: rgba(229, 9, 20, 0.08);
  border-left-color: var(--accent-red);
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-accent);
  flex-shrink: 0;
  transition: box-shadow var(--transition-fast);
}

.nav-link:hover .nav-dot,
.nav-link:focus-visible .nav-dot {
  box-shadow: 0 0 10px var(--accent-red);
}

.nav-text {
  line-height: 1.3;
}

.nav-footer-section {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.nav-copy {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ========================================
   HERO
   ======================================== */

.hero-section {
  position: relative;
  min-height: 45vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
  border-bottom: 2px solid var(--accent-red);
  scroll-margin-top: 0;
}

.hero-bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(120px, 20vw, 280px);
  color: rgba(229, 9, 20, 0.06);
  letter-spacing: 0.15em;
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero-icon {
  opacity: 0.9;
}

.hero-h1 {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.2;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
  letter-spacing: -0.01em;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 540px;
  line-height: 1.7;
}

/* ========================================
   CONTENT SECTION
   ======================================== */

.content-section {
  padding: 0;
}

.content-with-aside {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  align-items: start;
  max-width: 1200px;
}

.main-content-body {
  padding: 0;
}

/* ========================================
   PAGE CONTENT (injected sections)
   ======================================== */

.main-content-body article {
  padding: 56px 48px;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 56px;
}

.main-content-body article:last-child {
  border-bottom: none;
}

.main-content-body h2 {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.25;
  border-left: 4px solid var(--accent-red);
  padding-left: 16px;
}

.main-content-body h3 {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--text-secondary);
  margin-top: 32px;
  margin-bottom: 14px;
}

.main-content-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
  max-width: 72ch;
}

.main-content-body ul,
.main-content-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.main-content-body li {
  margin-bottom: 8px;
  line-height: 1.7;
  font-size: 16px;
}

.main-content-body a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast), text-shadow var(--transition-fast);
}

.main-content-body a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--accent-blue);
}

.main-content-body strong {
  color: var(--text-primary);
  font-weight: 700;
}

.main-content-body blockquote {
  border-left: 3px solid var(--accent-gold);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.main-content-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 15px;
}

.main-content-body th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--accent-red);
}

.main-content-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.main-content-body tr:hover td {
  background: rgba(229, 9, 20, 0.04);
}

/* Card-like elements in content */
.main-content-body figure {
  margin: 24px 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
  border-bottom: 3px solid var(--accent-red);
}

.main-content-body figcaption {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ========================================
   ASIDE
   ======================================== */

.content-aside {
  position: sticky;
  top: 24px;
  padding: 32px 28px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  min-height: 100%;
  align-self: start;
}

.aside-eyebrow {
  display: block;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent-red);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.aside-title {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.aside-nav-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.aside-nav-list li {
  border-bottom: 1px solid var(--border-subtle);
}

.aside-link {
  display: block;
  padding: 10px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  letter-spacing: 0.02em;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
  min-height: 40px;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.aside-link:hover,
.aside-link:focus-visible {
  color: var(--accent-red);
  padding-left: 8px;
}

.aside-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 16px 0;
}

.aside-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================
   HOME ARTICLE
   ======================================== */

.home-article {
  width: 100%;
}

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

.page-footer {
  background: var(--bg-card);
  border-top: 2px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.footer-brand-section {
  padding: 40px 48px;
  border-right: 1px solid var(--border-subtle);
}

.footer-brand-name {
  display: block;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 40ch;
}

.footer-links-section {
  padding: 40px 48px;
}

.footer-nav-dl {
  margin-bottom: 24px;
}

.footer-nav-dl dt,
.footer-nav-dl dd {
  margin: 0;
  padding: 0;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-main);
  letter-spacing: 0.03em;
  min-height: 40px;
  transition: color var(--transition-fast);
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 8px;
}

/* ========================================
   STAGGER ANIMATION
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
  .main-content-body article {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
  }

  .main-content-body article:nth-child(1) { animation-delay: 0.05s; }
  .main-content-body article:nth-child(2) { animation-delay: 0.10s; }
  .main-content-body article:nth-child(3) { animation-delay: 0.15s; }
  .main-content-body article:nth-child(4) { animation-delay: 0.20s; }
  .main-content-body article:nth-child(5) { animation-delay: 0.25s; }
  .main-content-body article:nth-child(6) { animation-delay: 0.30s; }
  .main-content-body article:nth-child(7) { animation-delay: 0.35s; }

  @keyframes fadeUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-link,
  .aside-link,
  .footer-link {
    transition: color var(--transition-mid), border-color var(--transition-mid),
                background var(--transition-mid), padding-left var(--transition-mid),
                box-shadow var(--transition-mid), text-shadow var(--transition-mid);
  }
}

/* ========================================
   FOCUS STYLES
   ======================================== */

:focus-visible {
  outline: 2px solid var(--accent-red);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ========================================
   RESPONSIVE — MOBILE
   ======================================== */

@media (max-width: 900px) {
  :root {
    --nav-width: 0px;
  }

  .side-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 60px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid var(--border-subtle);
    overflow: visible;
    z-index: 200;
  }

  .nav-brand-section {
    padding: 8px 12px;
    border-bottom: none;
    border-right: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  .nav-links-section {
    flex: 1;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-dl {
    display: flex;
    flex-direction: row;
    height: 60px;
  }

  .nav-dl dt {
    flex-shrink: 0;
  }

  .nav-link {
    padding: 0 12px;
    min-height: 60px;
    border-left: none;
    border-top: 3px solid transparent;
    font-size: 11px;
    gap: 6px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .nav-link:hover,
  .nav-link:focus-visible {
    border-left-color: transparent;
    border-top-color: var(--accent-red);
    background: rgba(229, 9, 20, 0.08);
  }

  .nav-dot {
    display: none;
  }

  .nav-footer-section {
    display: none;
  }

  .content-area {
    margin-left: 0;
    padding-bottom: 60px;
  }

  .content-with-aside {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
    padding: 24px 20px;
  }

  .main-content-body article {
    padding: 36px 20px;
  }

  .page-footer {
    grid-template-columns: 1fr;
  }

  .footer-brand-section {
    padding: 28px 20px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }

  .footer-links-section {
    padding: 28px 20px;
  }

  .hero-inner {
    padding: 36px 20px;
  }

  .hero-section {
    min-height: 45vh;
  }
}

@media (max-width: 480px) {
  .main-content-body article {
    padding: 28px 16px;
  }

  .main-content-body h2 {
    padding-left: 12px;
  }

  .footer-brand-section,
  .footer-links-section {
    padding: 24px 16px;
  }

  .hero-inner {
    padding: 28px 16px;
  }
}

/* ========================================
   SMALL EYEBROW TITLES
   ======================================== */

small.aside-eyebrow {
  font-size: 11px;
}

.main-content-body small {
  display: block;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent-red);
  text-transform: uppercase;
  margin-bottom: 4px;
}

button[aria-expanded]{min-width:44px;min-height:44px}
