/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  background-color: #111;
  color-scheme: only light;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
img {
  will-change: auto;
}

.lazy {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy.loaded {
  opacity: 1;
}

.lazy.error {
  opacity: 0.5;
  background: #333;
}

/* ===== HERO SECTION ===== */
.hero {
  min-height: auto;
  position: relative;
  background: url("background.jpg") center/cover no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5rem 1.5rem 2rem 1.5rem;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
}

.hero header {
  position: relative;
  z-index: 2;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.85);
}

/* ===== HERO LINKS ===== */
.hero-links {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  display: flex;
  gap: 0.75rem;
  z-index: 3;
}

.hero-links a {
  padding: 0.4rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: white;
  text-decoration: none;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  transition: background 0.2s ease;
}

.hero-links a:hover {
  background: rgba(0,0,0,0.55);
  opacity: 0.8;
}

/* ===== TEAM MEMBERS ===== */
.team {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.team h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.team ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  padding: 0;
  align-items: start;
}

.team li {
  background: rgba(0,0,0,0.55);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  display: block;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team li:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.team li img {
  width: 100%;
  border-radius: 6px;
  margin-top: 0.5rem;
  display: block;
}

/* ===== SNAPWIDGET FIX (ONLY NECESSARY CHANGE) ===== */
.insta-single {
  width: 100%;
  margin-top: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
  height: 360px;        /* Lock height to prevent resize gap */
}

.insta-single iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
  display: block;
}

/* ===== INSTAGRAM CAROUSEL ===== */
.insta-carousel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  scroll-snap-type: x mandatory;
  width: 100%;
}

.insta-carousel img {
  width: 100%;
  height: auto;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* ===== BIO & LIGHTBOX ===== */
.bio {
  display: none;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #ddd;
}

.toggle-bio {
  margin-top: 0.5rem;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

/* ===== UI VISIBILITY ===== */
.desktop-ui { display: block; }
.mobile-ui { display: none; }

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 768px) {
  .team ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

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

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 480px) {
  .desktop-ui { display: none; }
  .mobile-ui { display: block; }

  .hero {
    padding: 4rem 1rem 2rem;
  }

  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: 1rem; }

  .team h2 { font-size: 1.4rem; }

  .team ul {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.5rem;
  }

  .team li {
    padding: 1rem;
  }

  .search-box {
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
  }

  .hamburger {
    font-size: 2rem;
    cursor: pointer;
    color: white;
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 1000;
  }

  .mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    z-index: 999;
  }

  .mobile-menu a {
    font-size: 2rem;
    color: white;
    text-decoration: none;
  }
}

/* ===== DARK/LIGHT THEME ===== */
body.light {
  background-color: #f0f0f0;
  color: #111;
}
body.light .team li {
  background: rgba(255,255,255,0.75);
  color: #111;
}
body.light .toggle-bio {
  background: rgba(0,0,0,0.1);
  color: #111;
}
body.light .bio { color: #333; }

#theme-toggle {
  background: rgba(0,0,0,0.35);
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

/* ===== SEARCH BOX ===== */
.search-box {
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.15);
  color: white;
  backdrop-filter: blur(4px);
  outline: none;
}
.search-box::placeholder { color: rgba(255,255,255,0.6); }
body.light .search-box {
  background: rgba(0,0,0,0.1);
  color: #111;
}
body.light .search-box::placeholder { color: rgba(0,0,0,0.4); }

/* ===== MEMBER COUNT ===== */
.member-count {
  font-size: 1rem;
  background: rgba(255,255,255,0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  vertical-align: middle;
}

/* ===== SCROLL ANIMATION ===== */
.team li {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}
.team li.visible {
  opacity: 1;
  transform: translateY(0);
}
.team li:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}


.lazy {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.lazy.loaded {
  opacity: 1;
}


/* ===== PAGE TRANSITIONS ===== */
body { animation: pageFadeIn 0.35s ease both; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
a[data-transition] { pointer-events: auto; }
