/* ==========================================================
 * COMPONENTS
 * Navigation, hero, sections, cards, grids, carousel, etc.
 * ========================================================== */

/* Base / resets that are component-adjacent */
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  font-family: "Outfit", sans-serif;
  color: var(--color-text-light);
  background: var(--color-dark-bg);
  overflow-x: hidden;
  position: relative;
}

/* Smoothly animatable custom property for navbar link gradient strength */
@property --nav-link-grad-alpha {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}
section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.section-title {
  text-align: center;
  margin-bottom: 30px;
}
h1,
h2,
h3,
h4 {
  margin: 0;
}
p {
  margin: 0 0 20px;
  line-height: 1.6;
  color: var(--color-text-medium);
}

/* Gradient text helpers */
.blue-gradient-text,
h4,
a {
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradientAnimation 5s ease infinite;
}
h1,
h2,
h3,
span {
  background: linear-gradient(90deg, var(--color-text-light), #999999);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Reveal utility */
.reveal {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* Directional reveal variants (used for grids like team cards) */
.reveal.reveal-left {
  transform: translateX(-40px) scale(0.96);
}
.reveal.reveal-right {
  transform: translateX(40px) scale(0.96);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Glass cards */
.interactive-card,
.project-card,
.stat-item,
.timeline-item,
.faq-item,
.team-card {
  border-radius: 15px;
  transform-style: preserve-3d;
  background: linear-gradient(
    135deg,
    var(--glass-card-bg-start),
    var(--glass-card-bg-end)
  );
  border: 1px solid var(--glass-border-color);
  backdrop-filter: var(--card-blur-filter);
  -webkit-backdrop-filter: var(--card-blur-filter);
  box-shadow: 0 0 0 1px var(--glass-inset-shadow) inset,
    0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s;
}
.interactive-card:hover,
.stat-item:hover,
.timeline-item:hover,
.faq-item:hover,
.team-card:hover {
  transform: translateY(-8px) rotateX(1deg) rotateY(-1deg) scale(1.01);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-primary);
}

/* Nav */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  background: var(--nav-glass-bg);
  backdrop-filter: var(--nav-blur-filter);
  -webkit-backdrop-filter: var(--nav-blur-filter);
  border-bottom: 1px solid var(--glass-border-color);
}
/* Inner pill container */
.nav-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand links cta";
  align-items: center;
  gap: 24px;
  width: min(1100px, 92vw);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border-color);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.005)
  );
  box-shadow: 0 0 0 1px var(--glass-inset-shadow) inset,
    0 8px 24px rgba(0, 0, 0, 0.28);
}

.nav-toggle {
  display: none; /* desktop hidden */
  grid-area: cta; /* position near right edge on mobile */
  appearance: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border-color);
  border-radius: 999px;
  margin-right: 14px;
  padding: 8px;
  color: var(--color-text-light);
  cursor: pointer;
}
.nav-toggle:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary) inset;
}

.nav-brand {
  grid-area: brand;
  text-decoration: none;
  font-weight: 700;
  padding: 10px 10px 8px 14px;
  border-radius: 999px;
  color: var(--color-text-light);
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.nav-links {
  grid-area: links;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0 10px;
}
.nav-links a {
  /* Base: text appears as solid light color using a stacked background clipped to text */
  --nav-link-grad-alpha: 0;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 999px;
  background-image: linear-gradient(
      135deg,
      rgba(41, 79, 151, var(--nav-link-grad-alpha)),
      rgba(107, 202, 232, var(--nav-link-grad-alpha))
    ),
    linear-gradient(0deg, var(--color-text-light), var(--color-text-light));
  background-size: 200% 200%, 100% 100%;
  background-position: 0% 50%, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; /* reveal backgrounds through text */
  transition: --nav-link-grad-alpha 0.35s ease, background-position 0.5s ease,
    transform 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active-link {
  --nav-link-grad-alpha: 1;
  background-position: 100% 50%, 0 0; /* subtle sweep */
  animation: gradientAnimation 5s ease infinite;
  transform: translateY(-1px);
}

.nav-cta {
  grid-area: cta;
  text-decoration: none;
  color: var(--color-text-light) !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  animation: none !important;
  border: 1px solid var(--glass-border-color);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 1px var(--glass-inset-shadow) inset;
  transition: border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.2s ease;
}
.nav-cta:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary) inset,
    0 0 12px var(--color-primary);
  transform: translateY(-1px);
}

/* Mobile dropdown behavior */
@media (max-width: 768px) {
  /* page overlay for open menu */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease-out;
  }
  .nav-container.open ~ .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .nav-cta {
    display: none;
  } /* hide desktop CTA */
  .nav-links {
    position: fixed;
    top: 82px; /* a bit lower for clear separation */
    left: 50%;
    transform: translateX(-50%);
    margin: 0 auto;
    width: min(560px, calc(100% - 24px));
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: none; /* hidden by default */
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
    z-index: 1000;
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
  }
  .nav-container {
    position: relative;
  }
  .nav-container.open .nav-links {
    display: flex;
    animation: navDropIn 200ms ease-out;
  }
  .nav-links .mobile-only {
    display: block;
    width: 100%;
    text-align: center;
  }
}

@keyframes navDropIn {
  from {
    opacity: 0;
    transform: translate(-50%, -8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 100px;
  padding-bottom: 100px;
  position: relative;
}
.hero h1 {
  font-size: 3em;
  margin-bottom: 20px;
  animation: continuousJump 2s ease-in-out infinite;
}
.hero p {
  font-size: 1.2em;
  max-width: 600px;
  margin-bottom: 40px;
  opacity: 0;
  animation: heroTextFade 1.2s ease-out forwards 0.5s;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}
.social-link {
  color: var(--color-text-light);
  font-size: 1.5rem;
  transition: transform 0.3s, color 0.3s;
}
.social-link:hover {
  transform: scale(1.3) rotate(5deg);
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradientAnimation 5s ease infinite;
}

/* Cinematic hero specifics */
.cinematic-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 10;
  padding: 0;
  margin: 0 auto;
  background: transparent;
  transition: opacity 0.8s cubic-bezier(0.77, 0, 0.18, 1),
    transform 1s cubic-bezier(0.77, 0, 0.18, 1);
}
.cinematic-hero .hero-overlay {
  position: absolute;
  inset: 0;
}
/* Base intro animation for the hero content on first load */
.cinematic-hero .hero-content {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  animation: heroContentIntro 1.5s cubic-bezier(0.77, 0, 0.18, 1) 0.7s forwards;
  box-sizing: border-box;
}

/* Stars canvas as fixed backdrop without causing horizontal overflow */
#starsCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
.cinematic-hero.hero-animate-in .hero-content {
  animation: heroContentIntro 1.5s cubic-bezier(0.77, 0, 0.18, 1) 0s forwards !important;
}
.cinematic-hero.hero-animate-in .hero-title {
  animation: heroTitleReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 0.4s forwards !important;
}
.cinematic-hero.hero-animate-in .hero-subtitle {
  animation: heroSubtitleReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 0.8s
    forwards !important;
}
.cinematic-hero.hero-animate-in .hero-desc {
  animation: heroDescReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.1s forwards !important;
}
.cinematic-hero.hero-animate-in .social-links {
  animation: heroSocialReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.4s forwards !important;
}
.cinematic-hero .social-links {
  opacity: 0;
  gap: 30px;
  margin-top: 0.5em;
  animation: heroSocialReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 2.3s forwards;
}
.cinematic-hero .hero-title {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.2em;
  color: var(--color-text-light);
  text-shadow: 0 8px 32px rgba(41, 79, 151, 0.25), 0 1px 0 #fff2;
  opacity: 0;
  animation: heroTitleReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.1s forwards;
}
.cinematic-hero .hero-subtitle {
  font-size: 2rem;
  font-weight: 400;
  color: var(--color-text-medium);
  margin-bottom: 1.2em;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: heroSubtitleReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.5s
    forwards;
}
.cinematic-hero .hero-desc {
  font-size: 1.25rem;
  color: var(--color-text-medium);
  margin-bottom: 2.2em;
  opacity: 0;
  animation: heroDescReveal 1.2s cubic-bezier(0.77, 0, 0.18, 1) 1.9s forwards;
}
body.hero-active {
  overflow: hidden;
}
.cinematic-hero.hero-out {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-80px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.77, 0, 0.18, 1),
    transform 1s cubic-bezier(0.77, 0, 0.18, 1);
}

/* About */
.about-me {
  padding: 0 40px 40px;
  margin-top: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 950px;
  margin-left: auto;
  margin-right: auto;
}
.about-card {
  flex: 2 1 420px;
  min-width: 320px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
}
.about-card .about-desc {
  padding: 38px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: none;
}
.about-card .about-desc p {
  margin-bottom: 18px;
  text-align: left;
  font-size: 1.1em;
}
.about-card .fun-fact {
  background: linear-gradient(
    90deg,
    rgba(107, 202, 232, 0.08),
    rgba(41, 79, 151, 0.08)
  );
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1em;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(41, 79, 151, 0.07);
  font-weight: 500;
  animation: funFactFadeIn 1.2s cubic-bezier(0.77, 0, 0.18, 1) 0.5s both;
}
.about-card .fun-fact i {
  font-size: 1.2em;
}
.about-card .fun-fact span {
  font-weight: 700;
  color: var(--color-text-light);
}
.about-skills-standalone {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: none !important;
  box-shadow: none !important;
  border: none !important;
}
.about-skills-standalone .skill-item {
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.about-skills-standalone .skill-item:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 0 10px var(--color-primary);
}
.about-skills {
  padding: 38px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
}
.about-skills h3 {
  margin-bottom: 18px;
  color: var(--color-primary);
  font-size: 1.3em;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px 24px;
  width: 100%;
}
.skill-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08em;
  color: var(--color-text-light);
  background: linear-gradient(
    90deg,
    rgba(107, 202, 232, 0.06),
    rgba(41, 79, 151, 0.06)
  );
  border-radius: 7px;
  padding: 8px 14px;
  box-shadow: 0 1px 4px rgba(41, 79, 151, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  opacity: 0;
  transform: translateY(20px);
}
.about-skills-standalone.reveal.active .skill-item {
  animation: skillFadeIn 0.7s cubic-bezier(0.77, 0, 0.18, 1) both;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(1) {
  animation-delay: 0.1s;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(2) {
  animation-delay: 0.25s;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(3) {
  animation-delay: 0.4s;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(4) {
  animation-delay: 0.55s;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(5) {
  animation-delay: 0.7s;
}
.about-skills-standalone.reveal.active .skill-item:nth-child(6) {
  animation-delay: 0.85s;
}
.skill-item i {
  font-size: 1.3em;
  color: var(--color-primary);
}
.skill-item span {
  font-weight: 500;
}

/* --- Skills Grid (About Me only) — square card variant (final override) --- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 22px;
  justify-items: center;
  align-items: center;
  width: 100%;
}
.skill-item {
  /* Ensure perfect centering and consistent spacing */
  min-width: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(
    90deg,
    rgba(107, 202, 232, 0.08),
    rgba(41, 79, 151, 0.08)
  );
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.025);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04),
    0 0 0 1.5px rgba(255, 255, 255, 0.01) inset;
  /* grid handles centering */
  font-size: 1.1rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s,
    border-color 0.3s;
  cursor: pointer;
  margin: 0;
  backdrop-filter: blur(10px) saturate(160%) brightness(120%);
  -webkit-backdrop-filter: blur(10px) saturate(160%) brightness(120%);
  position: relative;
  overflow: hidden;
}
.skill-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.025) 0%,
    rgba(255, 255, 255, 0.005) 100%
  );
  opacity: 0.3;
}
.skill-item:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(107, 202, 232, 0.06) 40%,
    rgba(41, 79, 151, 0.03) 100%
  );
  border-color: var(--color-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08),
    0 0 0 2px var(--color-primary) inset;
}
.skill-item i {
  font-size: 2.3rem;
  color: var(--color-primary);
  display: block;
  line-height: 1;
}
.skill-item span {
  font-size: 1.08rem;
  color: var(--color-text-light);
  display: block;
  line-height: 1.15;
  margin: 0;
  text-align: center;
}

/* Carousel */
.carousel-container {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}
.carousel {
  display: flex;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 100%;
}
.carousel-slide {
  display: flex;
  width: 100%;
}
.project-card {
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* Visual media wrapper with consistent aspect and rounded corners */
.project-card .project-media {
  width: min(980px, 100%);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border-color);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.005)
  );
}
.project-card .project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Textual info under image */
.project-card .project-info {
  width: min(900px, 100%);
  text-align: center;
  padding: 0 8px 8px;
}
.project-card .project-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.project-card .project-desc {
  font-size: 1rem;
  color: var(--color-text-medium);
}
.project-card .project-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--color-text-light);
  text-decoration: none;
  border: 1.5px solid var(--glass-border-color);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.015),
    rgba(255, 255, 255, 0.005)
  );
  transition: transform 0.25s ease, box-shadow 0.25s ease,
    border-color 0.25s ease;
}
.btn-github:hover {
  transform: translateY(-2px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 12px var(--color-primary);
}
.carousel-buttons {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.carousel-button {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 15px;
  padding: 0;
  box-sizing: border-box;
  outline: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-text-light);
  background-color: var(--nav-glass-bg);
  border: 1px solid var(--glass-border-color);
  backdrop-filter: blur(10px);
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.carousel-button:hover {
  background-color: rgba(107, 202, 232, 0.2);
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--color-primary);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  justify-items: stretch;
  align-items: stretch;
  margin-top: 30px;
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.stat-item {
  border-radius: 15px;
  background: linear-gradient(
    135deg,
    var(--glass-card-bg-start),
    var(--glass-card-bg-end)
  );
  border: 1px solid var(--glass-border-color);
  box-shadow: 0 0 0 1px var(--glass-inset-shadow) inset,
    0 4px 10px rgba(0, 0, 0, 0.3);
  padding: 28px 14px 22px;
  text-align: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s;
  backdrop-filter: var(--card-blur-filter);
  -webkit-backdrop-filter: var(--card-blur-filter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(30px) scale(0.98);
}
.stats-grid.reveal.active .stat-item {
  animation: statFadeIn 0.7s cubic-bezier(0.77, 0, 0.18, 1) both;
}
.stats-grid.reveal.active .stat-item:nth-child(1) {
  animation-delay: 0.1s;
}
.stats-grid.reveal.active .stat-item:nth-child(2) {
  animation-delay: 0.3s;
}
.stats-grid.reveal.active .stat-item:nth-child(3) {
  animation-delay: 0.5s;
}
.stats-grid.reveal.active .stat-item:nth-child(4) {
  animation-delay: 0.7s;
}
.stat-item:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-primary);
}
.stat-item .counter {
  font-size: 3em;
  display: block;
  margin-bottom: 10px;
  background: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 200%;
  animation: gradientAnimation 5s ease infinite;
}
.stat-item p {
  color: var(--color-text-medium);
  font-size: 1.08rem;
  margin: 0;
}

/* Timeline */
.timeline {
  margin-top: 50px;
  position: relative;
  padding-top: 20px;
  padding-bottom: 20px;
  width: 100%;
  margin: 50px 0;
  display: flow-root;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-50%);
  z-index: 1;
}
.timeline::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.1) calc(var(--scroll-progress, 0%) - 15%),
    var(--color-primary) calc(var(--scroll-progress, 0%) - 10%),
    var(--color-secondary) var(--scroll-progress, 0%),
    var(--color-primary) calc(var(--scroll-progress, 0%) + 10%),
    rgba(255, 255, 255, 0.1) calc(var(--scroll-progress, 0%) + 15%),
    rgba(255, 255, 255, 0.1) 100%
  );
}
.timeline-item {
  position: relative;
  width: calc(45% - 50px);
  padding: 20px 30px;
  margin-bottom: 60px;
  opacity: 0.8;
  transition: all 0.3s ease-in-out;
  z-index: 5;
}
.timeline-item:hover {
  box-shadow: 0 0 25px rgba(107, 202, 232, 0.3);
  opacity: 1;
}
.timeline-item h4 {
  margin-bottom: 10px;
  background-color: linear-gradient(
    135deg,
    var(--color-secondary),
    var(--color-primary)
  );
}
.timeline-item-left {
  float: left;
  clear: left;
  text-align: right;
  margin-right: 50px;
}
.timeline-item-right {
  float: right;
  clear: right;
  text-align: left;
  margin-left: 50px;
}
.timeline-item:last-child {
  margin-bottom: 0;
}
.timeline-item-left:hover {
  transform: translateX(-10px) scale(1.03);
}
.timeline-item-right:hover {
  transform: translateX(10px) scale(1.03);
}
.timeline-item-left::after,
.timeline-item-right::after {
  content: "";
  position: absolute;
  top: 25px;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 50%;
  border: 3px solid var(--color-dark-bg);
  box-shadow: 0 0 10px var(--color-primary);
  z-index: 10;
  animation: dotPulse 2s infinite;
}
.timeline-item-left::after {
  right: -77px;
}
.timeline-item-right::after {
  left: -77px;
}

/* FAQ */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  margin-top: 40px;
}
.faq-item {
  margin-bottom: 15px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}
.faq-item:hover {
  box-shadow: 0 0 10px rgba(107, 202, 232, 0.2);
}
.faq-question {
  padding: 15px 20px;
  cursor: pointer;
  position: relative;
  font-weight: 600;
  color: var(--color-text-light);
  transition: background 0.3s;
}
.faq-question:hover {
  background: rgba(255, 255, 255, 0.1);
}
.faq-question::after {
  content: "\25BC";
  font-size: 0.8em;
  color: var(--color-primary);
  position: absolute;
  right: 20px;
  transition: transform 0.3s;
}
.faq-item.open .faq-question::after {
  transform: rotate(180deg);
}
.faq-answer {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
  font-weight: 300;
}
.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 20px 20px 15px;
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 30px;
  margin-top: 40px;
}
.team-card {
  padding: 20px;
  text-align: center;
}
.team-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-dark), 0 0 10px rgba(107, 202, 232, 0.4);
}
.team-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 3px solid var(--color-primary);
  box-shadow: 0 0 10px rgba(107, 202, 232, 0.5);
  transition: transform 0.3s;
}
.team-card img:hover {
  transform: scale(1.05);
}
.team-card h4 {
  font-size: 1.2em;
  margin-bottom: 5px;
}
.team-card span {
  font-size: 0.9em;
  color: var(--color-text-medium);
  display: block;
  margin-bottom: 10px;
}
.team-card p {
  color: var(--color-text-medium);
}

/* Contact */
.contact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.contact-container p {
  max-width: 600px;
  margin-bottom: 30px;
}
.contact-container .btn-contact {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-light);
  border: 2px solid var(--color-primary);
  background: none;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
  transition: background 0.3s, transform 0.3s, box-shadow 0.5s;
  animation: pulseBorder 2s infinite alternate;
}
.contact-container .btn-contact:hover {
  background: rgba(107, 202, 232, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(107, 202, 232, 0.4);
  animation: none;
}
.contact-form {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
  background: linear-gradient(
    135deg,
    var(--glass-card-bg-start),
    var(--glass-card-bg-end)
  );
  border: 1px solid var(--glass-border-color);
  box-shadow: 0 0 0 1px var(--glass-inset-shadow) inset,
    0 4px 10px rgba(0, 0, 0, 0.18);
  border-radius: 18px;
  padding: 32px 28px 24px;
  backdrop-filter: var(--card-blur-filter);
  -webkit-backdrop-filter: var(--card-blur-filter);
  align-items: stretch;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  color: var(--color-text-light);
  font-size: 1.08em;
  font-family: inherit;
  outline: none;
  box-shadow: 0 1px 4px rgba(41, 79, 151, 0.04);
  transition: border-color 0.3s, background 0.3s;
  resize: none;
  margin: 0;
  box-sizing: border-box;
  text-align: left;
}
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
  border-color: var(--color-primary);
  background: linear-gradient(
    120deg,
    rgba(107, 202, 232, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
}
.contact-form textarea {
  min-height: 110px;
  max-height: 320px;
  overflow-y: auto;
  resize: none;
}
.contact-form .btn-contact {
  margin-top: 8px;
  width: 100%;
  font-size: 1.08em;
  padding: 13px 0;
  border-radius: 10px;
  border-width: 2px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.contact-form .btn-contact:hover {
  background: rgba(107, 202, 232, 0.13);
  color: var(--color-primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 60px;
  font-size: 0.9em;
  color: #777;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid var(--glass-border-color);
  border-image: linear-gradient(
      to right,
      transparent,
      rgba(107, 202, 232, 0.5),
      transparent
    )
    1;
}
