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

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

:root {
  --bg-primary: #000000;
  --bg-secondary: #121212;
  --bg-card: #0d0d0d;
  --accent-blue: #1e3a5f;
  --accent-blue-bright: #2979ff;
  --accent-blue-mid: #1565c0;
  --accent-glow: #1e88e5;
  --neon-blue: #29b6f6;
  --text-primary: #ffffff;
  --text-secondary: #b0bec5;
  --text-muted: #607d8b;
  --border-color: #1e3a5f;
  --border-bright: #2979ff;
  --eyebrow-color: #29b6f6;
  --font-main: 'Exo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Roboto Mono', 'Courier New', monospace;
  --radius: 4px;
  --radius-pill: 999px;
  --bottom-nav-h: 64px;
  --transition: 0.22s ease;
}

html {
  font-size: 16px;
  line-height: 1.6;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--neon-blue);
  text-decoration: none;
  transition: color var(--transition), text-shadow var(--transition);
}

a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--neon-blue);
}

a:focus-visible {
  outline: 2px solid var(--accent-blue-bright);
  outline-offset: 3px;
  border-radius: var(--radius);
}

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

p { line-height: 1.7; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

/* ===== Page Wrapper ===== */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-h) + 16px);
}

/* ===== Eyebrow Labels ===== */
.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--eyebrow-color);
  margin-bottom: 8px;
}

/* ===== Grid Background ===== */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(41, 182, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(41, 182, 246, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ===== Hero Section (Home) ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 48px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 80px;
}

.hero-text {
  flex: 1 1 480px;
  max-width: 600px;
}

.hero-eyebrow {
  margin-bottom: 12px;
}

.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-shadow: 0 0 30px rgba(41, 182, 246, 0.2);
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  background: var(--accent-blue-bright);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  text-shadow: none;
}

.btn-primary:hover {
  background: var(--neon-blue);
  color: #000;
  box-shadow: 0 0 18px rgba(41, 182, 246, 0.5);
  text-shadow: none;
  transform: translateY(-1px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border: 1.5px solid var(--border-bright);
  color: var(--neon-blue);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-outline:hover {
  background: rgba(41, 182, 246, 0.1);
  box-shadow: 0 0 14px rgba(41, 182, 246, 0.3);
  color: var(--text-primary);
  text-shadow: none;
  transform: translateY(-1px);
}

.hero-media {
  flex: 0 0 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-placeholder {
  width: 320px;
  height: 320px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}

.hero-mono {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 700;
  color: var(--accent-blue-bright);
  text-shadow: 0 0 20px rgba(41, 182, 246, 0.6);
  letter-spacing: 0.1em;
}

.hero-img {
  border-radius: var(--radius);
  max-height: 480px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* ===== Content Section (Sidebar + Body) ===== */
.content-section {
  display: flex;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
  width: 100%;
}

/* ===== Aside ===== */
.inner-aside,
.home-aside {
  flex: 0 0 240px;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-link {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-link:hover,
.aside-link.active {
  color: var(--neon-blue);
  border-left-color: var(--neon-blue);
  background: rgba(41, 182, 246, 0.06);
  text-shadow: none;
}

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

.aside-parent {
  margin-bottom: 20px;
}

.parent-link {
  display: block;
  padding: 8px 12px;
  background: rgba(41, 182, 246, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

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

.aside-contact {
  padding: 8px 0;
}

.contact-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Inner Body ===== */
.inner-body,
.home-body {
  flex: 1 1 0;
  min-width: 0;
}

/* ===== Page Hero (Inner Pages) ===== */
.page-hero {
  position: relative;
  padding: 72px 24px 56px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  overflow: hidden;
}

.page-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.page-h1 {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  margin: 8px 0 16px;
  color: var(--text-primary);
}

.page-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.page-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.meta-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-date--mod {
  color: var(--eyebrow-color);
}

/* ===== Page Content ===== */
.page-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.page-content h2 {
  font-size: 1.4rem;
  margin: 40px 0 16px;
  color: var(--text-primary);
  border-left: 3px solid var(--accent-blue-bright);
  padding-left: 12px;
}

.page-content h3 {
  font-size: 1.15rem;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.page-content p {
  margin-bottom: 16px;
}

.page-content ul,
.page-content ol {
  margin: 16px 0 16px 24px;
}

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

.page-content a {
  color: var(--neon-blue);
  border-bottom: 1px solid rgba(41, 182, 246, 0.3);
}

.page-content a:hover {
  border-bottom-color: var(--neon-blue);
}

.page-content blockquote {
  border-left: 3px solid var(--accent-blue-bright);
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
  color: var(--text-secondary);
}

.page-content code {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 0.875em;
  color: var(--neon-blue);
}

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

.content-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== Article Hero Image ===== */
.article-hero-wrap {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.article-hero-img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Home Main ===== */
.home-main {
  flex: 1;
}

.home-article {
  display: block;
}

/* ===== Topics Section ===== */
.topics-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--text-primary);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ===== Topic Card ===== */
.topic-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 3px solid var(--accent-blue-bright);
  border-radius: var(--radius);
  padding: 24px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(41, 182, 246, 0.15);
  border-color: var(--accent-blue-bright);
}

.topic-card h3 {
  font-size: 1rem;
  margin: 8px 0 10px;
}

.topic-card h3 a {
  color: var(--text-primary);
  text-shadow: none;
}

.topic-card h3 a:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 10px rgba(41, 182, 246, 0.4);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.card-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  transition: color var(--transition);
}

.card-links a:hover {
  color: var(--neon-blue);
  text-shadow: 0 0 6px rgba(41, 182, 246, 0.4);
}

.card-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-blue-bright), var(--neon-blue));
  opacity: 0;
  transition: opacity var(--transition);
}

.topic-card:hover .card-accent {
  opacity: 1;
}

/* ===== Inner Main ===== */
.inner-main {
  flex: 1;
}

.inner-article {
  display: block;
}

/* ===== Child List ===== */
.child-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.child-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.child-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--accent-blue-mid);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

.child-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(41, 182, 246, 0.12);
  border-color: var(--border-bright);
}

.child-link {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  min-height: 48px;
  color: inherit;
  text-shadow: none;
}

.child-link:hover {
  text-shadow: none;
}

.child-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue-bright);
  min-width: 28px;
  line-height: 1.5;
  padding-top: 2px;
}

.child-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.child-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.4;
}

.child-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.child-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.child-date time {
  color: inherit;
}

/* ===== Related Articles ===== */
.related-articles {
  margin-top: 24px;
}

/* ===== About & Link Cards ===== */
.about-links {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.link-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 2px solid var(--accent-blue-bright);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-shadow: none;
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 80px;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(41, 182, 246, 0.15);
  text-shadow: none;
  color: var(--text-primary);
}

.link-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--neon-blue);
}

.link-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.footer-brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-copy a {
  color: var(--text-muted);
  border-bottom: 1px solid rgba(96, 125, 139, 0.3);
  transition: color var(--transition), border-color var(--transition);
}

.footer-copy a:hover {
  color: var(--neon-blue);
  border-bottom-color: var(--neon-blue);
  text-shadow: none;
}

/* ===== Bottom Navigation ===== */
.bottom-nav-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: var(--bottom-nav-h);
  display: flex;
  align-items: center;
}

.bottom-nav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.bottom-nav-dl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-nav-dl::-webkit-scrollbar {
  display: none;
}

.bottom-nav-dl dt.brand-center {
  order: -1;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--accent-blue-bright);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.75rem;
  min-height: 40px;
  white-space: nowrap;
  text-shadow: none;
  transition: background var(--transition), box-shadow var(--transition);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.brand-link:hover {
  background: var(--neon-blue);
  color: #000;
  text-shadow: none;
  box-shadow: 0 0 14px rgba(41, 182, 246, 0.5);
}

.bottom-nav-dl dd {
  display: block;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.72rem;
  min-height: 40px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition), box-shadow var(--transition);
  text-shadow: none;
}

.nav-pill:hover,
.nav-pill.active {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  background: rgba(41, 182, 246, 0.08);
  text-shadow: none;
  box-shadow: 0 0 8px rgba(41, 182, 246, 0.2);
}

/* ===== Stagger Animation ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-item {
  animation: fadeInUp 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 0.07s);
}

@media (prefers-reduced-motion: reduce) {
  .stagger-item {
    animation: none;
  }
  .topic-card,
  .child-item,
  .link-card,
  .btn-primary,
  .btn-outline {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 60px;
    gap: 32px;
  }

  .hero-media {
    flex: 0 0 auto;
    width: 100%;
    justify-content: flex-start;
  }

  .hero-placeholder {
    width: 200px;
    height: 200px;
  }

  .content-section {
    flex-direction: column;
    gap: 32px;
    padding: 40px 20px;
  }

  .inner-aside,
  .home-aside {
    flex: none;
    width: 100%;
    position: static;
  }

  .aside-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .aside-link {
    min-height: 40px;
    padding: 8px 12px;
    border-left: none;
    border-bottom: 1px solid var(--border-color);
  }

  .aside-link:hover,
  .aside-link.active {
    border-left: none;
    border-bottom-color: var(--neon-blue);
  }
}

@media (max-width: 640px) {
  .hero-h1 {
    font-size: 1.8rem;
  }

  .page-h1 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .link-cards {
    grid-template-columns: 1fr 1fr;
  }

  .hero-cta {
    flex-direction: column;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .page-hero {
    padding: 60px 20px 40px;
  }

  .bottom-nav-dl {
    justify-content: flex-start;
    padding: 0 4px;
  }

  .brand-link {
    font-size: 0.68rem;
    padding: 8px 10px;
  }

  .nav-pill {
    font-size: 0.68rem;
    padding: 8px 10px;
  }

  .child-link {
    padding: 14px 16px;
  }

  .topics-section {
    padding: 0 20px 40px;
  }

  .about-links,
  .child-section {
    margin-top: 32px;
    padding-top: 24px;
  }
}

@media (max-width: 375px) {
  .hero-inner {
    padding: 72px 16px 48px;
  }

  .content-section {
    padding: 32px 16px;
  }

  .page-hero {
    padding: 56px 16px 36px;
  }

  .page-content h2 {
    font-size: 1.2rem;
  }

  .link-cards {
    grid-template-columns: 1fr;
  }
}
