/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile-first breakpoints
   ═══════════════════════════════════════════ */

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
  :root {
    --section-py: var(--space-16);
    --section-height:       400px;
    --section-height-hero:  auto;
    --section-height-banner: 200px;
    --section-height-cta:   250px;
  }

  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }

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

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

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

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

/* Mobile ≤ 768px */
@media (max-width: 768px) {
  :root {
    --section-py: var(--space-12);
    --section-height:        auto;
    --section-height-hero:   auto;
    --section-height-banner: auto;
    --section-height-cta:    auto;
    --container-pad: var(--space-4);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Section banner */
  .section--banner {
    padding-block: var(--space-12);
  }

  /* Hero */
  .section--hero {
    padding-top: 80px;
    min-height: auto;
  }

  .hero__grid,
  .overview__grid,
  .app__grid {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    order: 1;
  }

  .app__visual {
    order: 1;
  }

  .app__content {
    order: -1;
  }

  .hero__text {
    max-width: none;
  }

  .hero-phone {
    max-width: 400px;
  }

  .hero-globe-bg {
    width: 80%;
    right: -15%;
    opacity: 0.30;
  }

  .hero-phone__glow {
    width: 360px;
    height: 360px;
  }

  .app-phone {
    max-width: 480px;
  }

  .hero__metrics {
    gap: var(--space-6);
    flex-wrap: wrap;
  }

  /* Instruments */
  .instruments__panel--active {
    grid-template-columns: 1fr 1fr;
  }

  .instruments__tabs {
    gap: var(--space-1);
  }

  .instruments__tab {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  /* ─── Drawer (mobile nav) ─── */
  .header__nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: var(--color-bg);
    border-left: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    z-index: calc(var(--z-header) + 2);
    padding: var(--space-16) var(--space-6) var(--space-8);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .header__nav--open {
    transform: translateX(0);
  }
  .header__burger {
    display: flex;
    position: relative;
    z-index: calc(var(--z-header) + 3);
  }
  .header__link {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
  }
  .header__link:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .header__link::after {
    display: none;
  }
  .header__nav .btn {
    margin-top: var(--space-4);
    width: 100%;
    justify-content: center;
  }

  /* Dropdown inside drawer */
  .header__dropdown {
    width: 100%;
  }
  .header__dropdown-toggle {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    width: 100%;
  }
  .header__dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
  }
  .header__dropdown-menu {
    position: static;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0 var(--space-4);
    min-width: auto;
  }
  .header__dropdown-link {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-4);
  }

  /* Buttons stack on mobile */
  .hero__actions,
  .app__buttons {
    flex-direction: column;
  }
  .hero__actions .btn,
  .app__buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Footer mobile */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
  }

  .stat-card__value {
    font-size: var(--text-3xl);
  }

  .app__title {
    text-align: center;
  }

  .widget-frame iframe {
    height: 300px;
  }

  /* Converter in hero */
  .converter {
    max-width: 100%;
  }
  .converter__result-main {
    font-size: var(--text-lg);
    flex-direction: column;
    gap: var(--space-1);
  }

  /* Timeline — stack vertically */
  .timeline {
    grid-template-columns: 1fr;
    gap: var(--space-10);
  }
  .timeline__line {
    display: none;
  }

  /* Ticker / Partners speed adjustment */
  .ticker__track {
    animation-duration: 25s;
    gap: var(--space-6);
  }
  .partners__track {
    animation-duration: 22s;
    gap: var(--space-8);
  }
}

/* Small mobile ≤ 480px */
@media (max-width: 480px) {
  h1 { font-size: var(--text-2xl); }

  .btn--lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-sm);
  }

  .hero-phone {
    max-width: 320px;
  }

  .hero-globe-bg {
    display: none;
  }

  .hero-phone__glow {
    width: 280px;
    height: 280px;
  }

  .app-phone {
    max-width: 360px;
  }

  .hero__metrics {
    gap: var(--space-4);
  }

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

  .instruments__panel--active {
    grid-template-columns: 1fr;
  }

  .timeline__number {
    width: 44px;
    height: 44px;
    font-size: var(--text-lg);
  }
}
