/* ================================================
   RESPONSIVE MEDIA QUERIES
   Desktop layout remains unchanged - only tablet/mobile overrides
   ================================================ */

/* Mobile Menu - Hidden on Desktop */
.mobile-menu-toggle {
  display: none;
}

.mobile-menu-overlay {
  position: sticky;
  display: none;
  top: 67px;
  left: 0;
  width: 100%;
  height: 0;
  max-height: calc(100dvh - 67px);
  background-color: var(--bg-light);
  border: var(--border-primary);
  border-top: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform, opacity;
  animation: fadeOut 0.3s ease-out forwards;
}

.mobile-menu-overlay.active {
  height: auto;
  opacity: 1;
  display: block;
  visibility: visible;
  pointer-events: auto;
  overflow-y: hidden;
  animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    visibility: visible;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.mobile-menu-header {
  display: none;
  height: 68px;
}

.mobile-menu-close {
  display: none;
}

.close-line {
  display: none;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--p-10) var(--p-6) var(--p-8) var(--p-6);
  gap: var(--p-8);
  min-height: 100%;
  height: 100dvh;
}

.mobile-menu-link {
  font-family: "Roboto Mono", monospace, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--primary-500);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateX(-30px);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-menu-overlay.active .mobile-menu-link {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu-link:nth-child(even) {
  transform: translateX(30px);
}

.mobile-menu-overlay.active .mobile-menu-link:nth-child(1) {
  transition-delay: 0.1s;
}

.mobile-menu-overlay.active .mobile-menu-link:nth-child(2) {
  transition-delay: 0.15s;
}

.mobile-menu-overlay.active .mobile-menu-link:nth-child(3) {
  transition-delay: 0.2s;
}

.mobile-menu-overlay.active .mobile-menu-link:nth-child(4) {
  transition-delay: 0.25s;
}

.mobile-menu-link:hover {
  opacity: var(--opacity-70);
}

/* Light Mobile Menu Active State */
.mobile-menu-link.active {
  color: var(--primary-400);
}

/* Tablet and Desktop - Features Grid */
@media (min-width: 768px) {
}

/* ================================================
   TABLET BREAKPOINT (max-width: 1024px)
   ================================================ */

@media (max-width: 1024px) {
  /* Global Adjustments */
  :root {
    --text-h1: 2.25rem;
    --text-lg: 1.125rem;
  }
   
   body {
       background-image: none;
   }


  /* Team Section - 2 columns on tablet */
  .team-members {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-card:nth-child(3n) {
    border-right: var(--border-primary);
  }

  .team-card:nth-child(2n) {
    border-right: none;
  }

  .team-card:nth-child(4),
  .team-card:nth-child(5),
  .team-card:nth-child(6),
  .team-card:nth-child(10) {
    border-bottom: var(--border-primary);
  }

  /* Testimonials - 2 cards per view */
  .testimonial-card {
    flex: 0 0 calc(100% / 2);
    width: calc(100% / 2);
  }

  /* Contributions Page - Tablet */
  .contributions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contribution-card:nth-child(2n) {
    border-left: none;
  }

  .contribution-card:nth-child(3n + 2),
  .contribution-card:nth-child(3n + 3) {
    border-left: var(--border-primary);
  }

  .contribution-card:nth-child(-n + 2) {
    border-top: var(--border-primary);
  }

  .contribution-card:nth-child(3) {
    border-top: none;
    border-right: none;
  }

  .contribution-card:nth-child(4) {
    border-bottom: var(--border-primary);
    border-left: var(--border-primary);
  }

  .contribution-card:nth-child(4),
  .contribution-card:nth-child(6) {
    border-right: none;
  }
}

/* ================================================
   MOBILE BREAKPOINT (max-width: 768px)
   ================================================ */

@media (max-width: 820px) {
  /* Global Adjustments */
  :root {
    --text-h1: 1.75rem;
    --text-h2: 1.25rem;
    --text-lg: 1rem;
    --text-base: 0.9rem;
  }

  /* Prevent horizontal scroll */
  body,
  html {
    max-width: 100vw;
  }

  section {
    max-width: 100%;
  }

  .max-w {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
  }

  /* Button */

  .btn {
    padding: var(--p-4) var(--p-5);
  }

  /* Fix navbar to stay at top when scrolling on mobile */
  .navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 2000;
  }


  /* Add padding to body to prevent content from hiding under fixed navbar */
  body {
    padding-top: 0px;
  }

  /* Show mobile menu toggle button */
  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 32px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
    position: relative;
    margin: var(--p-6);
  }

  .hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--primary-500);
    transition: all 0.3s ease;
    transform-origin: center;
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
    background-color: var(--primary-500);
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
    background-color: var(--primary-500);
  }

  /* Hide desktop nav links */
  .nav-links {
    display: none;
  }

  /* Hero */

  .columns .first {
    border-bottom: var(--border-primary);
  }

  .hero-content {
    flex-direction: column;
  }

  /* Metrics */

  .metrics h1 {
    font-size: var(--text-h1);
  }

  .logo .column {
    height: 132px;
  }

  .metrics.columns {
    flex-direction: column;
    border-bottom: var(--border-primary);
  }

  /* Why */

  .why-subsection:first-child {
    height: auto;
  }

  .why-subsection .h2-title {
    margin-bottom: var(--p-15);
  }

  .text-wrapper.columns {
    flex-direction: column;
  }

  .why-subsection.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .why-subsection.columns.col-3 {
    display: flex;
    flex-direction: column;
  }

  .why-subsection.col-3 .card {
    border-right: none;
  }

  .why.no-border .text-wrapper {
    width: 100%;
  }

  .why-subsection .card {
    border-right: 1px solid var(--bg-light);
    border-bottom: 1px solid var(--bg-light);
  }

  .why-subsection .card:first-child {
    border-bottom: 1px solid var(--bg-light);
  }

  .why-subsection .card.no-border-right {
    border-right: none;
  }

  .why-subsection .card.no-border-bottom {
    border-bottom: none;
  }

  /* What Section */

  .what {
    height: auto;
    min-height: auto;
  }

  .what-container.columns {
    flex-direction: column;
  }

  .what-sticky {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: var(--border-primary);
    top: 0;
  }

  .what-flow {
    width: 100%;
    padding: var(--p-6);
    padding-top: var(--p-10);
  }

  .flow-card {
    width: 100%;
    padding: var(--p-6);
  }

  .flow-section {
    margin-bottom: var(--p-4);
  }

  /* Solutions */

  .solution-row {
    flex-direction: column;
    height: auto;
  }

  .solution-row .description {
    border-right: none;
    border-bottom: var(--border-primary);
  }

  .solution-row .card-buttons {
    width: 100%;
  }

  .description.columns {
    flex-direction: column;
  }

  .name-and-logo img {
    width: 60px;
    margin-bottom: var(--p-5);
  }

  /* Team Section - 2 columns on mobile */
  .team-members {
    grid-template-columns: repeat(2, 1fr);
  }

  .team-card {
    min-height: 280px;
    border-bottom: var(--border-primary);
  }

  .team-card:nth-child(2n) {
    border-right: none;
  }

  .team-member-image img {
    width: 80px;
    height: 80px;
  }

  .twitter-link {
    width: 28px;
    height: 28px;
  }

  .twitter-link svg {
    width: 12px;
    height: 12px;
  }

  .team-bio {
    font-size: var(--text-sm);
  }

  .team-card-footer {
    padding: var(--p-4);
  }

  .team-name {
    font-size: var(--text-sm);
  }

  .team-role {
    font-size: var(--text-xs);
  }

  .team-toggle {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  /* Testimonials - 1 card per view */
  .testimonial-card {
    flex: 0 0 100%;
    width: 100%;
  }

  /* Previous Contributions - Stack on Mobile */
  .previous-contributions-wrapper {
    grid-template-columns: 1fr;
  }

  .previous-contributions .sidebar {
    border-right: none;
    border-bottom: var(--border-primary);
  }

  /* Talks and Events - Stack on Mobile */
  .talks-wrapper {
    grid-template-columns: 1fr;
  }

  .talks-events .sidebar {
    border-right: none;
    border-bottom: var(--border-primary);
  }

  .talks-events .subtitle,
  .previous-contributions .subtitle {
    margin-bottom: 0;
  }

  .event-column.image {
    height: 100%;
  }

  /* ---DECISION & Impact --- */

  .decision.columns {
    display: flex;
    flex-direction: column;
  }

  .decision .image-column {
    display: none;
  }

  .impact-section.columns {
    height: auto;
  }

  .image-column.smaller img {
    width: 100%;
  }

  /* About*/

  .text-hightlight {
    grid-template-columns: 2fr;
  }

  .text-hightlight p {
    font-size: 24px;
    line-height: 36px;
  }

  .text-wrapper h1 {
    margin-top: var(--p-10);
  }
}

/* ================================================
   MOBILE BREAKPOINT (max-width: 480px)
   ================================================ */

@media (max-width: 480px) {
  /* Global Adjustments */

  /* Hero */

  .hero-content {
    height: calc(100dvh - 360px);
  }

  /* Track Record */
  .track-record h1 {
    margin-bottom: var(--p-6);
  }

  .track-record-item {
    display: flex;
    flex-direction: column;
  }

  .track-record-content {
    display: flex;
    flex-direction: column;
  }

  /* CTAs */
  .hero-buttons {
    flex-direction: column;
  }

  .ctas {
    padding-bottom: var(--p-15);
  }

  /* Footer */

  .footer-wrapper {
    padding: var(--p-10) var(--p-0);
  }

  .footer-wrapper.links {
    flex-direction: column;
    flex: 1;
  }

  .footer-wrapper.links .subtitle {
    margin-bottom: var(--p-0);
  }

  .footer-wrapper .column {
    width: 100%;
    border-right: none;
    height: 220px;
  }

  .footer-wrapper .column:last-child {
    border-bottom: none;
  }

  /* Team Section - Single column on small mobile */
  .team-members {
    grid-template-columns: 1fr;
  }

  .team-card {
    border-right: none;
    border-bottom: var(--border-primary);
    min-height: 260px;
  }

  .team-card:last-child {
    border-bottom: none;
  }

  .team-card-footer {
    padding: var(--p-4) var(--p-5);
  }

  .impact-section.columns {
    height: auto;
    display: flex;
    flex-direction: column-reverse;
  }

  .text-hightlight p {
    font-size: 18px;
    line-height: 32px;
  }

  .team-card:nth-child(12) {
    display: none;
  }

  /* CONTRIBUTIONS */

  /* Contributions Page - Mobile */
  .contributions-grid {
    grid-template-columns: 1fr;
  }
  

  .bigger-video video {
    width: 180%;
    object-position: center center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .contribution-card {
    border-left: none;
    border-right: none;
    min-height: 180px;
  }

  .contribution-card:nth-child(3n + 2),
  .contribution-card:nth-child(3n + 3),
  .contribution-card:nth-child(4),
  .contribution-card:nth-child(6) {
    border-left: none;
  }
  

  .contribution-card:nth-child(1) {
    border-bottom: none;
  }

  .contribution-card:nth-child(5) {
    border-bottom: none;
  }

  .contribution-links {
    flex-direction: column;
    gap: var(--p-4);
  }

  .contribution-card.empty {
    display: none;
  }

  /* IMPACT - SOLUTIONS */
  .image-column.border {
    border-left: none;
  }
}
