/* =========================
   CSS RESET
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =========================
   ROOT VARIABLES
========================= */
:root {
  --bg-color: #05070a;
  --surface-color: #0f141b;
  --surface-color-2: #161d26;
  --primary-color: #8ec5ff;
  --primary-hover: #b8dcff;
  --text-color: #f5f7fa;
  --muted-color: #9aa6b2;
  --border-color: #222b36;
  --white: #ffffff;

  --max-width: 1100px;
  --radius: 12px;
  --transition: 0.3s ease;
}

/* =========================
   GLOBAL
========================= */
html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background-color: #05070a; /* Fallback solid color */
  background: radial-gradient(circle at center, #0f141b 0%, #05070a 100%);
  color: var(--text-color);
  line-height: 1.6;
  padding-top: 80px;
  overflow-x: hidden; /* Prevents scrollbars from shooting stars */
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section {
  padding: 5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* =========================
   HEADER / NAVBAR
========================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(5, 7, 10, 0.88);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  z-index: 1000;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.header-hidden {
  transform: translateY(-100%);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 0;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--muted-color);
  transition: var(--transition);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* =========================
   HERO
========================= */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 700px;
}

.hero-subtitle {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero-text {
  color: var(--muted-color);
  margin-bottom: 2rem;
  font-size: 1.1rem;
  max-width: 60ch;
}

/* =========================
   BUTTONS
========================= */
.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  transition: var(--transition);
  letter-spacing: 0.03em;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #05070a;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  border: 1px solid var(--border-color);
  color: var(--text-color);
  background-color: transparent;
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background-color: rgba(142, 197, 255, 0.04);
}

/* =========================
   PROJECTS
========================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: linear-gradient(180deg, var(--surface-color) 0%, var(--surface-color-2) 100%);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.project-card h3 {
  margin-bottom: 1rem;
}

.project-description {
  color: var(--muted-color);
  margin-bottom: 1.2rem;
}

.project-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* =========================
   SKILLS
========================= */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.skills-list span {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  color: var(--text-color);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}


/* =========================
   FOOTER
========================= */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  color: var(--muted-color);
  text-align: center;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

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

/* =========================
   FANCY TRANSITIONS & EFFECTS
========================= */

/* 1. Scroll Reveal Base Classes */
.reveal {
  opacity: 0;
  transform: translateY(40px); /* Pushes the element down initially */
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1); /* Smooth snap-into-place curve */
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Add a slight delay for elements inside a grid so they don't load all at once */
.project-card:nth-child(1) { transition-delay: 0.1s; }
.project-card:nth-child(2) { transition-delay: 0.2s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }

/* 2. Neon Glow Hover Effects for Skills */
.skills-list span {
  transition: all 0.3s ease;
  cursor: default;
}

.skills-list span:hover {
  background-color: rgba(142, 197, 255, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(142, 197, 255, 0.4);
  transform: translateY(-3px) scale(1.05);
}

/* 3. Blinking Cursor for the Typing Effect */
.cursor::after {
  content: '|';
  color: var(--primary-color);
  animation: blink 1s step-start infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* =========================
   SPACE BACKGROUND & STARS
========================= */

/* The interactive constellation canvas */
#space-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* Puts it behind everything */
  pointer-events: none; /* Ensures you can still click buttons over it */
}

/* Shooting Stars */
.shooting-star {
  position: fixed;
  top: -10px;
  left: -10px;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(142, 197, 255, 0.8), #fff);
  z-index: -1;
  pointer-events: none;
  transform: rotate(-45deg);
  animation: shooting 6s linear infinite;
  opacity: 0;
}

/* Give the shooting stars a glowing "head" */
.shooting-star::after {
  content: '';
  position: absolute;
  top: -2px;
  right: 0;
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px 2px rgba(142, 197, 255, 0.8);
}

/* Different timings and positions for the shooting stars */
.delay-1 {
  top: 20%;
  left: 50%;
  animation-delay: 2s;
  animation-duration: 8s;
}

.delay-2 {
  top: 0;
  left: 80%;
  animation-delay: 4.5s;
  animation-duration: 7s;
}

@keyframes shooting {
  0% {
    transform: rotate(-45deg) translateX(0);
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
  100% {
    transform: rotate(-45deg) translateX(-1500px);
    opacity: 0;
  }
}

/* =========================
   HOLOGRAPHIC SPACE DINO
========================= */
.space-dino {
  position: absolute;
  top: 50%;
  right: -150px; /* Hidden off-screen to the right */
  transform: translateY(-50%);
  font-size: 5rem; /* Size of the dino */
  opacity: 0;
  pointer-events: none; /* Prevents it from blocking text/clicks */
  
  /* The Hologram Effect */
  filter: grayscale(100%) brightness(200%) drop-shadow(0 0 15px var(--primary-color)) sepia(1) hue-rotate(180deg) saturate(500%);
  
  /* The slide-in animation */
  transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* This class is added by Javascript when we scroll to the About section */
.space-dino.show-dino {
  right: 5%; /* Slides it into view */
  opacity: 0.6; /* Keeps it slightly transparent/subtle */
  animation: floatDino 4s ease-in-out infinite 1s; /* Starts floating after sliding in */
}

/* The zero-gravity floating effect */
@keyframes floatDino {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50% { transform: translateY(-65%) rotate(8deg); }
}



/* =========================
   HOLOGRAPHIC ROCKETSHIP
========================= */
.space-rocket {
  position: absolute;
  top: 15%;
  right: 5%;
  font-size: 5rem;
  pointer-events: none; /* Prevents it from blocking clicks */
  
  /* The same Hologram Effect as the Dinosaur */
  filter: grayscale(100%) brightness(200%) drop-shadow(0 0 15px var(--primary-color)) sepia(1) hue-rotate(180deg) saturate(500%);
  
  /* Smooth transition for launching and landing */
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1); 
}

/* The state when the hero section is visible */
.space-rocket.docked {
  opacity: 0.8;
  transform: translate(0, 0) rotate(-15deg); /* Slight tilt for a dynamic look */
  animation: floatRocket 4s ease-in-out infinite 1.2s; /* Starts floating after it lands */
}

/* The state when you scroll away */
.space-rocket.launched {
  opacity: 0;
  transform: translate(300px, -400px) rotate(45deg); /* Shoots up and to the right */
  animation: none; /* Stop floating while flying */
}

/* Zero-gravity floating effect for the rocket */
@keyframes floatRocket {
  0%, 100% { transform: translateY(0) rotate(-15deg); }
  50% { transform: translateY(-20px) rotate(-10deg); }
}

/* =========================
   MOBILE RESPONSIVENESS FOR HOLOGRAMS
========================= */
@media (max-width: 768px) {
  /* Bring back the Rocket */
  .space-rocket {
    display: block; /* Overrides any previous hidden state */
    font-size: 3rem; /* Make it smaller */
    top: 5%; /* Move it up slightly */
    right: 2%;
    z-index: -1; /* Push it behind the text */
  }

  /* Make the docked rocket slightly more transparent on phones */
  .space-rocket.docked {
    opacity: 0.3; 
  }

  /* Bring back the Dinosaur */
  .space-dino {
    display: block;
    font-size: 3rem; /* Make it smaller */
    top: auto; /* Remove the vertical centering */
    bottom: 5%; /* Pin it to the bottom of the section instead */
    transform: translateY(0);
    z-index: -1; /* Push it behind the text */
  }

  /* Adjust the shown state for phones */
  .space-dino.show-dino {
    right: 0; 
    opacity: 0.25; /* Very transparent so it doesn't make text unreadable */
    animation: floatDinoMobile 4s ease-in-out infinite 1s; 
  }
}

/* We need a slightly different float animation for the mobile dino 
   since we moved it to the bottom of the section */
@keyframes floatDinoMobile {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(8deg); }
}