/* APEX — mobile layer. Loaded last on every page; everything is inside max-width queries so desktop is untouched.
   Phones: ≤640px. Menu/tablet: ≤1080px. */

/* Hidden by default; the phone rules below swap them in */
.when .short, .facts .v .short, .tn-s, .tt-list, .lede-m { display: none; }

/* ---------- Menu (≤1080, burger) ---------- */
@media (max-width: 1080px) {
  html.menu-open, html.menu-open body { overflow: hidden; }
  .burger { position: relative; z-index: 2; }
  .burger span { transition: transform .25s, opacity .2s; transform-origin: center; }
  .burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .mobile-nav { display: block; position: fixed; inset: var(--hdr, 112px) 0 0; z-index: 49; background: var(--ink); color: #fff; padding: 20px var(--gutter) calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
  .mobile-nav.open { inset: var(--hdr, 112px) 0 0; padding: 20px var(--gutter) 0; opacity: 1; visibility: visible; transform: none; transition: opacity .2s, transform .2s; }
  .mobile-nav a:not(.btn) { border: 0; padding: 0; font-size: inherit; }
  .mobile-nav .mn-foot .btn { display: flex; padding: 15px 20px; font-size: 17px; color: #fff; }
  .mobile-nav .mn-label { font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--magenta); margin-bottom: 10px; }
  .mobile-nav .mn-fests { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .mobile-nav .mn-fests a { display: block; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: 12px 14px; }
  .mobile-nav .mn-fests .s { display: block; font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--magenta); }
  .mobile-nav .mn-fests .rugby .s { color: #12a39a; }
  .mobile-nav .mn-fests b { display: block; font-family: var(--display); font-size: 22px; font-weight: 800; text-transform: uppercase; line-height: 1.05; margin-top: 2px; }
  .mobile-nav .mn-links { display: grid; margin-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
  .mobile-nav .mn-links a { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 22px; font-weight: 700; text-transform: uppercase; color: #fff; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .mobile-nav .mn-links a::after { content: "→"; font-size: 18px; color: rgba(255,255,255,.35); }
  .mobile-nav .mn-links a.active { color: var(--magenta); }
  .mobile-nav .mn-foot { position: sticky; bottom: 0; margin: 18px calc(-1 * var(--gutter)) 0; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 12px; background: linear-gradient(rgba(21,22,58,0), var(--ink) 18px); }
  .mobile-nav .mn-foot .btn { justify-content: center; width: 100%; }
  .mobile-nav .mn-social { display: flex; justify-content: center; gap: 22px; color: rgba(255,255,255,.7); }
  .mobile-nav .mn-social a { padding: 6px; }
}

/* ---------- Tablet tweaks (≤860) ---------- */
@media (max-width: 860px) {
  .timeline.tl { display: block; }
  .sponsor-band .link { justify-self: start; }
}

/* ---------- Vertical season timeline (≤860) ---------- */
@media (max-width: 860px) {
  .timeline.tl { height: auto !important; padding-left: 26px; margin-top: 8px; }
  .timeline.tl::after { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
  .tl-band { display: none; }
  .tl-ev { position: relative; left: auto !important; top: auto; width: auto; height: auto; display: block; margin-bottom: 10px; }
  .tl-ev .stem { display: none; }
  .tl-ev .dot, .tl-ev.below .dot { left: -22px; top: 22px; z-index: 1; width: 8px; height: 8px; border-width: 2px; margin: -2px; box-shadow: 0 0 0 3px rgba(237,2,140,.2); }
  .tl-ev.rugby .dot { box-shadow: 0 0 0 3px rgba(18,163,154,.2); }
  .tl-ev .tl-card, .tl-ev.flip .tl-card { position: relative; left: auto; right: auto; top: auto !important; bottom: auto !important; width: auto; max-width: none; min-width: 0; text-align: left;
    background: var(--white); border-right: 0; border-left: 3px solid var(--magenta); border-radius: 0 8px 8px 0; padding: 12px 16px; box-shadow: 0 1px 0 var(--line); }
  .tl-ev.rugby .tl-card { border-color: var(--rugby); }
  .tl-ev .v { font-size: 22px; }
  .tl-ev .more { display: none; }
  .tl-ev .tl-card { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: baseline; }
  .tl-ev .s { grid-column: 1 / -1; }
  .tl-ev .d { text-align: right; }
  .timeline.tl:hover .tl-ev .tl-card { opacity: 1; }
  .timeline.tl .tl-ev:hover .tl-card { transform: none; box-shadow: 0 1px 0 var(--line); }
}

/* ---------- Phones (≤640) ---------- */
@media (max-width: 640px) {
  :root { --gutter: 16px; --hdr: 92px; }
  body { font-size: 16px; }

  /* Type scale */
  h1 { font-size: clamp(40px, 11.5vw, 48px); }
  h2 { font-size: clamp(32px, 9.4vw, 38px); }
  h3 { font-size: 22px; }
  .lede { font-size: 16.5px; line-height: 1.55; }
  .eyebrow { font-size: 12.5px; letter-spacing: .14em; }
  .section { padding: 56px 0; }
  .section--tight { padding: 36px 0; }
  .section-head { margin-bottom: 22px; gap: 14px; }
  .section-head h2 { margin-top: 10px; }
  .section-head > div[style*="display:flex"] { flex-wrap: wrap; }
  .btn { font-size: 16px; padding: 13px 20px; }
  .link { font-size: 15px; }

  /* Header: 32 + 60 = 92px */
  .utility .wrap { height: 32px; }
  .utility .countdown { font-size: 12.5px; }
  .nav { height: 60px; }
  .nav .logo img { height: 26px; }
  .burger { width: 40px; height: 40px; margin-right: -8px; }
  .burger span { width: 24px; margin: 6px auto; }
  .subnav { top: var(--hdr); }

  /* Heroes */
  .hero { min-height: 0 !important; }
  .hero__inner { padding-top: 124px; padding-bottom: 28px; }
  .hero h1 { font-size: clamp(40px, 11.5vw, 48px); }
  .hero .lede { margin-top: 16px; font-size: 16px; }
  .hero__ctas { margin-top: 22px; gap: 10px; }
  .hero__ctas .btn { width: 100%; justify-content: center; }
  .page-hero { padding: 124px 0 40px; }
  .page-hero h1 { font-size: clamp(38px, 11vw, 46px); margin-top: 12px; }
  .page-hero .lede { margin-top: 14px; }
  .crumbs { font-size: 11.5px; }
  .facts { margin-top: 28px; gap: 0 12px; }
  .facts div { padding-top: 14px; }
  .facts .v { font-size: 18px; }
  .facts .v .long { display: none; } .facts .v .short { display: inline; }
  .league-head { padding: 116px 0 22px; }
  .league-head::after { width: 78vw; height: auto; border: 0; }
  .league-head h1 { font-size: 42px; }
  .league-head .sub { font-size: 14.5px; }

  /* Swipe rows: horizontal snap carousels that peek the next card */
  .m-swipe, #bento, .week, #leaders, [data-page="home"] #fests, #boards, .pillars--img, #others {
    display: flex !important; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
    margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
  .m-swipe::-webkit-scrollbar, #bento::-webkit-scrollbar, .week::-webkit-scrollbar, #leaders::-webkit-scrollbar,
  [data-page="home"] #fests::-webkit-scrollbar, #boards::-webkit-scrollbar, .pillars--img::-webkit-scrollbar, #others::-webkit-scrollbar { display: none; }
  .m-swipe > *, #bento > *, .week > *, #leaders > *, [data-page="home"] #fests > *, #boards > *, .pillars--img > *, #others > * { flex: 0 0 84%; scroll-snap-align: start; min-width: 0; }
  .week > * { flex-basis: 78%; }

  /* Next-up strip → swipe row */
  .nextup .wrap { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 0; }
  .nextup .wrap::-webkit-scrollbar { display: none; }
  .nextup a { flex: 0 0 44%; scroll-snap-align: start; padding: 14px 16px; }
  .nextup a:first-child { border-left: 0; }
  .nextup .where { font-size: 20px; }
  .nextup .sport { font-size: 11px; }
  .nextup .rugby .sport { color: #12a39a; }
  .nextup .when { font-size: 13px; }
  .nextup .when .long { display: none; } .nextup .when .short { display: inline; }

  /* Instagram ticker */
  .ig-ticker { padding: 12px 0 0; --split: calc(12px + 132px * 7 / 9); }
  .ig-track { gap: 8px; }
  .ig-track .ig { width: 132px; }

  /* Experience bento → swipe cards */
  #bento > .tile { height: 380px; grid-column: auto !important; grid-row: auto !important; }
  .tile .cap { padding: 18px; }
  .tile h3, .tile.big h3 { font-size: 28px; }
  .tile p { font-size: 15px; }

  /* Week cards */
  .day { padding: 20px; }
  .day .dname { font-size: 44px; }
  .day h3 { font-size: 20px; margin-bottom: 12px; }
  .day ul { font-size: 14.5px; }

  /* Testimonials */
  .qtrack .qcard { width: 290px; padding: 20px; }
  .qcard blockquote { font-size: 16px; }

  /* Paths */
  .path { min-height: 300px; padding: 22px; }
  .path .who { font-size: 12.5px; }
  .path h3 { font-size: 34px; margin: 10px 0 8px; }
  .path p { font-size: 14.5px; margin-bottom: 14px; }

  /* Festival cards */
  .fest { grid-template-rows: 190px auto; }
  .fest__body { padding: 18px; }
  .fest__body h3 { font-size: 26px; }
  .fest__date { padding: 8px 12px; }
  .fest__date .dd { font-size: 26px; }

  /* League bits on the homepage + results pages */
  .champs { gap: 10px; }
  .champ { padding: 16px; gap: 14px; }
  .champ::after { font-size: 40px; right: 12px; top: 8px; }
  .champ .badge { width: 52px !important; height: 52px !important; font-size: 18px !important; }
  .champ .k { font-size: 11.5px; }
  .champ .t { font-size: 22px; }
  .champ .d { font-size: 13px; }
  .card h2.card-title { font-size: 24px; padding: 18px 18px 6px; }
  .lead { padding: 10px 16px; gap: 12px; }
  .lead .nm { font-size: 17px; }
  .lead .tm { font-size: 13px; }
  .lead .val b { font-size: 24px; }
  .card .more { margin: 6px 16px 16px; }
  .avatar { width: 44px; height: 44px; font-size: 18px; }

  /* Video */
  .split--video { gap: 24px; }

  /* News: lead story large, the rest as compact rows */
  .news-grid { gap: 18px; }
  .news-card h3 { font-size: 21px; }
  .news-grid .news-card:nth-child(n+2) { display: grid; grid-template-columns: 112px 1fr; grid-template-rows: auto 1fr; column-gap: 14px; row-gap: 4px; align-items: start; }
  .news-grid .news-card:nth-child(n+2) .img { grid-row: 1 / span 2; aspect-ratio: 1; border-radius: 6px; }
  .news-grid .news-card:nth-child(n+2) .meta { font-size: 12px; gap: 8px; }
  .news-grid .news-card:nth-child(n+2) h3 { font-size: 17.5px; line-height: 1.12; }
  .qtabs { flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
  .qtabs::-webkit-scrollbar { display: none; }
  .qtabs button { flex: 0 0 auto; font-size: 14px; padding: 8px 14px; }
  /* Lightbox: edge-to-edge photo, controls along the bottom */
  .lb img { max-width: 100vw; max-height: 72vh; border-radius: 0; }
  .lb .prev, .lb .next { top: auto; bottom: 64px; transform: none; width: 46px; height: 46px; }
  .lb .x { top: 14px; right: 14px; width: 44px; height: 44px; }
  .lb-cap { bottom: 22px; padding: 0 70px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: 0 0 auto; padding: 8px 14px; font-size: 14px; }

  /* Partners */
  .sponsor-band { gap: 14px; }
  .sponsor-band img { height: 56px; }
  .sponsor-band .lede { font-size: 15.5px; }
  .logo-wall { grid-template-columns: repeat(3, 1fr) !important; }
  .logo-wall .partner-btn { padding: 12px; }
  .logo-wall .partner-btn { font-size: 46px; }
  .logo-wall .partner-btn span { display: none; }

  /* Newsletter band + footer */
  .signup .wrap { gap: 20px; }
  .signup h2 { font-size: 34px; }
  .site-footer { padding: 48px 0 calc(24px + env(safe-area-inset-bottom)); font-size: 14.5px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr !important; gap: 30px 20px; }
  .site-footer .cols > div:first-child { grid-column: 1 / -1; }
  .site-footer .cols > div:last-child { grid-column: 1 / -1; }
  .site-footer .cols > div:last-child ul { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .site-footer .logo img { height: 28px; margin-bottom: 12px; }
  .site-footer h4 { font-size: 15px; margin-bottom: 10px; }
  .site-footer .base { margin-top: 32px; flex-direction: column; gap: 6px; }

  /* Festival page */
  .subnav .wrap { gap: 22px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .subnav .wrap::-webkit-scrollbar { display: none; }
  .subnav a { font-size: 14px; padding: 13px 0; }
  .subnav .btn { display: none; }
  .pillars--img > .pillar { padding-bottom: 20px; }
  .pillars--img .pimg { aspect-ratio: 4/3; margin-bottom: 16px; }
  .pillars--img .pillar > :not(.pimg) { padding-left: 20px; padding-right: 20px; }
  .pillar .num { font-size: 40px; }
  .pillar h3 { margin: 6px 0 8px; }
  .pillar p { font-size: 15px; }
  .pillars:not(.pillars--img) .pillar { padding: 24px 20px; }
  .pillars:not(.pillars--img) .pillar .duo { width: 42px; height: 42px; }
  .split__media img { aspect-ratio: 4/3; }
  .venue { gap: 22px; }
  .venue h2 { font-size: 34px; }
  .glance { margin: 20px 0 18px; }
  .glance b { font-size: 22px; }
  .glance span { font-size: 11.5px; }
  .venue__map { aspect-ratio: 1; }
  .reveal-count { gap: 10px 14px; }
  .reveal-count > b { font-size: 36px; }
  .reveal-count .btn { flex: 1 1 100%; justify-content: center; }
  .reveal-count { flex-wrap: wrap; }
  .team-slots { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
  .team-slots-wrap { gap: 22px; }
  .slots-h { font-size: 20px; margin-bottom: 10px; }
  .tslot { aspect-ratio: 3/4; padding: 6px; gap: 6px; border-radius: 6px; }
  .tslot--secret b { display: none; }
  .tslot .shield { width: 34px; height: 40px; }
  .tslot .shield i { font-size: 20px; }
  .tslot--open { border-width: 1.5px; }
  .tslot--open .plus { width: 30px; height: 30px; font-size: 22px; }
  .tslot--open b { font-size: 11.5px; line-height: 1.1; letter-spacing: .02em; }
  .tslot--open .go { display: none; }

  /* Timetable: day tabs as one row, list instead of the wide grid */
  .days { grid-template-columns: repeat(4, 1fr) !important; gap: 6px; margin-bottom: 14px; }
  .days button { padding: 10px 4px; border-radius: 10px 10px 4px 4px; border-width: 1.5px; }
  .days button b { font-size: 20px; }
  .days button span { font-size: 11px !important; letter-spacing: .02em !important; display: block; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tt { display: none; }
  .tt-list { display: grid; gap: 8px; list-style: none; }
  .tt-list li { display: grid; grid-template-columns: 54px 1fr; gap: 12px; background: var(--white); border-radius: 0 8px 8px 0; padding: 12px 14px 12px 0; border-left: 4px solid var(--navy); }
  .tt-list li.final { border-color: #f59f00; }
  .tt-list li.girls { border-color: var(--magenta); }
  .tt-list li.event { border-color: #2f9e44; }
  .tt-list li.social { border-color: #7048e8; }
  .tt-list .tm { font-family: var(--display); font-weight: 800; font-size: 17px; text-align: right; line-height: 1.1; }
  .tt-list .tm small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  .tt-list .what em { display: block; font-style: normal; font-family: var(--display); font-weight: 700; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .tt-list .what b { display: block; font-family: var(--display); font-size: 19px; text-transform: uppercase; line-height: 1.1; margin-top: 1px; }
  .tt-list .what span { display: block; font-size: 13.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
  .tt-key { gap: 6px 14px; font-size: 12px; }

  /* Festival map: taller window you can pan once unlocked */
  .village { aspect-ratio: auto; height: 400px; overflow: hidden; }
  .village.open { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .village.open::-webkit-scrollbar { display: none; }
  .village__canvas { position: relative; inset: auto; width: calc(400px * 1800 / 1005); height: 100%; }
  .village:not(.open) .village__canvas { margin-left: calc((100% - 400px * 1800 / 1005) / 2); }
  .village__box { padding: 22px 20px; }
  .village__box h3 { font-size: 24px; }
  .village__box p { font-size: 14px; margin-bottom: 14px; }
  .village.open + .village__hint { display: block; margin-top: 12px; text-align: center; font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; color: rgba(255,255,255,.6); }
  .pin .dot { width: 26px; height: 26px; font-size: 13px; }
  .pin .tip { width: 190px; }

  /* Gallery */
  .masonry { gap: 8px !important; } .masonry .col { gap: 8px !important; }
  .masonry button { margin: 0 !important; border-radius: 8px !important; }

  /* Enquiry */
  .enquiry-wrap { gap: 24px; }
  .enquiry-card { padding: 18px !important; }
  .enquiry-card .audience, .audience { grid-template-columns: 1fr 1fr !important; gap: 8px; margin-bottom: 20px; }
  .audience .opt { padding: 12px; }
  .audience .opt b { font-size: 17px; }
  .audience .opt span { font-size: 12.5px; line-height: 1.35; display: block; }
  /* Compact audience pickers on phones so the first form field is on screen: thumbnail + label, no description */
  .audience .opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
  .audience .opt img { width: 44px; height: 44px; margin: 0; aspect-ratio: 1; border-radius: 4px; flex: none; }
  .audience .opt b { margin: 0; font-size: 15px; line-height: 1.1; }
  .audience .opt span { display: none; }
  [id] { scroll-margin-top: calc(var(--hdr, 92px) + 56px); }
  .form-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .form-grid label { font-size: 13px; }
  .field { font-size: 16px; padding: 13px 14px; } /* 16px stops iOS zooming into fields */
  .enquiry .checks { grid-template-columns: 1fr; gap: 10px; }
  .enquiry .checks label { font-size: 15px; }

  /* Results */
  .tabbar { gap: 20px; margin-bottom: 18px; scrollbar-width: none; }
  .tabbar::-webkit-scrollbar { display: none; }
  .tabbar button { font-size: 15px; padding: 12px 0; white-space: nowrap; }
  .toolbar { gap: 8px; margin-bottom: 14px; justify-content: flex-start; }
  .seg button { padding: 7px 14px; font-size: 14px; }
  .search { flex: 1 1 100%; max-width: none; order: -1; }
  .stack { gap: 12px; }
  .day-label { font-size: 13px; margin: 6px 0 0; }
  .result-card { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px; }
  .result-card .meta { text-align: left; margin: 0 0 2px; font-size: 12px; }
  .result-card .side { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; text-align: left; }
  .result-card .side .badge { width: 32px !important; height: 32px !important; font-size: 11px !important; }
  .result-card .side .nm { font-size: 17px; }
  .result-card .side .sc { font-size: 22px; white-space: nowrap; }
  .result-card .side .sc small { font-size: 12px; }
  .result-card .mid { order: 5; text-align: left; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
  .result-card .mid .won { font-size: 13px; max-width: none; color: var(--ink); }
  .result-card .foot { order: 6; justify-content: flex-start; }
  .tn-l { display: none; } .tn-s { display: inline; }
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .tbl th:first-child, .tbl td:first-child { padding-left: 14px; }
  .tbl th:last-child, .tbl td:last-child { padding-right: 14px; }
  .tbl .team-cell { gap: 8px; }
  .tbl .team-cell .badge { width: 26px !important; height: 26px !important; }
  .tbl .pts { font-size: 17px; }
  /* Stats table: player column stays put while the numbers scroll */
  #tbl th:first-child, #tbl td:first-child { position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--line); }
  #tbl .avatar { width: 28px !important; height: 28px !important; font-size: 12px !important; }
  #tbl .avatar .badge { display: none; }
  .team-chips { justify-content: flex-start; gap: 10px; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; }
  .team-row { padding: 12px 16px; gap: 12px; }
  .team-row .badge { width: 40px !important; height: 40px !important; }
  .team-row .nm { font-size: 18px; }
  .team-row .sub { font-size: 13px; }
  .team-row .go { display: none; }
  .player-row { padding: 12px 16px; }
  .profile-head { gap: 14px; align-items: flex-start; }
  .profile-head > .badge, .profile-head > .avatar { width: 68px !important; height: 68px !important; font-size: 24px !important; }
  .profile-head > .avatar .badge { width: 26px !important; height: 26px !important; }
  .profile-head h1 { font-size: 32px !important; }
  .profile-head .sub { font-size: 13.5px; }
  .league-head .stats { grid-template-columns: repeat(4, 1fr) !important; margin-top: 18px !important; }
  .league-head .stat { padding: 14px 6px 0 0; }
  .league-head .stat .n { font-size: 30px !important; }
  .league-head .stat .l { font-size: 10.5px; letter-spacing: .06em; line-height: 1.2; }
  .stack > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  .stack .card { overflow-x: auto; }
  .stack > div > h2 { font-size: 30px !important; }
  .statbox { grid-template-columns: repeat(3, 1fr) !important; }
  .statbox span { font-size: 10.5px; letter-spacing: .08em; }
  [data-page="stats"] .stack .tbl td.muted { display: none; }
  .statbox div:last-child:nth-child(3n+2) { grid-column: span 2; }
  .statbox div:last-child:nth-child(3n+1) { grid-column: span 3; }
  [data-page="stats"] .stack .tbl td { white-space: normal; font-size: 13.5px; }
  [data-page="stats"] .stack .tbl td:first-child { white-space: nowrap; }
  .statbox b { font-size: 28px; }
  .statbox div { padding: 14px 8px; }

  /* About */
  .team-grid { gap: 14px; }
  .team-grid figcaption { font-size: 18px; margin-top: 8px; }
  .team-grid figcaption .role { font-size: 13.5px; }

  /* Articles */
  .article p { font-size: 17px; line-height: 1.65; margin-bottom: 18px; }
  .article .hero-img { margin: -24px 0 28px; }
  .gate { min-height: 380px; }
  .gate__box { inset: 70px 0 auto; padding: 22px 18px; }
  .gate__box h3 { font-size: 24px; }

  /* Dialogs → bottom sheets */
  .dlg, .dlg--nl { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 88vh; max-height: 88dvh; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .dlg[open] { animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dlg-x { position: sticky; top: 10px; float: right; margin: 10px 10px -50px 0; box-shadow: 0 2px 10px rgba(21,22,58,.12); }
  .dlg-body { padding: 26px 20px 28px; }
  .dlg-logo { height: 64px; margin-bottom: 14px; }
  .dlg-logo { font-size: 64px; }
  .dlg-logo img { max-width: 170px; }
  .dlg-body h2 { font-size: 32px; }
  .dlg-body p { font-size: 15.5px; }
  .dlg-quote { font-size: 15.5px; padding: 14px 16px; }
  .nl-img { height: 150px; }
  .nl-img img { object-position: 50% 18%; }
  .nl-more { display: none; }
  .dlg--nl { overflow: hidden; overscroll-behavior: contain; }
  .dlg--nl .dlg-body { padding: 22px 20px 18px; }
  .dlg--nl .dlg-body h2 { font-size: 30px; margin: 6px 0 8px !important; }
  .dlg--nl .dlg-body > p { font-size: 14.5px !important; line-height: 1.5; }
  .dlg--nl .nl-why { gap: 7px; margin: 12px 0 16px; }
  .dlg--nl .nl-why li { font-size: 15px; }
  .dlg--nl .nl-no { margin-top: 8px; }
  html:has(.dlg--nl[open]) { overflow: hidden; }
  .nl-why { font-size: 14.5px; }
  .nl-form .btn, .signup .btn, .gate__box .btn, .enquiry .btn[type=submit] { justify-content: center; width: 100%; }

  /* Bigger tap targets for small text links, without moving anything */
  .link, .crumbs a, .utility .countdown, .result-card .foot a, .fest__foot .link { position: relative; }
  .link::after, .crumbs a::after, .utility .countdown::after, .result-card .foot a::after { content: ""; position: absolute; inset: -10px -6px; }
  .pin::after { content: ""; position: absolute; inset: -9px; }

  /* Misc */
  .split { gap: 26px; }
  .split__media .badge { font-size: 17px; padding: 12px 14px; }
  .stats .stat .n { font-size: 48px; }
}

/* ---------- Phones: deliberate layout pass 2 ---------- */
@media (max-width: 640px) {
  /* Shorter hero intro */
  .lede-d { display: none; } .lede-m { display: inline; }

  /* Buttons side by side, not stacked */
  .hero__ctas, .cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero__ctas .btn, .cta-row .btn { width: auto; justify-content: center; text-align: center; white-space: normal; line-height: 1.1; min-height: 48px; padding: 10px 8px; font-size: 14.5px; letter-spacing: .05em; }
  .hero__ctas .btn .arrow, .cta-row .btn .arrow { display: none; }
  .hero__ctas .btn:only-child, .cta-row .btn:only-child { grid-column: 1 / -1; }
  .cta-row { margin-top: 20px; }
  .cta-row > :not(.btn) { grid-column: 1 / -1; justify-self: center; margin: 4px 0 0; }

  /* Upcoming festivals: fixed 2×2 grid */
  .nextup .wrap { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .nextup a { border-left: 0; border-right: 0 !important; border-bottom: 1px solid rgba(255,255,255,.1); padding: 12px 16px; }
  .nextup a:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.1) !important; }
  .nextup a:nth-last-child(-n+2) { border-bottom: 0; }

  /* Social ticker moves at a mobile-appropriate pace */
  .ig-track { animation-duration: 30s; }

  /* Swipe rows scroll sideways only (no vertical wobble/cropping) */
  #bento, .week, #leaders, [data-page="home"] #fests, #boards, .pillars--img, #others { overflow-y: hidden; touch-action: pan-x pan-y; overscroll-behavior-y: auto; }
  #bento > .reveal, .week > .reveal { transform: none; opacity: 1; }

  /* Carousel position dots */
  .swipe-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
  .swipe-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(21,22,58,.2); transition: width .25s, background .25s; position: relative; }
  .swipe-dots button::after { content: ""; position: absolute; inset: -10px -4px; }
  .swipe-dots button.on { width: 22px; background: var(--magenta); }
  .dark .swipe-dots button:not(.on), .navy .swipe-dots button:not(.on) { background: rgba(255,255,255,.3); }
}

/* Cookie banner: bottom sheet on phones */
@media (max-width: 640px) {
  .cc { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 18px 18px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; max-height: 85vh; overflow-y: auto; }
  .cc h2 { font-size: 22px; }
  .cc p { font-size: 14px; }
}
@media (max-width: 640px) {
  .rugby-facts .wrap > div { padding: 12px 16px; border: 0 !important; border-bottom: 1px solid rgba(255,255,255,.1) !important; }
  .rugby-facts .wrap > div:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.1) !important; }
  .rugby-facts .wrap > div:nth-last-child(-n+2) { border-bottom: 0 !important; }
  .rugby-facts .where { font-size: 18px; }
  .quote-more { font-size: 15.5px; }
}

/* My Apex link lives in the mobile menu instead */
@media (max-width: 640px) { .utility .u-login { display: none; } }

/* Inline link inside the rugby facts strip (not a .nextup card link) */
.nextup.rugby-facts .when a { display: inline; padding: 0; border: 0 !important; flex: none; font-weight: 600; }
@media (max-width: 860px) { .split__media.founders img { aspect-ratio: 4 / 5; object-position: 50% 22%; } }

/* Testimonials on phones: a thumb-swipe row instead of the auto ticker */
@media (max-width: 640px) {
  .qticker { overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; -webkit-mask-image: none; mask-image: none; }
  .qticker::-webkit-scrollbar { display: none; }
  .qtrack { animation: none !important; transform: none !important; width: max-content; padding: 0 16px; }
  .qtrack .qcard { scroll-snap-align: start; }
  .qtrack .qcard[aria-hidden="true"] { display: none; }
}

/* Confirmed team tiles on phones: 2 across so names fit */
@media (max-width: 640px) {
  .team-slots { grid-template-columns: repeat(2, 1fr) !important; }
  .tslot { aspect-ratio: auto; min-height: 120px; padding: 14px 10px; }
  .tslot--secret b { display: block; font-size: 12px; }
  .tslot--team b { font-size: 14px; }
  .tslot--team .tmeta { font-size: 10.5px; }
  .tslot--team .shield { width: 40px; height: 46px; }
  .tslot--team .shield i { font-size: 13px; }
  .tslot--team .crest { width: 52px; height: 52px; padding: 7px; }
  .tslot--open .go { display: none; }
}
