/* Phase 2: the approved painting frames the existing portrait slideshow. */
.hero {
  --hero-gutter: max(12vw, calc((100vw - 1400px) / 2));
  position: relative;
  isolation: isolate;
  height: auto;
  min-height: calc(100svh - var(--site-header-height));
  padding: .5rem var(--hero-gutter) 0;
  grid-template-rows: auto 1fr auto;
  background: var(--wine-900);
  color: var(--cream);
}
.hero-art, .hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-art { z-index: -2; overflow: hidden; user-select: none; }
.hero-background {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-fox {
  position: absolute; display: block;
  width: min(61vw,1040px); height: auto; max-width: none;
  left: 33%; bottom: -9%; object-fit: contain;
  mask-image: linear-gradient(#000 0 78%,transparent 100%);
}
.hero::after {
  content: "";
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(41,10,19,.64), rgba(41,10,19,.54) 36%, transparent 53%),
    linear-gradient(0deg, rgba(41,10,19,.66), transparent 16%, transparent 86%, rgba(41,10,19,.44));
}
.hero > .eyebrow {
  gap: 1rem;
  align-items: baseline;
  padding-top: .75rem;
  border-color: rgba(232,205,182,.3);
  color: var(--cream);
  font-size: .6875rem;
  letter-spacing: .14em;
}
.hero > .eyebrow > :last-child { flex-shrink: 0; }
.hero-grid {
  grid-template-columns: minmax(0,1.2fr) minmax(0,.65fr) minmax(14rem,.72fr);
  grid-template-rows: auto;
  gap: clamp(1rem,2vw,2rem);
  padding: clamp(1rem,3svh,2rem) 0;
  min-height: 0;
  align-items: center;
}
.hero-copy { display: block; grid-column: 1; min-width: 0; }
.hero h1, html[lang=es] .hero h1 {
  font-size: clamp(3rem,min(5.4vw,8.4svh),6rem);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin: 0 0 1.5rem;
  max-width: none;
  color: var(--cream);
  text-shadow: 0 2px 18px rgba(41,10,19,.2);
}
.hero h1 em { color: #edbc83; }
.hero-bottom { display: block; padding: 0; }
.hero-bottom p {
  max-width: 25rem;
  margin: 0 0 1.5rem;
  font-size: .9375rem;
  line-height: 1.65;
  color: var(--cream);
}
.hero-bottom .button {
  width: auto;
  max-width: 100%;
  min-height: 52px;
  margin: 0;
  padding: .875rem 1.25rem;
  gap: 1.5rem;
}
.hero-film {
  grid-column: 3;
  grid-row: 1;
  width: min(100%,calc((100svh - var(--site-header-height) - 210px)*.8),19rem);
  height: auto;
  max-height: none;
  max-width: none;
  min-width: 0;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: auto auto auto;
  align-self: center;
  justify-self: end;
}
.hero-film > .eyebrow {
  width: fit-content;
  max-width: 100%;
  padding: .375rem .5rem;
  margin: 0 0 .5rem;
  font-size: .625rem;
  line-height: 1.6;
  letter-spacing: .11em;
  color: var(--cream);
  background: rgba(41,10,19,.38);
}
.hero-slideshow {
  height: auto;
  aspect-ratio: 4 / 5;
  min-width: 0;
  border: clamp(5px,.6vw,9px) solid var(--cream);
  background: #29131c;
  box-shadow: 0 16px 48px rgba(27,6,12,.3);
}
.hero-controls {
  display: grid;
  grid-template-columns: 44px minmax(2.25rem,1fr) 44px minmax(4.75rem,auto);
  gap: .375rem;
  align-items: center;
  margin-top: .625rem;
  color: var(--cream);
  background: rgba(41,10,19,.38);
}
.hero-controls button {
  min-width: 0;
  min-height: 44px;
  padding: .5rem;
  font-size: 1rem;
  line-height: 1.3;
  color: var(--cream);
  border-color: rgba(232,205,182,.65);
}
.hero-controls #hero-count {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  font-size: .625rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hero-controls button:last-child {
  grid-column: 4;
  grid-row: 1;
  margin: 0;
  font-size: .6875rem;
}
.hero-foot {
  min-height: 72px;
  margin: 0 calc(-1 * var(--hero-gutter));
  padding: .25rem var(--hero-gutter) 1.25rem;
  gap: 1rem;
  border-color: rgba(232,205,182,.3);
  background: linear-gradient(180deg,rgba(41,10,19,.24),rgba(41,10,19,.7));
  color: var(--cream);
}
.hero-foot span { font-size: .625rem; line-height: 1.6; letter-spacing: .14em; }
.hero-foot a {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  min-height: 44px;
  padding: 0;
}
@media (min-width: 901px) and (max-width: 1100px) {
  header { padding-inline: 6vw; }
  .hero { --hero-gutter: 6vw; }
  .hero-background { object-position: 30% center; }
  .hero-grid { grid-template-columns: minmax(0,1.1fr) minmax(0,.35fr) minmax(14rem,.75fr); }
  .hero h1, html[lang=es] .hero h1 { font-size: clamp(2.7rem,5.4vw,3.75rem); }
}
@media (min-width: 901px) and (max-height: 740px) {
  .hero-film { width: min(100%,16rem); }
  .hero-grid { padding-block: 1.25rem; }
}
/* A compact gallery below the copy leaves the fox visible beside the heading. */
@media (max-width: 900px) {
  .hero { --hero-gutter: 6vw; padding-top: .75rem; }
  .hero-background {
    position: absolute;
    top: 0;
    right: calc(-14.5rem - 20vw);
    width: 52rem;
    height: 29.25rem;
    max-width: none;
  }
  .hero::after {
    background:
      linear-gradient(90deg, rgba(41,10,19,.62), rgba(41,10,19,.3) 62%, transparent),
      linear-gradient(180deg, rgba(70,23,29,.06) 7rem, rgba(70,23,29,.25) 12rem, var(--wine-900) 23rem);
  }
  .hero > .eyebrow { font-size: .5625rem; letter-spacing: .09em; }
  .hero-grid {
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto auto;
    gap: 1.75rem;
    padding: 1.75rem 0;
    align-content: center;
    min-height: 0;
  }
  .hero-copy { grid-column: 1; grid-row: 1; }
  .hero h1, html[lang=es] .hero h1 {
    font-size: clamp(2.25rem,10.2vw,3.5rem);
    margin: 0 0 1.5rem;
  }
  .hero-bottom p { max-width: 30rem; }
  .hero-bottom .button { min-width: min(100%,16rem); }
  .hero-film {
    grid-column: 1;
    grid-row: 2;
    width: min(100%,30rem);
    max-height: none;
    height: auto;
    justify-self: start;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    grid-template-rows: 1fr auto;
    column-gap: 1rem;
  }
  .hero-film > .eyebrow {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    padding: 0;
    margin: 0 0 1rem;
    background: transparent;
    font-size: .625rem;
    letter-spacing: .09em;
  }
  .hero-slideshow { grid-column: 1; grid-row: 1 / 3; border-width: 5px; }
  .hero-controls {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 44px minmax(0,1fr) 44px;
    gap: .375rem;
    margin: 0;
    background: transparent;
  }
  .hero-controls button:last-child { grid-column: 1 / -1; grid-row: 2; font-size: .75rem; }
  .hero-foot span { font-size: .5625rem; letter-spacing: .08em; }
}
@media (min-width: 601px) and (max-width: 900px) {
  .hero-background { right: -9rem; width: 64rem; height: 36rem; }
  .hero::after {
    background:
      linear-gradient(90deg, rgba(41,10,19,.65), rgba(41,10,19,.4) 45%, transparent 75%),
      linear-gradient(180deg, transparent 10rem, var(--wine-900) 29rem);
  }
}
@media (max-width: 360px) {
  .hero-grid { gap: 1.5rem; }
  .hero-film { column-gap: .75rem; }
  .hero-controls { gap: .25rem; }
  .hero-controls #hero-count { font-size: .5625rem; }
  .hero-bottom .button { width: 100%; }
}

/* The existing painted paper edge closes the opening within its viewport. */
/* Alpha contour extracted from the approved paint #14; no simulated brush. */
.hero-edge {
  position: absolute; inset: auto 0 -1px; height: clamp(24px,2.6vw,42px);
  z-index: var(--layer-foreground); pointer-events: none;
  background: var(--parchment);
  mask-image: url("assets/art-direction/paint/14-footer-transition-mask.webp"),linear-gradient(transparent 55%,#000 85%);
  mask-size: 100% 100%; mask-repeat: no-repeat;
}
@media (min-width:901px) and (min-height:621px) {
  .hero { height: calc(100svh - var(--site-header-height)); }
}
@media (max-width:900px) {
  .hero-film { width: min(100%,30rem); }
  .hero-foot { padding-bottom: 1.25rem; }
  .hero-edge { height: 22px; }
}

/* The character and paper are independent planes, with a readable mobile crop. */
@media (max-width:900px) {
  .hero-background { right: -12rem; width: 64rem; height: 36rem; }
  .hero-fox { width: 39rem; left: 37%; bottom: auto; top: .5rem; }
}
@media (max-width:600px) {
  .hero-background { right: -21rem; width: 52rem; height: 36rem; }
  .hero-fox { width: 28rem; left: 20%; top: 2rem; opacity: .8; }
}
