/* One complete opening composition; longer content always keeps its natural height. */
:root{--opening-header:91px;--opening-tail:0px;--section-anchor-offset:0px}
html{scroll-padding-top:0}
main .section{scroll-margin-top:var(--section-anchor-offset)}
main>section:first-child:is(.hero,.javi-intro,.page-hero,.career-hero,.article-intro){
  min-height:calc(100svh - var(--opening-header) - var(--opening-tail));
  display:flex;flex-direction:column;justify-content:center;
  padding-block:clamp(32px,6svh,88px);
}
main>section:first-child>.shell{flex-shrink:0;width:min(1160px,calc(100% - 96px));margin-block:0}
html:has(body.home-page){--opening-tail:110px}
html:has(body[data-page="sobre-mi"]){--opening-tail:64px;--section-anchor-offset:64px}
body[data-page="contacto"].has-selection main>.contact-intro{min-height:0}
/* A shorter laptop window needs less portrait height, not smaller body text. */
@media(min-width:761px) and (max-height:820px){
  .home-page .hero-portrait .portrait-image{height:auto}
  .home-page .hero-portrait img{height:clamp(210px,34svh,278px);width:100%;object-fit:contain}
  .home-page .hero-portrait figcaption{padding-top:15px}
  .home-page .hero-portrait strong{font-size:36px}
  .home-page .hero-portrait figcaption::after{margin-top:15px}
}
@media(max-width:760px){
  main>section:first-child>.shell{width:calc(100% - 40px)}
  main>section:first-child:is(.hero,.javi-intro,.page-hero,.career-hero,.article-intro){padding-block:32px}
  html:has(body.home-page){--opening-header:77px;--opening-tail:138px}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@media(max-width:760px){
  .home-page main>section.hero:first-child{padding-block:24px}
  .home-page .hero-layout{gap:24px}
  .home-page .trust-strip{padding-block:18px}
  .home-page .hero-copy .actions{margin-top:24px;gap:16px}
}
