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

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

:root {
  --bg: #000000;
  --bg2: #121212;
  --bg3: #1a1a2e;
  --mid-blue: #0d1b3e;
  --accent: #3a7bd5;
  --accent2: #00c9ff;
  --neon-blue: #4fc3f7;
  --neon-gold: #ffd700;
  --neon-green: #39ff14;
  --text: #e0e0e0;
  --text-dim: #8a8a9a;
  --text-bright: #ffffff;
  --pill-bg: #0d1b3e;
  --pill-hover: #3a7bd5;
  --border: rgba(58, 123, 213, 0.25);
  --border-bright: rgba(79, 195, 247, 0.5);
  --sidebar-w: 220px;
  --radius: 10px;
  --font-mono: 'Space Mono', 'Courier New', monospace;
  --font-display: 'Syncopate', 'Space Mono', monospace;
  --transition: 0.25s ease;
  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--bg);
}

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

article[id] {
  scroll-margin-top: 80px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* ===== SITE WRAPPER ===== */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform var(--transition);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  padding: 0 0 24px 0;
}

.sidebar-brand {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.brand-icon-text {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--text-bright);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-shadow: 0 0 10px var(--neon-blue);
}

.sidebar-announce {
  padding: 10px 16px;
  font-size: 10px;
  color: var(--neon-blue);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  text-align: center;
  text-shadow: 0 0 8px var(--neon-blue);
}

.nav-list {
  list-style: none;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-list li {
  width: 100%;
}

.nav-pill {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--pill-bg);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition), border-color var(--transition), text-shadow var(--transition);
  min-height: 44px;
  line-height: 1.3;
  font-family: var(--font-mono);
}

.nav-pill:hover,
.nav-pill:focus-visible {
  background: var(--pill-hover);
  color: var(--text-bright);
  border-color: var(--accent2);
  text-shadow: 0 0 8px var(--neon-blue);
  outline: none;
}

.nav-pill:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

/* ===== MAIN WRAP ===== */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ===== MAIN / ARTICLE ===== */
main {
  flex: 1;
}

.page-article {
  min-height: 80vh;
}

/* ===== HERO ===== */
.hero-section {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 60px 48px 48px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(160deg, var(--bg) 40%, var(--mid-blue) 100%);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  filter: brightness(0.7) saturate(0.6);
}

.hero-text {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.eyebrow-label {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  font-size: 11px;
  letter-spacing: 0.2em;
  font-family: var(--font-mono);
  margin-bottom: 20px;
  text-shadow: 0 0 8px var(--neon-blue);
}

.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  text-shadow: 0 0 10px var(--neon-blue);
}

.hero-lead {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.8;
  max-width: 560px;
}

/* ===== CONTENT SECTION ===== */
.content-section {
  padding: 48px 48px 64px;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.content-main {
  min-width: 0;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.8;
}

.page-content h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 48px 0 8px;
  letter-spacing: 0.06em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-bright);
  text-shadow: 0 0 8px var(--neon-blue);
}

.page-content h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent2);
  margin: 32px 0 8px;
  letter-spacing: 0.04em;
}

.page-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--neon-gold);
  margin: 24px 0 8px;
}

.page-content p {
  margin-bottom: 16px;
  color: var(--text);
}

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

.page-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.page-content a {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), text-shadow var(--transition);
}

.page-content a:hover {
  border-color: var(--accent2);
  text-shadow: 0 0 6px var(--neon-blue);
}

.page-content strong {
  color: var(--text-bright);
  font-weight: 700;
}

.page-content em {
  color: var(--neon-gold);
  font-style: normal;
}

.page-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--bg2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  font-style: italic;
}

.page-content code {
  background: var(--bg3);
  color: var(--neon-green);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.page-content pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.page-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.page-content article {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

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

/* ===== ASIDE ===== */
.content-aside {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.aside-block {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.aside-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  text-shadow: 0 0 6px var(--neon-blue);
}

.aside-block p.subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.aside-toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  min-height: 40px;
  line-height: 1.4;
}

.toc-link:hover,
.toc-link:focus-visible {
  color: var(--accent2);
  border-color: var(--border);
  background: rgba(58, 123, 213, 0.1);
  outline: none;
}

.aside-notice .notice-text {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 48px 48px 0;
}

.footer-brand-block {
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 32px;
}

.footer-brand-big {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 12px;
  text-shadow: 0 0 10px var(--neon-blue);
}

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

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 0;
}

.footer-dl dt {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.15em;
  text-shadow: 0 0 6px var(--neon-blue);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.footer-dl dd {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  line-height: 1.6;
}

.footer-dl dd a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
}

.footer-dl dd a:hover {
  color: var(--accent2);
}

.footer-bar {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  margin-top: 32px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ===== MENU TOGGLE (mobile) ===== */
.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 300;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  position: relative;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

.sidebar.open { transform: translateX(0); }

/* ===== SCROLL REVEAL ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .reveal.visible {
    opacity: 1;
    transform: none;
  }
  .parallax-slow {
    will-change: transform;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr 240px;
    gap: 28px;
  }
  .content-section {
    padding: 36px 36px 48px;
  }
  .hero-section {
    padding: 48px 36px 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 200px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.8);
  }

  .main-wrap {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .hero-section {
    min-height: 70vh;
    padding: 60px 20px 36px;
  }

  .hero-text h1 {
    font-size: clamp(1.6rem, 7vw, 2.4rem);
  }

  .content-section {
    padding: 28px 20px 40px;
  }

  .content-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .content-aside {
    position: static;
  }

  .site-footer {
    padding: 36px 20px 0;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-brand-big {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  article[id] {
    scroll-margin-top: 20px;
  }
}

@media (max-width: 375px) {
  .hero-text h1 {
    font-size: 1.5rem;
  }
  .content-section {
    padding: 20px 16px 32px;
  }
  .hero-section {
    padding: 56px 16px 28px;
  }
  .site-footer {
    padding: 28px 16px 0;
  }
  .nav-pill {
    font-size: 11px;
    padding: 10px 12px;
    min-height: 44px;
  }
}

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