/* --- Base Reset, Body & Variables --- */
:root {
  --gold: #f9a825;
  --gold-darker: #d4af37;
  --black: #000000;
  --dark-gray: #1a1a1a; /* Dark bg for cards */
  --medium-gray: #2c2c2c; /* Hover for dark cards */
  --white: #ffffff;
  --gray-text: #ccc;
  --text-light: #e5e7eb;
  --light-bg: #faf7f2;
  --text-dark: #111827; /* For light bg */
  --text-muted: #6b7280; /* For light bg */
  --border-light: #eef0f2; /* For light bg */
  --border-dark: rgba(255, 255, 255, 0.1); /* For dark bg */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--black); /* Default bg is black */
  color: var(--white);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Main Layout --- */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 150px;
}

.bg-img {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
  opacity: 0.8;
}

.mobile-bg {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(249, 168, 37, 0.15) 0%,
    rgba(0, 0, 0, 0) 70%
  );
  z-index: -1;
}

/* --- Floating Elements from HTML --- */
.floating-element {
  position: absolute;
  background: rgba(249, 168, 37, 0.08);
  border-radius: 50%;
  filter: blur(60px);
  z-index: -1;
  will-change: transform;
}
.floating-element:nth-child(3) {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 5%;
}
.floating-element:nth-child(4) {
  width: 200px;
  height: 200px;
  top: 50%;
  right: 10%;
}
.floating-element:nth-child(5) {
  width: 150px;
  height: 150px;
  bottom: 10%;
  left: 20%;
}

/* --- Header & Navigation --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease,
    padding 0.4s ease, transform 0.4s ease;
  transform: translateY(0);
}

.header.scrolled {
  background-color: rgba(18, 18, 18, 0.65);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.171);
  border-radius: 0 0 50px 50px;
  transform: translateY(-0.5rem);
}

/* This is the class for the light-body scroll */
.header.scrolled.on-light-bg {
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.navbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.8rem 2rem;
  transition: padding 0.4s ease, color 0.4s ease;
  margin-top: 1rem;
  color: var(--text-light); /* Default light text */
}

.header.scrolled .navbar {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  margin-top: 0;
}

/* Navbar text becomes dark when on light-bg */
.header.scrolled.on-light-bg .navbar,
.header.scrolled.on-light-bg .nav-links-desktop a {
  color: var(--text-dark);
}
.header.scrolled.on-light-bg .bar {
  background-color: var(--text-dark);
}

/* BUT, we need to style the hamburger icon *itself* (the X) */
/* when the menu is open, regardless of scroll */
.header.scrolled.on-light-bg .hamburger-btn.active .bar {
  background-color: var(--text-dark);
}

.logo-link {
  grid-column: 1;
}

.logo {
  height: 100px;
  width: auto;
  transition: transform 0.3s ease, height 0.4s ease;
}

.header.scrolled .logo {
  height: 85px;
}

.logo:hover {
  transform: scale(1.05);
}

/* --- Hamburger Menu (Mobile-First) --- */
.hamburger-btn {
  display: block;
  grid-column: 3;
  justify-self: end;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
}

.bar {
  display: block;
  width: 28px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--white);
  transition: all 0.3s ease-in-out;
}

.hamburger-btn.active .bar {
  /* When menu is open, it's always dark on light bg */
  background-color: var(--text-dark);
}

.hamburger-btn.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger-btn.active .bar:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-links-desktop,
.btn-nav-desktop {
  display: none;
}

/* --- Mobile Navigation Menu --- */
.nav-menu-mobile {
  position: fixed;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  transition: left 0.4s ease-in-out;
  z-index: 1000;
}

.nav-menu-mobile.active {
  left: 0;
}

.nav-menu-mobile a {
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-dark); /* Dark text */
  transition: all 0.3s ease;
  position: relative;
  padding: 0.5rem 1rem;
}

.nav-menu-mobile a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--gold);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-menu-mobile a:hover {
  color: var(--gold);
}

.nav-menu-mobile a.active {
  color: var(--gold);
}

.nav-menu-mobile a.active::after,
.nav-menu-mobile a:hover::after {
  width: 100%;
}

/* --- Buttons --- */
.btn {
  background-color: var(--gold);
  color: var(--black);
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(249, 168, 37, 0.4);
}

.btn-nav-mobile {
  font-size: 1.5rem;
  padding: 0.75rem 2rem;
}

.btn-nav-desktop {
  font-size: 1rem;
  padding: 0.75rem 2rem;
}

/* --- Hero Content Styling (Centered) --- */
.hero-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  z-index: 10;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 800px;
  margin-bottom: 1.5rem;
  color: var(--white);
  text-align: center;
}

.hero-content p {
  font-size: 1rem;
  max-width: 600px;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

.btn-hero {
  font-size: 1.1rem;
  padding: 0.8rem 2.5rem;
  font-weight: 700;
}

/* --- Footer --- */
footer {
  background: linear-gradient(180deg, var(--black) 0%, var(--dark-gray) 100%);
  color: #f9f9f9;
  padding: 60px 8%;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  position: relative;
  z-index: 2;
}

.footer-logo h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--gold-darker);
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.footer-logo p {
  font-size: 14px;
  color: var(--gray-text);
  line-height: 1.6;
}

.footer-links h3 {
  color: var(--gold-darker);
  margin-bottom: 15px;
  font-size: 18px;
  position: relative;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: var(--gray-text);
  text-decoration: none;
  transition: 0.3s;
}

.footer-links ul li a:hover {
  color: var(--gold-darker);
  transform: translateX(4px);
}

.footer-social h3 {
  color: var(--gold-darker);
  margin-bottom: 15px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-gray);
  border: 1px solid var(--gold-darker);
  border-radius: 50%;
  color: var(--gold-darker);
  font-size: 18px;
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background: var(--gold-darker);
  color: var(--black);
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--gold-darker);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  margin-top: 50px;
  padding-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #aaa;
}

.footer-bottom span {
  color: var(--gold-darker);
  font-weight: 500;
}

/* --- Scroll to top button --- */
#scrollTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gold-darker);
  color: var(--black);
  border: none;
  width: 50px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
  display: none;
  z-index: 99;
  transition: 0.3s;
}

#scrollTopBtn:hover {
  background: var(--black);
  color: var(--gold-darker);
  border: 1px solid var(--gold-darker);
}

/* =================================== */
/* ==== NEW TEAM SECTION STYLES ==== */
/* =================================== */

/* --- Shared Styles --- */
.team-container {
  max-width: 1200px;
  margin: 0 auto;
}

.team-intro {
  text-align: center;
  margin-bottom: 4rem; /* 64px */
}

.team-intro h2 {
  font-size: 2.5rem; /* 40px */
  font-weight: 800;
  margin-bottom: 1rem;
}

.team-intro p {
  font-size: 1.125rem; /* 18px */
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- 1. LEADERSHIP SECTION (White BG) --- */
.leadership-section {
  background-color: var(--light-bg);
  color: var(--text-dark);
  padding: 6rem 1.5rem;
  position: relative;
  z-index: 5;
}

.leadership-section .team-intro h2 {
  color: var(--text-dark);
}
.leadership-section .team-intro p {
  color: var(--text-muted);
}

/* --- Leadership Grid --- */
.leadership-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.leader-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  display: grid;
  grid-template-columns: 40% 60%; /* Image | Text */
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
  border-top: 4px solid transparent;
}

.leader-image {
  height: 100%;
  min-height: 350px;
  position: relative; /* Added to make image positioning work */
  overflow: hidden; /* Added to clip the images */
}

.leader-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem;
}

.leader-content h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
}

.leader-content .title {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 500;
  margin: 0.25rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.leader-content .desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.leader-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* --- 2. CORE TEAM SECTION (Black BG) --- */
.core-team-section {
  background-color: var(--black);
  color: var(--white); /* Default text is white */
  padding: 6rem 1.5rem;
  position: relative;
  z-index: 5;
}

.core-team-section .team-intro h2 {
  color: var(--gold);
}
.core-team-section .team-intro p {
  color: var(--gray-text); /* Lighter gray for sub-heading */
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* --- 2.1. The Core Team Card (SMOOTH) --- */
.core-team-section .team-card {
  background: var(--dark-gray);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-dark);
  border-top: 4px solid transparent;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background-color 0.4s ease, border-color 0.4s ease;
  will-change: transform, border-color;
}

/* --- 2.2. The Image Wrapper & Images (SMOOTH) --- */
.card-image-wrapper {
  width: 100%;
  height: 350px;
  overflow: hidden;
  position: relative;
}

/* Combined rules for images in BOTH card types */
.card-image-wrapper img,
.leader-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity;
}

/* Image START State (Default) */
.img-casual {
  opacity: 1;
}
.img-formal {
  opacity: 0;
}

/* --- 2.3. The Text Descriptions (SMOOTH - NO POSITION CHANGE) --- */
.core-team-section .card-content {
  padding: 1.5rem;
  min-height: 190px; /* This helps keep cards the same size */
  display: flex;
  flex-direction: column;
  position: relative;
}

.core-team-section .card-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
}

.core-team-section .card-content .title {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 500;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Shared styles for both descriptions */
.core-team-section .desc-short,
.core-team-section .desc-detailed {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-top: 1rem;
  overflow: hidden; /* This is crucial for max-height */
  transition: opacity 0.3s ease-out 0.1s, max-height 0.5s ease-out;
  will-change: opacity, max-height; /* Performance hint */
}

/* Default (non-hover) state */
.core-team-section .desc-short {
  opacity: 1;
  max-height: 100px; /* Enough space for 3-4 lines */
}

.core-team-section .desc-detailed {
  opacity: 0;
  max-height: 0;
}

.core-team-section .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border-dark);
  padding-top: 1rem;
  margin-top: auto;
}

/* --- Shared Tag Style (Works on light or dark) --- */
.tag {
  background-color: rgba(249, 168, 37, 0.1);
  color: var(--gold-darker);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* =================================== */
/* ==== RESPONSIVE MEDIA QUERIES ==== */
/* =================================== */

/* --- 1. DESKTOP-ONLY INTERACTIONS (Hover) --- */
@media (min-width: 769px) {
  /* --- Desktop Header --- */
  .bg-img {
    display: block;
  }
  .mobile-bg {
    display: none;
  }
  .navbar {
    grid-template-columns: auto 1fr auto;
    gap: 3rem;
    padding: 2rem 3rem;
  }
  .logo {
    height: 150px;
  }
  .header.scrolled .logo {
    height: 100px;
  }
  .hamburger-btn,
  .nav-menu-mobile {
    display: none;
  }
  .nav-links-desktop {
    display: flex;
    justify-content: center;
    gap: 3rem;
    grid-column: 2;
  }
  .nav-links-desktop a {
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
  }
  .nav-links-desktop a::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
  }
  .nav-links-desktop a:hover {
    color: var(--gold);
  }
  .nav-links-desktop a.active {
    color: var(--gold);
  }
  .nav-links-desktop a.active::after,
  .nav-links-desktop a:hover::after {
    width: 100%;
  }
  .btn-nav-desktop {
    display: inline-block;
    grid-column: 3;
    z-index: 1;
  }
  .hero-content h1 {
    font-size: 5.5rem;
  }
  .hero-content p {
    font-size: 1.25rem;
    max-width: 48rem;
  }
  .navbar .btn-nav-desktop {
    display: inline-block;
    grid-column: 3;
  }

  /* --- Desktop Card Hovers --- */
  .leader-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--gold);
  }
  .core-team-section .team-card:hover {
    transform: translateY(-10px);
    border-color: var(--gold);
    background-color: var(--medium-gray);
  }

  /* Image hover */
  .core-team-section .team-card:hover .img-casual,
  .leadership-section .leader-card:hover .img-casual {
    opacity: 0;
  }
  .core-team-section .team-card:hover .img-formal,
  .leadership-section .leader-card:hover .img-formal {
    opacity: 1;
  }

  /* Text description hover */
  .core-team-section .team-card:hover .desc-short {
    opacity: 0;
    max-height: 0;
    transition: opacity 0.2s ease-in, max-height 0.4s ease-in;
  }
  .core-team-section .team-card:hover .desc-detailed {
    opacity: 1;
    max-height: 500px; /* Generous space to expand into */
  }
}

/* --- 2. TABLET & MOBILE RESPONSIVENESS (Layout) --- */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet-specific header/hero */
  .logo {
    height: 120px;
  }
  .header.scrolled .logo {
    height: 95px;
  }
  .hero-content h1 {
    font-size: 4.5rem;
  }
  .hero-content p {
    font-size: 1.1rem;
    max-width: 42rem;
  }
  .nav-links-desktop,
  .navbar .btn-nav-desktop {
    display: none; /* Keep mobile menu for tablets */
  }
}

@media (max-width: 992px) {
  /* Stack leadership cards on tablets */
  .leadership-grid {
    grid-template-columns: 1fr;
  }
}

/* --- 3. MOBILE-ONLY INTERACTIONS (Tap) --- */
@media (max-width: 768px) {
  .leadership-section,
  .core-team-section {
    padding: 4rem 1rem;
  }
  .team-intro h2 {
    font-size: 2rem;
  }
  .team-intro p {
    font-size: 1rem;
  }

  /* Stack leader card image and text */
  .leader-card {
    grid-template-columns: 1fr;
  }
  .leader-image {
    height: 350px; /* Give image a fixed height on mobile */
  }
  .leader-content {
    padding: 2rem;
  }
  .team-grid {
    grid-template-columns: 1fr; /* Stack core team on small screens */
  }

  /* --- START: Mobile Interaction --- */

  /* 1. Show detailed description by default */
  .core-team-section .card-content {
    min-height: auto; /* Remove min-height */
  }
  .core-team-section .desc-short {
    display: none; /* Hide short desc */
  }
  .core-team-section .desc-detailed {
    opacity: 1;
    max-height: 500px; /* Show detailed desc */
    position: relative;
    top: 0;
    left: 0;
    right: 0;
  }

  /* 2. Add .is-flipped (JS tap) image flip */
  /* This is activated by the JavaScript */
  .leader-card.is-flipped .img-casual,
  .team-card.is-flipped .img-casual {
    opacity: 0;
  }
  .leader-card.is-flipped .img-formal,
  .team-card.is-flipped .img-formal {
    opacity: 1;
  }
  /* --- END: Mobile Interaction --- */
}