:root {
  --green: #00ff41;
  --green-dim: #00b32c;
  --green-dark: #003b00;
  --bg: #000;
  --text: #c8ffc8;
  --muted: #6dff9a99;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #000; color: var(--text); font-family: "Share Tech Mono", monospace; }
body { overflow: hidden; }
.world-bg {
  position: fixed; inset: 0; z-index: 0;
  background: url("../images/world.jpg") center / cover no-repeat;
  pointer-events: none;
}

#rain {
  position: fixed; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  pointer-events: none;
  background: transparent;
}
.scanlines, .vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
}
.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 2px,
    rgba(0, 0, 0, 0.18) 3px
  );
  opacity: 0.35;
}
.vignette {
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
}
.logo {
  font-family: Orbitron, sans-serif;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.18em;
  font-weight: 700;
  text-shadow: 0 0 12px var(--green);
}
.logo span { opacity: 0.5; }
.nav { display: flex; gap: 22px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  text-transform: uppercase;
}
.nav a:hover, .nav a.active { color: var(--green); text-shadow: 0 0 8px var(--green); }

.hamburger {
  display: none;
  width: 44px; height: 44px;
  background: transparent; border: 1px solid var(--green);
  flex-direction: column; justify-content: center; align-items: center; gap: 6px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--green);
}

main { position: relative; z-index: 5; height: 100%; }
.panel {
  display: none;
  height: 100%;
  padding: 88px 32px 88px;
  overflow: auto;
}
.panel.active { display: block; }

.eyebrow {
  color: var(--green);
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  margin-bottom: 12px;
}
h1, h2 {
  font-family: Orbitron, sans-serif;
  color: var(--green);
  text-shadow: 0 0 18px var(--green);
  margin-bottom: 18px;
  line-height: 1.15;
}
h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); }
.lead { max-width: 38rem; font-size: 1.05rem; line-height: 1.7; margin-bottom: 16px; }
.home-copy, .about-wrap, .contact-wrap, .projects-wrap, .skills-head {
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0.12));
  padding: 18px 20px;
  border-left: 2px solid rgba(0,255,65,0.45);
}
.signal { color: var(--green); opacity: 0.85; }

.home-grid, .tab-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 24px;
  align-items: center;
  min-height: calc(100vh - 110px);
}
.tab-grid-skills { align-items: start; }
.hero-stage {
  position: relative;
  display: flex; justify-content: center; align-items: center;
}
.hero {
  width: min(100%, 540px);
  height: auto;
  background: transparent;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 22px rgba(0, 255, 65, 0.28));
}
.hero-fly { animation: fly 5.5s ease-in-out infinite; }
.hero-idle { animation: idle 6s ease-in-out infinite; }
.hero-power { animation: power 0.55s ease-in-out infinite; }
.hero-blast { animation: blast 1.8s ease-in-out infinite; }
.hero-wave { animation: wave 4.2s ease-in-out infinite; }
@keyframes fly {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-28px) rotate(1.5deg); }
}
@keyframes idle {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 22px rgba(0, 220, 255, 0.35)); }
  50% { transform: translateY(-10px) scale(1.02); filter: drop-shadow(0 0 36px rgba(0, 255, 180, 0.55)); }
}
@keyframes power {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-2px, 3px) scale(1.03); }
  50% { transform: translate(2px, -2px) scale(1.06); }
  75% { transform: translate(-1px, 1px) scale(1.03); }
}
@keyframes blast {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(-14px) rotate(-2deg); }
}
@keyframes wave {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-18px) rotate(2deg); }
}

.about-wrap, .contact-wrap, .projects-wrap { max-width: 820px; }
.about-wrap p { line-height: 1.75; margin-bottom: 14px; }

.skills-head { margin-bottom: 16px; }
.lang-rain {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  height: calc(100vh - 280px);
  min-height: 280px;
  overflow: hidden;
  mask-image: linear-gradient(to top, transparent, #000 12%, #000 88%, transparent);
}
.lang-col {
  font-size: 12px;
  line-height: 1.6;
  color: var(--green);
  text-shadow: 0 0 6px var(--green-dim);
  white-space: nowrap;
  animation: rise linear infinite;
  opacity: 0.72;
}
.lang-col span { display: block; }
@keyframes rise {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.hint { color: var(--muted); margin-bottom: 22px; }
.project-list { list-style: none; }
.project-list li {
  border: 1px solid #0b3d0b;
  padding: 18px 20px;
  margin-bottom: 12px;
  cursor: default;
  background: rgba(0, 20, 0, 0.55);
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.project-list li:hover, .project-list li:focus {
  border-color: var(--green);
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.25);
  color: var(--green);
}
.project-list .idx { color: var(--green); margin-right: 10px; opacity: 0.7; }

.popup-scrim {
  position: fixed; inset: 0; z-index: 39;
  background: rgba(0, 0, 0, 0.55);
}
.popup-scrim[hidden] { display: none !important; }
.matrix-popup {
  position: fixed; z-index: 40;
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, calc(100dvh - 96px));
  overflow: auto;
  background: #001400;
  border: 1px solid var(--green);
  box-shadow: 0 0 24px rgba(0, 255, 65, 0.35), inset 0 0 40px rgba(0, 255, 65, 0.08);
  padding: 0 16px 16px;
  color: var(--text);
  pointer-events: auto;
}
.matrix-popup-bar {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #001400;
  background: var(--green);
  margin: 0 -16px 12px;
  padding: 6px 12px;
}
.popup-close {
  display: none;
  background: none; border: 0;
  color: #001400; font-size: 26px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.matrix-popup h3 { color: var(--green); font-size: 1rem; margin-bottom: 8px; font-family: Orbitron, sans-serif; }
.matrix-popup p { font-size: 0.85rem; line-height: 1.55; }

.btn-pulse {
  margin-top: 18px;
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
  padding: 12px 22px;
  font-family: inherit;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.25);
}
.btn-pulse:hover { background: var(--green); color: #001400; }

.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: grid; place-items: center;
  padding: 16px;
}
.modal[hidden], .matrix-popup[hidden] { display: none !important; }
.modal-card {
  position: relative;
  width: min(480px, 100%);
  background: #001000;
  border: 1px solid var(--green);
  padding: 18px 18px 22px;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.3);
}
.modal-card h3 { color: var(--green); margin-bottom: 14px; font-family: Orbitron, sans-serif; }
.modal-close {
  position: absolute; top: 28px; right: 12px;
  background: none; border: 0; color: var(--green); font-size: 28px; cursor: pointer;
}
form label { display: block; margin-bottom: 12px; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; }
form input, form textarea {
  display: block; width: 100%; margin-top: 6px;
  background: #000; color: var(--green);
  border: 1px solid #145214;
  padding: 10px;
  font-family: inherit;
}
form input:focus, form textarea:focus { outline: 1px solid var(--green); }
.hp { position: absolute; left: -9999px; }
.crawl-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.form-status { margin-top: 10px; min-height: 1.2em; color: var(--green); }

@media (max-width: 860px) {
  body { overflow: auto; }
  .home-grid, .tab-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero { width: min(100%, 380px); }
  .lang-rain { grid-template-columns: repeat(3, 1fr); height: 42vh; }
  .panel { padding: 80px 16px 72px; }
  .popup-close { display: block; }
  .matrix-popup {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 12px !important;
    width: auto;
    max-width: none;
    max-height: min(72dvh, calc(100dvh - 88px));
  }
}

@media (max-width: 768px) {
  .hamburger { display: flex !important; }
  .nav {
    display: none;
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column;
    background: rgba(0, 10, 0, 0.96);
    border: 1px solid var(--green);
    padding: 12px;
    gap: 0;
    z-index: 30;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-bottom: 1px solid #0b3d0b; }
}

@media (min-width: 769px) {
  .hamburger { display: none !important; }
  .nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 22px;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .nav a { padding: 0; border-bottom: 0; }
}
