/* =============================================
   Responsive Breakpoints
   360 / 390 / 480 / 768 / 1024 / 1280+
   ============================================= */

@media (max-width: 768px) {
  .hub-stage {
    padding: 2rem 0 1.5rem;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .hub-card--youtube {
    grid-column: auto;
  }
}

/* ---- Mobile nav ---- */
@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .header-inner {
    flex-wrap: nowrap;
    height: var(--header-height);
    padding: 0 1.25rem;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    z-index: 150;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: none;
    padding: 0.75rem 1.25rem 1.25rem;
    gap: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: var(--shadow-lg);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav-links {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .main-nav-links > a {
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .lang-switcher {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .lang-dropdown {
    width: 100%;
  }

  .lang-dropdown-toggle {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .lang-dropdown-menu {
    position: static;
    transform: none;
    left: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    max-height: 12rem;
    margin-top: 0.375rem;
    box-shadow: none;
    border: 1px solid var(--border);
  }

  [dir="rtl"] .lang-dropdown-menu {
    left: auto;
    right: auto;
    transform: none;
  }

  .main-nav a.nav-tool {
    font-size: 0.9375rem;
    padding: 0.875rem 0;
  }

  .search-bar {
    padding: 0.25rem 0.25rem 0.25rem 0.625rem;
    gap: 0.25rem;
  }

  .search-bar-icon {
    display: none;
  }

  .url-input {
    font-size: 16px;
    padding: 0.5rem 0.125rem;
  }

  .format-picker-toggle {
    min-width: 4.25rem;
    min-height: 36px;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
  }

  .format-picker-value {
    max-width: 3.5rem;
  }

  .search-bar .btn-download {
    min-height: 36px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
  }
}

/* ---- 480px and below ---- */
@media (max-width: 480px) {
  .hero {
    padding: 2rem 0 1.5rem;
  }

  .search-bar {
    border-radius: 1rem;
  }

  .format-type-toggle {
    width: 100%;
    justify-content: center;
  }

  .format-type-option {
    flex: 1;
  }

  .format-type-option span {
    text-align: center;
  }

  .url-input {
    padding: 0.75rem 0.5rem;
  }

  .search-bar .btn-download {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .result-header {
    flex-direction: column;
    padding: 1.25rem;
  }

  .result-thumbnail {
    width: 100%;
    max-width: 100%;
  }

  .format-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .btn-format-download {
    width: 100%;
    text-align: center;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .platform-cards-grid {
    grid-template-columns: 1fr;
  }

  .endbar-matrix {
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem 1.25rem;
  }

  .endbar-zone--identity {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .endbar-matrix {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .endbar-zone--identity {
    grid-column: auto;
  }

  .endbar-badges {
    gap: 0.4rem;
  }

  .endbar-badge {
    font-size: 0.6875rem;
  }
}

/* ---- 360px ---- */
@media (max-width: 360px) {
  .container {
    padding: 0 1rem;
  }

  .header-inner {
    padding: 0 1rem;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .logo span {
    font-size: 1rem;
  }
}

/* ---- 390px fine-tuning ---- */
@media (min-width: 361px) and (max-width: 390px) {
  .hero-subtitle {
    font-size: 0.9375rem;
  }
}

/* ---- Tablet ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .step-card {
    padding: 1.25rem;
  }
}

/* ---- Desktop ---- */
@media (min-width: 1024px) {
  .hero {
    padding: 4.5rem 0 3rem;
  }

  .url-input {
    font-size: 1rem;
    padding: 0.75rem 0.375rem;
  }

  .btn-download {
    padding: 1rem 2.5rem;
    font-size: 1.0625rem;
  }
}

/* ---- Large desktop ---- */
@media (min-width: 1280px) {
  .container {
    padding: 0 2rem;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
