/* =====================
   Intro / Opening Sequence
   ===================== */

#intro-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: introFadeOut 0.6s ease 2.4s forwards;
  pointer-events: none;
}

#intro-overlay .intro-name {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(20px);
  animation: introTextIn 0.7s ease 0.3s forwards;
}

#intro-overlay .intro-tagline {
  color: #bfdbfe;
  font-size: 1.2rem;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
  animation: introTextIn 0.7s ease 0.7s forwards;
}

#intro-overlay .intro-bar {
  width: 60px;
  height: 4px;
  background: white;
  border-radius: 2px;
  margin-top: 1.25rem;
  opacity: 0;
  transform: scaleX(0);
  animation: introBarIn 0.6s ease 1.1s forwards;
}

@keyframes introTextIn {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introBarIn {
  to { opacity: 1; transform: scaleX(1); }
}

@keyframes introFadeOut {
  to { opacity: 0; visibility: hidden; }
}

.intro-skip #intro-overlay {
  display: none;
}

/* =====================
   Section Reveal Animations
   ===================== */

.section-hidden {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f5f5f5;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Navigation */
nav {
  background-color: #1e293b;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

nav ul {
  display: flex;
  list-style: none;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
}

nav ul li a {
  color: #e2e8f0;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}

nav ul li a:hover {
  color: #60a5fa;
  text-decoration: none;
}

/* Hero Section */
#hero {
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  color: white;
  text-align: center;
  padding: 10rem 2rem;
}

#hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

#hero .subtitle {
  font-size: 1.3rem;
  color: #bfdbfe;
  margin-bottom: 1.5rem;
}

#hero .hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.btn-primary {
  background-color: #2563eb;
  color: white;
  border: 2px solid #2563eb;
}

.btn-outline {
  background-color: transparent;
  color: white;
  border: 2px solid white;
}

/* Sections */
section {
  padding: 4rem 2rem;
  width: 100%;
}

.section-content {
  max-width: 900px;
  margin: 0 auto;
}

section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #1e293b;
  border-bottom: 3px solid #2563eb;
  display: inline-block;
  padding-bottom: 0.25rem;
}

/* About */
#about p {
  font-size: 1.05rem;
  color: #475569;
  max-width: 700px;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

.skill-card {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  color: #1e293b;
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

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

.project-card {
  background-color: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.project-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-card-link:hover {
  text-decoration: none;
}

.project-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #2563eb;
  color: white;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  font-weight: 600;
  align-self: flex-start;
  transition: background-color 0.2s;
}

.project-card-link:hover .project-btn {
  background-color: #1d4ed8;
}

.project-card h3 {
  font-size: 1.1rem;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 1rem;
}

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

.tag {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

/* Contact */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-list li {
  font-size: 1rem;
  color: #475569;
}

.contact-list li span {
  font-weight: 600;
  color: #1e293b;
  margin-right: 0.4rem;
}

/* Footer */
footer {
  background-color: #1e293b;
  color: #94a3b8;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

/* Section background colors */
#about {
  background-color: #eff6ff;
}

#skills {
  background-color: #f0fdf4;
}

#projects {
  background-color: #faf5ff;
}

#contact {
  background-color: #f8fafc;
}

/* Photos */
#photos {
  background-color: #fff7ed;
}

#photos .section-content {
  max-width: 1100px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.photo-card {
  background-color: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.photo-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.photo-card:focus {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.photo-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s;
}

.photo-card:hover img {
  opacity: 0.9;
}

.photo-card figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: #475569;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: block;
  margin: 0 auto;
}

.lightbox-content figcaption {
  color: #e2e8f0;
  margin-top: 0.75rem;
  font-size: 1rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
  z-index: 1001;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s;
  z-index: 1001;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  user-select: none;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.3);
}

/* =====================
   Hamburger Toggle Button
   ===================== */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =====================
   Mobile Responsive
   ===================== */

@media (max-width: 640px) {
  /* Nav */
  nav {
    position: relative;
    padding: 0.75rem 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  nav ul {
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0.75rem;
    text-align: center;
    width: 100%;
  }

  nav ul.nav-open {
    display: flex;
  }

  nav ul li a {
    display: block;
    padding: 0.65rem 1rem;
  }

  /* Intro overlay */
  #intro-overlay .intro-name {
    font-size: 2rem;
    text-align: center;
    padding: 0 1rem;
  }

  #intro-overlay .intro-tagline {
    font-size: 1rem;
    text-align: center;
    padding: 0 1rem;
  }

  /* Hero */
  #hero {
    padding: 3.5rem 1.25rem;
  }

  #hero h1 {
    font-size: 2rem;
  }

  #hero .subtitle {
    font-size: 1.05rem;
  }

  /* Sections */
  section {
    padding: 2.5rem 1.25rem;
  }

  section h2 {
    font-size: 1.6rem;
  }

  /* Skills – ensure at least 2 columns */
  .skills-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }

  /* Projects – single column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Photos – single column */
  .photos-grid {
    grid-template-columns: 1fr;
  }

  /* Lightbox: larger touch targets */
  .lightbox-close {
    font-size: 2rem;
    top: 0.5rem;
    right: 0.75rem;
    padding: 0.5rem;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2rem;
    padding: 0.75rem 0.9rem;
  }

  .lightbox-prev {
    left: 0.25rem;
  }

  .lightbox-next {
    right: 0.25rem;
  }

  /* Contact list – allow wrapping on tiny screens */
  .contact-list li {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow-wrap: break-word;
  }

  .contact-list li span {
    margin-right: 0;
  }
}
