/* TechM4Schools — Mobile-First Responsive System */

/* ── Design tokens ── */
:root {
  --space-section-y: 40px;
  --space-section-x: 16px;
  --space-card: 24px;
  --radius-card: 24px;
  --gap-grid: 16px;
  --btn-height: 48px;
  --container-max: 1280px;
  --nav-height: 70px;
}

img, video, svg {
  max-width: 100%;
  height: auto;
}

/* ── Section spacing (mobile base) ── */
.section,
.why-sect,
.programs-sect,
.kits-sect,
.game-sect,
.experts-sect,
.cta-sect,
.transform-sect,
.platforms-sect {
  padding: var(--space-section-y) var(--space-section-x);
}

.hero {
  padding: calc(var(--nav-height) + 24px) var(--space-section-x) 48px;
}

footer {
  padding: 48px var(--space-section-x) 24px;
}

/* ── Typography (fluid) ── */
.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.sec-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
}

.cta-title,
.game-title {
  font-size: clamp(1.75rem, 4.5vw, 3.5rem);
}

/* ── Buttons (mobile) ── */
.btn-main,
.btn-outline,
.experts-cta-btn,
.quiz-btn {
  min-height: var(--btn-height);
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.hero-btns,
.cta-btns {
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hero-btns .btn-main,
.hero-btns .btn-outline,
.cta-btns .btn-main,
.cta-btns .btn-outline {
  width: 100%;
}

/* ── Cards (mobile) ── */
.lab-card,
.prog-card,
.plat-card,
.kit-card,
.expert-card,
.testi-card,
.wv-card,
.wl-item,
.contact-card {
  border-radius: var(--radius-card);
  padding: var(--space-card);
  height: 100%;
}

/* ── Hero (mobile single column) ── */
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  grid-template-columns: 1fr;
  padding-bottom: 0;
  text-align: center;
}

.hero-content {
  order: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-visual {
  order: 2;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.hero-sub {
  max-width: 100%;
}

.hero-trust {
  justify-content: center;
}

.float-badge {
  display: none;
}

/* ── Grids (mobile base: 1 column) ── */
.labs-grid,
.plat-grid,
.prog-grid,
.kits-grid,
.transform-steps,
.about-grid,
.why-inner,
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
}

.prog-card {
  flex-direction: column;
}

.footer-bottom {
  flex-direction: column;
  text-align: center;
  justify-content: center;
}

.contact-socials {
  justify-content: center;
}

.contact-socials a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.contact-card:nth-child(2):hover {
  border-color: rgba(123, 47, 247, 0.3);
}

.contact-card:nth-child(3):hover {
  border-color: rgba(14, 165, 233, 0.3);
}

.partners-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--space-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.partners-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  max-width: 900px;
  margin: 2rem auto 0;
}

/* Prevent horizontal overflow */
main,
.hero-inner,
.section,
.experts-inner,
.platforms-inner,
.programs-inner,
.kits-inner,
.transform-sect-inner,
.contact-inner {
  max-width: 100%;
  overflow-x: clip;
}

.why-visual {
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-grid);
}

.quiz-options {
  grid-template-columns: 1fr;
}

.footer-top {
  grid-template-columns: 1fr;
  gap: 32px;
  text-align: center;
}

.footer-brand p {
  margin-left: auto;
  margin-right: auto;
}

/* ── Leadership carousel (mobile) ── */
.experts-carousel-wrap {
  position: relative;
  margin-top: 2rem;
}

.experts-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: 16px;
  padding-bottom: 8px;
  scrollbar-width: none;
  margin-top: 0;
}

.experts-grid::-webkit-scrollbar {
  display: none;
}

.experts-grid .expert-card {
  flex: 0 0 min(88vw, 340px);
  scroll-snap-align: center;
  min-height: 100%;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(123, 47, 247, 0.25);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.carousel-dot[aria-current="true"] {
  background: var(--purple, #7B2FF7);
  transform: scale(1.25);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--orange, #FF6B35);
  outline-offset: 2px;
}

/* ── Mobile navigation overlay ── */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-overlay.visible {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

.nav-toggle {
  z-index: 1002;
  position: relative;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle span {
  transition: transform 0.25s, opacity 0.25s;
}

.nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(123, 47, 247, 0.08);
  border-radius: 12px;
  font-size: 1.5rem;
  color: var(--ink, #1A1A2E);
  cursor: pointer;
  margin-bottom: 8px;
}

/* Mobile/tablet nav panel */
@media (max-width: 1023px) {
  .nav-links {
    display: flex !important;
    position: fixed;
    inset: 0;
    left: auto;
    width: min(100%, 360px);
    flex-direction: column;
    align-items: stretch;
    padding: 24px 20px 32px;
    gap: 4px;
    background: #fff;
    box-shadow: -8px 0 40px rgba(26, 26, 46, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    top: 0 !important;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    min-height: 48px;
    border-radius: 12px !important;
  }

  .nav-links .nav-cta {
    margin-top: 12px;
    text-align: center;
    justify-content: center;
    min-height: 48px !important;
    display: flex !important;
    align-items: center;
  }

  .nav-toggle {
    display: flex !important;
  }
}

/* Desktop nav */
@media (min-width: 1024px) {
  .nav-overlay,
  .nav-close {
    display: none !important;
  }

  .nav-links {
    display: flex !important;
    position: static !important;
    transform: none !important;
    flex-direction: row !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
    overflow: visible !important;
  }

  .nav-toggle {
    display: none !important;
  }
}

/* ── Contact cards ── */
.contact-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: border-color 0.3s, transform 0.3s;
}

.contact-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-4px);
}

.contact-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

.contact-card h3 {
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.contact-card p {
  font-size: 0.88rem;
  color: var(--ink-l);
  line-height: 1.6;
}

.contact-card-link {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.contact-socials {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

.contact-socials a {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  color: var(--ink-l);
  text-decoration: none;
}

/* Reduce motion on mobile */
@media (max-width: 767px) {
  .hero-blob,
  .lab-icon-wrap,
  .cta-emoji,
  .quiz-emoji,
  .mission-icon {
    animation: none !important;
  }

  .reveal,
  .reveal-l,
  .reveal-r {
    transition-duration: 0.4s;
  }
}

/* ── Breakpoint: 375px+ (large mobile) ── */
@media (min-width: 375px) {
  :root {
    --space-section-x: 20px;
  }
}

/* ── Breakpoint: 480px+ ── */
@media (min-width: 480px) {
  :root {
    --space-section-y: 48px;
    --space-section-x: 20px;
  }

  .experts-grid .expert-card {
    flex: 0 0 min(82vw, 360px);
  }
}

/* ── Breakpoint: 768px+ (tablet) ── */
@media (min-width: 768px) {
  :root {
    --space-section-y: 64px;
    --space-section-x: 24px;
    --space-card: 32px;
    --gap-grid: 24px;
    --btn-height: 56px;
  }

  .hero-btns,
  .cta-btns {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
  }

  .hero-btns .btn-main,
  .hero-btns .btn-outline,
  .cta-btns .btn-main,
  .cta-btns .btn-outline,
  .btn-main,
  .btn-outline,
  .experts-cta-btn {
    width: auto;
  }

  .float-badge {
    display: flex;
  }

  .labs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .plat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kits-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .transform-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .transform-steps::before {
    display: none;
  }

  .quiz-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-card--wide {
    grid-column: 1 / -1;
  }

  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }

  .footer-brand p {
    margin-left: 0;
  }

  .footer-bottom {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }

  .contact-socials {
    justify-content: flex-start;
  }

  .partners-card {
    flex-direction: row;
    text-align: left;
    padding: 2rem 3rem;
  }

  .prog-card {
    flex-direction: row;
  }

  /* Experts: 2-col grid, no carousel */
  .experts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    padding-bottom: 0;
  }

  .experts-grid .expert-card {
    flex: unset;
    scroll-snap-align: unset;
  }

  .carousel-dots {
    display: none;
  }
}

/* ── Breakpoint: 1024px+ (laptop) ── */
@media (min-width: 1024px) {
  .hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    text-align: left;
    align-items: center;
    padding-bottom: 48px;
  }

  .hero-content {
    order: unset;
    align-items: flex-start;
  }

  .hero-visual {
    order: unset;
    max-width: none;
    margin: 0;
  }

  .hero-trust {
    justify-content: flex-start;
  }

  .hero-sub {
    max-width: 490px;
  }

  .about-grid,
  .why-inner {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .labs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .plat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .kits-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .transform-steps {
    grid-template-columns: repeat(4, 1fr);
  }

  .transform-steps::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: linear-gradient(90deg, var(--orange, #FF6B35), var(--pink, #FF4D8D), var(--purple, #7B2FF7), var(--blue, #0EA5E9));
    z-index: 0;
    display: block;
  }

  .prog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-card--wide {
    grid-column: span 1;
  }
}

/* ── Breakpoint: 1280px+ (desktop) ── */
@media (min-width: 1280px) {
  :root {
    --space-section-x: 5%;
  }

  .section {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
  }

  .experts-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer-top {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* ── Breakpoint: 1536px+ (large desktop) ── */
@media (min-width: 1536px) {
  .hero-inner,
  .experts-inner,
  .platforms-inner,
  .programs-inner,
  .kits-inner,
  .why-inner,
  .transform-sect-inner {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ── Ultra-wide containment ── */
@media (min-width: 1920px) {
  body {
    background: linear-gradient(90deg, #f0ebe3 0%, var(--bg) 12%, var(--bg) 88%, #f0ebe3 100%);
  }
}
