/* ==========================================================================
   Hobby Doser — Responsive Styles (Mobile-First)
   Breakpoints: 480 / 768 / 1024 / 1280
   ========================================================================== */

/* Small phones+ */
@media (min-width: 480px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    gap: 1.75rem;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }

  .nav__menu {
    display: flex;
  }

  .nav__cta-download {
    display: inline-flex;
  }

  .nav__drawer {
    display: none !important;
  }

  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
  }

  .hero__visual {
    min-height: 520px;
  }

  .phone-mockup--primary {
    width: 240px;
  }

  .phone-mockup--secondary {
    width: 175px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .steps-timeline {
    max-width: 44rem;
  }

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

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

  .footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .gallery__slide {
    flex: 0 0 200px;
  }

  .legal-layout {
    grid-template-columns: 220px 1fr;
    gap: 2.5rem;
  }

  .legal-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    max-height: calc(100vh - var(--nav-height) - 3rem);
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .page-legal .nav__cta-download {
    display: inline-flex;
  }
}

/* Laptops */
@media (min-width: 1024px) {
  .container {
    width: min(100% - 3rem, var(--container));
  }

  .features-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  /* Horizontal timeline on laptop+ */
  .steps-timeline {
    max-width: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    align-items: start;
    overflow: visible;
  }

  .step {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 0 0.75rem 0;
    gap: 1.25rem;
    overflow: visible;
  }

  .step__marker {
    flex-direction: row;
    justify-content: center;
    width: 100%;
    min-height: auto;
    position: relative;
    overflow: visible;
  }

  .step__number {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1rem;
  }

  .step__connector {
    position: absolute;
    top: 50%;
    left: calc(50% + 1.85rem);
    width: calc(100% - 0.2rem);
    height: 2px;
    min-height: 0;
    margin: 0;
    flex: none;
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--brand-indigo), var(--brand-teal));
    opacity: 0.45;
  }

  .step:last-child .step__connector {
    display: none;
  }

  .step__content {
    text-align: center;
    padding: 1.35rem 1.1rem 1.5rem;
  }

  .step:hover .step__content {
    transform: translateY(-6px) translateX(0);
  }

  .step__text {
    font-size: 0.9rem;
  }

  .hero__visual {
    min-height: 560px;
  }

  .phone-mockup--primary {
    width: 260px;
  }

  .phone-mockup--secondary {
    width: 190px;
  }

  .phone-mockup--left {
    left: 0;
  }

  .phone-mockup--right {
    right: 0;
  }

  .gallery__slide {
    flex: 0 0 220px;
  }

  .legal-layout {
    grid-template-columns: 260px 1fr;
  }
}

/* Desktops */
@media (min-width: 1280px) {
  .hero__grid {
    gap: 3.5rem;
  }

  .features-grid {
    gap: 1.35rem;
  }

  .feature-card {
    padding: 1.65rem 1.5rem;
    min-height: 12rem;
  }

  .step__content {
    padding: 1.5rem 1.25rem 1.65rem;
  }

  .step__title {
    font-size: 1.15rem;
  }
}

/* Large phones landscape / small tablets */
@media (max-width: 767px) {
  .hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .hero__title {
    max-width: none;
  }

  .btn-group {
    width: 100%;
  }

  .btn-group .btn {
    flex: 1 1 auto;
    min-width: calc(50% - 0.5rem);
  }

  .btn-group .btn--ghost {
    flex: 1 1 100%;
  }

  .phone-mockup--left,
  .phone-mockup--right {
    display: none;
  }

  .hero__visual {
    min-height: 380px;
  }

  .phone-mockup--primary {
    width: min(220px, 62vw);
  }

  .lightbox__nav {
    width: 2.5rem;
    height: 2.5rem;
  }

  .lightbox__prev {
    left: 0.5rem;
  }

  .lightbox__next {
    right: 0.5rem;
  }
}

/* iPad portrait refinements */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero__visual {
    min-height: 480px;
  }

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

  @media (min-width: 900px) {
    .testimonials-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}

/* Reduce horizontal padding on very small screens */
@media (max-width: 379px) {
  .container {
    width: min(100% - 1.25rem, var(--container));
  }

  .btn {
    padding: 0.75rem 1.1rem;
    font-size: 0.875rem;
  }

  .nav__brand span {
    font-size: 1rem;
  }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
  .nav__link,
  .hobby-chip,
  .faq-item__question,
  .btn--icon {
    min-height: 44px;
  }

  .theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }

  .gallery__dot {
    /* Keep visual size; expand hit area without stretching the dot */
    min-height: 0;
    position: relative;
  }

  .gallery__dot::after {
    content: "";
    position: absolute;
    inset: -12px;
  }

  .gallery__phone:hover {
    transform: none;
  }
}

/* Gallery controls — small screens */
@media (max-width: 480px) {
  .gallery__controls {
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    row-gap: 1rem;
  }

  .gallery__dots {
    order: 3;
    flex: 1 0 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
  }

  .gallery__dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
    flex-shrink: 0;
  }

  .gallery__dot.is-active {
    width: 1.15rem;
    min-width: 1.15rem;
    height: 7px;
    min-height: 7px;
  }
}

/* Print */
@media print {
  .site-header,
  .back-to-top,
  .nav__toggle,
  .theme-toggle,
  .bg-shapes,
  .lightbox {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
