:root {
  --bg-dark: #050505;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-color: rgba(255, 255, 255, 0.1);
  --primary-color: #8b5cf6;
  /* Violet */
  --secondary-color: #ec4899;
  /* Pink */
  --accent-color: #10b981;
  /* Emerald */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --font-main: 'Outfit', sans-serif;
  --nav-height: 80px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

canvas#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

* {
  box-sizing: border-box;
}

/* Typography */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  margin: 0;
  color: #fff;
}

h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 3rem;
  text-align: center;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  color: var(--text-muted);
  line-height: 1.7;
  font-size: 1.1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glassmorphism */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 24px;
}

/* Navigation - Floating Pill */
.nav-container {
  position: fixed;
  top: 2rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 1000;
  padding: 0 1rem;
}

.glass-nav {
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.logo {
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  margin-right: 1rem;
}

.logo a {
  color: #fff;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo a:hover {
  opacity: 0.7;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #fff;
}

/* Button */
.cta-button {
  background: #fff;
  color: #000;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* Sections */
section {
  padding: 8rem 5%;
  position: relative;
}

.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  /* Center strictly */
  justify-content: center;
  padding-top: var(--nav-height);
  text-align: center;
}

.hero-content {
  max-width: 900px;
  z-index: 2;
}

.subtitle {
  font-size: 1.5rem;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

/* Typewriter Cursor */
.typewriter-text::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Grid for Projects/Services */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 3rem 2rem;
  border-radius: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-5px);
}

.service-card h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-color);
  background: #020202;
}

/* Utilities */
.hidden {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 3rem;
  }

  .glass-nav {
    padding: 0.75rem 1.5rem;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }
}

/* Tech Stack Section */
.tech-section {
  padding: 4rem 2rem;
  margin: 4rem 10%;
  text-align: center;
}

.tech-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  margin-top: 2rem;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.tech-item:hover {
  transform: translateY(-5px) scale(1.1);
  color: #fff;
}

.tech-icon {
  width: 64px;
  height: 64px;
  color: inherit;
  transition: color 0.3s ease;
}

.tech-item:hover .tech-icon {
  color: var(--accent-color);
  filter: drop-shadow(0 0 10px rgba(16, 185, 129, 0.5));
}

.tech-item span {
  font-weight: 500;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .tech-grid {
    gap: 2rem;
  }

  .tech-icon {
    width: 48px;
    height: 48px;
  }
}

/* Map Section */
.map-container {
  width: 100%;
  max-width: 800px;
  margin: 2rem auto;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.map-container iframe {
  width: 100%;
  height: 300px;
  /* CSS Filter to invert map mechanism for dark mode sci-fi look */
  filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(110%) grayscale(40%);
  pointer-events: none;
  /* Non-interactive */
}

/* Scanline overlay for extra sci-fi feel */
.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

/* -------------------------------------------------------------
   Cookie Consent - Cyberpunk Style
   ------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--accent-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1.5rem;
  border-radius: 16px;
  z-index: 9999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 1200px;
  margin: 0 auto;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-text {
  flex: 1;
}

.cookie-text h3 {
  color: var(--accent-color);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.cookie-text p {
  margin: 0;
  font-size: 0.95rem;
  color: #ccc;
}

.cookie-actions {
  display: flex;
  gap: 1rem;
}

.cookie-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font-main);
  transition: all 0.2s;
  white-space: nowrap;
}

.cookie-btn.accept {
  background: var(--accent-color);
  color: #000;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.cookie-btn.accept:hover {
  background: #34d399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  transform: translateY(-2px);
}

.cookie-btn.decline {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.cookie-btn.decline:hover {
  border-color: #fff;
  color: #fff;
}

.cookie-icon-revoke {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(5px);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0.6;
  font-size: 1.2rem;
}

.cookie-icon-revoke:hover {
  opacity: 1;
  transform: scale(1.1) rotate(10deg);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .cookie-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .cookie-icon-revoke {
    bottom: 80px;
    /* clear the footer if needed */
  }
}

/* -------------------------------------------------------------
   Rocket Launch Intro
   ------------------------------------------------------------- */
#launch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1.5s ease-out;
}

#launch-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Rocket Wrapper - holds both rocket and flame */
#rocket-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Intro Rocket Style */
#intro-rocket {
  width: 300px;
  /* 2x smaller than 600px */
  height: auto;
  position: relative;
  left: 30px;
  z-index: 2;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

/* Exhaust Flame */
.exhaust-flame {
  position: absolute;
  width: 100px;
  /* 2x smaller (was 200px) */
  height: 180px;
  /* 2x smaller (was 360px) */
  bottom: -160px;
  /* Adjusted for smaller size */
  left: 50%;
  transform: translateX(-50%);
  /* Proper centering */
  background: linear-gradient(to bottom,
      rgba(255, 69, 0, 0.9) 0%,
      rgba(255, 140, 0, 0.8) 30%,
      rgba(255, 215, 0, 0.6) 60%,
      transparent 100%);
  border-radius: 50% 50% 40% 40%;
  filter: blur(3px);
  opacity: 0;
  z-index: 1;
  transform-origin: center top;
}

/* The Intro Animation Class - applied to wrapper */
.rocket-intro-sequence {
  animation: intro-sequence 2.5s cubic-bezier(0.6, 0.05, 0.2, 1) forwards;
  -webkit-animation: intro-sequence 2.5s cubic-bezier(0.6, 0.05, 0.2, 1) forwards;
  will-change: transform;
  animation-fill-mode: forwards;
  -webkit-animation-fill-mode: forwards;
}

/* Show and animate flame during intro */
.rocket-intro-sequence .exhaust-flame {
  opacity: 1;
  animation: flame-flicker 0.08s infinite alternate;
}

@keyframes flame-flicker {
  0% {
    transform: translateX(-50%) scaleX(0.9) scaleY(1.1);
    opacity: 0.85;
  }

  50% {
    transform: translateX(-50%) scaleX(1.1) scaleY(0.95);
    opacity: 1;
  }

  100% {
    transform: translateX(-50%) scaleX(0.95) scaleY(1.05);
    opacity: 0.9;
  }
}

@keyframes flame-flicker-flyby {
  0% {
    transform: translateX(calc(-50% - 39px)) scaleX(0.9) scaleY(1.1);
    opacity: 0.85;
  }

  50% {
    transform: translateX(calc(-50% - 39px)) scaleX(1.1) scaleY(0.95);
    opacity: 1;
  }

  100% {
    transform: translateX(calc(-50% - 39px)) scaleX(0.95) scaleY(1.05);
    opacity: 0.9;
  }
}

@keyframes intro-sequence {

  /* 0s - 1s: Hang / Rumble */
  0%,
  40% {
    transform: translateY(0) scale(1);
  }

  /* 40% (1s) - 100% (2.5s): Blast off */
  45% {
    transform: translateY(20px) scale(0.95);
  }

  100% {
    transform: translateY(-200vh) scale(0.8);
  }
}


/* -------------------------------------------------------------
   Background Rocket Flybys
   ------------------------------------------------------------- */
.rocket-flyby {
  position: fixed;
  z-index: -1;
  /* Behind all text, with the stars */
  pointer-events: none;
  opacity: 0.7;
}

.rocket-flyby img {
  width: 80px;
  height: auto;
  position: relative;
  left: 8px;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

.rocket-flyby .exhaust-flame {
  width: 30px;
  height: 50px;
  bottom: -45px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
  animation: flame-flicker 0.08s infinite alternate;
}

/* Loop-de-loop animation */
.rocket-loop {
  animation: rocket-loop 8s linear forwards;
}

@keyframes rocket-loop {
  0% {
    left: 100%;
    top: 50%;
    transform: translate(0, -50%) rotate(-90deg);
  }

  /* Enter from right, start curving up */
  15% {
    left: 70%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
  }

  /* Top of the loop */
  35% {
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%) rotate(0deg);
  }

  /* Coming down the other side */
  50% {
    left: 30%;
    top: 20%;
    transform: translate(-50%, -50%) rotate(45deg);
  }

  /* Bottom of loop */
  65% {
    left: 30%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }

  /* Straightening out */
  80% {
    left: 20%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }

  /* Exit left */
  100% {
    left: -10%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }
}