/* ==========================================================================
   Responsive — tablet & mobile breakpoints
   ========================================================================== */

/* ---- Tablet (≤ 900px) ---- */
@media (max-width: 900px) {
  :root {
    --sp-6: 72px;
    --sp-7: 100px;
  }

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

  .hero__meta {
    flex-direction: column;
    gap: var(--sp-1);
    border-radius: var(--radius-lg);
    padding: var(--sp-2);
  }

  .hero__meta-sep {
    display: none;
  }

  .countdown {
    gap: 0;
  }

  .countdown__unit {
    padding: 0 var(--sp-2);
  }

  .countdown__card {
    width: clamp(70px, 12vw, 110px);
    height: clamp(70px, 12vw, 110px);
  }

  .venue__info-grid {
    gap: var(--sp-2) var(--sp-3);
  }
}

/* ---- Mobile (≤ 640px) ---- */
@media (max-width: 640px) {
  body { font-size: 16.5px; }

  :root {
    --sp-6: 56px;
    --sp-7: 76px;
  }

  .container {
    padding: 0 var(--sp-2);
  }

  /* --- Nav --- */
  .nav {
    padding: 12px var(--sp-2);
  }

  .nav__brand {
    font-size: 1.2rem;
  }

  .nav__list {
    gap: var(--sp-2);
    font-size: 0.58rem;
    letter-spacing: 0.15em;
  }

  /* Hide RSVP nav item on very small screens */
  .nav__list li:last-child {
    display: none;
  }

  /* --- Gate --- */
  .gate__floral--tl img,
  .gate__floral--br img {
    width: clamp(80px, 28vw, 130px);
  }

  .gate__arabic {
    font-size: 1.3rem;
  }

  .gate__names {
    font-size: clamp(2.6rem, 13vw, 3.8rem);
  }

  /* --- Hero --- */
  .hero {
    min-height: 100dvh;
  }

  .hero__container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 100dvh;
    padding: clamp(140px, 30vw, 200px) var(--sp-3) var(--sp-5);
    box-sizing: border-box;
  }

  .hero__content {
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .hero__names {
    font-size: clamp(2rem, 7.2vw, 3.2rem);
    text-align: center;
    white-space: nowrap;
  }

  .hero__invite {
    text-align: center;
  }

  .hero__date-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    gap: 12px;
  }

  .hero__days-num {
    font-size: 2.2rem;
  }

  /* --- Countdown --- */
  .countdown {
    flex-wrap: nowrap;
    gap: 0;
  }

  .countdown__unit {
    padding: 0 clamp(4px, 1.5vw, 10px);
  }

  .countdown__card {
    width: clamp(60px, 18vw, 80px);
    height: clamp(60px, 18vw, 80px);
    border-radius: 8px;
  }

  .countdown__num {
    font-size: clamp(1.4rem, 5vw, 1.9rem);
  }

  .countdown__label {
    font-size: 0.52rem;
    letter-spacing: 0.15em;
  }

  .countdown__sep {
    font-size: 1.3rem;
    margin-top: clamp(14px, 4vw, 24px);
    padding: 0;
  }

  .wedding-date-badge {
    padding: var(--sp-2) var(--sp-3);
  }

  .badge__day {
    font-size: 1.8rem;
  }

  /* --- Story --- */
  .story__quote {
    font-size: 5rem;
  }

  /* --- Gallery --- */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* --- Timeline --- */
  .timeline__line {
    left: 20px;
  }

  .timeline__item {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "dot content";
    margin-bottom: var(--sp-4);
  }

  .timeline__dot-wrap {
    grid-area: dot;
    width: 42px;
    padding-top: 4px;
  }

  .timeline__spacer {
    display: none;
  }

  .timeline__item--left .timeline__content,
  .timeline__item--right .timeline__content {
    grid-area: content;
    text-align: left;
    padding: 0 0 0 var(--sp-2);
  }

  .timeline__dot {
    margin-left: 6px;
  }

  /* --- Venue --- */
  .venue__map iframe {
    height: 260px;
  }

  .venue__info-grid {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
  }

  .venue__info-item {
    justify-content: center;
  }

  /* --- RSVP --- */
  .rsvp__choices {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-1);
  }

  .rsvp__choice {
    font-size: 0.6rem;
    padding: 12px var(--sp-1);
  }

  /* --- Buttons --- */
  .btn {
    padding: 14px 28px;
    font-size: 0.67rem;
  }

  /* --- Music --- */
  .music-toggle {
    width: 50px;
    height: 50px;
    bottom: var(--sp-2);
    right: var(--sp-2);
  }

  .music-toggle__disc {
    width: 36px;
    height: 36px;
  }

  /* --- Footer --- */
  .footer__floral--l,
  .footer__floral--r {
    width: clamp(70px, 22vw, 120px);
  }
}

/* ---- Very small (≤ 380px) ---- */
@media (max-width: 380px) {
  .hero__names {
    font-size: 2.8rem;
  }

  .countdown__card {
    width: 56px;
    height: 56px;
  }

  .countdown__num {
    font-size: 1.3rem;
  }

  .nav__list {
    gap: var(--sp-1);
    font-size: 0.54rem;
  }
}

/* ---- Disable effects on touch devices ---- */
@media (hover: none) {
  .cursor-glow { display: none; }
  .music-toggle__waves { display: none; }
}

/* ---- Landscape mobile ---- */
@media (max-width: 812px) and (orientation: landscape) {
  .hero {
    min-height: 100vw;
    padding: var(--sp-4) var(--sp-2);
  }

  .hero__names {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    margin: var(--sp-1) 0;
  }

  .gate__names {
    font-size: clamp(2.2rem, 7vw, 3rem);
  }
}

/* ---- High DPI / retina ---- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero__bg-img {
    image-rendering: -webkit-optimize-contrast;
  }
}
