/* ==========================================================================
   BEIKORA — Responsive Breakpoints
   Mobile-first override layer.
   Base / desktop styles live in sections.css and components.css.

   Breakpoints
   ─────────────────────────────────────────────────────────────────────────
   Tablet          max-width: 1024px
   Small tablet    max-width: 768px
   Mobile          max-width: 576px
   Very small      max-width: 400px
   ========================================================================== */


/* ==========================================================================
   NAVIGATION
   ========================================================================== */

/* ── Show hamburger + mobile drawer on small tablets and below ── */
@media (max-width: 768px) {

  .nav__inner {
    padding: 0 var(--space-md);
  }

  /* Hide horizontal links and secondary action button */
  .nav__links {
    display: none;
  }

  .nav__actions .btn--primary {
    display: none;
  }

  /* Reveal hamburger button */
  .nav__hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-xs);
    transition: background var(--duration-short) var(--ease-default);
  }

  .nav__hamburger:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  /* Mobile drawer — fullscreen slide-in panel */
  .nav__mobile {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 100vw);
    background: var(--surface-container);
    border-left: 1px solid rgba(38, 38, 38, 0.5);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: calc(var(--nav-height) + 24px) 32px 40px;
    gap: 0;
    overflow-y: auto;
    transform: translateX(100%);
  }

  .nav__mobile-link {
    display: block;
    padding: 14px 0;
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--on-surface-variant);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: color var(--duration-short) var(--ease-default);
    letter-spacing: var(--ls-snug);
  }

  .nav__mobile-link:hover,
  .nav__mobile-link:focus-visible {
    color: var(--on-surface);
  }

  .nav__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
  }

  /* Backdrop overlay */
  .nav__overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

/* ── Ensure desktop elements stay visible above the breakpoint ── */
@media (min-width: 769px) {
  .nav__hamburger {
    display: none !important;
  }

  .nav__mobile {
    display: none !important;
  }

  .nav__overlay {
    display: none !important;
  }
}


/* ==========================================================================
   HERO
   ========================================================================== */

/* ── Tablet: two-column but tighter ── */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

/* ── Small tablet / large mobile: single column ── */
@media (max-width: 768px) {
  .hero {
    padding-top: calc(var(--nav-height) + 20px);
    padding-bottom: 48px;
    min-height: auto;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 28px;
    align-items: center;
  }

  .hero__content {
    max-width: 100%;
  }

  .hero__eyebrow {
    margin-bottom: 16px;
  }

  .hero__subtitle {
    max-width: 100%;
    margin-inline: auto;
    margin-bottom: 20px;
  }

  .hero__cta {
    justify-content: center;
    gap: 12px;
  }

  .hero__store-badges {
    justify-content: center;
    margin-top: 16px;
  }

  .hero__social-proof {
    justify-content: center;
    margin-top: 16px;
  }

  /* Phone mockup moves above the headline on mobile */
  .hero__visual {
    order: -1;
  }

  .hero__title {
    font-size: clamp(2.25rem, 10vw, 3rem);
    margin-bottom: 16px;
  }
}

/* ── Mobile: stack CTA but keep social proof as compact row ── */
@media (max-width: 576px) {
  .hero__cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero__cta .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Social proof — horizontal compact row, no stacking */
  .hero__social-proof {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
  }

  .proof-item {
    font-size: 0.8125rem;
  }

  .proof-divider {
    width: 1px;
    height: 16px;
  }
}


/* ==========================================================================
   TRUST BAR
   ========================================================================== */

@media (max-width: 980px) {
  .stats-bar__grid {
    grid-template-columns: 1fr 1px 1fr;
    row-gap: 48px;
  }
  .stats-bar__divider:nth-of-type(2) {
    display: none;
  }
  .stats-bar__item {
    padding: 16px 24px;
  }
}

@media (max-width: 640px) {
  .stats-bar {
    padding: 40px 0 48px;
  }
  .stats-bar__eyebrow {
    margin-bottom: 16px;
  }
  .stats-bar__grid {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .stats-bar__divider {
    display: none;
  }
  .stats-bar__item {
    padding: 20px 12px;
    border-bottom: 1px solid var(--border);
  }
  .stats-bar__item:last-child {
    border-bottom: none;
  }
  .stats-bar__number {
    font-size: clamp(1.75rem, 9vw, 2.5rem);
  }
  .stats-bar__context {
    max-width: 100%;
    font-size: var(--text-sm);
  }
}


/* ==========================================================================
   FEATURES GRID
   ========================================================================== */

/* ── Tablet: 2-column grid; hero card stacks ── */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-card--hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 36px;
  }
  .feature-card__hero-visual {
    min-height: 140px;
  }
  .feature-card__rings-bg {
    width: 140px;
    height: 140px;
  }
}

/* ── Mobile: single column ── */
@media (max-width: 576px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: var(--space-lg);
  }

  .feature-card--hero {
    grid-column: span 1;
    padding: var(--space-lg);
  }

  .feature-card__hero-visual {
    display: none;
  }
}


/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */

@media (max-width: 768px) {
  /* Grid collapse — flex-direction has no effect on display:grid */
  .steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .step {
    padding: 28px 24px;
  }

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


/* ==========================================================================
   SHOWCASE
   ========================================================================== */

/* ── Tablet: collapse to single column, text below phone ── */
@media (max-width: 1024px) {
  .showcase__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .showcase__phone {
    order: -1;
    display: flex;
    justify-content: center;
  }

  .showcase__list {
    align-items: center;
  }

  .showcase__list li {
    justify-content: center;
  }

  /* Reuse section-header alignment */
  .showcase .section-header {
    text-align: center;
  }
}

/* ── Mobile: hide floating callout bubbles to reduce clutter ── */
@media (max-width: 768px) {
  .callout--1,
  .callout--2 {
    display: none;
  }
}

@media (max-width: 576px) {
  .showcase__inner {
    gap: 32px;
  }
}


/* ==========================================================================
   DIFFERENTIATORS
   ========================================================================== */

/* ── Tablet: 2-column with middle card spanning full row ── */
@media (max-width: 1024px) {
  .diff-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .diff-card:nth-child(2) {
    grid-column: 1 / -1;
    max-width: 480px;
    margin-inline: auto;
    width: 100%;
  }
}

/* ── Mobile: single column, reset middle-card overrides ── */
@media (max-width: 576px) {
  .diff-grid {
    grid-template-columns: 1fr;
  }

  .diff-card:nth-child(2) {
    grid-column: auto;
    max-width: none;
    margin-inline: 0;
  }
}


/* ==========================================================================
   PRICING
   ========================================================================== */

/* ── Tablet and below: stack cards, feature card first ── */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
  }

  /* Remove the "lifted" transform on the featured card when stacked */
  .pricing-card--featured {
    transform: none;
    order: -1;
  }

  .pricing-card--featured:hover {
    transform: translateY(-4px);
  }
}

@media (max-width: 576px) {
  .pricing-grid {
    max-width: 100%;
  }

  .pricing-card {
    padding: var(--space-lg);
  }
}


/* ==========================================================================
   FAQ
   ========================================================================== */

@media (max-width: 768px) {
  .faq__inner {
    max-width: 100%;
  }

  .faq-question {
    font-size: 0.9375rem;
    padding: 18px 20px;
  }

  .faq-answer {
    padding: 0 20px 16px;
  }
}

@media (max-width: 576px) {
  .faq-question {
    font-size: 0.875rem;
    padding: 16px;
    line-height: var(--lh-snug);
  }

  .faq-answer {
    padding: 0 16px 16px;
    font-size: var(--text-sm);
  }
}


/* ==========================================================================
   FINAL CTA
   ========================================================================== */

@media (max-width: 768px) {
  .cta-final__inner {
    text-align: center;
    padding: 64px var(--space-lg);
  }
}

@media (max-width: 576px) {
  .cta-final__badges {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

/* ── Tablet: 2-column, brand row spans full width ── */
@media (max-width: 1024px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

/* ── Small tablet: tighter padding and bottom bar stacks ── */
@media (max-width: 768px) {
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    padding-block: 40px 32px;
    gap: 32px;
  }

  .footer__bottom .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
}

/* ── Mobile: true single column ── */
@media (max-width: 576px) {
  .footer__inner {
    grid-template-columns: 1fr;
  }

  .footer__brand {
    grid-column: auto;
  }

  .footer__col-title {
    margin-bottom: var(--space-sm);
  }
}


/* ==========================================================================
   GENERAL SECTION PADDING — targets both .section class AND section element
   ========================================================================== */

@media (max-width: 768px) {
  section,
  .section {
    padding-block: 72px;
  }

  .section--sm {
    padding-block: 52px;
  }

  .section--lg {
    padding-block: 88px;
  }

  .section-header {
    margin-bottom: 40px;
  }
}

@media (max-width: 576px) {
  section,
  .section {
    padding-block: 56px;
  }

  .section--sm {
    padding-block: 40px;
  }

  .section--lg {
    padding-block: 72px;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .section-title {
    font-size: clamp(1.625rem, 8vw, 2.25rem);
  }

  .section-subtitle {
    font-size: var(--text-body);
  }

  /* Reduce container side gutters slightly on very small screens */
  .container {
    padding-inline: var(--space-md);
  }
}

@media (max-width: 400px) {
  section,
  .section {
    padding-block: 48px;
  }
}


/* ==========================================================================
   PHONE MOCKUP — Sizes on mobile (legacy)
   ========================================================================== */

@media (max-width: 576px) {
  .phone-mockup--hero .phone-mockup__frame {
    width: 220px;
    height: 460px;
  }

  .phone-mockup--large .phone-mockup__frame {
    width: 240px;
    height: 500px;
  }
}


/* ==========================================================================
   IPHONE FRAME — Sizes on mobile
   ========================================================================== */

@media (max-width: 1024px) {
  .iphone-frame--showcase .iphone-frame__body { width: 260px; }
  .iphone-frame--duo .iphone-frame__body { width: 220px; }
}

@media (max-width: 768px) {
  .iphone-frame--hero .iphone-frame__body { width: 200px; }
  .hero__rings { display: none; }
}

@media (max-width: 576px) {
  .iphone-frame--hero .iphone-frame__body  { width: 185px; }
  .iphone-frame--showcase .iphone-frame__body { width: 200px; }
  .iphone-frame--duo .iphone-frame__body   { width: 185px; }
}


/* ==========================================================================
   SHOWCASE — Dos phones responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .showcase__stage {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .showcase__phones {
    order: -1;
    justify-content: center;
    height: 480px;
  }

  .showcase__phone-back {
    right: auto;
    left: calc(50% - 200px);
  }

  .showcase__content {
    max-width: 100%;
  }

  .showcase__content .section-header {
    text-align: center;
  }

  .showcase__desc {
    max-width: 100%;
    margin-inline: auto;
  }

  .showcase__list li {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .showcase__phone-back {
    display: none;
  }

  .showcase__phone-front {
    transform: none;
  }

  .showcase__phones {
    height: auto;
  }
}


/* ==========================================================================
   DIFFERENTIATORS — Responsive grid
   ========================================================================== */

@media (max-width: 1024px) {
  .diff-grid {
    grid-template-columns: 1fr;
    border-radius: var(--radius-lg);
  }

  .diff-card {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 36px 28px;
  }

  .diff-card:last-child {
    border-bottom: none;
  }
}


/* HOW IT WORKS — duplicate block removed, handled above */


/* ==========================================================================
   VERY SMALL SCREENS  (max-width: 400px)
   ========================================================================== */

@media (max-width: 400px) {
  /* Single-column buttons go truly full-width */
  .hero__cta .btn {
    max-width: 100%;
  }

  /* Prevent typography from going too large */
  .hero__title {
    font-size: clamp(2rem, 12vw, 2.5rem);
  }

  .section-title {
    font-size: clamp(1.5rem, 9vw, 2rem);
  }

  /* Reduce section padding a touch more */
  .section {
    padding-block: 56px;
  }

  /* Pricing card: reduce internal spacing */
  .pricing-card {
    padding: var(--space-md);
  }

  /* Feature card: reduce internal spacing */
  .feature-card {
    padding: var(--space-md);
  }

  /* Store badges fit side by side still */
  .store-badge img {
    height: 44px;
  }

  /* Footer columns tighten */
  .footer__inner {
    gap: 24px;
  }
}


/* ==========================================================================
   TYPOGRAPHY SCALE — Fluid overrides at breakpoints
   ========================================================================== */

/* Allow hero to shrink gracefully between 768–1024 */
@media (max-width: 1024px) {
  .hero__title {
    font-size: clamp(2.5rem, 7vw, 3.5rem);
  }
}

/* Section eyebrow — slightly smaller on mobile */
@media (max-width: 576px) {
  .section-eyebrow {
    font-size: 0.6875rem;
    letter-spacing: 0.4px;
  }
}


/* ==========================================================================
   COMPONENT OVERRIDES AT BREAKPOINTS
   ========================================================================== */

/* ── Pill and badge — reduce padding on mobile ── */
@media (max-width: 576px) {
  .pill {
    padding: 5px 12px;
    font-size: 0.6875rem;
  }

  .badge {
    padding: 2px 8px;
    font-size: 0.625rem;
  }
}

/* ── Buttons — slightly shorter padding on mobile ── */
@media (max-width: 576px) {
  .btn--primary,
  .btn--secondary {
    padding: 13px 24px;
  }

  .btn--sm {
    padding: 9px 18px;
    font-size: 0.8125rem;
  }
}


/* ==========================================================================
   ACCESSIBILITY — Touch targets on mobile
   ========================================================================== */

@media (max-width: 768px) {
  /* Ensure all interactive elements meet 44px minimum touch target */
  .btn {
    min-height: 44px;
  }

  .nav__mobile-link {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .faq-question {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .store-badge {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}
