@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body.dark-theme {
  background-color: #001e3c;
  color: #99ffcc;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCROLL MARGIN FOR FIXED NAV ===== */
article[id] {
  scroll-margin-top: 80px;
}

/* ===== CELL BACKGROUND ===== */
.cell-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#cellCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
}

.cell-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: breathe 8s ease-in-out infinite;
}

.cell-glow.g1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #00ff4133 0%, transparent 70%);
  top: -10%;
  left: -8%;
  animation-delay: 0s;
}

.cell-glow.g2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #99ffcc22 0%, transparent 70%);
  bottom: 20%;
  right: 5%;
  animation-delay: 2.5s;
}

.cell-glow.g3 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, #00ff4122 0%, transparent 70%);
  top: 50%;
  left: 50%;
  animation-delay: 5s;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.18); opacity: 1; }
}

/* ===== HEADER & HERO ===== */
.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
}

.header-inner {
  width: 100%;
}

.hero-section {
  position: relative;
  width: 100%;
  height: 45vh;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    #001e3cee 0%,
    #001e3c99 40%,
    #001e3c44 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 2.5rem;
  max-width: 680px;
  text-align: left;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #00ff41;
  border: 1px solid #00ff4166;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #00ff4111;
}

h1.hero-title {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 500;
  color: #99ffcc;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 30px #00ff4155;
}

.hero-sub {
  font-size: 0.9rem;
  color: #99ffccaa;
  margin-bottom: 1.2rem;
  max-width: 520px;
}

.hero-cta {
  display: inline-block;
  background: linear-gradient(135deg, #00ff41, #99ffcc);
  color: #001e3c;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.65rem 1.6rem;
  border-radius: 30px;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px #00ff4155;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px #00ff4188;
}

/* ===== MAIN LAYOUT ===== */
main {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 1rem 6rem;
}

main > section {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
}

main > section > article {
  min-width: 0;
}

/* ===== CONTENT SECTION ===== */
.content-wrap {
  min-width: 0;
}

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

/* Page content injected styles */
.main-content-section article {
  margin-bottom: 3rem;
  padding: 2rem;
  background: rgba(0, 30, 60, 0.6);
  border: 1px solid #99ffcc22;
  border-radius: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.main-content-section article::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00ff41, transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.main-content-section article:hover {
  border-color: #99ffcc55;
  box-shadow: 0 0 30px #00ff4118;
}

.main-content-section article:hover::before {
  opacity: 1;
}

/* Typography inside content */
.main-content-section h2 {
  font-size: 1.3rem;
  font-weight: 500;
  color: #00ff41;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
  text-shadow: 0 0 16px #00ff4155;
}

.main-content-section h3 {
  font-size: 1.05rem;
  font-weight: 500;
  color: #99ffcc;
  margin: 1.2rem 0 0.4rem;
}

.main-content-section p {
  margin-bottom: 0.85rem;
  color: #99ffcccc;
  font-size: 0.95rem;
  line-height: 1.75;
}

.main-content-section a {
  color: #00ff41;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.main-content-section a:hover {
  color: #99ffcc;
}

.main-content-section ul, .main-content-section ol {
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
  color: #99ffcccc;
  font-size: 0.95rem;
}

.main-content-section li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

.main-content-section strong {
  color: #99ffcc;
  font-weight: 500;
}

.main-content-section em {
  color: #00ff41;
  font-style: italic;
}

.main-content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.main-content-section th {
  background: #00ff4122;
  color: #00ff41;
  padding: 0.5rem 0.75rem;
  text-align: left;
  border: 1px solid #99ffcc33;
}

.main-content-section td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #99ffcc1a;
  color: #99ffcccc;
}

.main-content-section tr:nth-child(even) td {
  background: #99ffcc08;
}

/* p.subtitle pattern */
.main-content-section p.subtitle,
.main-content-section .subtitle {
  color: #99ffcc88;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ===== ASIDE / SIDEBAR ===== */
.sidebar {
  position: sticky;
  top: 1.5rem;
  min-width: 0;
}

.aside-inner {
  background: rgba(0, 30, 60, 0.7);
  border: 1px solid #99ffcc33;
  border-radius: 10px;
  padding: 1.5rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: #00ff41;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  text-transform: none;
}

.aside-inner p.subtitle {
  font-size: 0.78rem;
  color: #99ffcc66;
  margin-bottom: 1rem;
}

.aside-links {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem;
}

.aside-links li {
  margin-bottom: 0.35rem;
}

.aside-links a {
  display: block;
  padding: 0.45rem 0.7rem;
  color: #99ffcccc;
  font-size: 0.82rem;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.aside-links a:hover {
  background: #00ff4115;
  border-color: #00ff4144;
  color: #00ff41;
}

.aside-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: #99ffcc88;
  border-top: 1px solid #99ffcc22;
  padding-top: 0.85rem;
}

.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff41;
  box-shadow: 0 0 8px #00ff41;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px #00ff41; opacity: 1; }
  50% { box-shadow: 0 0 14px #00ff41; opacity: 0.7; }
}

/* ===== FOOTER ===== */
.site-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid #99ffcc22;
  background: rgba(0, 10, 25, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem 1.5rem 1.5rem;
  margin-bottom: 72px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-address {
  font-style: normal;
}

.footer-logo-text {
  display: block;
  font-size: 1.1rem;
  color: #99ffcc;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 12px #00ff4155;
}

.footer-brand-desc {
  font-size: 0.82rem;
  color: #99ffcc77;
  line-height: 1.6;
}

.footer-contact {
  font-size: 0.82rem;
  color: #00ff41;
  text-decoration: none;
}

.footer-contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-contact-list a {
  font-size: 0.82rem;
  color: #99ffcc88;
  text-decoration: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.footer-contact-list a:hover {
  color: #00ff41;
}

.footer-no-contact {
  font-size: 0.8rem;
  color: #99ffcc55;
}

/* Footer nav with dl structure */
.footer-nav {
  height: 100%;
}

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

.footer-dl-title {
  font-size: 0.8rem;
  color: #00ff41;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.footer-dl dd {
  margin: 0;
}

.footer-dl dd a,
.footer-dl dt a {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  color: #99ffcc88;
  text-decoration: none;
  padding: 0.25rem 0;
  min-height: 40px;
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
}

.footer-dl dd a:hover,
.footer-dl dt a:hover {
  color: #99ffcc;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #99ffcc1a;
  padding-top: 1rem;
  font-size: 0.78rem;
  color: #99ffcc55;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-note {
  color: #00ff4166;
}

/* ===== BOTTOM FIXED NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 10, 25, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid #99ffcc33;
  height: 64px;
  display: flex;
  align-items: center;
}

.bottom-nav-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  gap: 0.4rem;
}

.bottom-nav-left,
.bottom-nav-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
}

.bottom-nav-right {
  justify-content: flex-end;
}

.bottom-nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.bnav-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 40px;
  min-height: 40px;
}

.bnav-brand-text {
  font-size: 0.72rem;
  color: #99ffcc;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  text-shadow: 0 0 10px #00ff4177;
}

.bnav-brand img {
  border-radius: 6px;
}

.bnav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #99ffcc33;
  color: #99ffccbb;
  font-family: inherit;
  font-size: 0.72rem;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  background: transparent;
}

.bnav-pill:hover {
  background: #00ff4122;
  border-color: #00ff4177;
  color: #00ff41;
  box-shadow: 0 0 12px #00ff4133;
}

.bnav-pill.bnav-cta {
  background: linear-gradient(135deg, #00ff41cc, #99ffcccc);
  color: #001e3c;
  border-color: transparent;
  font-weight: 500;
  box-shadow: 0 0 16px #00ff4155;
}

.bnav-pill.bnav-cta:hover {
  background: linear-gradient(135deg, #00ff41, #99ffcc);
  box-shadow: 0 0 24px #00ff4188;
  color: #001e3c;
}

/* ===== LINKS GLOBAL ===== */
a {
  color: #99ffcc;
  transition: color 0.2s;
}

a:focus-visible {
  outline: 2px solid #00ff41;
  outline-offset: 2px;
  border-radius: 3px;
}

/* ===== IMAGES ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== STAGGER ANIMATION ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.main-content-section article {
  animation: fadeSlideUp 0.55s ease both;
}

.main-content-section article:nth-child(1) { animation-delay: 0.05s; }
.main-content-section article:nth-child(2) { animation-delay: 0.12s; }
.main-content-section article:nth-child(3) { animation-delay: 0.19s; }
.main-content-section article:nth-child(4) { animation-delay: 0.26s; }
.main-content-section article:nth-child(5) { animation-delay: 0.33s; }
.main-content-section article:nth-child(6) { animation-delay: 0.40s; }
.main-content-section article:nth-child(7) { animation-delay: 0.47s; }

/* Parallax subtle */
@media (min-width: 769px) {
  .cell-glow.g1 { will-change: transform; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  main > section {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    order: -1;
  }

  .aside-inner {
    padding: 1.2rem;
  }

  .aside-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .aside-links li {
    margin-bottom: 0;
  }

  .aside-links a {
    padding: 0.35rem 0.7rem;
    border: 1px solid #99ffcc33;
    border-radius: 16px;
    font-size: 0.8rem;
    min-height: 40px;
  }
}

@media (max-width: 600px) {
  .hero-content {
    padding: 1.5rem 1rem 2rem;
  }

  h1.hero-title {
    font-size: 1.5rem;
  }

  .hero-section {
    min-height: 240px;
  }

  main {
    padding: 0 0.75rem 6rem;
  }

  .main-content-section article {
    padding: 1.5rem 1rem;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .bottom-nav-inner {
    padding: 0 0.4rem;
    gap: 0.25rem;
  }

  .bnav-pill {
    padding: 0.3rem 0.45rem;
    font-size: 0.67rem;
  }

  .bnav-brand-text {
    font-size: 0.65rem;
  }
}

@media (max-width: 375px) {
  .bnav-pill {
    padding: 0.3rem 0.35rem;
    font-size: 0.63rem;
    letter-spacing: 0;
  }

  .hero-section {
    height: 42vh;
  }
}
