/* r1 creative direction: storytelling order, hero composition, motion */

/* Section order is set visually so the HTML stays merge safe (grid, not flex, so pinned scroll sections keep their spacing) */
body[data-page="home"] main,
body[data-page="vera"] main,
body[data-page="about"] main{display:grid;grid-template-columns:minmax(0,1fr)}
body[data-page="home"] main>*,
body[data-page="vera"] main>*,
body[data-page="about"] main>*{min-width:0}

/* Home: problem, benchmark, negotiation, fee, coverage, proof, films */
body[data-page="home"] main>.hero{order:1}
body[data-page="home"] main>.clients{order:2}
body[data-page="home"] main>.who-film:not(#fee-film){order:3}
body[data-page="home"] main>#core{order:4}
body[data-page="home"] main>.photo-band{order:5}
body[data-page="home"] main>.manifesto{order:6}
body[data-page="home"] main>#vera{order:7}
body[data-page="home"] main>#engine{order:8}
body[data-page="home"] main>#calc{order:9}
body[data-page="home"] main>#railSec{order:10}
body[data-page="home"] main>section[aria-labelledby="caseH"]{order:11}
body[data-page="home"] main>section[aria-labelledby="stH"]{order:12}
body[data-page="home"] main>.cta-big{order:13}
/* The 30 second fee film repeated the engine and calculator; it now lives in the Studio grid below */
body[data-page="home"] #fee-film{order:9}

/* Vera: explain the product first, then one film per app right after the app list */
body[data-page="vera"] main>.hero{order:1}
body[data-page="vera"] main>#film{order:2}
body[data-page="vera"] main>section[aria-labelledby="shotsH"]{order:3}
body[data-page="vera"] main>section[aria-labelledby="howH"]{order:4}
body[data-page="vera"] main>section[aria-labelledby="rankH"]{order:5}
body[data-page="vera"] main>section[aria-labelledby="appsH"]{order:6}
body[data-page="vera"] main>#films{order:7}
body[data-page="vera"] main>section[aria-labelledby="pathH"]{order:8}
body[data-page="vera"] main>section[aria-labelledby="secH"]{order:9}
body[data-page="vera"] main>.cta-big{order:10}

/* About: who, numbers, the insider story, the rules, then the reference answers */
body[data-page="about"] main>.hero{order:1}
body[data-page="about"] main>section[aria-labelledby="whoH"]{order:2}
body[data-page="about"] main>#facts{order:3}
body[data-page="about"] main>.photo-band{order:4}
body[data-page="about"] main>section[aria-labelledby="fH"]{order:5}
body[data-page="about"] main>section[aria-labelledby="pH"]{order:6}
body[data-page="about"] main>section[aria-label^="About Redress"]{order:7;background:var(--paper)}
body[data-page="about"] main>.cta-big{order:8}

/* Hero product shots: show the whole screen, never a cropped edge */
body:not([data-page="about"]):not([data-page="locations"]) .hero-vis .hv-f img{aspect-ratio:auto;height:auto;object-fit:contain}

/* Hero delight: the shot settles flat on hover, the proof chip floats gently */
.hero-vis .hv-f{transition:transform .9s cubic-bezier(.2,.7,.2,1),box-shadow .9s}
@media(hover:hover){.hero-vis:hover .hv-f{transform:rotate(0) translateY(-4px)}}
body:not([data-page="locations"]) .hero-vis .hv-chip{animation:r1float 6s ease-in-out 1.6s infinite}
@keyframes r1float{0%,100%{translate:0 0}50%{translate:0 -8px}}
@media(prefers-reduced-motion:reduce){.hero-vis .hv-chip{animation:none!important}.hero-vis .hv-f{transition:none}}

/* Phones: the proof chip tucks under the corner instead of covering the shot */
@media(max-width:600px){
  body:not([data-page="locations"]) .hero-vis{margin-bottom:40px!important}
  body:not([data-page="locations"]) .hero-vis .hv-chip{left:auto;right:10px;bottom:-34px;max-width:62%;padding:10px 14px;border-radius:14px;gap:2px}
  body:not([data-page="locations"]) .hero-vis .hv-chip b{font-size:24px}
  body:not([data-page="locations"]) .hero-vis .hv-chip span{font-size:12px;line-height:1.35}
}

/* About headline: no orphaned last word */
body[data-page="about"] .hero h1{text-wrap:balance}
