/* =========================================================
   Device layer — iPad / iPhone 17 family tuning. Loaded last.
   Breakpoints used across the site:
     ≤600   small phones            (iPhone 17 / Pro 402px, Pro Max 440px)
     ≤960   phones + iPad portrait  (hamburger nav, single column)
     768–960 tablet portrait        (this file: two-column grids, horizontal footer)
     961–1240 iPad landscape / iPad Pro portrait (compact desktop)
   ========================================================= */

/* ---------- Safe areas (notch / Dynamic Island / home indicator) ---------- */
@supports (padding: max(0px)) {
  .container { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  .site-footer { padding-bottom: max(36px, env(safe-area-inset-bottom)); }
  .nav.is-open { padding-bottom: max(40px, env(safe-area-inset-bottom)); }
}

/* ---------- Touch devices: 44px minimum targets, no hover-only states ---------- */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .nav__link, .subnav__link, .footer__links a, .tab, .tl__btn, .acc__btn { min-height: 44px; }
  .chip { padding: 11px 16px; }
  .footer__social a { padding: 6px; margin: -6px; }
  .nav__dropdown a { padding-top: 12px; padding-bottom: 12px; }
}

/* ---------- Tablet portrait: iPad 10.9"/11" (820–834px), iPad mini (744–768px) ---------- */
@media (min-width: 740px) and (max-width: 960px) {
  :root { --gutter: 40px; --header-h: 88px; }
  body { font-size: 17px; }
  .brand { gap: 18px; }
  .brand__seal { height: 56px; }
  .brand__sep { height: 46px; }
  .brand__word { height: 40px; }
  .brand__lockup { height: 56px; }
  .nav { padding: 24px var(--gutter) 40px; }
  .nav__link { font-size: 17px; }
  .nav__dropdown { columns: 2; column-gap: 32px; }
  .nav__dropdown a { break-inside: avoid; }
  .nav__cta { margin-top: 32px; }

  /* heroes */
  .hero { min-height: 560px; }
  .hero__logo { width: 240px; }
  .hero__tag { font-size: 15px; }
  .hero__title { font-size: 28px; }
  .hero__title--lg { font-size: 48px; }
  .pr-hero { min-height: 320px; }
  .pr-hero__title { font-size: 44px; }
  .stories-hero__title { font-size: 44px; }

  /* type */
  .section { padding: 64px 0; }
  .section__title { font-size: 32px; }
  .section__sub { font-size: 17px; }
  .statement p, .bets__copy { font-size: 19px; }
  .quote { font-size: 30px; }
  .goal__title { font-size: 48px; }
  .join__title { font-size: clamp(30px, 5.2vw, 46px); }
  .h-xl { font-size: 48px; } .h-lg { font-size: 36px; }

  /* home */
  .split { grid-template-columns: 1fr 1fr; }
  .split__media { order: 2; }
  .split__media img { height: 100%; }
  .split__text { text-align: left; align-items: flex-start; padding: 48px 40px; }
  .split__text .btn { align-self: flex-start; }
  .quote-mark { margin: 0 0 20px; }
  .prow, .prow--flip { grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
  .prow--flip .prow__media { order: 2; }
  .prow__media img { height: 340px; }
  .prow__num { font-size: 52px; }
  .prow__title { font-size: 32px; }
  .progress { grid-template-columns: 1fr 240px 1fr; gap: 32px; }
  .progress__ring { grid-column: auto; order: 0; width: 240px; height: 240px; }
  .join .container { grid-template-columns: 300px 1fr; gap: 32px; text-align: left; }
  .join__icon { width: 240px; }
  .join__actions { justify-content: flex-start; }

  /* footer: three columns */
  .site-footer { padding: 56px 0 32px; }
  .footer__grid { grid-template-columns: 1.1fr 1fr 1fr; gap: 24px; align-items: center; }
  .footer__brand .brand__seal { height: 80px; }
  .footer__brand .brand__sep { height: 60px; }
  .footer__brand .brand__word { height: 50px; }
  .footer__brand .brand__lockup { height: 80px; }
  .footer__links { border-left: 1px solid rgba(255,255,255,.6); border-right: 1px solid rgba(255,255,255,.6); padding: 12px 0; min-height: 110px; justify-content: center; gap: 18px 36px; }
  .footer__side { padding-left: 24px; align-items: flex-start; }

  /* grids → two columns */
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr 1fr; gap: 24px; }
  .stories-grid-2, .stories-grid-3, .st-more__grid, .pr-feat__grid, .pr-stories__grid, .gstories__grid, .gexplore__grid, .ggive__cards, .ptile-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .story-card--feature, .story-card--feature.story-card--flip, .story-card--row, .story-card--row.story-card--flip { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .pr-feat-card--lg { grid-column: 1 / -1; }
  .pr-enable__item { width: 50% !important; }
  .pr-split, .pr-slider, .st-split__inner, .st-feature, .st-band--split, .st2-band, .st2-band--left { grid-template-columns: 1fr 1fr !important; }
  .cstats .container { grid-template-columns: 1fr 1fr 1fr !important; }
  .cintro__top { grid-template-columns: 1fr 1fr !important; }
  .tl__eras { grid-template-columns: repeat(3, 1fr) !important; gap: 8px 16px !important; }
  .tl__btn { flex-direction: column !important; text-align: center !important; border-bottom: 0 !important; }
  .tl__dot { margin-bottom: 12px !important; }
  .tl__year { min-width: 0 !important; }
  .cform__row { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .gform { grid-template-columns: 1fr 1fr !important; }
  .subnav__list { gap: 36px; }
  .subnav__search { width: 260px; margin: 0; }
  .subnav .container { flex-wrap: nowrap; }
}

/* ---------- iPad landscape / iPad Pro 13" portrait / small laptops (961–1240px) ---------- */
@media (min-width: 961px) and (max-width: 1240px) {
  :root { --header-h: 104px; }
  .brand__seal { height: 64px; }
  .brand__sep { height: 50px; }
  .brand__word { height: 46px; }
  .brand__lockup { height: 64px; }
  .nav { gap: 24px; }
  .nav__list { gap: 22px; }
  .nav__link { font-size: 13px; }
  .nav__cta { margin-left: 8px; min-height: 52px; padding: 0 22px; }
  .hero { min-height: 560px; }
  .hero__logo { width: 280px; }
  .prow__media img { height: 420px; }
  .prow__title { font-size: 34px; }
  .join__title { font-size: clamp(34px, 4vw, 48px); }
  .join__icon { width: 280px; }
  .footer__links { gap: 24px 40px; }
  .footer__side { padding-left: 32px; }
  .goal__title { font-size: 60px; }
}

/* ---------- Large phones: iPhone 17 Pro Max (440px) / Plus-class ---------- */
@media (min-width: 420px) and (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero__title { font-size: 24px; }
  .join__title { font-size: clamp(28px, 8.2vw, 40px); }
  .goal__title { font-size: 38px; }
}

/* ---------- Phones in landscape (iPhone 17 family: 874–956 × 402–440) ---------- */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  .hero { min-height: 100vh; }
  .hero__logo { width: 150px; margin-bottom: 14px; }
  .hero__title { margin-top: 18px; }
  .nav { padding-top: 8px; }
  .nav__link { padding: 10px 0; }
  .nav__cta { margin-top: 16px; }
}

/* ---------- Very narrow (≤360px, older/compact phones) ---------- */
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .hero__logo { width: 150px; }
  .hero__title { font-size: 19px; }
  .btn { padding: 0 16px; font-size: 12px; }
  .join__actions .btn { width: 100%; }
}

/* ---------- Retina media: slightly thinner hairlines ---------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .brand__sep, .footer__brand .brand__sep { width: 1px; }
}

/* sub-nav tabs: scroll horizontally on phones instead of overflowing */
@media (max-width: 739px) {
  .subnav .container { gap: 12px; }
  .subnav__list { gap: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex: 1 1 auto; min-width: 0; padding-right: 8px; }
  .subnav__list::-webkit-scrollbar { display: none; }
  .subnav__list li { flex: 0 0 auto; }
  .subnav__link { white-space: nowrap; font-size: 12px; }
}
@media (max-width: 739px) { .play { width: 56px; height: 56px; border-width: 3px; right: 5%; bottom: 7%; } .play::after { margin-left: 5px; border-width: 11px 0 11px 20px; } }
