/* ================= RESET ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background: #f0f8ff;
}

/* ================= HEADER ================= */
.site-header {
  background: linear-gradient(to bottom, #fceabb, #f8b500, #3a9bdc);
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Semi-transparent state when scrolling */
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 45px;
  height: auto;
  image-rendering: pixelated;
  animation: tiltHat 3s infinite ease-in-out;
}

@keyframes tiltHat {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  75% { transform: rotate(-5deg); }
}

.site-title {
  font-family: 'Pirata One', cursive;
  font-size: 1.8rem;
  color: #2b1b0e;
  text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.site-title:hover {
  transform: translateY(-8px) scale(1.05);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-family: 'Pirata One', cursive;
  font-size: 1.2rem;
  color: #2b1b0e;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  position: relative;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover {
  color: #c99700;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: #c99700;
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:active,
.nav-links a:focus,
.nav-links a.active {
  color: #fff;
  background: #c99700;
  box-shadow: 0 0 5px rgba(201, 151, 0, 0.6);
}

/* Hamburger Toggle */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: #2b1b0e;
  cursor: pointer;
  z-index: 1100;
}

/* ================= HERO ================= */
.hero {
  position: relative;
  background: url('assets/pixel-wave.jpg') center/cover no-repeat;
  color: #fff;
  text-align: center;
  padding: 8rem 1rem;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.hero h1,
.hero p,
.hero .btn {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: 'Pirata One', cursive;
  font-size: 3rem;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.hero p {
  font-size: 1.2rem;
  font-family: 'Roboto', sans-serif;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7);
}

.hero .btn {
  background: #c99700;
  color: #fff;
  padding: 0.7rem 1.5rem;
  font-size: 1.1rem;
  font-family: 'Pirata One', cursive;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s, background 0.3s;
}

.hero .btn:hover {
  background: #ffd700;
  transform: scale(1.1);
}

/* ================= SKILLS / CHEST ================= */
#skills {
  background: #fafad2;
  padding: 3rem 2rem;
  text-align: center;
}

#skills h2 {
  font-family: 'Pirata One', cursive;
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.chest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.chest {
  position: relative;
  width: 200px;
  height: 150px;
  perspective: 1000px;
  cursor: pointer;
}

.chest-lid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: #8b4513;
  border: 3px solid #5a2d0c;
  border-radius: 8px 8px 0 0;
  transform-origin: top center;
  transition: transform 0.5s ease;
  z-index: 2;
}

.chest-body {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: #a0522d;
  border: 3px solid #5a2d0c;
  border-radius: 0 0 8px 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 0.5rem;
}

.chest-icon {
  font-size: 2rem;
  transition: opacity 0.3s ease;
}

.chest-content {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
  font-family: 'Pirata One', cursive;
  color: #fff;
}

.chest:hover .chest-lid {
  transform: rotateX(-60deg);
}

.chest:hover .chest-icon {
  opacity: 0;
}

.chest:hover .chest-content {
  opacity: 1;
  transform: translateY(0);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  /* Hamburger */
  .menu-toggle {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
  }

  /* Left slide menu */
  .nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: -50%; /* hidden initially */
    top: 0;
    width: 50%;
    height: 100vh;
    background: #3a2b1a;
    padding: 2rem 1rem;
    border-right: 2px solid #c99700;
    transition: left 0.3s ease;
    z-index: 1050;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    margin: 1rem 0;
  }

  .nav-links a {
    color: #fff;
    font-size: 1.2rem;
  }

  /* Treasure chests mobile fix */
  .chest-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .chest {
    width: 140px;
    height: 110px;
  }

  .chest-lid {
    height: 40px;
  }

  .chest-body {
    height: 70px;
    padding: 0.3rem;
  }

  .chest-icon {
    font-size: 1.5rem;
  }

  .chest-content {
    font-size: 0.9rem;
  }

  /* Site title smaller */
  .site-title {
    font-size: 1.2rem;
  }

  /* Contact heading smaller */
  #contact h1 {
    font-size: 2rem;
  }
  #contact h2 {
    font-size: 2.5rem;
  }
}
