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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: #ADD8E6;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

p { color: rgb(85, 85, 85); }

a { transition: all 0.3s ease; }

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --nav-height: 75px;
  --dark: #222222;
  --light: #888888;
  --accent: #007bff;
  --accent-hover: #0056cc;
  --white: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.16);
  --radius: 16px;
  --transition: all 0.3s ease;
}

/* ===========================
   ANIMATIONS
=========================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animated-text {
  animation: fadeInUp 0.7s ease-out forwards;
  opacity: 0;
}

.animated-text:nth-child(1) { animation-delay: 0.1s; }
.animated-text:nth-child(2) { animation-delay: 0.25s; }

/* Project card scroll reveal */
.project-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.35s ease;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===========================
   NAVIGATION — DESKTOP
=========================== */
#desktop-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  padding: 0 5%;
  background-color: rgba(173, 216, 230, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.logo {
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--dark);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(1rem, 2.5vw, 2.2rem);
  align-items: center;
}

.nav-links a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  font-size: clamp(0.85rem, 1.3vw, 1rem);
  position: relative;
  padding-bottom: 4px;
  white-space: nowrap;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a.active { color: var(--accent); }

/* ===========================
   NAVIGATION — HAMBURGER
=========================== */
#hamburger-nav {
  display: none;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  padding: 0 5%;
  background-color: rgba(173, 216, 230, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.hamburger-menu { position: relative; }

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 22px;
  width: 28px;
  cursor: pointer;
  padding: 2px 0;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: var(--dark);
  border-radius: 2px;
  transition: var(--transition);
  display: block;
}

.hamburger-icon.open span:first-child  { transform: rotate(45deg) translate(8px, 5px); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-icon.open span:last-child   { transform: rotate(-45deg) translate(8px, -5px); }

.menu-links {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background-color: var(--white);
  min-width: 180px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, box-shadow 0.3s ease;
  border-radius: var(--radius);
  list-style: none;
}

.menu-links.open {
  max-height: 280px;
  box-shadow: var(--shadow-lg);
}

.menu-links li {
  border-bottom: 1px solid #f0f0f0;
}

.menu-links li:last-child { border-bottom: none; }

.menu-links a {
  display: block;
  padding: 14px 20px;
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.menu-links a:hover {
  background-color: #f5f9ff;
  color: var(--accent);
  padding-left: 26px;
}

/* ===========================
   PROJECTS SECTION
=========================== */
#projects {
  padding: calc(var(--nav-height) + 50px) 5% 80px;
  min-height: 100vh;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section__text__p1 {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

/* ===========================
   PROJECTS GRID
=========================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.2rem, 2.5vw, 2rem);
  max-width: 1200px;
  margin: 0 auto;
}

/* ===========================
   PROJECT CARD
=========================== */
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.project-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.project-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 90%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s ease;
}

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

.project-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,123,255,0.88), rgba(0,86,204,0.88));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-description {
  color: var(--white);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  text-align: center;
  line-height: 1.6;
}

.project-info {
  padding: clamp(1rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-title {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  background-color: rgba(0,123,255,0.1);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.03em;
  border: 1px solid rgba(0,123,255,0.2);
}

/* ===========================
   BUTTONS
=========================== */
.btn-container {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 30px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: clamp(0.75rem, 1.3vw, 0.88rem);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-color-2.project-btn {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

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

.btn-color-1.project-btn {
  background-color: var(--accent);
  color: var(--white);
  border: 2px solid var(--accent);
}

.btn-color-1.project-btn:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
}

/* ===========================
   FOOTER
=========================== */
footer {
  background-color: rgba(255, 255, 255, 0.85);
  padding: 2rem 5%;
  text-align: center;
  border-top: 1px solid rgba(0,0,0,0.08);
}

footer nav {
  margin-bottom: 0.8rem;
}

.footer-links {
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a { font-size: 0.9rem; }

.footer-copy {
  font-size: 0.82rem;
  color: var(--light);
  margin-top: 0.5rem;
}

/* ===========================
   UTILITY
=========================== */
.hidden { display: none; }

/* ===========================
   RESPONSIVE — TABLET (≤1024px)
=========================== */
@media screen and (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .project-card:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }
}

/* ===========================
   RESPONSIVE — MOBILE (≤768px)
=========================== */
@media screen and (max-width: 768px) {
  #desktop-nav   { display: none; }
  #hamburger-nav { display: flex; }

  #projects { padding: calc(var(--nav-height) + 30px) 4% 60px; }

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

  .project-card:nth-child(3) {
    grid-column: auto;
    max-width: 100%;
    margin: 0;
  }

  .project-overlay { display: none; }
}

/* ===========================
   RESPONSIVE — SMALL MOBILE (≤480px)
=========================== */
@media screen and (max-width: 480px) {
  #projects { padding: calc(var(--nav-height) + 20px) 4% 50px; }

  .title { font-size: 1.7rem; }

  .btn-container {
    flex-direction: row;
    justify-content: flex-start;
  }

  .btn {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .footer-links { gap: 1rem; }
}

/* ===========================
   RESPONSIVE — VERY SMALL (≤360px)
=========================== */
@media screen and (max-width: 360px) {
  .btn-container { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .projects-grid { gap: 1rem; }
}