/* Phone layouts prioritize continuous reading; detailed evidence can be browsed sideways.
   All geometry changes are scoped to phones. Desktop keeps its established layout. */
.mobile-reel-controls{display:none}
/* Keep explanatory copy readable on phones and tablets; retain smaller legends. */
@media(max-width:1024px){
 body main :is(.story-feedback,.media-reading-key,.home-highlight p,.physics-outcomes p,.platform-capabilities p,.gpu-benchmark-sizes>p){font-size:14px;line-height:1.85}
}
@media(max-width:760px){
  :root{--phone-rail:clamp(104px,27vw,150px)}
  /* A compact vertical index stays beside the material narrative. */
  .home-story-gallery,
  .case-gallery,
  .platform-panel .data-overview.case-gallery,
  .platform-panel .training-overview.case-gallery,
  .research-study.case-gallery,
  .method-gallery{grid-template-columns:var(--phone-rail) minmax(0,1fr);align-items:stretch}
  .home-story-gallery{--story-height:720px}
  .home-story-gallery .home-story-navigation,
  .case-gallery>.case-rail,
  .method-gallery>.method-gallery-nav{padding:12px 8px;gap:0;border-bottom:0;border-right:1px solid var(--story-line);min-width:0}
  .home-story-gallery .home-story-tabs,
  .case-gallery .case-choices,
  .method-gallery .model-scale-path{display:flex;flex-direction:column;gap:6px}
  .home-story-gallery .home-story-tabs button,
  .case-gallery .case-choices>button,
  .method-gallery .model-scale-path button{min-height:68px;height:auto;padding:14px 8px;gap:6px;hyphens:auto;overflow-wrap:normal;text-align:left}
  .home-story-gallery .home-story-tab-label,
  .case-gallery .case-choices .case-choice-title,
  .method-gallery .scale-choice-title{font-size:14px;line-height:1.5;min-height:0;letter-spacing:-.02em;transform:none}
  .home-story-gallery .home-story-tab-description,
  .case-gallery .case-choices .case-choice-description,
  .method-gallery .scale-choice-description,
  .case-gallery .case-choices .case-choice-method,
  .method-gallery-nav .mobile-scale-hint{display:none}
  .home-story-gallery .home-story-tabs button[aria-selected=true] .home-story-tab-description{display:block;font-size:12px;line-height:1.75;margin-top:3px}
  .home-story-gallery .home-story-tabs button[aria-selected=true] .home-story-tab-label,
  .method-gallery .model-scale-path button[aria-selected=true] .scale-choice-title{transform:none;font-weight:600}
  .home-story-gallery .home-story-navigation>.timed-gallery-controls,
  .case-gallery .case-rail>.timed-gallery-controls,
  .method-gallery .method-gallery-controls{padding:18px 0 0;margin-top:auto;gap:8px;flex-wrap:wrap;justify-content:center}
  :is(.home-story-navigation,.case-rail,.method-gallery-nav) .timed-gallery-controls>span{width:100%;text-align:center;font-size:12px}
  :is(.home-story-navigation,.case-rail,.method-gallery-nav) .media-actions{gap:2px;justify-content:center;flex-wrap:wrap}
  .method-gallery-nav>.method-subchoices{flex-direction:column;padding:12px 0 0;gap:6px}
  .method-gallery-nav>.method-subchoices button{font-size:13px;padding:8px 6px;flex:none;hyphens:auto}
  .home-story-gallery .home-path-stage{padding:30px 20px;min-height:var(--story-height);justify-content:center}
  .home-story-gallery .home-path-stage h3{font-size:clamp(25px,6vw,36px);line-height:1.24;margin-bottom:20px;text-wrap:pretty}
  .home-story-gallery .home-path-stage p{font-size:15px;line-height:1.85}
  .home-story-gallery .home-path-label{font-size:13px;margin-bottom:18px}
  .home-story-gallery .home-path-stage .home-path-detail{margin-top:18px}
  .home-story-gallery .home-path-cta{font-size:14px;margin-top:20px}
  .home-story-gallery .material-story-image img{width:120%;max-width:none;opacity:.75;object-position:center;filter:blur(1px)}
  .home-story-gallery .material-story-images::after{background:linear-gradient(90deg,#f7f7faed,#f7f7fac4 65%,#f7f7fa8c),linear-gradient(0deg,#f7f7fa 0%,#f7f7fa00 28%,#f7f7fa00 75%,#f7f7fa 100%)}
  .home-story-gallery .home-material-path{margin:0}
  .home-story-gallery .property-keywords{gap:6px}
  .home-story-gallery .property-keywords span{padding:5px 9px;font-size:12px}
  /* Leave the result a full reading width below its media, beside the narrow index. */
  .case-gallery .case-content,
  .training-overview.case-gallery .training-outcome,
  .characterization-case-layout.case-gallery .case-content,
  .method-gallery-content{padding:20px 16px;min-height:0}
  .method-gallery .method-scale-step,#numerical-methods .method-gallery .method-scale-step{min-height:0}
  .case-gallery :is(.research-study-copy h3,.training-outcome h3,.data-source-caption h3),
  .method-gallery .scale-step-title{font-size:24px;line-height:1.35;text-wrap:pretty}
  .case-gallery .case-content p,.method-gallery .method-scale-step>p{font-size:15px;line-height:1.85}
  .case-gallery .gallery-detail-points,.method-gallery .gallery-detail-points{grid-template-columns:1fr;gap:16px}
  .case-gallery .gallery-detail-points span,.method-gallery .gallery-detail-points span{font-size:13px}
  .case-gallery .research-study-copy{padding-top:22px}
  .case-gallery .research-study-copy .text-link,.method-gallery .scale-step-links a{font-size:14px}
  .method-gallery .scale-step-links{grid-template-columns:1fr;gap:17px}
  /* Scientific pairs scroll at a legible size instead of becoming tiny thumbnails. */
  .case-gallery :is(.data-source-art,.training-media-pair),
  .method-gallery .gallery-science-pair{display:flex;align-items:flex-start;gap:14px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:0;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#c3afd8 transparent;padding-bottom:12px;height:auto;max-width:100%}
  .case-gallery :is(.data-source-art,.training-media-pair)>figure,
  .method-gallery .gallery-science-pair>figure{flex:0 0 90%;min-width:0;scroll-snap-align:start}
  .case-gallery :is(.data-source-image-window,.training-media-window){height:210px!important;max-height:none}
  .case-gallery :is(.data-source-image-window,.training-media-window)>img{max-height:210px}
  .method-gallery .gallery-science-figure>img{height:230px;max-height:none;object-fit:contain}
  .method-gallery .method-slide-art:has(.gallery-science-pair),
  .method-gallery .method-slide-art:has(.gallery-science-pair) .method-preview-image{height:auto;min-height:0}
  .method-gallery .gallery-science-figure>img.gallery-colour-ramp{height:6px}
  .method-gallery .recording-result-pair>.recording{flex:0 0 100%;height:auto}
  .method-gallery .recording-result-pair .recording img.recording-image{height:230px;max-height:230px}
  .method-gallery .method-slide-art:has(.recording-result-pair){height:auto}
  .method-gallery .method-slide-art{height:auto;min-height:0}
  .method-gallery .method-preview-image{height:235px}
  .method-gallery .method-preview-image>img{max-height:235px}
  .case-gallery .recording-bar,.method-gallery .recording-bar{padding:10px;flex-wrap:wrap;gap:8px}
  .case-gallery .recording-bar :is(a,p),.method-gallery .recording-bar :is(a,p){font-size:12px;line-height:1.65}
  /* Same-level cards keep their spatial sequence, with a visible next-card edge. */
  body main .mobile-reel{--reel-width:86%;display:flex;grid-template-columns:none;gap:16px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:0;overscroll-behavior-x:contain;scrollbar-width:none;padding-block:4px 10px;max-width:100%;margin-bottom:0}
  body main .mobile-reel::-webkit-scrollbar{display:none}
  body main .mobile-reel>*{flex:0 0 var(--reel-width);min-width:0;max-width:none;scroll-snap-align:start;scroll-snap-stop:normal;box-sizing:border-box}
  body main .mobile-reel>*:last-child{margin-right:0}
  body main .mobile-reel>:not(:last-child)::after{display:none}
  .mobile-reel-controls{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:44px;margin:2px 0 15px;color:var(--story-copy);font-size:13px}
  .mobile-reel-controls .reel-position{display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums;white-space:nowrap;min-width:0}
  .mobile-reel-controls .reel-progress{width:56px;min-width:24px;height:2px;background:#e0d7eb;overflow:hidden}
  .mobile-reel-controls .reel-progress i{display:block;background:#6940ab;width:100%;height:100%;transform-origin:left;transform:scaleX(var(--reel-progress));transition:transform .2s ease}
  .mobile-reel-actions{display:flex;gap:6px}
  .mobile-reel-controls button{display:grid;place-items:center;border:1px solid #ded7e8;background:transparent;color:var(--violet-deep);font:22px/1 var(--font);width:44px;height:44px;border-radius:50%;padding:0;cursor:pointer}
  .mobile-reel-controls button:disabled{opacity:.3;cursor:default}
  .mobile-reel-controls button:focus-visible,.mobile-reel:focus-visible{outline:2px solid var(--violet-deep);outline-offset:2px}
  .home-metric-grid.mobile-reel{--reel-width:87%;align-items:stretch}
  .home-metric-grid.mobile-reel .home-metric{padding:28px 25px 23px;min-height:350px}
  .home-metric-grid.mobile-reel .metric-value{font-size:65px;margin-bottom:28px}
  .home-metric-grid.mobile-reel h3{font-size:21px}
  /* Compact copy is read at a glance, without pagination or clipped next items. */
  .story-decision-path{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 22px}
  .story-decision-path li{padding:17px 0 12px}
  .story-decision-path li:not(:last-child)::after{display:none}
  .story-decision-path strong{font-size:17px;line-height:1.5}
  .story-decision-path p{font-size:14px;line-height:1.8;margin-top:8px}
  .physics-outcomes{grid-template-columns:1fr;gap:0}
  .physics-outcome{padding:24px 30px 24px 0}
  .physics-outcome h3{font-size:23px;margin-bottom:10px}
  .physics-outcome p{font-size:15px;line-height:1.85;max-width:none}
  .physics-outcome>span{top:25px}
  .home-method-grid{grid-template-columns:1fr}
  .home-narrative .home-method{display:flex;flex-direction:column;align-items:flex-start;min-height:0;padding:28px 25px;gap:0}
  .home-narrative .home-method h3{min-height:0;font-size:28px;margin:0 0 20px;white-space:normal}
  .home-narrative .home-method p{max-width:none;margin:0 0 22px;padding:0;font-size:15px;line-height:1.8}
  .home-method .method-topics{width:100%;font-size:13px}
  .highlight-mechanism-path{grid-template-columns:1fr;gap:0}
  .highlight-mechanism-path>a{display:grid;grid-template-columns:96px minmax(0,1fr);column-gap:20px;row-gap:5px;align-content:center;padding:20px 0;border-top:1px solid var(--story-line)}
  .highlight-mechanism-path>a:first-child{border-top:0}
  .highlight-mechanism-path>a:not(:last-child)::after{display:none}
  .highlight-mechanism-path img{grid-column:1;grid-row:1/4;height:108px;align-self:center}
  .highlight-mechanism-path :is(span,h4,small){grid-column:2}
  .highlight-mechanism-path h4{font-size:18px;line-height:1.55}
  .highlight-mechanism-path :is(span,.highlight-method){font-size:13px}
  #material-scales .scale-route{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 18px}
  #material-scales .scale-route img{height:115px;margin-bottom:12px}
  #material-scales .scale-route h3{font-size:17px;line-height:1.5}
  #material-scales .scale-route>li:not(:last-child)::after{display:none}
  #framework .platform-scale-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:26px 18px}
  #framework .platform-scale-strip>a{display:flex;flex-direction:column;align-items:flex-start;min-height:0;padding:0}
  #framework .platform-scale-strip img{width:100%;height:115px;max-width:none;grid-area:auto;margin:0 0 15px}
  #framework .platform-scale-strip h3{font-size:17px;line-height:1.5;margin:0 0 8px;align-self:auto}
  #framework .platform-scale-strip p{font-size:13px;line-height:1.75;align-self:auto}
  #framework .platform-scale-strip>a:not(:last-child)::after{display:none}
  #framework .platform-lifecycle.platform-capabilities{grid-template-columns:1fr;gap:22px}
  #framework .platform-capabilities>li+li{padding:22px 0 0;border-left:0;border-top:1px solid var(--story-line)}
  #framework .platform-capabilities a{min-height:0;gap:10px}
  #framework .platform-capabilities strong{font-size:23px;white-space:normal}
  #framework .platform-capabilities p{font-size:15px;line-height:1.85}
  #framework .platform-capabilities small{font-size:13px}
  .scale-use-paths{grid-template-columns:1fr;padding:24px;gap:22px}
  .scale-use-paths>a+a{padding-top:22px;border-top:1px solid var(--story-line)}
  .scale-use-paths h3{font-size:21px}
  .scale-use-paths p{font-size:15px;line-height:1.85}
  .platform-validation-grid{grid-template-columns:1fr;gap:22px}
  .application-scope{grid-template-columns:1fr;gap:20px}
  .application-scope>div{display:grid;grid-template-columns:minmax(70px,.28fr) minmax(0,1fr);gap:18px}
  .application-scope dt{font-size:14px;line-height:1.75;margin:0}
  .application-scope dd{font-size:15px;line-height:1.8}
  /* Keep the result close to its controls rather than below three tall groups. */
  .mptt-controls{gap:12px;padding:18px 15px}
  .mptt-choice{flex-basis:100%}
  .mptt-choice legend{float:left;width:80px;min-height:44px;display:flex;align-items:center;margin:0 8px 0 0;font-size:13px}
  .mptt-choice label{margin:0 2px 0 0}
  .mptt-choice span{font-size:13px;padding-inline:10px}
}
@media(min-width:390px) and (max-width:760px){
  /* Retain the editorial title/copy relationship on a large phone. */
  #materials-perspective .home-editorial-heading{grid-template-columns:.82fr 1.18fr;gap:22px;align-items:start;margin-bottom:30px}
  #materials-perspective .home-editorial-heading h2{font-size:clamp(25px,5.8vw,37px);line-height:1.28}
  #materials-perspective .vision-statement{font-size:20px;line-height:1.5;margin-bottom:18px}
  #materials-perspective .home-copy{font-size:15px;line-height:1.85}
  #materials-perspective .home-inline-link{font-size:14px}
}
@media(max-width:389px){
  :root{--phone-rail:96px}
  .application-scope>div{grid-template-columns:1fr;gap:6px}
  .home-story-gallery{--story-height:850px}
  .home-story-gallery .home-path-stage{padding:26px 15px}
  .home-story-gallery .home-path-stage h3{font-size:25px}
  .home-story-gallery .home-path-stage p{font-size:15px;line-height:1.85}
  .home-story-gallery .home-story-navigation,.case-gallery>.case-rail,.method-gallery>.method-gallery-nav{padding-inline:5px}
  .home-story-gallery .home-story-tabs button,.case-gallery .case-choices>button,.method-gallery .model-scale-path button{padding-inline:6px}
  .case-gallery .case-content,.training-overview.case-gallery .training-outcome,.method-gallery-content{padding:18px 12px}
  .case-gallery :is(.research-study-copy h3,.training-outcome h3),.method-gallery .scale-step-title{font-size:22px}
}
@media(prefers-reduced-motion:reduce){.mobile-reel-controls .reel-progress i{transition:none}}
@media(min-width:390px) and (max-width:760px){
 #materials-perspective .home-editorial-heading>div:last-child{display:contents}
 #materials-perspective .purpose-heading{grid-column:1;grid-row:1}
 #materials-perspective .vision-statement{grid-column:2;grid-row:1;margin:0;align-self:center}
 #materials-perspective :is(.home-editorial-heading .home-copy,.home-editorial-heading .home-inline-link){grid-column:1/-1;margin:0}
}
@media(max-width:760px){
 .method-gallery .gallery-science-pair.atomic-energy-pair .gallery-science-figure>img{height:230px;max-height:230px}
 .method-gallery .gallery-science-pair.mesh-response-pair .gallery-science-figure>img{height:auto;max-height:none}
 .method-gallery .gallery-science-pair.mesh-response-pair .gallery-science-figure{flex:0 0 86%}
 .case-gallery .case-content .mobile-reel-controls,.method-gallery .mobile-reel-controls{margin-bottom:22px}
 .method-gallery .gallery-science-pair.mobile-reel{--reel-width:86%;align-items:flex-start}
 .case-gallery :is(.data-source-art,.training-media-pair).mobile-reel{--reel-width:86%;gap:14px;height:auto;margin-bottom:0}
 .case-gallery :is(.data-source-art,.training-media-pair).mobile-reel>figure{flex-basis:var(--reel-width)}
 .method-gallery .gallery-science-pair.mobile-reel>.recording{flex-basis:100%}
}
@media(max-width:760px){
 body.platform-workflow main .data-overview.case-gallery .data-source-view .data-source-art.mobile-reel,
 body.platform-workflow main .training-overview.case-gallery .learning-explainer.mobile-reel{display:flex;align-items:flex-start;gap:14px;height:auto;margin-inline:0}
 body.platform-workflow main .data-overview.case-gallery .data-source-view .data-source-picture,
 body.platform-workflow main .training-overview.case-gallery .learning-explainer figure{width:auto;max-width:none;margin:0;flex:0 0 var(--reel-width,86%)}
 body.platform-workflow main .data-overview.case-gallery .data-source-view[data-source=defects] .data-source-picture:first-child{flex-basis:100%}
 body.platform-workflow main .data-overview.case-gallery .data-source-view[data-source=defects] .data-source-image-window{height:auto!important;aspect-ratio:1000/330}
 body.platform-workflow main .training-overview.case-gallery .learning-explainer .training-media-window{height:auto!important;aspect-ratio:7/5}
 .mobile-reel::after{content:'';flex:0 0 max(0px,calc(100% - var(--reel-width,86%) - 16px))}
 .mobile-reel-controls[hidden]{display:none!important}
}
/* A narrow phone cannot carry a plot and a permanent rail at a useful size.
   Keep the same choices as a single sideways strip; the evidence gets the width. */
@media(max-width:389px){
 .case-gallery,.platform-panel .data-overview.case-gallery,.platform-panel .training-overview.case-gallery,.research-study.case-gallery,.method-gallery{grid-template-columns:1fr}
 .case-gallery>.case-rail,.method-gallery>.method-gallery-nav{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 8px;border-right:0;border-bottom:1px solid var(--story-line);padding:8px}
 .case-gallery .case-choices,.method-gallery .model-scale-path{display:flex;flex-direction:row;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#c3afd8 transparent;gap:5px;scroll-snap-type:x proximity;grid-column:1;grid-row:1}
 .case-gallery .case-choices>button,.method-gallery .model-scale-path>li{flex:0 0 138px;scroll-snap-align:start}
 .case-gallery .case-choices>button,.method-gallery .model-scale-path button{min-height:70px;width:100%;height:100%;padding:10px}
 .case-gallery .case-rail>.timed-gallery-controls,.method-gallery .method-gallery-controls{grid-column:2;grid-row:1;margin:0;padding:0;align-self:center}
 :is(.case-rail,.method-gallery-nav) .timed-gallery-controls>span{display:none}
 :is(.case-rail,.method-gallery-nav) .media-actions{flex-direction:column;gap:0}
 .case-gallery .case-content,.training-overview.case-gallery .training-outcome,.characterization-case-layout.case-gallery .case-content,.method-gallery-content{padding:24px 20px}
 .method-gallery-nav>.method-subchoices{grid-column:1/-1;flex-direction:row;flex-wrap:wrap}
 .method-gallery-nav>.method-subchoices button{flex:1}
}
@media(min-width:390px) and (max-width:760px){
 #materials-perspective .home-editorial-heading{grid-template-columns:1fr 1.05fr}
 #materials-perspective .home-editorial-heading h2{font-size:clamp(22px,5.6vw,32px)}
}
@media(max-width:760px){body main h2{text-wrap:balance}}
@media(max-width:760px){
 .home-section-heading h2,.home-highlight-layout .highlight-intro h2{white-space:pre-line}
}
