/* =========================================================
   SALVATORE ZARBO — VIEWPORT SYSTEM 070
   Master reading frame: 1440 × 900
   Fluid desktop: 1366×768 → 1920×1080 and beyond
   ========================================================= */
:root{
  --sz-design-w:1440;
  --sz-design-h:900;
  --sz-header-h:106px;
  --sz-content-max:1720px;
  --sz-edge:max(5.8vw, calc((100vw - var(--sz-content-max))/2));
  --sz-frame-h:calc(100svh - var(--sz-header-h));
  --sz-frame-min:620px;
  --sz-reading:680px;
}

html{scroll-padding-top:var(--sz-header-h)}

@media (min-width:901px){
  /* One horizontal datum across the whole site. */
  .sz-header{
    padding-left:var(--sz-edge)!important;
    padding-right:var(--sz-edge)!important;
    height:var(--sz-header-h)!important;
  }

  /* ---------- HOME ---------- */
  body[data-page="home"] .art-hero{
    min-height:100svh;
    padding-left:var(--sz-edge);
    padding-right:var(--sz-edge);
    padding-top:calc(var(--sz-header-h) + 22px);
    padding-bottom:42px;
    gap:clamp(56px,7vw,118px);
  }
  body[data-page="home"] .art-hero-copy{padding-top:0}
  body[data-page="home"] .art-hero-image{
    min-height:0;
    height:clamp(600px,calc(100svh - 160px),860px);
    max-height:calc(100svh - 128px);
    align-self:center;
  }
  body[data-page="home"] .art-title{
    font-size:clamp(58px,6.1vw,98px);
    max-width:620px;
  }
  body[data-page="home"] .art-light,
  body[data-page="home"] .art-selection,
  body[data-page="home"] .art-manifesto,
  body[data-page="home"] .art-footer{
    padding-left:var(--sz-edge);
    padding-right:var(--sz-edge);
  }
  body[data-page="home"] .art-light-track{
    top:calc(var(--sz-header-h) + 26px);
    min-height:calc(100svh - var(--sz-header-h) - 52px);
  }
  body[data-page="home"] .art-light-image{
    height:clamp(500px,64vh,680px);
  }
  body[data-page="home"] .art-projects{align-items:start}
  body[data-page="home"] .art-project figure{
    height:clamp(430px,55vh,620px);
    min-height:0;
  }
  body[data-page="home"] .art-project-meta{
    min-height:66px;
    grid-template-rows:14px 14px;
  }

  /* ---------- PROJECTS INDEX ---------- */
  body[data-page="projects"] main{padding-top:var(--sz-header-h)!important}
  body[data-page="projects"] .intro{
    height:var(--sz-frame-h);
    min-height:var(--sz-frame-min);
    padding:40px var(--sz-edge) 48px;
    gap:clamp(44px,5vw,88px);
  }
  body[data-page="projects"] .intro .image{
    height:min(65vh,610px);
    max-height:calc(var(--sz-frame-h) - 80px);
  }
  body[data-page="projects"] .intro h1{
    font-size:clamp(76px,8.8vw,136px);
    margin-bottom:22px;
  }
  body[data-page="projects"] .chapter{
    min-height:var(--sz-frame-h);
    padding:46px var(--sz-edge);
  }
  body[data-page="projects"] .folio{
    top:34px;
    left:var(--sz-edge);
    right:var(--sz-edge);
  }
  body[data-page="projects"] .stage{gap:clamp(36px,4vw,70px)}
  body[data-page="projects"] .heroimg,
  body[data-page="projects"] .alt .heroimg,
  body[data-page="projects"] .portrait .heroimg{
    height:min(66vh,600px);
    max-height:calc(var(--sz-frame-h) - 90px);
  }
  body[data-page="projects"] .duo,
  body[data-page="projects"] .tiles{
    height:min(66vh,600px);
    max-height:calc(var(--sz-frame-h) - 90px);
  }
  body[data-page="projects"] .duo figure:first-child{height:72%}
  body[data-page="projects"] .duo figure:last-child{height:94%}
  body[data-page="projects"] .copy{padding-bottom:18px}
  body[data-page="projects"] .copy h2{
    font-size:clamp(58px,6.3vw,94px);
    margin-bottom:18px;
  }
  body[data-page="projects"] .overlay{min-height:var(--sz-frame-h)}
  body[data-page="projects"] .overlay .inside{
    min-height:var(--sz-frame-h);
    padding:54px var(--sz-edge) 48px;
  }
  body[data-page="projects"] .overlay h2{font-size:clamp(74px,8.8vw,132px)}
  body[data-page="projects"] .closing{
    height:auto;
    min-height:var(--sz-frame-h);
    padding:70px var(--sz-edge);
  }

  /* ---------- STUDIO / APPROACH / CONTACT ---------- */
  body.minimal-page .page{
    padding-left:var(--sz-edge)!important;
    padding-right:var(--sz-edge)!important;
    padding-top:calc(var(--sz-header-h) + 30px)!important;
  }
  body.minimal-page .title{
    font-size:clamp(60px,6.6vw,100px);
    max-width:980px;
  }
  body[data-page="studio"] .studio-hero,
  body[data-page="approach"] .approach-hero,
  body[data-page="contact"] .contact-hero{
    min-height:calc(100svh - var(--sz-header-h) - 70px);
    display:grid;
    align-content:end;
  }
  body[data-page="studio"] .studio-hero{
    grid-template-columns:1.25fr .55fr;
    align-items:end;
  }
  body[data-page="studio"] .director{
    min-height:min(72vh,650px);
  }
  body[data-page="studio"] .team-grid{align-items:start}
  body[data-page="studio"] .person figure{aspect-ratio:4/5}
  body[data-page="approach"] .approach-hero,
  body[data-page="contact"] .contact-hero{max-width:1100px}

  /* ---------- ALL PROJECT DETAIL PAGES ---------- */
  body.project-magazine-page main{padding-top:var(--sz-header-h)!important}
  body.project-magazine-page .project-hero.mag-cover{
    box-sizing:border-box!important;
    width:100%!important;
    height:var(--sz-frame-h)!important;
    min-height:var(--sz-frame-min)!important;
    padding:22px var(--sz-edge) 22px!important;
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    align-content:stretch!important;
    overflow:hidden!important;
  }
  body.project-magazine-page .project-hero .mag-folio{
    grid-row:1!important;
    min-height:24px!important;
    padding:0 0 14px!important;
  }
  body.project-magazine-page .project-hero .project-title{
    position:relative!important;
    inset:auto!important;
    grid-row:2!important;
    width:100%!important;
    padding:20px 0 26px!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    gap:28px!important;
  }
  body.project-magazine-page .project-title h1{
    margin:0!important;
    font-size:clamp(58px,6.8vw,98px)!important;
    line-height:.88!important;
    letter-spacing:-.045em!important;
  }
  body.project-magazine-page .project-title p{
    position:relative!important;
    inset:auto!important;
    grid-column:2!important;
    grid-row:1!important;
    align-self:end!important;
    margin:0 0 6px!important;
    max-width:360px!important;
    text-align:right!important;
    font-size:8px!important;
    line-height:1.55!important;
    letter-spacing:.17em!important;
  }
  body.project-magazine-page .project-hero .mag-cover-image{
    position:relative!important;
    inset:auto!important;
    grid-row:3!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    overflow:hidden!important;
  }
  body.project-magazine-page .project-hero .mag-cover-image img{
    width:100%!important;
    height:100%!important;
    object-fit:cover!important;
  }
  body.project-magazine-page .project-hero .mag-image-caption{
    grid-row:4!important;
    padding:9px 0 0!important;
    min-height:18px!important;
  }
  body.project-magazine-page .project-intro.mag-intro{
    padding-top:clamp(76px,10vh,104px)!important;
    padding-bottom:clamp(84px,12vh,122px)!important;
    padding-left:var(--sz-edge)!important;
    padding-right:var(--sz-edge)!important;
  }
  body.project-magazine-page .project-next{
    padding-left:var(--sz-edge)!important;
    padding-right:var(--sz-edge)!important;
  }
  body.project-magazine-page .villa025-gallery .v25-chapter,
  body.project-magazine-page .v25-colophon{
    margin-left:var(--sz-edge)!important;
    margin-right:var(--sz-edge)!important;
  }
}

/* Preserve the compact mobile compositions already designed. */
@media (max-width:900px){
  :root{--sz-header-h:0px;--sz-edge:20px;--sz-frame-h:auto}
}

/* =========================================================
   072 — FINAL HERO FRAME OVERRIDES
   Header remains in normal flow; hero fills the exact
   remaining 1440×900 reading frame with no top gap.
   ========================================================= */
@media (min-width:901px){
  body.hero-dark main,
  body.hero-dark .page,
  body[data-page="home"] main{
    padding-top:0!important;
  }

  body.hero-dark .immersive-hero,
  body[data-page="home"] .art-hero.art-hero-full{
    box-sizing:border-box!important;
    height:calc(100svh - var(--sz-header-h))!important;
    min-height:var(--sz-frame-min)!important;
    margin-top:0!important;
    padding-top:0!important;
    padding-bottom:0!important;
    padding-left:0!important;
    padding-right:0!important;
    border:0!important;
  }

  body[data-page="home"] .art-hero.art-hero-full .art-hero-image{
    position:absolute!important;
    inset:0!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
  }
  body[data-page="home"] .art-hero.art-hero-full .art-hero-copy{
    padding:0 0 9vh var(--sz-edge)!important;
  }

  body[data-page="projects"] main{padding-top:0!important}
  body.minimal-page.hero-dark .page{
    padding-top:0!important;
    padding-left:var(--sz-edge)!important;
    padding-right:var(--sz-edge)!important;
  }

  /* immersive heroes intentionally break out to the viewport edge */
  body.minimal-page.hero-dark .immersive-hero{
    margin-left:calc(50% - 50vw)!important;
    margin-right:calc(50% - 50vw)!important;
  }

  body[data-page="studio"] .immersive-hero,
  body[data-page="approach"] .immersive-hero,
  body[data-page="contact"] .immersive-hero{
    display:flex!important;
    align-items:flex-end!important;
    max-width:none!important;
  }
}

/* =========================================================
   074 — DEFINITIVE FULL VIEWPORT + FIXED HEADER SYSTEM
   First view is always 100% image. Header overlays the hero,
   stays fixed, then becomes paper/beige after the hero.
   ========================================================= */
:root{
  --sz-header-paper:rgba(246,243,237,.97);
  --sz-header-transition:650ms cubic-bezier(.22,.7,.18,1);
}

/* Fixed navigation on every real site page */
.sz-header{
  position:fixed !important;
  top:0 !important;
  left:0 !important;
  right:0 !important;
  width:100% !important;
  z-index:9999 !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
  transition:background-color var(--sz-header-transition),
             box-shadow var(--sz-header-transition),
             backdrop-filter var(--sz-header-transition) !important;
}
.sz-header.is-scrolled{
  background:var(--sz-header-paper) !important;
  box-shadow:0 1px 0 rgba(47,43,39,.07) !important;
  backdrop-filter:blur(10px) !important;
  -webkit-backdrop-filter:blur(10px) !important;
}

/* No page is allowed to reserve vertical room for the overlay header. */
body[data-page="home"] main,
body[data-page="projects"] main,
body[data-page="project"] main,
body.minimal-page .page,
body.hero-dark main,
body.hero-dark .page,
body.project-magazine-page main{
  padding-top:0 !important;
  margin-top:0 !important;
}

/* HOME — exactly one visible viewport, including the area below the header. */
body[data-page="home"] .art-hero.art-hero-full{
  box-sizing:border-box !important;
  width:100% !important;
  height:100vh !important;
  height:100dvh !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
}
body[data-page="home"] .art-hero.art-hero-full .art-hero-image{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
}
body[data-page="home"] .art-hero.art-hero-full .art-hero-copy{
  padding-left:var(--sz-edge) !important;
  padding-bottom:clamp(54px,8.5vh,92px) !important;
}

/* PROYECTOS / STUDIO / ENFOQUE / CONTACTO — same first-view geometry. */
body.hero-dark .immersive-hero{
  box-sizing:border-box !important;
  width:100vw !important;
  height:100vh !important;
  height:100dvh !important;
  min-height:0 !important;
  max-height:none !important;
  margin-top:0 !important;
  margin-bottom:0 !important;
  border:0 !important;
  outline:0 !important;
  overflow:hidden !important;
}
body.minimal-page.hero-dark .immersive-hero{
  margin-left:calc(50% - 50vw) !important;
  margin-right:calc(50% - 50vw) !important;
}
body.hero-dark .immersive-hero .hero-media{
  position:absolute !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
}
body.hero-dark .immersive-hero .hero-media img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}

/* PROJECT DETAIL PAGES — immersive opening as well. */
body.project-magazine-page .project-hero.mag-cover{
  position:relative !important;
  box-sizing:border-box !important;
  width:100vw !important;
  height:100vh !important;
  height:100dvh !important;
  min-height:0 !important;
  max-height:none !important;
  margin:0 !important;
  padding:0 !important;
  display:block !important;
  overflow:hidden !important;
  background:#1f1b18 !important;
  color:#fff !important;
}
body.project-magazine-page .project-hero .mag-cover-image{
  position:absolute !important;
  inset:0 !important;
  z-index:0 !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  aspect-ratio:auto !important;
  margin:0 !important;
}
body.project-magazine-page .project-hero .mag-cover-image::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg,rgba(24,20,17,.60) 0%,rgba(24,20,17,.34) 40%,rgba(24,20,17,.10) 72%,rgba(24,20,17,.04) 100%);
  pointer-events:none;
}
body.project-magazine-page .project-hero .mag-cover-image img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}
body.project-magazine-page .project-hero .project-title{
  position:absolute !important;
  left:var(--sz-edge) !important;
  right:auto !important;
  bottom:clamp(58px,8.5vh,92px) !important;
  top:auto !important;
  z-index:3 !important;
  width:min(820px,84vw) !important;
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  flex-direction:column-reverse !important;
  align-items:flex-start !important;
  gap:15px !important;
  color:#fff !important;
}
body.project-magazine-page .project-title h1{
  margin:0 !important;
  color:#fff !important;
  font-size:clamp(76px,9vw,148px) !important;
  line-height:.84 !important;
  letter-spacing:-.05em !important;
}
body.project-magazine-page .project-title p{
  position:relative !important;
  inset:auto !important;
  grid-column:auto !important;
  grid-row:auto !important;
  margin:0 !important;
  max-width:700px !important;
  text-align:left !important;
  color:rgba(255,255,255,.82) !important;
  font-size:9px !important;
  line-height:1.45 !important;
  letter-spacing:.18em !important;
  text-transform:uppercase !important;
}
body.project-magazine-page .project-hero .mag-folio{
  position:absolute !important;
  top:132px !important;
  left:var(--sz-edge) !important;
  right:var(--sz-edge) !important;
  z-index:3 !important;
  padding:0 !important;
  border:0 !important;
  color:rgba(255,255,255,.72) !important;
}
body.project-magazine-page .project-hero .mag-image-caption{display:none !important}

/* Cinematic entry: image first, copy second. */
body.project-magazine-page .project-hero .mag-cover-image{
  opacity:0;
  animation:sz074ImageFade 2.25s cubic-bezier(.22,.7,.18,1) .08s forwards;
}
body.project-magazine-page .project-hero .mag-cover-image img{
  transform:scale(1.018);
  animation:sz074ImageSettle 4.6s cubic-bezier(.22,.7,.18,1) .08s forwards;
}
body.project-magazine-page .project-hero .project-title,
body.project-magazine-page .project-hero .mag-folio{
  opacity:0;
  transform:translateY(18px);
  animation:sz074TextFade 1.55s cubic-bezier(.22,.7,.18,1) 1.20s forwards;
}
body.project-magazine-page .project-hero .mag-folio{animation-delay:1.02s}
@keyframes sz074ImageFade{to{opacity:1}}
@keyframes sz074ImageSettle{from{transform:scale(1.018)}to{transform:scale(1)}}
@keyframes sz074TextFade{to{opacity:1;transform:none}}

/* The site after the first screen is deliberately paper/beige. */
body,
.art-home,
body.minimal-page,
body.project-magazine-page,
body[data-page="projects"]{
  background:#f3efe8 !important;
}

@media(max-width:900px){
  .sz-header{
    position:fixed !important;
    height:auto !important;
    background:transparent !important;
  }
  .sz-header.is-scrolled{background:var(--sz-header-paper) !important}
  body[data-page="home"] .art-hero.art-hero-full,
  body.hero-dark .immersive-hero,
  body.project-magazine-page .project-hero.mag-cover{
    height:100vh !important;
    height:100dvh !important;
    min-height:620px !important;
  }
  body.project-magazine-page .project-hero .project-title{
    left:20px !important;
    bottom:7vh !important;
    width:calc(100% - 40px) !important;
  }
  body.project-magazine-page .project-title h1{font-size:64px !important}
  body.project-magazine-page .project-hero .mag-folio{top:120px !important;left:20px !important;right:20px !important}
}

@media(prefers-reduced-motion:reduce){
  body.project-magazine-page .project-hero .mag-cover-image,
  body.project-magazine-page .project-hero .mag-cover-image img,
  body.project-magazine-page .project-hero .project-title,
  body.project-magazine-page .project-hero .mag-folio{
    animation:none !important;
    opacity:1 !important;
    transform:none !important;
  }
}


/* =========================================================
   075 — FULL FIRST VIEWPORT SAFETY
   ========================================================= */
body[data-page="home"] main,
body[data-page="projects"] main,
body[data-page="project"] main,
body.minimal-page .page,
body.hero-dark main,
body.hero-dark .page,
body.project-magazine-page main{
  padding-top:0 !important;
  margin-top:0 !important;
}
body[data-page="home"] .art-hero.art-hero-full,
body.hero-dark .immersive-hero,
body.project-magazine-page .project-hero.mag-cover{
  height:100vh !important;
  height:100dvh !important;
  min-height:0 !important;
  max-height:none !important;
  margin-top:0 !important;
  border:0 !important;
}
