@font-face {
  font-family: "NCL Gasdrifo Demo";
  font-style: normal;
  font-weight: normal;
  src: local("NCL Gasdrifo Demo"),
    url("../Fonts/NCLGasdrifo-Demo-BF6530ab3288d01.woff") format("woff");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Montserrat", sans-serif;
}

@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

:root {
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.141 0.005 285.823);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.141 0.005 285.823);
  --primary: oklch(0.21 0.006 285.885);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.967 0.001 286.375);
  --muted-foreground: oklch(0.552 0.016 285.938);
  --accent: oklch(0.967 0.001 286.375);
  --accent-foreground: oklch(0.21 0.006 285.885);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(0.577 0.245 27.325);
  --border: oklch(0.92 0.004 286.32);
  --input: oklch(0.92 0.004 286.32);
  --ring: oklch(0.705 0.015 286.067);
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.141 0.005 285.823);
}

.dark {
  --background: oklch(0.141 0.005 285.823);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.141 0.005 285.823);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.141 0.005 285.823);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.985 0 0);
  --primary-foreground: oklch(0.21 0.006 285.885);
  --secondary: oklch(0.274 0.006 286.033);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.274 0.006 286.033);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --accent: oklch(0.274 0.006 286.033);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.396 0.141 25.723);
  --destructive-foreground: oklch(0.637 0.237 25.331);
  --border: oklch(0.274 0.006 286.033);
  --input: oklch(0.274 0.006 286.033);
  --ring: oklch(0.442 0.017 285.786);
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);

  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}

html {
  color-scheme: light dark;
}
html.dark {
  color-scheme: dark;
}
html.light {
  color-scheme: light;
}

:root {
  --dep-photo-size: 140px; /* default size for member photos */
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  overflow-x: hidden;
}

.home {
  position: relative;
  width: 100%;
  height: 100vh;
  background: url("../IMG/Background.png") no-repeat center center/cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4); /* Dark overlay */
  z-index: 0;
}

.style-1 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
}

.wave-text span {
  text-align: center;
  justify-content: center;
  align-items: center;
  display: inline-block;
  font-size: 12rem;
  animation: wave 2s ease-in-out infinite;
  font-family: "NCL Gasdrifo Demo", "Montserrat", sans-serif;
}

.wave-text span:nth-child(1) {
  animation-delay: 0s;
}
.wave-text span:nth-child(2) {
  animation-delay: 0.2s;
}
.wave-text span:nth-child(3) {
  animation-delay: 0.4s;
}
.wave-text span:nth-child(4) {
  animation-delay: 0.6s;
}
.wave-text span:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes wave {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Split the mission-achievements area into two equal sections
   so `.mission` and `.achievements` can hold independent content */
.mission,
.achievements {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 3rem;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4); /* Dark overlay */
  z-index: 0;
}

.hero-section {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Logo */
.logo-container {
  position: absolute;
  margin-bottom: 25%;
  z-index: 3;
  width: 40%; /* Adjust size */
  text-align: center;
}

.main-logo {
  width: 100%;
  height: auto;
}

/* Paper Strip and Title */
.paper-strip-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  overflow: hidden;
}

.paper-strip {
  width: 100%;
  height: auto;
  transform: rotate(-2deg); /* Slight tilt */
  pointer-events: none;
}

.main-title {
  font-family: "Montserrat", sans-serif !important;
  font-size: 14rem; /* Large text */
  color: #ebf4dd;
  position: absolute;
  text-align: center;
  justify-self: center;
  align-self: center;
  z-index: 3;
  letter-spacing: 5px;
  text-shadow: 0px 0px 20px rgba(0, 0, 0, 0.8);
  width: 100%;
}

.main-title span {
  font-family: "Montserrat", sans-serif !important;
  text-align: center;
  align-self: center;
  justify-self: center;
}

/* Books */
.books-container {
  position: absolute;
  top: 20%;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* Behind paper strip */
  /* overflow: hidden; */
}

.notebook {
  position: absolute;
  width: 200px; /* Adjust size */
  height: auto;
}

.notebook-left {
  left: 15%;
  transform: rotate(-15deg);
}

.notebook:nth-child(2) {
  left: 10%;
  transform: rotate(-30deg);
}

.notebook-right {
  right: 15%;
  top: -50px;
  transform: rotate(15deg);
}

.notebook:nth-child(4) {
  right: 10%;
  transform: rotate(30deg);
}

/* Navbar */
.navbar {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px; /* Space between pill and hamburger */
  opacity: 1;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 280ms ease;
  will-change: transform, opacity;
  pointer-events: none; /* Container itself doesn't block */
}

.navbar > * {
  pointer-events: auto; /* Children should be interactive */
}

/* hide mobile hamburger by default; shown only in mobile media query */
.mobile-hamburger-wrapper {
  display: none;
}

.navlist {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 40px;
  background: rgba(105, 105, 105, 0.4); /* Dark paper-like pill */
  backdrop-filter: blur(10px);
  padding: 25px 10px;
  padding-right: 20px;
  border-radius: 999px;
  border: 1px solid rgba(125, 125, 125, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.navlist li a {
  font-size: 1.3rem;
  text-decoration: none;
  color: white;
  letter-spacing: 1px;
}

/* Smooth transition when nav active background changes */
.navlist li a,
.navlist-top li a {
  transition: background-color 700ms cubic-bezier(0.2, 0.9, 0.2, 1),
    color 500ms ease, padding 700ms cubic-bezier(0.2, 0.9, 0.2, 1),
    border-radius 700ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* Active style for bottom nav (matches top active) */
.navlist li a.active {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 16px 20px;
  border-radius: 999px;
}

/* Top centered navbar (single clean definition) */
.navbar-top {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -20px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 6px 28px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  width: 100vw;
  height: 100px;
  opacity: 0;
  transition: transform 360ms cubic-bezier(0.2, 0.9, 0.2, 1), opacity 280ms ease;
  will-change: transform, opacity;
  z-index: 999;
}

.navlist-top {
  list-style: none;
  display: flex;
  gap: 40px;
  align-items: center;
}

.navlist-top li a {
  font-family: "Montserrat", sans-serif;
  font-size: 1.6rem;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  letter-spacing: 2px;
  padding: 6px 10px;
}

.navlist-top li a.active {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 8px 20px;
  border-radius: 999px;
}

.login-pill {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  padding: 14px 24px;
  border-radius: 999px 0px 0px 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
  transition: background 0.3s ease;
}

.login-pill:hover {
  background: rgba(0, 0, 0, 0.6);
}

.login-btn {
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: 2px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
}

.caret {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* When body has .in-about, show top nav and hide bottom nav */
/* When body has .in-about, animate top nav in and bottom nav out */
body.in-about .navbar-top {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

body.in-about .navbar {
  transform: translateX(-50%) translateY(30px);
  opacity: 0;
  pointer-events: none;
}

.navbar-hamburger {
  position: relative;
  display: flex;
  align-items: center;
}

.hamburger-btn {
  width: 60px;
  height: 60px;
  border-radius: 60px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.hamburger-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.hamburger-btn span {
  display: block;
  width: 28px;
  height: 2px;
  background: white;
  transition: all 0.3s ease;
}

.hamburger-dropdown {
  position: absolute;
  bottom: calc(100% + 20px);
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
  min-width: 160px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.hamburger-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hamburger-dropdown a {
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 1rem;
  letter-spacing: 1px;
  transition: background 0.3s ease;
  text-align: center;
}

.hamburger-dropdown a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* About Section */
.about {
  position: relative;
  height: 100vh;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  background-color: black;
}

.about::before {
  content: "";
  opacity: 0.4;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../IMG/NOTEBOOKS.jpg") no-repeat center center/cover;
  filter: blur(6px);
}

.about h1 {
  position: absolute;
  font-family: "NCL Gasdrifo Demo", sans-serif;
  font-size: 14rem;
  z-index: 2;
  color: white;
  margin-top: 4%;
  justify-self: center;
  text-align: center;

  text-shadow: 0 0 5px #fff, /* subtle inner white glow */ 0 0 10px rgb(0, 0, 0),
    /* brighter outer teal glow */ 0 0 20px rgb(255, 255, 255);
}

.about img {
  position: absolute;
  width: 100vw;
  height: auto;
  margin-top: 4%;
  align-self: center;
  justify-self: center;
  transform: translateX(-50%);
}

.about p {
  position: absolute;
  z-index: 2;
  margin: 0 auto;
  margin-top: 20%;
  text-align: center;
  justify-self: center;
  width: 60%;
  font-size: 1.6rem;
  line-height: 1.4;
  color: #000000;
}

.mission-achievements {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  /* align-items: center; */
  width: 100%;
  height: 200vh;
  min-height: 300px;
  background-color: #000000;
}

.mission-achievements::before {
  content: "";
  width: 100%;
  height: 100%;
  opacity: 0.6;
  background-image: url(../IMG/NOTEBOOKS.jpg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(20px);
  z-index: 0;
}

.mission-achievements img:last-child {
  position: absolute;
  bottom: 0;
  min-width: 100%;
  max-width: 150%;
  height: auto;
  z-index: 1;
}

.mission,
.achievements {
  position: relative;
  height: 100vh;
  width: 100vw;
  top: 0;
  z-index: 20;
  /* background: white; */
}

.mission:nth-child(1) {
  position: absolute;
  z-index: 2;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.mission {
  display: flex;
  flex-direction: column;

  margin-top: 15%;
}

.mission-heading {
  font-family: "NCL Gasdrifo Demo", sans-serif;
  font-size: 15rem;
  margin-bottom: 20%;
  text-align: center;
  color: white;
  text-shadow: white 0 0 40px;
}

.mission-content {
  display: flex;
  flex-direction: row;
  align-items: center;

  justify-content: center;
  gap: 50px;
  padding: 0 5%;
  margin-bottom: 10%;

  background: linear-gradient(to bottom, #ffffffdd, #f0f0f000 80%);
  border-radius: 40px;
  padding: 20px;
}

.mission-text h1,
.mission-text p:nth-child(1) {
  font-size: 3.2rem;
  /* margin-bottom: 20px; */
  color: #333;
  font-weight: 400;
}

.mission-text p:nth-child(3) {
  font-size: 1.4rem;
  line-height: 1.4;
  color: #555;
}

.mission-content img {
  width: 400px;
  height: auto;
  margin-right: 50px;
  background-blend-mode: multiply;
}

.achievements {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 0;
  /* top: 0; */
  bottom: 0;
}

.achievements h1 {
  font-family: "NCL Gasdrifo Demo", sans-serif;
  font-size: 10rem;
  text-align: center;
  color: white;
  text-shadow: white 0 0 40px;
}

/* Achievements grid: 3 items per row, wraps for additional items */
.achievements-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4%;
  width: 100%;
  max-width: 70vw;
  margin: 2rem auto 0;
  align-items: start;
  transform-style: preserve-3d; /* Enable 3D transforms for children */
  perspective: 1000px; /* Set perspective for 3D effects */
}

.achievement {
  background: rgba(255, 255, 255, 0.06);
  min-height: 400px;
  border-radius: 40px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 1rem;
  transform-style: preserve-3d; /* Enable 3D transforms */
  backface-visibility: hidden; /* Prevent flickering */
}

/* Responsive: switch to auto-fit for smaller viewports */
@media (max-width: 900px) {
  .achievements-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
  }
}

/* Responsive Adjustments */
@media (max-width: 1100px) {
  .navlist-top {
    gap: 36px;
  }
  .navlist-top li a {
    font-size: 1.4rem;
  }
  .login-pill {
    right: -90px;
    padding: 10px 18px;
  }
}

@media (max-width: 768px) {
  .main-title {
    font-size: 4rem;
  }

  .notebook {
    width: 120px;
  }

  .navbar {
    width: 90%;
    padding: 10px 20px;
    justify-content: space-between;
  }

  .menu-icon {
    margin-left: 0;
  }

  .navbar-top {
    top: 20px;
    padding: 6px 12px;
  }
  .navlist-top {
    gap: 18px;
  }
  .navlist-top li a {
    font-size: 1rem;
    letter-spacing: 2px;
  }
  .login-pill {
    display: none;
  }
}

/* Desktop: ensure mobile overlay and hamburger are hidden and desktop nav visible */
@media (min-width: 769px) {
  .mobile-nav-overlay {
    display: none !important;
  }
  .mobile-hamburger-wrapper {
    display: none !important;
  }
  /* ensure desktop navbars are visible */
  .navbar,
  .navbar-top {
    display: flex !important;
  }
  .navlist,
  .navlist-top {
    display: flex !important;
  }
}

/* Team section */
.team {
  position: relative;
  padding: 6rem 0 8rem;
  overflow: visible;
  background: transparent;
  width: 100vw;
}

.team-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  top: 0;
  pointer-events: none;
  width: 100vw;
  height: 100%;
}

.team-paper {
  position: absolute;
  width: 100vw;
  height: 100vh;
  /* object-fit: cover; */
  opacity: 1;
  top: 0;
  left: 0;
  z-index: 0;
  filter: none;
}

.team-vector {
  position: absolute;
  width: 100vw;
  /* max-width: 1100px; */
  /* right: 4%; */
  /* top: -6%; */
  margin-top: 10%;
  z-index: 1;
  pointer-events: none;
}

.team-container {
  position: relative;
  z-index: 5;
  width: 92%;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.team-title {
  font-family: "NCL Gasdrifo Demo", sans-serif;
  font-size: 8rem;
  color: #fff;
  text-align: center;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.9);
  margin-top: 1rem;
}

.department-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 40px;
  padding: 2% 2% 18%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  position: relative;
}

.department-pill {
  position: absolute;
  left: 2rem;
  top: 14%;
  transform: translateY(-50%);
  background: #f1ecec;
  border: 0;
  padding: 2% 2%;
  border-radius: 1000px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  font-size: 1rem;
  cursor: pointer;
}

.dept-caret {
  margin-left: 10px;
  opacity: 0.7;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.member-card {
  background: rgba(0, 0, 0, 0.03);
  height: 250%;
  top: 0;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.member-photo {
  width: 82px;
  height: 82px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
}

.member-name {
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #222;
}

/* Empty department placeholder height */
.members-grid.empty {
  min-height: 160px;
}

.department-solo .dep-photo,
.department-solo img {
  width: var(--dep-photo-size) !important;
  height: var(--dep-photo-size) !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background-size: cover; /* for background-image divs */
  background-position: center;
  border-radius: 50% !important;
  display: block !important;
  margin: 0 auto;
  overflow: hidden;
}

/* center everything horizontally inside each department-solo (keeps existing heights/widths) */
.department-solo {
  display: flex; /* already used, but ensure column layout centers children */
  flex-direction: column;
  align-items: center; /* horizontal center */
  text-align: center;
}

/* ensure member blocks stack centre and don't force extra width changes */
.department-solo .department-member {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

/* keep per-member card layout but center contents and make cards wider */
.department-solo .dep-mem {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 12px;
  width: 100%;
  max-width: calc(
    var(--dep-photo-size) + 80px
  ); /* cap width so cards remain uniform */
  box-sizing: border-box;
  gap: 8px;
}

/* Force h1/h2 to remain on a single line and truncate if too long */
.department-solo .dep-mem h1,
.department-solo .dep-mem h2 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(
    var(--dep-photo-size) + 72px
  ); /* keep title within the visual card width */
  color: black;
}

/* Make department names fully visible: allow wrapping and use full card width */
.department-solo .dep-mem h1,
.department-solo .dep-mem h2 {
  white-space: normal; /* allow wrapping instead of truncation */
  overflow: visible; /* ensure not clipped */
  text-overflow: clip;
  width: 100%; /* fill the available card width */
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 6px; /* small horizontal padding so text doesn't touch edges */
  word-break: break-word; /* break long words if needed */
  hyphens: auto;
  text-align: center; /* center align to match layout */
  line-height: 1.15;
}

.department {
  position: relative;
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  background: url("../IMG/DEPARTMENT BACKGROUND.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  /* prevent the page from scrolling when the inner pane scrolls */
  overflow: hidden;
}

.department::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #1d3e15;
  /* linear-gradient(to bottom, #1d3e15, rgba(0, 128, 255, 0.2)); */
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  z-index: 0;
  pointer-events: none; /* Prevent interaction */
}

/* scrolling container inside .department */
.department-content {
  z-index: 2;
  width: 90%;
  height: 80vh; /* use viewport height so inner scroll is fixed to the pane */
  max-height: calc(100vh - 120px); /* reserve space for header/margins */
  margin-top: 20px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 30px;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  box-sizing: border-box;
  min-width: 0; /* allow children to shrink properly */

  /* make the content scrollable but keep scrolling contained */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  overscroll-behavior: contain; /* prevents the page from receiving scroll when at the edges */

  /* optional: snap children vertically */
  /* scroll-snap-type: y proximity; */
  gap: 20px;

  position: relative;
  box-shadow: 5px 5px 20px;
}

.department-heading {
  position: absolute;
  top: 0;
  left: 0;
  margin-top: 4%;
  margin-left: 8%;
  height: 10%;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;

  /* translucent background so backdrop-filter can blur content behind */
  background-color: rgba(61, 116, 89, 0.35);

  /* blur whatever is behind this element */
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);

  /* allow the box to size reliably and avoid overflow issues */
  box-sizing: border-box;
  padding: 8px 24px;
  pointer-events: auto;
}

/* keep pseudo-element only if you want an extra tint; don't reapply backdrop-filter here */
.department-heading::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(
    61,
    116,
    89,
    0
  ); /* transparent tint; change alpha if you want stronger color */
  z-index: -1;
  pointer-events: none;
}

.department-heading h1 {
  font-size: 50px;
  font-weight: 800;
  color: white;
  padding: 0 40px;

  z-index: 2;
}

/* Ensure child panels don't stretch and snap correctly */
.department-solo {
  flex: 0 0 auto; /* prevent children from growing/shrinking */
  width: 90%;
  scroll-snap-align: start; /* snap each department into view */
}

/* Small, minimal custom scrollbar (optional) */
.department-content::-webkit-scrollbar {
  width: 10px;
}
.department-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}
.department-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.department-solo {
  width: 90%;
  height: auto;
  background-color: rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  /* align-items: center; */
  justify-content: center;
  border-radius: 40px;
  padding: 20px 0;
}

.solo-dep-heading {
  display: flex;
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: rgba(61, 116, 89, 0.8);
  height: 80px;
  min-width: 20%;
  max-width: 65%;
  margin-top: 0.2%;
  margin-left: 1.5%;
  box-sizing: border-box;
  pointer-events: auto;
  border-radius: 100px;
}

.solo-dep-heading h1 {
  font-size: 35px;
  font-weight: 800;
  color: white;
  padding: 0 20px;
  box-sizing: border-box;

  pointer-events: auto;
}

.department-1 {
  margin-top: 4%; /* small gap above the section */
}

.department-member {
  width: 100%;
  height: auto;
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(calc(var(--dep-photo-size) + 40px), 1fr)
  );
  gap: 24px;
  align-items: start;
  justify-items: center;
  margin-top: 20px;
}

.dep-mem {
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  width: 100%;
  max-width: calc(var(--dep-photo-size) + 80px);
  box-sizing: border-box;
}

.dep-mem h1 {
  font-size: 30px;
  font-weight: 800;
  color: black;
  margin-bottom: 10px;
}

/* Collapsible bio shown when member card is expanded */
.dep-mem .member-bio {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 360ms ease, opacity 240ms ease, padding 200ms ease;
  padding: 0 8px;
  color: white;
  font-size: 0.95rem;
  line-height: 1.4;
}

.dep-mem.expanded .member-bio {
  max-height: 400px; /* allow content to expand */
  opacity: 1;
  padding: 10px 8px 0 8px;
}

/* make the whole .dep-mem clickable and indicate it's interactive */
.dep-mem {
  cursor: pointer;
}
.dep-mem:focus {
  outline: 2px solid rgba(255, 255, 255, 0.12);
}

/* Fullscreen member modal/popout */

.member-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.member-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.65);
  z-index: 100;
  background-color: red;
  border-radius: 1000px;
}

.member-modal-close::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  opacity: 50%;
  filter: blur(2px);
  background-color: red;
  border-radius: 1000px;
  z-index: 0;
}

.member-modal-body {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 40px;
  width: 100%;
  box-sizing: border-box;
}

.member-modal-photo {
  width: calc(var(--dep-photo-size) * 1.8);
  height: calc(var(--dep-photo-size) * 1.8);
  object-fit: cover;
  border-radius: 1000px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  transform: scale(0.98);
  transition: transform 260ms ease;
}

.member-modal .member-modal-info {
  max-width: 780px;
}
.member-modal-name {
  font-size: 3rem;
  margin: 0 0 6px 0;
}
.member-modal-title {
  font-size: 1.15rem;
  color: #555;
  margin: 0 0 12px 0;
}
.member-modal-bio {
  font-size: 1rem;
  line-height: 1.6;
  color: #222;
}

.member-modal.open .member-modal-photo,
.member-modal.open .member-modal-name {
  transform: scale(1);
}

/* Prevent body scroll while modal open */
body.member-modal-open {
  overflow: hidden;
  height: 20px;
}

/* Member Modal Styles */
.member-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.member-modal-overlay.modal-open {
  display: flex;
  opacity: 1;
}

.member-modal-content {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  padding: 20px;
  margin: 20px;
}

.member-modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px) saturate(1.1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  border-radius: 10px;
  z-index: -1;
}

.member-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 30px;
  cursor: pointer;
  color: #333;
  z-index: 1001;
}

.member-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.member-modal-photo {
  margin-bottom: 20px;
}

.member-modal-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.member-modal-details h1 {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: #333;
}

.member-modal-details h2 {
  font-size: 1rem;
  color: #666;
  margin-bottom: 15px;
  font-weight: normal;
}

.member-modal-bio {
  max-width: 100%;
}

.member-modal-bio p {
  line-height: 1.6;
  color: #555;
}

.member-modal-content {
  border-radius: 30px !important;
}

/* --- Gallery Grid & Modal Styles --- */
.gallery {
  position: relative;
  padding: 3.5rem 1rem;
  background: linear-gradient(180deg, #153805f3 0%, #fbfbfb 100%);
}

.gallery-heading {
  font-family: "Montserrat", sans-serif;
  font-size: 100px;
  text-align: center;
  margin-bottom: 0.25rem;
  color: white;
}

.gallery-intro {
  text-align: center;
  color: #666;
  margin-bottom: 1.5rem;
}

.gallery-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem 1.25rem;
  align-items: start;
}

.gallery-item {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(12, 20, 30, 0.06);
  transition: transform 220ms ease, box-shadow 220ms ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-item:focus {
  outline: 3px solid rgba(34, 150, 243, 0.18);
  transform: translateY(-4px);
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(12, 20, 30, 0.12);
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  color: #222;
  background: #fafafa;
}

/* Gallery modal */
.gallery-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1200;
  padding: 2rem;
}

.gallery-modal-overlay.modal-open {
  display: flex;
}

.gallery-modal-content {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 22px 60px rgba(2, 8, 23, 0.35);
  position: relative;
  display: flex;
  gap: 1rem;
  padding: 1rem;
}

.gallery-modal-photo img {
  width: 360px;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.gallery-modal-details {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.gallery-modal-details h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.15rem;
}

.gallery-modal-desc {
  color: #444;
  line-height: 1.45;
}

.gallery-modal-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}

/* --- Contact section styles --- */
.contact {
  position: relative;
  padding: 3rem 1rem;
  background: linear-gradient(180deg, #fff 0%, #fcfcfd 100%);
}
.contact-inner {
  max-width: 1000px;
  margin: 0 auto;
}
.contact-heading {
  text-align: center;
  margin-bottom: 0.25rem;
}
.contact-lead {
  text-align: center;
  color: #666;
  margin-bottom: 1.25rem;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
.contact-form {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(12, 20, 30, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.contact-form label {
  font-size: 0.9rem;
  color: #333;
}
.contact-form input,
.contact-form textarea {
  border: 1px solid #e6e6e8;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #22a0ff;
  box-shadow: 0 6px 20px rgba(34, 160, 255, 0.06);
}
.contact-submit {
  margin-top: 0.25rem;
  padding: 0.7rem 1rem;
  background: #22a0ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.contact-submit:hover {
  filter: brightness(0.98);
}
.contact-info {
  background: transparent;
  padding: 0.75rem 1rem;
}
.contact-info h2 {
  margin-top: 0;
}
.contact-info a {
  color: #1678d6;
  text-decoration: none;
}

@media (max-width: 880px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .contact-info {
    order: 2;
  }
}

@media (max-width: 820px) {
  .gallery-item img {
    height: 160px;
  }
  .gallery-modal-content {
    flex-direction: column;
    align-items: stretch;
  }
  .gallery-modal-photo img {
    width: 100%;
    height: 220px;
  }
}

@media (max-width: 900px) {
  .member-modal-body {
    flex-direction: column;
    padding: 28px;
  }
  .member-modal-photo {
    width: calc(var(--dep-photo-size) * 1.4);
    height: calc(var(--dep-photo-size) * 1.4);
  }
  .member-modal-name {
    font-size: 2rem;
  }
}

/* Make member photos circular (both background divs and <img> tags) */
.dep-mem .dep-photo,
.dep-mem img {
  width: 100%;
  aspect-ratio: 1 / 1; /* keep square shape */
  height: auto;
  object-fit: cover; /* crop nicely for <img> */
  background-size: cover; /* for background-image divs */
  background-position: center;
  border-radius: 50%; /* make circle */
  overflow: hidden;
  display: block !important; /* ensure visible if previously hidden */
}

.department-member h2 {
  color: white;
  font-size: 20px;
  font-weight: 200;
}

.dep-top-right {
  position: absolute;
  top: 0;
  right: 0;
  height: auto;
}

.dep-bottom-left {
  position: absolute;
  bottom: 0;
  left: 0;
  height: auto;
}

@media (max-width: 900px) {
  .team-vector {
    width: 90%;
    right: -6%;
    top: -10%;
  }
  .team-title {
    font-size: 5rem;
  }
  .members-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  .department-card {
    padding: 1.5rem;
    border-radius: 20px;
  }
}

/* Mobile hamburger & full-screen nav overlay (only active on small screens) */
@media (max-width: 768px) {
  /* Hide desktop navbars on mobile; use separate hamburger instead */
  .navbar,
  .navbar-top {
    display: none !important;
  }
  .navlist {
    display: none !important;
  }

  .mobile-hamburger-wrapper {
    display: flex;
    position: fixed;
    top: 16px;
    left: 18px;
    z-index: 10060;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
  }
  .nav-toggle .hamburger {
    display: inline-block;
    width: 22px;
    height: 16px;
    position: relative;
  }
  .nav-toggle .hamburger span {
    display: block;
    height: 2px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
    transition: transform 220ms ease, opacity 160ms ease;
  }

  .about-heading {
    font-size: 4rem !important;
    color: black;
  }

  /* overlay */
  .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
  }
  .mobile-nav-overlay.open {
    display: flex;
  }

  .mobile-nav {
    background: transparent;
    padding: 30px;
    text-align: center;
  }
  .mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .mobile-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 2rem;
    font-weight: 700;
    padding: 8px 12px;
    display: inline-block;
  }

  /* animate hamburger into an X when mobile nav is open; use body class set by JS */
  body.mobile-nav-open {
    overflow: hidden;
  }
  .mobile-hamburger-wrapper .hamburger span {
    transition: transform 200ms ease, opacity 150ms ease;
  }
  body.mobile-nav-open .mobile-hamburger-wrapper .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  body.mobile-nav-open .mobile-hamburger-wrapper .hamburger span:nth-child(2) {
    opacity: 0;
  }
  body.mobile-nav-open .mobile-hamburger-wrapper .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  /* make overlay nav full-screen scrollable content on small devices */
  .mobile-nav {
    width: 100%;
    max-width: 920px;
  }
  .mobile-nav ul li a {
    font-size: clamp(1.6rem, 6vw, 2.2rem);
  }

  /* Ensure .navbar remains visible and hamburger is shown */
  .navbar {
    justify-content: space-between;
    padding: 10px 16px;
  }
  .navbar .nav-toggle {
    margin-left: auto;
  }

  .mission-achievements img:last-child {
    max-width: 100vw;
  }

  .gallery-heading {
    font-size: 5rem !important;
    text-align: center;
    justify-content: center;
  }

  .contact-heading {
    color: black;
    font-size: 4rem !important;
  }
}

/* Navbar Hamburger styles */
