/* ================================================
   template4 — RESPONSIVE STYLES
   All breakpoints: 1280px, 1024px, 768px, 640px, 480px
   ================================================ */

/* ------------------------------------------------
   LARGE DESKTOP (max 1280px)
   ------------------------------------------------ */
@media (max-width: 1280px) {
  .nav__inner { padding: 0 1.75rem; }
  .h1-hero__left { padding: 7rem 2.5rem 4rem 2.5rem; }
  .h1-hero__right { padding: 7rem 2rem 4rem; }
  .h1-hero__bg-text { font-size: clamp(7rem, 15vw, 18rem); }
  .h3-bento-cell--xl { grid-column: span 6; }
  .h3-bento-cell--lg { grid-column: span 6; }
  .h3-bento-cell--wide { grid-column: span 8; }
  .h3-bento-cell--md { grid-column: span 4; }
  .h3-bento-cell--tall { grid-column: span 4; }
}

/* ------------------------------------------------
   TABLET LANDSCAPE / SMALL LAPTOP (max 1024px)
   ------------------------------------------------ */
@media (max-width: 1024px) {

  /* Navigation */
  .nav__menu { display: none; }
  .nav__hamburger { display: flex; }
  .nav__inner { padding: 0 1.25rem; max-width: 100vw; box-sizing: border-box; }
  .nav__logo { margin-left: 0 !important; }
  .nav__logo-img { height: 72px; max-height: 76px; }
  .nav__actions { gap: 0.5rem; }
  .nav__actions .btn { padding: 0.5rem 0.9rem; font-size: 0.8rem; }

  /* Container */
  .container { padding: 0 1.5rem; }
  .container-wide { padding: 0 1.5rem; }

  /* Footer */
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .footer__brand { grid-column: span 2; }

  /* H1 Hero */
  .h1-hero { grid-template-columns: 1fr; min-height: auto; }
  .h1-hero__right { display: none; }
  .h1-hero__left { padding: 9rem 2rem 5rem; }
  .h1-hero__bg-text { font-size: clamp(5rem, 12vw, 10rem); }
  .h1-hero__scroll { bottom: 1.5rem; left: 2rem; }

  /* H1 Stats */
  .h1-stats__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .h1-stats__right { grid-template-columns: repeat(4, 1fr); }
  .h1-stat-cell { padding: 1.5rem 1.25rem; }

  /* H1 Platforms */
  .h1-platforms__grid { grid-template-columns: 1fr; gap: 3rem; }
  .h1-platforms__cards { order: -1; }

  /* H1 Steps */
  .h1-steps__track { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
  .h1-steps__track::before { display: none; }

  /* H1 Strength */
  .h1-strength__grid { grid-template-columns: 1fr; gap: 3rem; }

  /* H1 Payments */
  .h1-payments__grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* H1 Webinars */
  .h1-webinars__grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* H2 Hero */
  .h2-hero__content { grid-template-columns: 1fr; gap: 3rem; }
  .h2-hero__right { display: none; }

  /* H2 Counters */
  .h2-counters__grid { grid-template-columns: repeat(3, 1fr); gap: 1px; }
  .h2-counter:nth-child(4), .h2-counter:nth-child(5) { border-top: 1px solid var(--border); }

  /* H2 Why grid */
  .h2-why__grid { grid-template-columns: 1fr 1fr; }

  /* H2 Steps */
  .h2-steps__grid { grid-template-columns: repeat(2, 1fr); }

  /* H3 Hero */
  .h3-hero__content { grid-template-columns: 1fr; }
  .h3-hero__right { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-radius: 12px; }
  .h3-hero__stat-box { border-bottom: none; border-right: 1px solid var(--border); }
  .h3-hero__stat-box:last-child { border-right: none; }
  .h3-hero__headline { font-size: clamp(3.5rem, 8vw, 7rem); }

  /* H3 Bento */
  .h3-bento__grid { grid-template-columns: repeat(6, 1fr); }
  .h3-bento-cell--xl { grid-column: span 6; grid-row: span 1; }
  .h3-bento-cell--lg { grid-column: span 3; }
  .h3-bento-cell--md { grid-column: span 3; }
  .h3-bento-cell--wide { grid-column: span 6; }
  .h3-bento-cell--tall { grid-column: span 3; grid-row: span 1; }
  .h3-bento-cell--full { grid-column: span 6; }

  /* H3 Accounts */
  .h3-accounts__layout { grid-template-columns: 1fr; }
  .h3-accounts__nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .h3-accounts__nav::-webkit-scrollbar { display: none; }
  .h3-account-nav-item {
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 1rem 1.5rem;
  }
  .h3-account-nav-item__arrow { display: none; }

  /* H3 CTA */
  .h3-cta__grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* Contact Hero */
  .ct-hero__layout { grid-template-columns: 1fr; gap: 3rem; }
  .ct-form-card { position: static; }

  /* Contact location */
  .ct-location__grid { grid-template-columns: 1fr; gap: 2.5rem; }

  /* Contact support */
  .ct-support__grid { grid-template-columns: 1fr 1fr; gap: 1rem; }

  /* Account panel specs */
  .h3-account-panel__specs { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------
   TABLET PORTRAIT (max 768px)
   ------------------------------------------------ */
@media (max-width: 768px) {

  /* Hide login and start trading buttons on mobile to prevent overflow (they are in the mobile menu) */
  .nav__actions .btn { display: none !important; }
  .nav__actions { gap: 0.5rem; }
  .nav__logo-img { height: 64px; max-height: 68px; }

  /* Typography scale down */
  .h1-hero__headline { font-size: clamp(2.5rem, 8vw, 4.5rem); }
  .h1-stats__intro { font-size: clamp(2rem, 6vw, 3rem); }
  .h3-hero__headline { font-size: clamp(3rem, 10vw, 5rem); }
  .ct-hero__heading { font-size: clamp(3rem, 8vw, 5rem); }

  /* Container */
  .container { padding: 0 1.25rem; }

  /* Section spacing */
  .h1-stats { padding: 5rem 0; }
  .h1-pullquote { padding: 4rem 0; }
  .h1-markets { padding: 4rem 0; }
  .h1-platforms { padding: 4rem 0; }
  .h1-steps { padding: 4rem 0; }
  .h1-strength { padding: 4rem 0; }
  .h1-payments { padding: 3.5rem 0; }
  .h1-cta { padding: 4rem 0; }
  .h2-markets { padding: 4rem 0; }
  .h2-accounts { padding: 4rem 0; }
  .h2-why { padding: 4rem 0; }
  .h2-steps { padding: 4rem 0; }
  .h2-cta { padding: 4rem 0; }
  .h3-bento { padding: 4rem 0; }
  .h3-accounts { padding: 4rem 0; }
  .h3-steps { padding: 4rem 0; }
  .h3-cta { padding: 5rem 0; }
  .ct-hero { padding: 8rem 0 3.5rem; }
  .ct-support { padding: 4rem 0; }
  .ct-location { padding: 4rem 0; }
  .ct-cta { padding: 4rem 0; }

  /* Footer */
  .footer { padding: 3rem 0 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: span 2; }
  .footer__bottom { flex-direction: column; gap: 1rem; text-align: center; }

  /* H1 */
  .h1-stats__right { grid-template-columns: 1fr 1fr; }
  .h1-stats__right { border-radius: 12px; }
  .h1-steps__track { grid-template-columns: 1fr; gap: 1.5rem; }
  .h1-market-card { flex: 0 0 260px; height: 340px; }
  .h1-market-card:hover { flex: 0 0 340px; }
  .h1-strength__stat { padding: 1.5rem; gap: 1.25rem; }
  .h1-strength__stat-num { font-size: 1.5rem; min-width: auto; }

  /* H2 */
  .h2-counters__grid { grid-template-columns: repeat(2, 1fr); }
  .h2-counter { border-right: 1px solid var(--border); padding: 1.25rem; }
  .h2-counter:nth-child(2n) { border-right: none; }
  .h2-counter:nth-child(3), .h2-counter:nth-child(4), .h2-counter:nth-child(5) { border-top: 1px solid var(--border); }
  .h2-markets__grid { grid-template-columns: 1fr 1fr; }
  .h2-why__grid { grid-template-columns: 1fr; }
  .h2-steps__grid { grid-template-columns: 1fr 1fr; }

  /* H3 */
  .h3-bento__grid { grid-template-columns: repeat(2, 1fr); }
  .h3-bento-cell--xl { grid-column: span 2; }
  .h3-bento-cell--lg { grid-column: span 1; }
  .h3-bento-cell--md { grid-column: span 1; }
  .h3-bento-cell--wide { grid-column: span 2; }
  .h3-bento-cell--tall { grid-column: span 1; grid-row: span 1; }
  .h3-bento-cell--full { grid-column: span 2; }
  .h3-bento-cell { padding: 1.75rem; }
  .h3-hero__right { grid-template-columns: 1fr; gap: 0; }
  .h3-hero__stat-box { border-right: none; border-bottom: 1px solid var(--border); }
  .h3-hero__stat-box:last-child { border-bottom: none; }
  .h3-step-row { grid-template-columns: 60px 1fr auto; gap: 1rem; padding: 1.5rem; }
  .h3-step-row:hover { padding-left: 2rem; }
  .h3-step-row__num { font-size: 2rem; }
  .h3-accounts__nav { flex-direction: column; }
  .h3-account-nav-item { border-right: none; border-bottom: 1px solid var(--border); }
  .h3-account-nav-item__arrow { display: flex; }
  .h3-account-panel__specs { grid-template-columns: 1fr 1fr 1fr; }
  .h3-accounts__panel { padding: 2rem 1.5rem; }

  /* Contact */
  .ct-form-card { padding: 2rem; }
  .ct-support__grid { grid-template-columns: 1fr; }
  .ct-hero__cta-row { flex-direction: column; align-items: flex-start; }
  .ct-hero__cta-divider { display: none; }

  /* Theme panel */
  .theme-panel { width: 100%; }
  .theme-toggle { display: none; }

  /* H1 pullquote */
  .h1-pullquote__text { font-size: clamp(1.5rem, 4vw, 2.5rem); }
  .h1-pullquote::before { font-size: 15rem; }

  /* CTA actions */
  .h1-cta__actions { flex-direction: column; align-items: center; }
  .h2-cta__actions { flex-direction: column; align-items: center; }
  .h3-cta__actions { flex-direction: column; }
}

/* ------------------------------------------------
   MOBILE (max 640px)
   ------------------------------------------------ */
@media (max-width: 640px) {

  /* Nav */
  .nav__inner { padding: 0 0.85rem; height: 80px; }
  .nav__logo { margin-left: 0 !important; }
  .nav__logo-img { height: 64px; max-height: 68px; }
  .nav__logo-text { font-size: 1.05rem; }
  .nav__actions { gap: 0.35rem; }
  .nav__actions .btn { padding: 0.45rem 0.75rem; font-size: 0.75rem; border-radius: 6px; }

  /* Hero */
  .h1-hero__left { padding: 6.5rem 1rem 3.5rem; }
  .h1-hero__cta { flex-direction: column; align-items: stretch; width: 100%; }
  .h1-hero__cta .btn { width: 100%; justify-content: center; }

  /* Promo Modal */
  .promo-modal { width: 94%; max-width: 100%; }
  .promo-modal__frame { padding: 1.75rem 1.25rem 1.5rem; }
  .promo-modal__heading { font-size: 1.75rem; }
  .promo-modal__features { grid-template-columns: 1fr; gap: 0.35rem; }
  .promo-modal__form-row { grid-template-columns: 1fr; }

  /* H2 hero */
  .h2-hero { padding: 7rem 0 3.5rem; }
  .h2-hero__cta { flex-direction: column; width: 100%; }
  .h2-hero__cta .btn { width: 100%; justify-content: center; }
  .h2-hero__mini-stats { flex-wrap: wrap; gap: 1.25rem; }

  /* H3 hero */
  .h3-hero__cta-row { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .h3-hero__scroll-num { display: none; }
  .h3-hero__label::after { display: none; }

  /* Bento 1 col */
  .h3-bento__grid { grid-template-columns: 1fr; }
  .h3-bento-cell--xl,
  .h3-bento-cell--lg,
  .h3-bento-cell--md,
  .h3-bento-cell--wide,
  .h3-bento-cell--tall,
  .h3-bento-cell--full { grid-column: span 1; grid-row: span 1; }

  /* Market cards */
  .h1-market-card { flex: 0 0 240px; height: 320px; }
  .h1-market-card:hover { flex: 0 0 280px; }

  /* Stats */
  .h1-stat-cell { padding: 1.25rem 1rem; }
  .h1-stat-number { font-size: 2rem; }

  /* H2 markets grid */
  .h2-markets__grid { grid-template-columns: 1fr; }

  /* H2 accounts */
  .h2-account-card { flex: 0 0 250px; }

  /* H2 steps */
  .h2-steps__grid { grid-template-columns: 1fr; }

  /* Contact */
  .ct-info-item { padding: 1.25rem; }
  .ct-form-card { padding: 1.25rem; }
  .ct-location__map { height: 220px; }
  .h3-account-panel__specs { grid-template-columns: 1fr; }

  /* Footer */
  .footer__grid { grid-template-columns: 1fr; }
  .footer__brand { grid-column: span 1; }
  .footer__legal-links { flex-direction: column; gap: 0.75rem; }

  /* Buttons */
  .btn { padding: 0.65rem 1.2rem; font-size: 0.8rem; }

  /* Pull quote */
  .h1-pullquote::before { display: none; }

  /* Container */
  .container { padding: 0 1rem; }
}

/* ------------------------------------------------
   VERY SMALL MOBILE (max 480px)
   ------------------------------------------------ */
@media (max-width: 480px) {
  .nav__inner { padding: 0 0.65rem; }
  .nav__logo-img { height: 58px; max-height: 62px; }
  .nav__actions .btn { padding: 0.4rem 0.65rem; font-size: 0.72rem; }
  .h1-hero__headline { font-size: clamp(2rem, 8.5vw, 2.75rem); }
  .h2-hero__headline { font-size: clamp(2.25rem, 8.5vw, 3.25rem); }
  .h3-hero__headline { font-size: clamp(2.25rem, 9vw, 3.5rem); }
  .ct-hero__heading { font-size: clamp(2.25rem, 9vw, 3.25rem); }

  .h2-counters__grid { grid-template-columns: 1fr 1fr; }
  .h2-counter__num { font-size: 1.5rem; }

  .theme-panel { width: 100%; max-width: 100%; }
  .h3-steps .h3-step-row__num { font-size: 1.5rem; }

  /* H1 hero scroll */
  .h1-hero__scroll { display: none; }
}

/* ------------------------------------------------
   PRINT MEDIA
   ------------------------------------------------ */
@media print {
  .nav, .theme-toggle, .theme-panel, .theme-panel__overlay { display: none !important; }
  body { background: white; color: black; }
  .h1-hero, .h2-hero, .h3-hero { min-height: auto; }
}

/* ------------------------------------------------
   REDUCED MOTION ACCESSIBILITY
   ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .h1-hero__headline,
  .h1-hero__sub,
  .h1-hero__cta,
  .h1-hero__eyebrow,
  .h2-hero__headline,
  .h2-hero__sub,
  .h2-hero__cta,
  .h2-hero__eyebrow,
  .h2-hero__mini-stats,
  .h2-hero__right,
  .h3-hero__headline,
  .h3-hero__label,
  .h3-hero__cta-row,
  .h3-hero__scroll-num,
  .h3-hero__right {
    opacity: 1;
    transform: none;
  }

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }

  .marquee-track { animation: none; }
  .h2-particle { display: none; }
}
