@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323:wght@400&display=swap');

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

:root {
  --clr-primary: #99ffcc;
  --clr-accent: #00ff41;
  --clr-dark: #001e3c;
  --clr-dark-mid: #002a54;
  --clr-dark-lite: #003a70;
  --clr-text: #c8ffe8;
  --clr-text-dim: #7ac9a8;
  --clr-border: rgba(153,255,204,0.18);
  --font-pixel: 'Press Start 2P', monospace;
  --font-vt: 'VT323', monospace;
  --nav-h: 96px;
  --radius-card: 4px;
  --radius-blob: 60% 40% 70% 30% / 50% 60% 40% 50%;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  line-height: 1.6;
  background: var(--clr-dark);
  color: var(--clr-text);
}

body.dark-bio {
  font-family: var(--font-vt);
  font-size: 1.25rem;
  background: var(--clr-dark);
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--clr-primary);
  text-decoration: none;
  transition: color 0.2s, opacity 0.2s;
}
a:hover, a:focus-visible {
  color: var(--clr-accent);
  text-decoration: underline;
}

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

/* ===== Bio Background ===== */
.bio-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

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

.blob {
  position: absolute;
  border-radius: var(--radius-blob);
  filter: blur(52px);
  opacity: 0.22;
  animation: blobPulse 8s ease-in-out infinite alternate;
}

.blob-1 {
  width: 520px;
  height: 420px;
  background: radial-gradient(ellipse, #00ff41 0%, #99ffcc 60%, transparent 100%);
  top: -120px;
  left: -80px;
  animation-delay: 0s;
  animation-duration: 9s;
}

.blob-2 {
  width: 380px;
  height: 480px;
  background: radial-gradient(ellipse, #99ffcc 0%, #007744 70%, transparent 100%);
  bottom: 10%;
  right: -60px;
  border-radius: 40% 60% 50% 70% / 60% 40% 70% 30%;
  animation-delay: 3s;
  animation-duration: 11s;
}

.blob-3 {
  width: 260px;
  height: 300px;
  background: radial-gradient(ellipse, #00ff41 0%, transparent 80%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 70% 30% 40% 60% / 30% 70% 50% 50%;
  animation-delay: 6s;
  animation-duration: 7s;
}

@keyframes blobPulse {
  0%   { transform: scale(1) rotate(0deg); border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%; }
  50%  { transform: scale(1.12) rotate(6deg); border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%; }
  100% { transform: scale(0.95) rotate(-4deg); border-radius: 70% 30% 60% 40% / 40% 70% 30% 60%; }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 30, 60, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
}

.header-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  min-height: 48px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-link {
  display: flex;
  align-items: center;
}

.brand-logo {
  height: 36px;
  width: auto;
}

.brand-name {
  font-family: var(--font-pixel);
  font-size: 0.7rem;
  color: var(--clr-primary);
  letter-spacing: 0.04em;
  text-shadow: 0 0 12px var(--clr-accent), 0 0 24px rgba(0,255,65,0.4);
  line-height: 1.3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0;
}

.brand-name:hover {
  color: var(--clr-accent);
  text-decoration: none;
}

.nav-contact {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--clr-text-dim);
  padding: 0.5rem 0.8rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-card);
}

.site-nav {
  padding: 0 1.5rem;
}

.site-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}

.site-nav p a {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--clr-text-dim);
  padding: 0.75rem 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--clr-border);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.site-nav p a:first-child {
  border-left: 1px solid var(--clr-border);
}

.site-nav p a:hover,
.site-nav p a:focus-visible {
  color: var(--clr-accent);
  background: rgba(0,255,65,0.07);
  text-decoration: none;
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: linear-gradient(160deg, rgba(0,42,84,0.95) 0%, rgba(0,30,60,0.98) 60%, rgba(0,20,40,1) 100%);
  overflow: hidden;
}

.hero-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem 5rem;
  position: relative;
  z-index: 2;
  will-change: transform;
}

.hero-h1 {
  font-family: var(--font-pixel);
  font-size: clamp(0.75rem, 2.5vw, 1.4rem);
  color: var(--clr-primary);
  text-shadow: 0 0 20px var(--clr-accent), 0 0 40px rgba(0,255,65,0.5);
  line-height: 1.8;
  margin-bottom: 1.2rem;
  letter-spacing: 0.06em;
}

.hero-desc {
  font-family: var(--font-vt);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--clr-text-dim);
  max-width: 680px;
  line-height: 1.7;
}

.hero-arc {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--clr-dark);
  clip-path: ellipse(55% 100% at 50% 100%);
  z-index: 3;
}

/* ===== Page Layout ===== */
.page-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  gap: 2rem;
}

/* ===== Aside ===== */
.site-aside {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  width: 200px;
  flex-shrink: 0;
  background: rgba(0,42,84,0.7);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  backdrop-filter: blur(8px);
}

.site-aside h2 {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--clr-accent);
  text-shadow: 0 0 8px var(--clr-accent);
  margin-bottom: 0.4rem;
  line-height: 1.8;
}

.site-aside .subtitle {
  font-size: 0.95rem;
  color: var(--clr-text-dim);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 0.6rem;
}

.site-aside nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.aside-link {
  font-family: var(--font-pixel);
  font-size: 0.42rem;
  color: var(--clr-text-dim);
  padding: 0.55rem 0.5rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-left: 2px solid transparent;
  border-radius: 3px;
  line-height: 1.6;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-decoration: none;
}

.aside-link:hover,
.aside-link:focus-visible {
  color: var(--clr-primary);
  border-left-color: var(--clr-accent);
  background: rgba(0,255,65,0.06);
  text-decoration: none;
}

/* ===== Main Article ===== */
.site-main {
  flex: 1;
  min-width: 0;
}

.main-article {
  width: 100%;
}

.content-section {
  width: 100%;
}

/* ===== Content Sections from page.content ===== */
.content-section article {
  margin-bottom: 3.5rem;
  padding: 2rem 2rem 2.2rem;
  background: rgba(0,42,84,0.5);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.content-section article::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(0,255,65,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.content-section article:hover {
  border-color: rgba(153,255,204,0.35);
  box-shadow: 0 0 24px rgba(0,255,65,0.08);
}

.content-section h2 {
  font-family: var(--font-pixel);
  font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  color: var(--clr-primary);
  text-shadow: 0 0 10px rgba(153,255,204,0.5);
  margin-bottom: 0.6rem;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.content-section h2 + p,
.content-section .subtitle,
.content-section .subhead,
.content-section .desc,
.content-section .lead {
  font-size: 1.05rem;
  color: var(--clr-text-dim);
  margin-bottom: 1rem;
}

.content-section h3 {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--clr-accent);
  margin: 1.5rem 0 0.6rem;
  line-height: 1.8;
}

.content-section p {
  font-family: var(--font-vt);
  font-size: 1.25rem;
  line-height: 1.75;
  color: var(--clr-text);
  margin-bottom: 0.85rem;
}

.content-section ul,
.content-section ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.content-section li {
  font-family: var(--font-vt);
  font-size: 1.2rem;
  line-height: 1.75;
  color: var(--clr-text);
  margin-bottom: 0.4rem;
}

.content-section li::marker {
  color: var(--clr-accent);
}

.content-section a {
  color: var(--clr-accent);
  text-shadow: 0 0 6px rgba(0,255,65,0.35);
}

.content-section a:hover {
  color: var(--clr-primary);
}

.content-section table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-family: var(--font-vt);
  font-size: 1.1rem;
}

.content-section th {
  background: rgba(0,255,65,0.12);
  color: var(--clr-primary);
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  line-height: 1.8;
}

.content-section td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(153,255,204,0.08);
  color: var(--clr-text);
}

.content-section tr:last-child td {
  border-bottom: none;
}

.content-section .card,
.content-section [class*="card"] {
  background: rgba(0,58,112,0.6);
  border-radius: var(--radius-card);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  border: none;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  background: rgba(0,20,40,0.95);
  border-top: 1px solid var(--clr-border);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer article {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-vt);
  font-size: 1rem;
  color: var(--clr-text-dim);
}

.footer-links {
  gap: 0.8rem !important;
}

.footer-links a {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--clr-text-dim);
  padding: 0.5rem 0.4rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--clr-primary);
  text-decoration: none;
}

/* ===== Scroll margin for article anchors ===== */
article[id] {
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
}

/* ===== Hover micro-interactions ===== */
@media (hover: hover) {
  .content-section article {
    transition: transform 0.3s ease, border-color 0.3s, box-shadow 0.3s;
  }
  .content-section article:hover {
    transform: translateY(-2px);
  }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .blob,
  .blob-1,
  .blob-2,
  .blob-3 {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
  .content-section article {
    transition: none;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .page-wrap {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }

  .site-aside {
    position: static;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .site-aside h2 {
    width: 100%;
  }

  .site-aside .subtitle {
    width: 100%;
  }

  .site-aside nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .aside-link {
    min-height: 44px;
    padding: 0.5rem 0.7rem;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 0.38rem;
  }

  .aside-link:hover {
    border-left-color: transparent;
    border-bottom-color: var(--clr-accent);
  }
}

@media (max-width: 640px) {
  .header-brand-row {
    padding: 0.5rem 1rem;
    min-height: 52px;
  }

  .brand-name {
    font-size: 0.58rem;
    min-height: 44px;
  }

  .site-nav {
    padding: 0 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav p {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .site-nav p a {
    font-size: 0.42rem;
    padding: 0.7rem 0.65rem;
    min-height: 44px;
    white-space: nowrap;
  }

  .hero-inner {
    padding: 2.5rem 1.2rem 4rem;
  }

  .hero-h1 {
    font-size: 0.75rem;
  }

  .hero-desc {
    font-size: 1.05rem;
  }

  .content-section article {
    padding: 1.4rem 1.2rem 1.6rem;
  }

  .content-section h2 {
    font-size: 0.55rem;
  }

  .content-section p,
  .content-section li {
    font-size: 1.1rem;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem;
  }

  .footer-links a {
    font-size: 0.38rem;
    min-height: 44px;
  }

  .nav-contact {
    display: none;
  }
}

@media (max-width: 375px) {
  .brand-name {
    font-size: 0.5rem;
    min-height: 44px;
  }
  .content-section article {
    padding: 1.1rem 0.9rem;
  }
}
