/* The Leap Europe — mobile-first refinement
   Loaded after style.css by build.js. Desktop is intentionally untouched.
   This file focuses on real phone viewports, iOS-safe scrolling, touch targets,
   readable typography and reducing unnecessary vertical friction. */

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 78px;
  }

  body {
    overflow-x: clip;
  }

  img,
  svg,
  video,
  canvas {
    max-width: 100%;
  }

  .container {
    width: min(calc(100% - 32px), 1180px);
  }

  .section {
    padding: 60px 0;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.6rem, 12vw, 4rem);
    line-height: 1.01;
    overflow-wrap: break-word;
  }

  h2 {
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1.06;
    overflow-wrap: break-word;
  }

  h3,
  p,
  li,
  a,
  button,
  label,
  input,
  select,
  textarea {
    overflow-wrap: break-word;
  }

  p {
    font-size: .98rem;
    line-height: 1.72;
  }

  /* The promotional strip should remain useful without consuming the first
     quarter of an Instagram visitor's screen. */
  .launch-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    min-height: 0;
    padding: 10px 16px;
    text-align: left;
    font-size: .72rem;
    line-height: 1.42;
  }

  .launch-bar-link {
    align-self: center;
    white-space: nowrap;
  }

  .credibility-row {
    padding: 7px 16px;
    font-size: .7rem;
    line-height: 1.45;
  }

  /* When the menu is open, promote the real navigation to the very top of the
     viewport. This removes the launch/credibility bars from the interaction
     path and gives #primary-navigation almost the entire visible phone screen.
     The following sibling keeps the nav's flow height so the frozen background
     does not jump underneath the overlay. */
  html.nav-menu-open .nav,
  body.nav-menu-open .nav {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    z-index: 140;
  }

  body.nav-menu-open .nav + * {
    margin-top: var(--mobile-nav-offset, 68px);
  }

  html.js .nav {
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }

  html.js .nav-inner {
    height: 64px;
  }

  html.js .nav-toggle {
    min-width: 96px;
    min-height: 46px;
    justify-content: center;
    padding: 10px 16px;
    font-size: .82rem;
  }

  html.js .nav-logo img {
    width: 30px;
    height: 42px;
  }

  html.js .nav-links {
    top: var(--mobile-nav-offset, 64px);
    height: calc(var(--mobile-nav-viewport, 100dvh) - var(--mobile-nav-offset, 64px));
    max-height: calc(var(--mobile-nav-viewport, 100dvh) - var(--mobile-nav-offset, 64px));
    padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 22px) max(18px, env(safe-area-inset-left, 0px));
    background: rgba(251, 250, 248, .995);
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  html.js .nav-mobile-heading {
    margin-top: 8px;
    padding: 2px 4px 3px;
    font-size: .67rem;
    line-height: 1.35;
  }

  html.js .nav-mobile-study-toggle,
  html.js .nav-single-link,
  html.js .nav-dropdown a {
    min-height: 46px;
    padding: 8px 4px;
    font-size: .92rem;
    line-height: 1.35;
  }

  html.js .nav-mobile-study-toggle {
    font-size: .88rem;
  }

  html.js .nav-mobile-study-more a {
    min-height: 44px;
    padding-left: 16px;
    font-size: .86rem;
  }

  html.js .nav-links a.btn {
    min-height: 48px;
    margin-top: 12px;
    padding: 12px 18px;
    font-size: .86rem;
  }

  .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 0;
    margin-bottom: 18px;
    line-height: 1.5;
  }

  .breadcrumb span {
    margin: 0 5px;
  }

  .hero {
    padding: 54px 0 66px;
    gap: 28px;
  }

  .hero-sub {
    max-width: none;
    margin-bottom: 28px;
    font-size: 1.02rem;
    line-height: 1.7;
  }

  .hero-btns,
  .cta-btns,
  .open-session-actions,
  .lab-form-actions {
    gap: 10px;
  }

  .hero-btns .btn,
  .cta-btns .btn,
  .open-session-actions .btn,
  .lab-form-actions .btn {
    min-height: 48px;
  }

  .guidance-hero-grid {
    gap: 24px;
  }

  .guidance-hero-grid .founder-card {
    max-width: none;
  }

  .founder-card {
    width: 100%;
    padding: 26px;
    gap: 10px;
  }

  .founder-card::before {
    right: -30px;
    font-size: 2.65rem;
  }

  .founder-photo.founder-photo-portrait {
    width: 96px;
    height: 96px;
  }

  .founder-name {
    font-size: 1.75rem;
  }

  .founder-creds {
    max-width: 100%;
    font-size: .84rem;
  }

  .glance,
  .guidance-glance {
    margin: 22px 0;
    padding: 6px 18px;
  }

  .glance-row {
    gap: 3px;
    padding: 12px 0;
  }

  .route-grid,
  .scope-grid,
  .commitments,
  .related-grid,
  .journey,
  .lab-event-grid,
  .lab-what-grid,
  .lab-session-list {
    gap: 12px;
  }

  .route-card,
  .scope-col,
  .commitment,
  .related-item,
  .journey-stage,
  .lab-event-card,
  .lab-session-row,
  .note,
  .toc {
    padding: 18px;
  }

  .intent-box,
  .story-box,
  .session-box,
  .resource-card,
  .open-session-box,
  .lab-suggest-box {
    padding: 24px;
  }

  .waitlist-box {
    padding: 32px 18px;
  }

  .profile-eval-form,
  .lab-form,
  .waitlist-box,
  .resource-card,
  .open-session-box {
    width: 100%;
    max-width: 100%;
  }

  /* 16px prevents iOS Safari from zooming the page when a form field receives
     focus. Comfortable 50px+ controls also improve touch accuracy. */
  .field input,
  .field textarea,
  .field select,
  .lab-form input,
  .lab-form textarea,
  .lab-form select {
    min-height: 50px;
    font-size: 16px;
  }

  .field textarea,
  .lab-form textarea {
    min-height: 118px;
  }

  .lab-choice-group,
  .lab-single-check,
  .lab-consents {
    padding: 16px;
  }

  .lab-check {
    min-height: 44px;
  }

  .exam-table-wrap,
  .table-wrap {
    max-width: 100%;
    overscroll-behavior-x: contain;
  }

  .faq-accordion .faq-q {
    min-height: 52px;
  }

  .footer.footer-expanded,
  .footer {
    padding-right: 18px;
    padding-left: 18px;
  }

  .footer.footer-expanded {
    gap: 28px;
    padding-top: 42px;
    padding-bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  }

  .footer-expanded .footer-links a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
  }

  .mobile-sticky-cta {
    padding-top: 9px;
    padding-right: 82px;
    padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
    padding-left: 12px;
  }

  .whatsapp-float {
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 430px) {
  .container {
    width: calc(100% - 28px);
  }

  .section {
    padding: 52px 0;
  }

  .launch-bar {
    padding: 9px 14px;
    font-size: .7rem;
  }

  .credibility-row {
    padding: 6px 14px;
    font-size: .68rem;
  }

  .nav-wordmark {
    display: none;
  }

  .hero {
    padding: 46px 0 58px;
  }

  .founder-card,
  .intent-box,
  .story-box,
  .session-box,
  .resource-card,
  .open-session-box,
  .lab-suggest-box {
    padding: 20px;
  }

  .waitlist-box {
    padding: 28px 16px;
  }

  .service-card,
  .service-card.featured {
    padding: 24px 20px;
  }

  .math-row {
    padding: 16px;
  }

  .mobile-sticky-cta .btn {
    font-size: .8rem;
  }
}

@media (max-width: 375px) {
  .launch-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .launch-bar-link {
    font-size: .69rem;
  }

  html.js .nav-toggle {
    min-width: 90px;
    padding-right: 13px;
    padding-left: 13px;
  }
}
