@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* ========== PALETTE OCEAN SOMBRE ========== */
:root {
  --deep-ocean: #020c1b;
  --dark-sea: #0a192f;
  --sea-blue: #112240;
  --wave-teal: #64ffda;
  --soft-teal: #4fd1c5;
  --light-slate: #a8b2d1;
  --lightest-slate: #ccd6f6;
  --white: #e6f1ff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--deep-ocean);
  color: var(--lightest-slate);
  overflow-x: hidden;
  line-height: 1.6;
}

/* ========== ANIMATED BACKGROUND (BUBBLES) ========== */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--deep-ocean) 0%, var(--dark-sea) 50%, var(--sea-blue) 100%);
}

.bubble {
  position: absolute;
  bottom: -100px;
  background: radial-gradient(circle, rgba(100, 255, 218, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  animation: rise 15s infinite ease-in;
  opacity: 0.6;
}

.bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 12s; animation-delay: 0s; }
.bubble:nth-child(2) { width: 20px; height: 20px; left: 20%; animation-duration: 10s; animation-delay: 2s; }
.bubble:nth-child(3) { width: 50px; height: 50px; left: 35%; animation-duration: 14s; animation-delay: 4s; }
.bubble:nth-child(4) { width: 80px; height: 80px; left: 50%; animation-duration: 18s; animation-delay: 0s; }
.bubble:nth-child(5) { width: 35px; height: 35px; left: 65%; animation-duration: 11s; animation-delay: 3s; }
.bubble:nth-child(6) { width: 45px; height: 45px; left: 75%; animation-duration: 16s; animation-delay: 6s; }
.bubble:nth-child(7) { width: 25px; height: 25px; left: 85%; animation-duration: 13s; animation-delay: 1s; }
.bubble:nth-child(8) { width: 60px; height: 60px; left: 90%; animation-duration: 20s; animation-delay: 5s; }

@keyframes rise {
  0% { bottom: -100px; transform: translateX(0) scale(1); opacity: 0.6; }
  50% { opacity: 0.4; }
  100% { bottom: 110vh; transform: translateX(-50px) scale(0.5); opacity: 0; }
}

/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: transparent;
}

.hero-content {
  z-index: 10;
  padding: 0 20px;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hero-title .line1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 300;
  color: var(--light-slate);
  letter-spacing: 2px;
}

.hero-title .line2 {
  font-size: clamp(4rem, 15vw, 12rem);
  font-weight: 700;
  letter-spacing: 4px;
  line-height: 1;
  margin-top: -10px;
}

/* ========== GLOW TEXT ANIMATION ========== */
.glow-text {
  background: linear-gradient(90deg, var(--wave-teal), var(--soft-teal), var(--white), var(--wave-teal));
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite, pulse-glow 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(100, 255, 218, 0.5))
            drop-shadow(0 0 40px rgba(100, 255, 218, 0.3))
            drop-shadow(0 0 60px rgba(100, 255, 218, 0.1));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(100, 255, 218, 0.8))
            drop-shadow(0 0 60px rgba(100, 255, 218, 0.5))
            drop-shadow(0 0 90px rgba(100, 255, 218, 0.3));
  }
}

/* ========== WAVES ========== */
.wave-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-top {
  top: 0;
  bottom: auto;
  transform: rotate(180deg);
}

.waves {
  position: relative;
  width: 100%;
  height: 15vh;
  min-height: 100px;
  max-height: 150px;
}

.parallax > use {
  animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }

@keyframes move-forever {
  0% { transform: translate3d(-90px, 0, 0); }
  100% { transform: translate3d(85px, 0, 0); }
}

/* ========== DESYNCHRONIZED WAVES ========== */
.hero-waves .parallax > use:nth-child(1) { animation-delay: -2s; animation-duration: 7s; }
.hero-waves .parallax > use:nth-child(2) { animation-delay: -3s; animation-duration: 10s; }
.hero-waves .parallax > use:nth-child(3) { animation-delay: -4s; animation-duration: 13s; }
.hero-waves .parallax > use:nth-child(4) { animation-delay: -5s; animation-duration: 20s; }

.about-waves .parallax > use:nth-child(1) { animation-delay: -4s; animation-duration: 8s; }
.about-waves .parallax > use:nth-child(2) { animation-delay: -6s; animation-duration: 12s; }
.about-waves .parallax > use:nth-child(3) { animation-delay: -2s; animation-duration: 15s; }
.about-waves .parallax > use:nth-child(4) { animation-delay: -8s; animation-duration: 25s; }

.projects-waves .parallax > use:nth-child(1) { animation-delay: -1s; animation-duration: 6s; }
.projects-waves .parallax > use:nth-child(2) { animation-delay: -5s; animation-duration: 11s; }
.projects-waves .parallax > use:nth-child(3) { animation-delay: -3s; animation-duration: 14s; }
.projects-waves .parallax > use:nth-child(4) { animation-delay: -7s; animation-duration: 22s; }

/* ========== SECTIONS ========== */
.section {
  position: relative;
  padding: 180px 20px 180px;
  min-height: 60vh;
}

.about {
  background: var(--dark-sea);
}

.projects {
  background: var(--sea-blue);
}

.section-content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 5;
}

.section h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--wave-teal);
  border-radius: 2px;
}

.section p {
  font-size: 1.1rem;
  color: var(--light-slate);
  max-width: 600px;
  margin: 30px auto 0;
  line-height: 1.8;
}

.section-subtitle {
  margin-bottom: 50px !important;
}

/* ========== ABOUT SECTION ========== */
.about-content {
  text-align: left;
}

.about-content h2 {
  display: block;
  text-align: center;
  margin-bottom: 50px;
}

.about-grid {
  max-width: 800px;
  margin: 0 auto;
}

.about-text p {
  text-align: left;
  max-width: 100%;
  margin: 0 0 20px 0;
}

.about-text p strong {
  color: var(--wave-teal);
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  justify-content: center;
}

.skill-tag {
  background: rgba(100, 255, 218, 0.1);
  color: var(--wave-teal);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(100, 255, 218, 0.3);
  transition: all 0.3s ease;
}

.skill-tag:hover {
  background: rgba(100, 255, 218, 0.2);
  transform: translateY(-2px);
}

/* ========== PROJECTS SECTION ========== */
.projects-content h2 {
  margin-bottom: 10px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 20px;
}

.project-card {
  background: var(--dark-sea);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(100, 255, 218, 0.1);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-10px);
  border-color: rgba(100, 255, 218, 0.3);
  box-shadow: 0 20px 40px rgba(2, 12, 27, 0.5);
}

.project-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(2, 12, 27, 0.8) 100%);
}

.project-info {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-info h3 {
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 12px;
  font-weight: 600;
}

.project-info p {
  font-size: 0.95rem;
  color: var(--light-slate);
  line-height: 1.7;
  margin: 0 0 20px 0;
  max-width: 100%;
  text-align: left;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.project-tech span {
  font-size: 0.8rem;
  color: var(--wave-teal);
  background: rgba(100, 255, 218, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
}

.project-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
  flex-wrap: wrap;
}

/* ========== PROJECT DETAIL PAGE & MASCOT ========== */
.project-detail-header {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-sea);
  position: relative;
  text-align: center;
  padding: 80px 20px;
}

.project-detail-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
  position: relative;
}

.project-block {
  margin-bottom: 60px;
  position: relative;
  background: var(--sea-blue);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}

.project-block h2 {
  color: var(--wave-teal);
  margin-bottom: 20px;
}

.project-block img {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 20px;
  border: 1px solid var(--light-slate);
}

/* --- Floating Mascot (Fish) --- */
.mascot-wrapper {
  position: absolute;
  right: -60px;
  top: 20px;
  width: 100px;
  height: 100px;
  pointer-events: none; /* Let clicks pass through unless hovering specific interactive parts */
  z-index: 10;
  animation: float-swim 6s ease-in-out infinite;
}

.mascot-fish {
  font-size: 2.5rem;
  color: var(--wave-teal);
  transform: scaleX(-1); /* Face left towards text */
  cursor: help;
  pointer-events: auto;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 0 5px var(--wave-teal));
}

.mascot-fish:hover {
  transform: scaleX(-1) scale(1.1) rotate(-10deg);
}

.mascot-fish .question-mark {
  position: absolute;
  font-size: 1.2rem;
  color: var(--white);
  animation: bounce 2s infinite;
  font-weight: bold;
}

/* Tooltip / Bubble */
.mascot-bubble {
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%);
  background: var(--white);
  color: var(--deep-ocean);
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.9rem;
  width: 200px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.mascot-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border-width: 8px;
  border-style: solid;
  border-color: var(--white) transparent transparent transparent;
}

.mascot-wrapper:hover .mascot-bubble {
  opacity: 1;
  visibility: visible;
  bottom: 120%; /* Move up slightly on hover */
}

@keyframes float-swim {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-10px, -15px) rotate(-5deg); }
  50% { transform: translate(0, -5px) rotate(0deg); }
  75% { transform: translate(10px, -15px) rotate(5deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 1000px) {
  .mascot-wrapper {
    right: 0;
    top: -50px;
  }
}

/* Mobile Adjustments for Project Details */
@media (max-width: 768px) {
  .project-detail-header {
    padding-top: 100px; /* Give space for the back button */
  }

  /* Make sure images in project blocks don't overflow */
  .project-block img {
    height: auto;
    max-width: 100%;
  }
  
  .project-detail-header h1 {
    font-size: 2.5rem;
  }
  
  .project-detail-content {
    padding: 20px;
  }
  
  .project-block {
    padding: 20px;
  }
  
  .mascot-wrapper {
    display: none; /* Hide floating mascots on small screens to prevent overlap/overflow */
  }
  
  .wave-container {
    height: 60px !important; /* Force smaller waves */
    margin-bottom: -5px !important; /* Reset negative margins */
  }
  
  /* Fix sticky top/bottom waves on mobile */
  .project-detail-header .wave-container:first-child {
    top: -30px !important;
  }
  
  .project-detail-header .wave-container:last-child {
    bottom: -1px;
  }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--wave-teal);
  color: var(--deep-ocean);
}

.btn-primary:hover {
  background: var(--soft-teal);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(100, 255, 218, 0.3);
}

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

.btn-secondary:hover {
  background: rgba(100, 255, 218, 0.1);
  transform: translateY(-2px);
}

/* ========== FOOTER ========== */
footer {
  background: var(--deep-ocean);
  padding: 80px 20px 30px;
  position: relative;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.footer-brand .footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--wave-teal);
  margin-bottom: 15px;
}

.footer-brand p {
  color: var(--light-slate);
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-links h4,
.footer-contact h4,
.footer-social h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.footer-links ul,
.footer-contact ul {
  list-style: none;
}

.footer-links li,
.footer-contact li {
  margin-bottom: 12px;
}

.footer-links a,
.footer-contact a {
  color: var(--light-slate);
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-links a:hover,
.footer-contact a:hover {
  color: var(--wave-teal);
  transform: translateX(5px);
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(100, 255, 218, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wave-teal);
  font-size: 1.2rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid rgba(100, 255, 218, 0.2);
}

.social-icons a:hover {
  background: var(--wave-teal);
  color: var(--deep-ocean);
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(100, 255, 218, 0.2);
}

.footer-bottom {
  padding-top: 30px;
  text-align: center;
}

.footer-bottom p {
  color: var(--light-slate);
  font-size: 0.9rem;
  margin: 5px 0;
}

.made-with {
  color: var(--light-slate);
}

.made-with i {
  color: var(--wave-teal);
  margin: 0 3px;
}

.made-with .fa-heart {
  color: #ff6b6b;
  animation: heartbeat 1.5s ease infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ========== LANGUAGE SWITCHER ========== */
.lang-switch {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 100;
}

.lang-switch a {
  color: var(--wave-teal);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  border: 1px solid var(--wave-teal);
  padding: 8px 15px;
  border-radius: 4px;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.lang-switch a:hover {
  background: rgba(100, 255, 218, 0.1);
  box-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .waves {
    height: 60px;
    min-height: 60px;
  }

  .hero-title .line2 {
    font-size: clamp(3rem, 12vw, 6rem);
  }

  .section {
    padding: 120px 20px 120px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .footer-main {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .social-icons {
    justify-content: center;
  }

  .footer-links a:hover,
  .footer-contact a:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .hero-title .line1 {
    font-size: 1.5rem;
  }

  .hero-title .line2 {
    font-size: 3rem;
  }

  .bubble {
    display: none;
  }

  .project-links {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }
}

.footer-wave-container {
  height: 100px;
  margin-bottom: -36.5%;
}

@media (max-width: 768px) {
  .footer-wave-container {
    height: 50px;
    margin-bottom: -5px; /* Pull it down slightly to overlap footer top */
    position: relative;
    top: auto;
    background: var(--sea-blue); /* Match the section above it to fill gaps */
  }
  
  /* Ensure SVG fills the container */
  .footer-wave-container svg {
    height: 100%;
    display: block;
  }
}