/* =========================================================
   Sahara Cup · responsive
   The ball lane narrows at each breakpoint; content always starts to its right,
   so the ball never travels over text.
   ========================================================= */

/* Leave room for the fixed progress rail on wide screens */
:root { --content-right: max(84px, calc((100vw - 1320px) / 2 + 84px)); }

@media (max-width: 1180px) {
  .promises { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .depts { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Menu collapses where the full link row no longer fits ---------- */
@media (max-width: 1240px) {
  /* Collapsible glass menu */
  .nav__toggle {
    display: grid; place-items: center; width: 48px; height: 48px; margin-left: auto;
    border: 1px solid rgba(255, 255, 255, .85); border-radius: 14px; cursor: pointer;
    background: rgba(255, 255, 255, .55); color: var(--indigo);
  }
  .nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .25s ease, opacity .25s ease;
  }
  .nav__toggle-bars { position: relative; }
  .nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav__toggle-bars::before { top: -6px; }
  .nav__toggle-bars::after { top: 6px; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] .nav__toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .nav__menu {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .8rem; padding: 1rem;
    border-radius: 20px; border: 1px solid rgba(255, 255, 255, .85);
    background: rgba(255, 252, 245, .86);
    -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
    box-shadow: var(--glass-shadow);
  }
  .js .nav__menu { display: none; }
  .js .nav__menu.is-open { display: flex; }
  .nav__links { flex-direction: column; }
  .nav__links a { padding: .75rem .9rem; font-size: 1.05rem; }
  .nav__menu .btn { justify-content: center; }
  /* No JS: no toggle, keep just the primary action visible */
  html:not(.js) .nav__toggle { display: none; }
  html:not(.js) .nav__menu { position: static; padding: 0; border: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html:not(.js) .nav__links { display: none; }
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
  :root {
    --lane-w: 76px;
    --lane-left: 16px;
    --lane-gap: 24px;
    --content-right: 24px;
  }
  .rail { display: none; }

  .story, .difference, .split, .pair, .facts { grid-template-columns: 1fr; }
  .legacy__grid { grid-template-columns: 1fr; }
}

/* ---------- Hero stacks ---------- */
@media (max-width: 820px) {
  .hero { justify-content: flex-start; padding-bottom: 48px; }
  .hero__inner { grid-template-columns: 1fr; gap: 1.2rem; padding: 0 16px; }
  .hero__copy { max-width: none; }
  .pitch3d { width: min(220px, 60%); }
  .hero__cue { display: none; }
  .kickoff-strip { height: 22vh; min-height: 140px; }
}

/* ---------- Phone ---------- */
@media (max-width: 640px) {
  :root {
    --lane-w: 40px;
    --lane-left: 8px;
    --lane-gap: 12px;
    --content-right: 16px;
    --ball-size: 34px;
    --glass-blur: 10px;
    --glass-blur-strong: 14px;
    --glass-radius: 20px;
    --nav-h: 64px;
  }
  body { font-size: 1rem; }
  /* Compact hero so the pitch and ball show on the first screen */
  .hero { min-height: 0; padding: calc(var(--nav-h) + 16px) 0 8px; }
  .hero__copy { padding: 1.2rem 1.15rem 1.1rem; }
  .hero__title { font-size: 2.9rem; }
  .hero__tagline { font-size: 1.3rem; margin: .3rem 0 .6rem; }
  .hero__lede { font-size: .98rem; line-height: 1.55; }
  .hero__actions { gap: .5rem; margin: 1rem 0 .8rem; }
  .hero__actions .btn { min-height: 44px; padding: .55rem .95rem; font-size: .88rem; }
  .hero__status .pill { font-size: .78rem; }
  .hero__pitch { margin: -44px 0 -60px; }
  .pitch3d { width: 168px; }
  .site-header { top: 8px; padding: 0 8px; }
  .nav { height: 56px; padding: 0 .4rem 0 .8rem; }
  .nav__brand { font-size: 1.12rem; }
  /* Literal values: Safari 18 can ignore var() inside -webkit-backdrop-filter */
  .glass { -webkit-backdrop-filter: blur(10px) saturate(150%); }
  .glass--strong { -webkit-backdrop-filter: blur(14px) saturate(160%); }
  .pitch-lane { border-radius: 20px; }
  .milestone { top: 56px; }
  .milestone__dot { width: 30px; height: 30px; font-size: .9rem; }
  .milestone__label { display: none; }

  .promises, .days, .tiers, .calendar__list, .legend { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .depts { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .duo { gap: .5rem; }
  .photo { padding: 6px; }
  .photo__caption { left: 12px; bottom: 12px; max-width: calc(100% - 24px); font-size: .8rem; }
  .roadmap__bars { height: 300px; gap: .5rem; }
  .roadmap__bar { height: calc(var(--v) * 150px); }
  .roadmap__item { font-size: .78rem; }
  .roadmap__item strong { font-size: .9rem; }
  .tabs__list { width: 100%; }
  .tabs__tab { flex: 1 1 auto; padding: .5rem .7rem; font-size: .92rem; }
  .table { min-width: 520px; }
  .final__actions .btn { width: 100%; justify-content: center; }
  .footer { padding: 0 8px 8px; }
  .footer__inner { grid-template-columns: 1fr; }
  .penalty__toast { font-size: .8rem; padding: .4rem .8rem; }
}

/* Short landscape phones: keep the hero compact */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; }
  .hero__pitch { display: none; }
}
