/* ============================================
   AQUASTEALTH - Responsive Styles v4
   Mobile-first fixes: disable snap, fluid layout
   ============================================ */

/* ---- Tablet: <= 1024px ---- */
@media (max-width: 1024px) {
  .hydrogen__grid {
    grid-template-columns: 1fr;
  }

  .hydrogen__image {
    display: none;
  }

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

  .atom-section__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .atom-viz {
    max-width: min(280px, 35vh);
    order: -1;
  }

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

  .antioxidant__grid > :last-child {
    grid-column: span 2;
    max-width: 50%;
    margin: 0 auto;
  }

  .procedure__grid {
    grid-template-columns: 1fr;
  }

  .procedure__image {
    order: -1;
  }

  .procedure__image img {
    max-height: 35vh;
  }

  .device-section__grid {
    grid-template-columns: 1fr;
  }

  .device-section__image {
    order: -1;
  }

  .device-section__image img {
    max-height: 30vh;
  }

  .specs__grid {
    grid-template-columns: 1fr;
  }

  .specs__image {
    order: -1;
  }

  .specs__image img {
    max-height: 28vh;
  }

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

/* ---- Tablet small / Mobile: <= 768px ---- */
@media (max-width: 768px) {
  /* === Proximity snap: magnetic feel without trapping in tall sections === */
  html {
    scroll-snap-type: y proximity !important;
  }

  .section {
    height: auto;
    min-height: 100svh;
    scroll-snap-align: start;
    overflow: visible;
    padding: clamp(3rem, 8vw, 5rem) 0;
  }

  /* Hero fills viewport exactly */
  .hero {
    min-height: 100svh;
    padding: 0;
  }

  /* Hero title: prevent horizontal overflow */
  .hero__title {
    font-size: clamp(2.2rem, 9vw, 3.5rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Contacts section - natural height */
  .contacts {
    align-items: center;
    padding-bottom: clamp(2rem, 6vw, 4rem);
  }

  /* Nav - show hamburger */
  .nav__links {
    display: none;
  }

  .nav__phone {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }

  .nav__right .btn {
    display: none;
  }

  /* Reduce section padding */
  :root {
    --section-pad-x: clamp(1rem, 4vw, 2rem);
  }

  /* Section titles */
  .section__title {
    font-size: var(--text-3xl);
  }

  .section__title--left {
    text-align: center;
  }

  .section__title--left::after {
    margin-left: auto;
    margin-right: auto;
  }

  /* Hydrogen Stats */
  .hydrogen__stats {
    grid-template-columns: repeat(2, 1fr);
    margin-top: clamp(1.5rem, 4vw, 3rem);
  }

  /* Atom section */
  .atom-viz {
    max-width: min(200px, 30vw);
  }

  .atom-section__description {
    font-size: var(--text-base);
  }

  .atom-section__info-box {
    padding: clamp(1rem, 3vw, 1.5rem);
    font-size: var(--text-xs);
  }

  /* Radicals */
  .radicals__cards {
    margin-top: clamp(1.5rem, 4vw, 3rem);
  }

  .problem-card {
    padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 3vw, 1.5rem) clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3vw, 2rem);
  }

  .problem-card__text {
    font-size: var(--text-base);
    line-height: 1.6;
  }

  /* Antioxidant */
  .antioxidant__grid {
    grid-template-columns: 1fr;
    margin-top: clamp(1.5rem, 4vw, 3rem);
  }

  .antioxidant__grid > :last-child {
    grid-column: span 1;
    max-width: 100%;
  }

  .pillar-card {
    padding: clamp(1.2rem, 3vw, 2rem);
  }

  .pillar-card__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 0.75rem;
  }

  /* Business */
  .business__grid {
    grid-template-columns: 1fr;
    gap: clamp(0.75rem, 2vw, 1.25rem);
    margin-top: clamp(1.5rem, 4vw, 3rem);
  }

  .benefit-card {
    padding: clamp(1rem, 3vw, 1.5rem);
  }

  .benefit-card__icon {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
  }

  .benefit-card__title {
    font-size: var(--text-base);
    margin-bottom: 0.3rem;
  }

  .benefit-card__text {
    font-size: var(--text-xs);
  }

  .business__revenue {
    font-size: var(--text-2xl);
  }

  .business__cta {
    margin-top: clamp(1rem, 3vw, 2rem);
  }

  /* Indications */
  .indications__grid {
    grid-template-columns: 1fr;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    margin-top: clamp(1.5rem, 4vw, 3rem);
  }

  .indication-card {
    padding: clamp(0.6rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.25rem);
  }

  .indication-card__badge {
    width: 32px;
    height: 32px;
  }

  .indication-card__text {
    font-size: var(--text-sm);
  }

  /* Procedure */
  .procedure__image img {
    max-height: 25vh;
  }

  .timeline__step {
    padding-bottom: clamp(1rem, 3vw, 2rem);
  }

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

  /* Device section */
  .device-section__image img {
    max-height: 25vh;
    max-width: 200px;
  }

  .device-section__description {
    font-size: var(--text-base);
  }

  .device-section__pills {
    gap: 0.5rem;
  }

  .pill {
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
  }

  /* Specs */
  .specs__image img {
    max-height: 22vh;
    max-width: 180px;
  }

  .spec-bar__label {
    font-size: var(--text-xs);
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  /* Usage - horizontal scroll */
  .usage__grid {
    grid-template-columns: repeat(4, 220px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-sm);
    padding-bottom: 0.5rem;
  }

  .usage__grid::-webkit-scrollbar {
    display: none;
  }

  .usage__grid > * {
    scroll-snap-align: start;
  }

  .usage__description {
    font-size: var(--text-base);
  }

  /* Contacts */
  .contacts__logo {
    width: min(220px, 40vw);
  }

  .contacts__phone {
    font-size: var(--text-xl);
  }

  .contacts__description {
    font-size: var(--text-base);
  }

  /* Section badge tighter */
  .section-badge {
    margin-bottom: clamp(0.5rem, 2vw, 1rem);
  }
}

/* ---- Mobile: <= 480px ---- */
@media (max-width: 480px) {
  .hero__ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero__ctas .btn {
    width: 100%;
    text-align: center;
  }

  /* Full width buttons */
  .btn {
    padding: 0.85rem 1.8rem;
  }

  .business__cta .btn {
    width: 100%;
  }

  .contacts__cta .btn {
    width: 100%;
    max-width: 320px;
  }

  /* Stats */
  .hydrogen__stats {
    grid-template-columns: 1fr;
  }

  /* Timeline */
  .timeline {
    padding-left: 32px;
  }

  .timeline__dot {
    left: -31px;
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .timeline__line,
  .timeline__progress {
    left: 10px;
  }

  /* Problem cards */
  .problem-card__watermark {
    font-size: 4rem;
  }

  /* Modal */
  .modal__front,
  .modal__back {
    padding: var(--space-lg);
  }

  /* Usage grid */
  .usage__grid {
    grid-template-columns: repeat(4, 200px);
  }

  /* Atom - smaller on phones */
  .atom-viz {
    max-width: 160px;
  }

  /* Device & specs images smaller */
  .device-section__image img {
    max-height: 22vh;
    max-width: 160px;
  }

  .specs__image img {
    max-height: 20vh;
    max-width: 150px;
  }
}

/* ---- Small mobile: <= 360px ---- */
@media (max-width: 360px) {
  /* reCAPTCHA scaling */
  .form__captcha {
    transform: scale(0.85);
    transform-origin: center;
  }

  .hero__title {
    font-size: clamp(1.8rem, 7.5vw, 2.5rem);
  }

  .section__title {
    font-size: clamp(1.4rem, 6vw, 2rem);
  }
}

/* ---- Touch devices: no hover effects ---- */
@media (hover: none) {
  .cursor-glow {
    display: none !important;
  }

  /* Disable 3D tilt */
  .image-card {
    transform: none !important;
  }

  /* Disable magnetic effects */
  .pill {
    transform: none !important;
  }

  /* Simplify hover states */
  .glass-card:hover,
  .benefit-card:hover,
  .pillar-card:hover,
  .indication-card:hover,
  .image-card:hover {
    transform: none;
  }
}

/* ---- Desktop hover effects only ---- */
@media (hover: hover) and (pointer: fine) {
  .image-card {
    transition: transform var(--duration-base) var(--ease-out);
  }
}

/* ---- Large screens: >= 1440px ---- */
@media (min-width: 1440px) {
  :root {
    --max-width: 1400px;
  }
}
