/* ═══════════════════════════════════════════════════════════
   QEDream – responsive.css
   Mobile-first responsive overrides
═══════════════════════════════════════════════════════════ */

/* ─── BREAKPOINTS
   xs: < 480px    (phones portrait)
   sm: 480–767px  (phones landscape / small tablet)
   md: 768–991px  (tablet portrait)
   lg: 992–1199px (tablet landscape / small desktop)
   xl: 1200px+    (desktop)
─────────────────────────────────────────────────────────── */

/* ─── LARGE: 992px – 1199px ──────────────────────────────── */
@media (max-width: 1199px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Subject cards: stay 3-col down to ~992px, fine as-is */
  .subject-types-grid {
    gap: 1.25rem;
  }
}

/* ─── MEDIUM: < 992px ────────────────────────────────────── */
@media (max-width: 991px) {

  :root {
    --nav-height: 64px;
  }

  /* Navigation */
  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: rgba(8, 10, 15, 0.96);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-left: 1px solid rgba(255,255,255,0.08);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6rem 2.5rem;
    gap: 0.25rem;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
  }

  .nav-links.nav-open {
    transform: translateX(0);
  }

  .nav-link-item {
    font-size: 1.3rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 0;
    width: 100%;
  }
  .nav-link-item::after {
    bottom: -2px;
    left: 0;
    right: auto;
    width: 0;
    height: 1px;
  }
  .nav-link-item:hover::after {
    left: 0;
    right: 0;
  }

  /* Nav overlay */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }
  .nav-overlay.nav-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Hero */
  .hero-section {
    min-height: 100svh;
  }

  /* Sections */
  .students-section,
  .teachers-section,
  .about-section {
    padding: 5rem 0;
  }

  /* Feature grid */
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Topics grid */
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Subject type cards – stack to single column on tablet */
  .subject-types-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .subject-card {
    padding: 1.75rem 1.5rem;
  }

  /* About columns */
  .about-cols {
    row-gap: 1.5rem;
  }
  .about-card {
    padding: 2rem 1.75rem;
  }

  /* Countdown */
  .countdown-timer {
    gap: 1rem;
  }
  .countdown-sep {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
  }
}

/* ─── SMALL: < 768px ─────────────────────────────────────── */
@media (max-width: 767px) {

  :root {
    --nav-height: 60px;
  }

  .nav-inner {
    padding: 0 1.25rem;
  }
  .nav-wordmark {
    font-size: 1.1rem;
  }

  /* Hero */
  .hero-eyebrow {
    font-size: 0.68rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.6;
  }
  .hero-badges {
    gap: 0.5rem;
  }
  .hero-badge {
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  .btn-qed-primary,
  .btn-qed-ghost {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  /* Sections */
  .students-section,
  .teachers-section,
  .about-section {
    padding: 4rem 0;
  }
  .section-header {
    margin-bottom: 2.5rem;
  }
  .section-lead {
    font-size: 1rem;
  }

  /* Feature cards – single column on small phones */
  .feature-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }
  .feature-card {
    padding: 1.5rem 1.25rem;
  }
  .feature-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 1rem;
  }

  /* Topics grid – 2 columns still work on 768- */
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .topic-card {
    padding: 1.5rem 1.25rem;
  }
  .topic-glyph {
    font-size: 2rem;
  }

  /* Expectations */
  .expectation-item {
    grid-template-columns: 2.2rem 1fr;
    gap: 0.875rem;
  }
  .expectations-title {
    font-size: 1.25rem;
  }

  /* Countdown */
  .countdown-block {
    padding: 2rem 1.25rem;
    border-radius: 1.25rem;
  }
  .countdown-timer {
    gap: 0.5rem;
  }
  .countdown-sep {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    padding-bottom: 0.35rem;
  }
  .countdown-number {
    min-width: 2ch;
  }

  /* Notify form */
  .notify-form-wrap {
    padding: 1.75rem 1.25rem;
    border-radius: 1.25rem;
  }
  .notify-input-group {
    flex-direction: column;
    border-radius: 0.875rem;
    border-width: 1px;
  }
  .notify-input {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(124,158,255,0.15);
  }
  .notify-form--light .notify-input {
    border-bottom: 1px solid rgba(91,108,246,0.15);
  }
  .notify-btn {
    border-radius: 0 0 0.875rem 0.875rem;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  /* About */
  .about-contact-email {
    font-size: 1.05rem;
  }
  .about-contact {
    margin-top: 3rem;
    padding-top: 2.5rem;
  }

  /* Footer */
  .qed-footer {
    padding: 3rem 0 2rem;
  }
}

/* ─── EXTRA SMALL: < 480px ───────────────────────────────── */
@media (max-width: 479px) {

  .hero-title {
    /* Prevent text from being cut off */
    font-size: clamp(3.2rem, 16vw, 4.5rem);
  }
  .hero-slogan {
    font-size: 1.05rem;
  }

  /* Topics grid – single column on tiny screens */
  .topics-grid {
    grid-template-columns: 1fr;
  }

  .countdown-timer {
    gap: 0.35rem;
  }
  .countdown-sep {
    display: none; /* Hide separators, too crowded */
  }
  .countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    gap: 0.25rem;
  }
  /* Restore hidden sep items as grid-empty on tiny screens */
  .countdown-unit {
    background: rgba(124,158,255,0.05);
    border-radius: 0.75rem;
    padding: 0.75rem 0.25rem;
    border: 1px solid rgba(124,158,255,0.1);
  }
  .countdown-number {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }
  .countdown-unit-label {
    font-size: 0.58rem;
  }

  .section-lead {
    font-size: 0.95rem;
  }

  .nav-wordmark {
    font-size: 1rem;
  }
  .nav-logo {
    width: 28px;
    height: 28px;
  }
}

/* ─── TALL SCREENS / LANDSCAPE MOBILE ────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: 100svh;
    height: auto;
    padding: 6rem 0 4rem;
  }
  .hero-content {
    padding-top: 1rem;
  }
  .scroll-indicator {
    display: none;
  }
}

/* ─── HIGH-DPI / RETINA ───────────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-slide {
    background-size: cover;
  }
}

/* ─── TOUCH DEVICES: Remove hover effects ─────────────────── */
@media (hover: none) and (pointer: coarse) {
  .feature-card:hover,
  .topic-card:hover,
  .about-card:hover,
  .subject-card:hover {
    transform: none;
    box-shadow: none;
  }
  .btn-qed-primary:hover,
  .btn-qed-ghost:hover {
    transform: none;
  }
  .nav-link-item:hover::after {
    left: 50%;
    right: 50%;
  }
}

/* ─── PRINT ───────────────────────────────────────────────── */
@media print {
  .qed-nav,
  .hero-carousel,
  .scroll-indicator,
  .about-bg,
  .about-overlay { display: none; }

  body { background: white; color: #111; }

  .hero-section { height: auto; padding: 2rem 0; }
  .hero-title-main {
    -webkit-text-fill-color: #111;
    background: none;
  }
  .students-section { background: #f9f9f9; }
}
