/* ---------- Reset & Box Sizing ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- Base & Layout ---------- */
html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;              /* CRT bubble handles its own scroll */
  background: #000;
  font-family: 'VT323', monospace;
  color: #fff;
}

/* ---------- Fast Overlay Flicker ---------- */
.bubble .overlay {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  animation: flicker 0.3s infinite alternate;
  pointer-events: none;
  z-index: 1;
}
@keyframes flicker {
  from { opacity: .96; }
  to   { opacity: .98; }
}

/* ---------- CRT Bubble Container ---------- */
.bubble {
  position: relative;
  width: 90vw;
  height: 90vh;
  margin: 2rem auto;               /* added top/bottom spacing */
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,.05), transparent 60%);
  box-shadow: 0 0 40px rgba(0,255,255,.2);
  transform: perspective(800px) scale(1.01);
  backdrop-filter: blur(.6px);
}

/* ---------- Background Effects ---------- */
.bubble #vanta-bg,
.bubble #particles,
.bubble #three-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Site Header & Hero ---------- */
.bubble .site-header {
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.3);
  padding: 1rem;
  z-index: 12;
}
.bubble .hero {
  text-align: center;
  background: rgba(0,0,0,0.8);
  padding: 1.5rem 1rem;
  z-index: 12;
}
.bubble .hero h1 { font-size: 4rem; }
.bubble .hero p  { font-size: 1.5rem; }

/* ---------- Scrollable Content Pane ---------- */
.bubble #content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  backdrop-filter: blur(2px) brightness(1.1);
  z-index: 1;
}

/* ---------- Scan Distortion (VCR glitch) ---------- */
.bubble .scan-distortion {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02) 0,
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  background-size: 100% 3px;
  mix-blend-mode: overlay;
  opacity: 0.3;
  animation: scanDistort 0.2s infinite linear;
  pointer-events: none;
  z-index: 8;
}
@keyframes scanDistort {
  to { background-position-y: 3px; }
}

/* ---------- Static GIF Overlay (above content) ---------- */
.bubble .static {
  position: absolute;
  inset: 0;
  background: url('https://media.giphy.com/media/oEI9uBYSzLpBK/giphy.gif') center/cover no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 20;   /* sits on top of content */
}

/* ---------- Scanlines ---------- */
.bubble .scanlines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.02),
    rgba(255,255,255,0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 6;
}

/* ---------- Vignette ---------- */
.bubble .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 60%,
    rgba(0,0,0,0.6) 100%
  );
  pointer-events: none;
  z-index: 5;
}

/* ---------- Navigation ---------- */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.site-nav a {
  font-family: 'Orbitron', sans-serif;
  color: #0ff;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border: 1px solid #0ff;
  transition: background 0.3s, color 0.3s;
}
.site-nav a:hover,
.site-nav a:focus {
  background: #0ff;
  color: #000;
}

/* ---------- Main Content ---------- */
main {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto 4rem;
  background: rgba(0,0,0,0.2);
  line-height: 1.6;
  z-index: 4;
}

/* ---------- Sections ---------- */
.portfolio h2,
.about h2,
.contact h2 {
  font-family: 'Orbitron', sans-serif;
  color: #0ff;
  text-align: center;
  margin-bottom: 1rem;
}

/* ---------- Portfolio Grid ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
  gap: 1.5rem;
}
.project-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid #0ff;
  padding: 1rem;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}
.project-item:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px #0ff;
}
.project-item img {
  width: 100%;
  border: 1px solid #0ff;
  margin-bottom: 0.75rem;
}

/* ---------- About Section ---------- */
.about {
  background: rgba(0,0,0,0.2);
  padding: 2rem 1rem;
}
.about p {
  max-width: 800px;
  margin: 0 auto 4rem;
}

/* ---------- Contact Form ---------- */
#contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto 4rem;
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  z-index: 4;
}
#contact-form input,
#contact-form textarea {
  background: rgba(0,0,0,0.2);
  border: 1px solid #0ff;
  color: #fff;
  padding: 0.75rem;
  font-family: 'VT323', monospace;
  font-size: 1rem;
}
#contact-form button {
  background: rgba(0,255,255,0.5);
  color: #000;
  border: 1px solid #0ff;
  padding: 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
#contact-form button:hover,
#contact-form button:focus {
  background: rgba(0,255,255,0.8);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 { font-size: 8vw; }
  .hero p  { font-size: 4vw; }
  .projects-grid { grid-template-columns: 1fr; }
  .site-nav { gap: 0.5rem; }
}