/* Slide-by-slide pages: every section is exactly one screen tall (below the sticky header). */
html.slides-on{
  scroll-padding-top:var(--slide-offset,0px);
  overflow-anchor:none;
}
html.slides-on [data-slide]{
  height:calc(100svh - var(--slide-offset,0px) - var(--slide-extra,0px));
  max-height:none !important;
  box-sizing:border-box;
  overflow:hidden;
}
/* Short content is centred vertically inside its screen. */
html.slides-on [data-slide="block"]{
  display:flex;
  flex-direction:column;
  justify-content:center;
}
html.slides-on [data-slide="grid"]{align-content:center}
/* Content that is very short, or too long for one screen at a readable size, keeps its natural height. */
html.slides-on [data-slide][data-slide-free]{
  height:auto;
  overflow:visible;
}
/* Fixed one-screen slides ignore the page's own minimum heights; natural-height ones keep them (e.g. full-height heroes). */
html.slides-on [data-slide]:not([data-slide-free]){min-height:0 !important}
/* While measuring, let the slide take its natural height. */
html.slides-on [data-slide].is-measuring{height:auto !important;min-height:0 !important;overflow:visible}
html.slides-scanning [data-slide] *,html.slides-on [data-slide].is-measuring *{transition:none !important;animation-play-state:paused !important}

html.slides-scanning{scroll-snap-type:none !important}

/* Wheel, trackpad, keys and swipes are all paged by slide-scroll.js; stop pull-to-refresh bounce. */
html.slides-on{overscroll-behavior-y:none}

/* The /ai/ scroll film becomes one screen and plays on a loop. */
html.slides-on .film-scroll[data-slide]{height:calc(100svh - var(--slide-offset,0px)) !important}
html.slides-on .film-scroll .film-hero{position:relative;top:auto;height:100%;min-height:0}

/* Entrance animation, played once when a slide first comes into view. */
html.slides-on [data-slide-item]{
  opacity:0;
  transform:translateY(36px);
  transition:opacity .4s ease,transform .45s cubic-bezier(.2,.7,.2,1);
  transition-delay:calc(var(--slide-i,0) * 45ms);
}
html.slides-on [data-slide].is-seen [data-slide-item]{opacity:1;transform:none}

/* Long slides reveal block by block: anything that belongs to a later step waits below, then glides in. */
html.slides-on [data-slide-unit]{
  transition:opacity .35s ease,transform .4s cubic-bezier(.2,.7,.2,1);
  transition-delay:calc(var(--slide-i,0) * 40ms);
}
html.slides-on [data-slide-unit].is-later{opacity:0;transform:translateY(30px);transition-delay:0s}
/* blocks with their own motion: only fade, so their own transform (entrance, hover lift) is left alone */
html.slides-on [data-slide-unit][data-slide-own-motion]{transition:opacity .35s ease,transform .8s cubic-bezier(.2,.7,.2,1)}
html.slides-on [data-slide-unit][data-slide-own-motion].is-later{transform:none}

/* Slide dots on the right edge. */
.slide-dots{
  position:fixed;
  right:clamp(8px,1.4vw,22px);
  top:50%;
  transform:translateY(-50%);
  z-index:900;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
  padding:9px 5px;
  border-radius:999px;
  background:rgba(10,10,9,.55);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
}
.slide-dots button{
  width:8px;
  height:8px;
  padding:0;
  border:1px solid #ffbe00;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  transition:transform .25s ease,background .25s ease;
}
.slide-dots button:hover{transform:scale(1.3)}
.slide-dots button[aria-current="true"]{background:#ffbe00;transform:scale(1.25)}
@media (max-width:760px){
  .slide-dots{right:5px;gap:7px;padding:7px 4px}
  .slide-dots button{width:6px;height:6px}
}

@media (prefers-reduced-motion:reduce){
  html.slides-on [data-slide-item]{opacity:1;transform:none;transition:none}
  html.slides-on [data-slide-unit]{transition:none}
  html.slides-on [data-slide-unit].is-later{transform:none}
}

/* Phones: the dots would sit on top of text, so they are hidden. */
@media (max-width:600px){
  .slide-dots{display:none}
}

/* ── No sideways scrolling anywhere ───────────────────────────────────────── */
/* Only body: clipping on html would stop pages from scrolling normally and break sticky headers. */
body{overflow-x:clip !important}

/* Media page: the 12 capability cards become a wrapping grid instead of a swipe rail. */
.capability-rail{
  display:grid !important;
  grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));
  gap:18px !important;
  overflow:visible !important;
  scroll-snap-type:none !important;
}
.capability-rail .capability-card{flex:none !important;width:auto !important;scroll-snap-align:none}
.capability-rail .capability-card-copy{grid-template-columns:34px 1fr;gap:6px 12px;padding-top:16px}
.capability-rail .capability-card-copy>p{grid-column:2}
.capability-rail .capability-card h3{font-size:clamp(22px,2.2vw,32px)}
.capability-rail-hint{display:none !important}

/* Internship pages: swipe strips become stacked lists; the 14-week roadmap runs top to bottom. */
.platform-intro-grid,.journey-grid,.evi,.li-steps,.audience-grid,.faq-list,.pstrip,.lmpath{
  overflow-x:visible !important;
  scroll-snap-type:none !important;
}
.pstrip{flex-wrap:wrap !important}
.lmpath{flex-direction:column !important}
.lmpath .phase{flex:none !important}
@media (max-width:800px){
  .platform-intro-grid,.journey-grid,.evi,.li-steps,.audience-grid,.faq-list{
    display:grid !important;
    grid-template-columns:1fr !important;
  }
  .platform-intro article,.journey-step,.evi .card,.li-steps .st,.audience-card,.faq details{flex:none !important;scroll-snap-align:none}
  .platform-intro article+article,.journey-step+.journey-step{border-left:0 !important;border-top:1px solid var(--ink) !important}
  .journey-step{min-height:0 !important}
}

/* ── Short laptop screens (e.g. 1366×768: only ~600 px of page height at 100% zoom) ──
   Everything is sized for the screen height so each section fits one slide without zooming out:
   a slimmer header and much less empty padding above and below each section. */
@media (min-width:761px) and (max-height:820px){
  .site-header{height:76px !important}
  .site-header .site-header__brand .site-header__logo{height:40px !important}
  html.slides-on [data-slide]:not(.film-scroll){
    padding-top:clamp(16px,4.5vh,40px) !important;
    padding-bottom:clamp(16px,4.5vh,40px) !important;
  }
  /* full-height heroes are sized from the slide, not from their own min-heights */
  html.slides-on .platform-hero,html.slides-on .portal-hero{min-height:0 !important}
  html.slides-on .platform-hero h1,html.slides-on .platform-hero .platform-title,html.slides-on .portal-hero h1{font-size:min(clamp(3rem,7vw,6.2rem),11.5vh) !important}
  html.slides-on .portal-hero .portal-lead,html.slides-on .platform-hero .lead{margin-top:min(1.5rem,2.5vh)}
  html.slides-on .platform-actions,html.slides-on .portal-actions{margin-top:min(2rem,3.5vh)}
  /* main-site heroes ("Nectar of life", "Stories that move people"): headline sized by height too */
  html.slides-on .hero[data-slide] h1,html.slides-on .ai-hero h1{font-size:min(15vw,21vh) !important}
  /* main JMAC pages (not the internship portal or the /ai/ film page): big section headings scale with
     the screen height too, so a heading and the content under it fit on one screen */
  body:not(:has(.site-header--internship)):not(:has(.film-scroll)) [data-slide] h2,body:not(:has(.site-header--internship)):not(:has(.film-scroll)) [data-slide] h1#capabilities-title{font-size:min(7.7vw,13.5vh) !important}
  /* Media: shorter capability photos so a heading and a row of cards share one screen */
  .capability-rail .capability-card-visual{aspect-ratio:auto !important;height:22vh}
  .capability-rail .capability-card-visual img{width:100%;height:100%;max-height:none;object-fit:cover}
}

/* Phones: the main JMAC pages' sections had up to ~95 px of empty space above and below; cap it so a
   small screen shows content, not padding. (The internship pages already use smaller spacing.) */
@media (max-width:760px){
  body:not(:has(.site-header--internship)) [data-slide]:not(.film-scroll):not(.hero){
    padding-top:min(var(--slide-pad-cap,48px),12vw) !important;
    padding-bottom:min(var(--slide-pad-cap,48px),12vw) !important;
  }
}
