/* ===========================================
   BONOBONO - Responsive Styles
   =========================================== */

/* ─── Default: hide mobile-only elements ─── */
.nav__hamburger {
  display: none;
}
.nav__mobile-menu {
  display: none;
}

/* ─── Small Desktop (1024px - 1200px) ─── */
@media (max-width: 1200px) {
  .localization__bg-left,
  .localization__bg-right {
    height: 55% !important;
    opacity: 0.4 !important;
  }
  .localization__bg-left {
    transform: translateX(-25%);
  }
  .localization__bg-right {
    transform: translateX(25%);
  }
}

/* ─── Tablet (640px - 1024px) ─── */
@media (max-width: 1024px) {
  :root {
    --text-hero: 3.5rem;
    --text-5xl: 2.5rem;
  }

  .nav__logo {
    gap: 8px !important;
  }

  .nav__logo img {
    height: 32px !important;
    margin: 0 !important;
  }

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

  .characters__carousel {
    justify-content: flex-start;
  }

  .about-scroll-wrapper {
    height: auto;
  }

  .about {
    position: relative;
    top: auto;
  }

  .about::before {
    background-size: contain;
    background-position: center right;
    opacity: 0.08;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .about__timeline {
    padding-left: var(--space-6);
  }

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

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

  .bento-card--wide {
    grid-column: span 2;
  }

  .bento-card--tall {
    grid-row: span 1;
  }

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

  .community__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

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

  .footer__about {
    grid-column: span 2;
    padding-right: 0;
  }

  .footer__partners {
    gap: var(--space-6);
  }

  .localization__bg-left,
  .localization__bg-right {
    height: 45% !important;
    opacity: 0.25 !important;
  }
  .localization__bg-left {
    transform: translateX(-40%);
  }
  .localization__bg-right {
    transform: translateX(40%);
  }
}

/* ─── Small Tablet (< 768px) ─── */
@media (max-width: 768px) {
  .localization__bg-left,
  .localization__bg-right {
    display: none !important;
  }
}

/* ─── Mobile (< 640px) ─── */
@media (max-width: 640px) {
  :root {
    --text-hero: 2.5rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --space-24: 4rem;
    --space-16: 3rem;
  }

  /* Navigation */
  .nav {
    padding: 0 var(--space-4);
  }

  .nav__links {
    display: none;
  }

  .nav__logo-text {
    display: none;
  }

  /* Nav logo bar — scale down and hide dividers */
  .nav__logo {
    gap: var(--space-2) !important;
  }

  .nav__logo img {
    height: 32px !important;
    margin: 0 !important;
  }

  .nav__logo > span {
    display: none;
  }

  /* Hamburger button */
  .nav__hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px 8px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    flex-shrink: 0;
  }

  .nav__hamburger-bar {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--ocean-deep);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Mobile menu overlay */
  .nav__mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--nav-height);
    background: rgba(232, 244, 248, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
  }

  .nav__mobile-menu.is-open {
    display: flex;
  }

  .nav__mobile-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-8);
  }

  .nav__mobile-link {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--ocean-deep);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-3) var(--space-6);
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .nav__mobile-link:hover {
    color: var(--coral-accent);
  }

  /* Hero */
  .hero {
    padding-top: calc(var(--nav-height) + var(--space-8));
  }

  .hero__content {
    padding: var(--space-4);
  }

  .hero__character {
    width: 150px;
    height: 150px;
    font-size: 4rem;
  }

  .hero__logo {
    height: 56px;
  }

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

  /* Soundboard — fix column/tile size mismatch */
  .soundboard {
    gap: var(--space-3);
  }

  .language-tile {
    width: 72px;
    height: 72px;
  }

  .language-tile__flag {
    font-size: 1.4rem;
  }

  .language-tile__name {
    font-size: var(--text-xs);
  }

  /* Scene selector */
  .scene-selector {
    gap: var(--space-2) !important;
  }

  /* About section — remove wasted right padding */
  .about__content {
    padding-right: 0;
  }

  /* Stats */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    padding: var(--space-8) var(--space-4);
  }

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

  /* Character Carousel — near-full-width cards */
  .characters__carousel {
    padding: var(--space-4) var(--space-4);
    gap: var(--space-4);
    justify-content: flex-start;
  }

  .character-card {
    flex: 0 0 calc(100vw - var(--space-12));
    max-width: 320px;
    padding: var(--space-4);
  }

  .character-card__image {
    height: 140px;
    font-size: 3rem;
  }

  /* Culture grid — collapse to single column */
  .culture-grid {
    grid-template-columns: 1fr !important;
    max-width: 320px !important;
  }

  /* Bento Grid */
  .bento__grid {
    grid-template-columns: 1fr;
  }

  .bento-card--wide,
  .bento-card--tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  /* Blog Grid */
  .blog__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  /* Featured Article */
  .blog-featured {
    grid-template-columns: 1fr !important;
    padding: var(--space-6) !important;
  }

  .blog-featured > div:first-child {
    aspect-ratio: 16/9 !important;
  }

  /* Community */
  .community__grid {
    grid-template-columns: 1fr;
  }

  .community__subscribe {
    flex-direction: column;
  }

  /* Video */
  .video__languages {
    gap: var(--space-2);
  }

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

  /* Footer */
  .footer .container {
    padding: 0 var(--space-4);
  }

  .footer__partners {
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-8) 0 var(--space-6);
  }

  .footer__partner-logo {
    height: 28px;
  }

  .footer__partner-logo--tall {
    height: 36px;
  }

  .footer__anniversary-logo {
    height: 120px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
  }

  .footer__about {
    grid-column: span 1;
    padding-right: 0;
  }

  .footer__links {
    align-items: center;
  }

  /* Section Spacing */
  section {
    padding: var(--space-16) 0;
  }

  .container {
    padding: 0 var(--space-4);
  }
}

/* ─── Extra Small (< 360px) ─── */
@media (max-width: 360px) {
  .soundboard {
    gap: var(--space-2);
  }

  .language-tile {
    width: 60px;
    height: 60px;
  }

  .language-tile__flag {
    font-size: 1.2rem;
  }

  .nav__logo img {
    height: 26px !important;
  }
}

/* ─── Wide Screens (> 1440px) ─── */
@media (min-width: 1440px) {
  :root {
    --text-hero: 5rem;
    --container-max: 1400px;
  }

  .hero__character {
    width: 250px;
    height: 250px;
    font-size: 8rem;
  }

  .language-tile {
    width: 110px;
    height: 110px;
  }
}

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

  .hero__character {
    animation: none;
  }

  .wave-bg svg {
    animation: none;
  }

  .scroll-indicator {
    animation: none;
  }
}

/* ─── Print Styles ─── */
@media print {
  .nav,
  .scroll-indicator,
  .wave-bg,
  .soundboard,
  .video-section {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  section {
    page-break-inside: avoid;
  }
}
