.hero {
  display: grid;
  grid-template-columns: minmax(0, .76fr) minmax(0, 1.24fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(12px, 1.5vw, 30px);
  min-height: clamp(585px, calc(100svh - 148px), 890px);
  padding: clamp(20px, 3.2vw, 50px) var(--pad) 0;
  color: #243128;
  background:
    linear-gradient(0deg, #eeece4 0%, #eeece400 20%),
    linear-gradient(90deg, #f5f3ecf5 0%, #f5f3ecdd 27%, #f5f3ec7d 49%, #f5f3ec0d 74%),
    url("assets/showroom-wide.webp") center 64% / cover #e8e5dc;
}

.hero-copy { min-width: 0; }
.hero-copy h1 {
  font-size: clamp(46px, 4.95vw, 88px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: 1.01;
}
.hero-copy h1 em { color: #ae4728; }
.hero-summary {
  max-width: 37ch;
  margin: 22px 0 25px;
  color: #405046;
  font-size: 16px;
  line-height: 1.6;
}
.hero-actions .button { gap: 13px; min-height: 48px; padding: 12px 15px; }

.hero-stage {
  display: grid;
  align-self: end;
  min-width: 0;
  padding-bottom: 15px;
}
.hero-machine-frame {
  --machine-position: 100%;
  position: relative;
  height: clamp(335px, 56svh, 630px);
  perspective: 1400px;
}
.hero-machine-frame img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center var(--machine-position);
  filter: saturate(.97) drop-shadow(-2px 4px 4px #493d2f20);
  transform: rotateY(var(--rx, 0deg)) rotateX(var(--ry, 0deg));
  transition: opacity 230ms ease, transform 360ms ease-out;
}
.hero-machine-frame img.changing { opacity: 0; }

@supports (width: 1cqh) and selector(.hero-machine-frame:has(img)) {
  .hero-machine-frame {
    container-type: size;
    --machine-ratio: calc(1615 / 974);
    --front-caster: 86.5% 88.3%;
    --rear-caster: 93.6% 81.3%;
    --center-casters: 43% 79.8%;
    --left-caster: 4.7% 72.7%;
    --inside-caster: 12.9% 69%;
    --sealer-footprint: 63% 82%;
    --tunnel-footprint: 24% 73%;
  }
  .hero-machine-frame:has(> img[src$="/czl450m-bsg5030-hero.webp"]) {
    --machine-ratio: calc(1944 / 809);
    --front-caster: 87.7% 91.2%;
    --rear-caster: 95.5% 83.8%;
    --center-casters: 54.5% 83.2%;
    --left-caster: 6.4% 76.8%;
    --inside-caster: 47.9% 83.1%;
    --sealer-footprint: 74.5% 85%;
    --tunnel-footprint: 27% 75.5%;
  }
  .hero-machine-frame:has(> img[src$="/sleeve-inline.webp"]) {
    --machine-ratio: calc(1505 / 1045);
    --front-caster: 34.9% 92.6%;
    --rear-caster: 9.7% 88.6%;
    --center-casters: 53% 85%;
    --left-caster: 91.2% 72.4%;
    --inside-caster: 75.7% 70.1%;
    --sealer-footprint: 32% 89%;
    --tunnel-footprint: 72% 72%;
  }
  .hero-machine-frame::before {
    content: "";
    position: absolute;
    top: var(--machine-position);
    left: 50%;
    width: min(100%, calc(100cqh * var(--machine-ratio)));
    /* Match the contained image and extend below the lowest caster. */
    aspect-ratio: calc(var(--machine-ratio) / 1.08);
    translate: -50% calc(var(--machine-position) / -1.08);
    pointer-events: none;
    background:
      radial-gradient(ellipse 4% 2.3% at var(--front-caster), #3c322776, #3c322725 55%, transparent),
      radial-gradient(ellipse 3.7% 2.2% at var(--rear-caster), #3c322762, #3c322723 55%, transparent),
      radial-gradient(ellipse 8% 2.7% at var(--center-casters), #3c322768, #3c322726 55%, transparent),
      radial-gradient(ellipse 4.5% 2.2% at var(--left-caster), #3c32276b, #3c322723 55%, transparent),
      radial-gradient(ellipse 3.8% 2% at var(--inside-caster), #3c32275c, #3c322721 55%, transparent),
      radial-gradient(ellipse 34% 11% at var(--sealer-footprint), #4e44394d, #4e443928 54%, transparent),
      radial-gradient(ellipse 23% 7.8% at var(--tunnel-footprint), #4e443945, #4e443921 54%, transparent);
    transition: opacity 230ms ease;
  }
  .hero-machine-frame:has(> img.changing)::before { opacity: 0; }
}

.stage-caption {
  justify-self: end;
  margin-top: 12px;
}
.stage-caption .hero-machine-type {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stage-caption .hero-use { display: block; color: var(--fv-muted, #425149); font-size: .875rem; line-height: 1.3; }
.stage-caption strong { display: block; margin-top: 2px; font-size: 1rem; font-weight: 650; line-height: 1.25; }
.hero-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 13px 0 15px;
  border-top: 1px solid #c4c9bd;
}
.hero-tabs { display: flex; gap: 6px; min-width: 0; }
.hero-tabs button {
  min-height: 44px;
  padding: 7px 15px;
  border: 1px solid #bec7b9;
  background: #f8f7f0c9;
  color: #35463a;
  font-size: 13px;
  line-height: 1.25;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.hero-tabs button:hover { border-color: #687e6c; background: #e8ece2; }
.hero-tabs button[aria-pressed="true"] { border-color: #293a30; background: #293a30; color: #fff; }
.hero-workshops-link { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; }
.hero-workshops-link:hover { color: #963e25; }

.line-overview, .line-overview:nth-of-type(even) {
  background: radial-gradient(ellipse at 54% 56%, #e3ece3 0%, transparent 69%), #f8f7f1;
}
.line-overview:nth-of-type(even) { background-color: #f1f3ea; }

@media (min-width: 1000px) and (min-height: 800px) {
  .hero { min-height: clamp(585px, calc(100svh - 178px), 890px); }
}

@media (max-width: 999px) {
  .hero {
    --hero-header-space: calc(var(--site-header-height) + 38px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    gap: clamp(10px, 1.6svh, 17px);
    min-height: calc(100vh - var(--hero-header-space));
    min-height: calc(100svh - var(--hero-header-space));
    padding: clamp(22px, 4.3svh, 48px) var(--pad) max(15px, env(safe-area-inset-bottom));
    background:
      linear-gradient(180deg, #f6f3e9a8, #f6f3e970 33%, #f6f3e90a 58%, #eeeade19 77%, #f1eee4ed),
      url("assets/showroom-portrait.webp") right 58% / cover #eae6dd;
  }
  .hero-copy { max-width: 620px; }
  .hero-copy h1 { font-size: clamp(34px, 11.1vw, 68px); }
  .hero-summary { margin: 13px 0 16px; font-size: 15px; line-height: 1.5; }
  .hero-actions .button { min-height: 44px; padding: 10px 14px; font-size: 13px; }
  .hero-workshops-link { display: none; }
  .hero-stage { grid-template-rows: 1fr auto; align-self: stretch; padding: 0; }
  .hero-machine-frame {
    --machine-position: 70%;
    height: auto;
    min-height: clamp(163px, min(60vw, 38svh), 440px);
    margin-inline: calc(var(--pad) * -.68);
  }
  .hero-machine-frame img {
    position: absolute;
    inset: 0;
    transform: none;
  }
  .stage-caption { justify-self: start; margin: 8px 0 0; }
  .hero-bottom { padding-block: 9px 0; border-color: #68756665; }
  .hero-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: 100%; }
  .hero-tabs button { padding-inline: 4px; background: #faf7efdb; font-size: 12px; }
}

@media (max-width: 800px) {
  .hero { --hero-header-space: calc(var(--site-header-height) + 32px); }
}

@media (max-width: 600px) {
  .hero { --hero-header-space: calc(var(--phone-header-height) + 44px); }
  .workshop-feature { padding-block: 22px 24px; }
  .workshop-feature h2 { margin-top: 0; font-size: clamp(27px, 7.6vw, 36px); }
  .workshop-feature .workshop-gallery-heading { gap: 7px 12px; }
  .workshop-feature .workshop-rails { margin-top: 11px; }
  .workshop-feature .workshop-intro { display: none; }
  .workshop-feature .workshop-card-caption { padding: 8px 10px; font-size: 13px; }
  .workshop-feature-actions .text-link { gap: 10px; font-size: 13px; }
  .workshop-feature .workshop-credit { margin-top: 8px; font-size: 11px; }
  .line-overview, .line-overview:nth-of-type(even) { background: #f6f5ee; }
  .line-overview .line-overview-art { background: radial-gradient(ellipse at 52% 48%, #f4f6ef, #e1e9e0 74%); }
}

@media (max-width: 600px) and (max-height: 780px) {
  .hero {
    gap: 8px;
    padding-block-start: clamp(15px, 3.4svh, 22px);
    padding-block-end: max(12px, env(safe-area-inset-bottom));
  }
  .hero-copy h1 { font-size: clamp(31px, 10.4vw, 48px); }
  .hero-summary { margin: 8px 0 10px; font-size: 14px; line-height: 1.45; }
  .hero-machine-frame { min-height: clamp(143px, min(57vw, 32svh), 245px); }
  .stage-caption { margin-top: 4px; }
  .hero-bottom { padding-top: 5px; }
}

@media (max-width: 600px) and (max-height: 680px) {
  .hero-applications { display: none; }
}

@media (max-width: 360px) {
  .hero-actions .button { gap: 7px; padding-inline: 9px; font-size: 12px; }
}

@media (max-width: 600px) and (max-height: 600px) {
  .hero { gap: 6px; padding-block-start: 14px; }
  .hero-copy h1 { font-size: clamp(30px, 9.8vw, 40px); }
  .hero-summary { margin: 6px 0 8px; font-size: 13px; line-height: 1.4; }
  .hero-machine-frame { min-height: clamp(132px, min(56vw, 29svh), 200px); }
  .stage-caption { margin-top: 3px; }
}

@media (min-width: 601px) and (max-width: 999px) and (orientation: landscape) {
  .hero {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 10px 16px;
    padding-block: clamp(12px, 3svh, 28px) 12px;
    background:
      linear-gradient(90deg, #f5f2e9ef, #f5f2e9c4 35%, #f5f2e916 76%),
      linear-gradient(0deg, #eeece4b0, #eeece400 40%),
      url("assets/showroom-compact.webp") right 64% / cover #e8e5dc;
  }
  .hero-copy h1 { font-size: clamp(32px, 5.2vw, 49px); }
  .hero-summary { margin: 9px 0 11px; font-size: 14px; line-height: 1.45; }
  .hero-machine-frame { min-height: clamp(135px, min(30vw, 42svh), 300px); margin-inline: 0; }
}

@media (min-width: 601px) and (max-width: 999px) and (max-height: 460px) and (orientation: landscape) {
  .hero { gap: 8px 16px; padding-block: 10px; }
  .hero-applications { display: none; }
  .hero-summary { margin: 7px 0 9px; }
  .hero-machine-frame { min-height: clamp(116px, 36svh, 172px); }
  .stage-caption { margin-top: 5px; }
  .hero-bottom { padding-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-machine-frame img { transform: none; transition: none; }
  .hero-machine-frame::before { transition: none; }
}

@media (max-width: 600px), (max-width: 999px) and (max-height: 520px) and (orientation: landscape) {
  .sealer-showcase-compact { margin-top: 10px; }
  .sealer-showcase-compact .equipment-type-picker { margin-bottom: 10px; }
  .sealer-showcase-compact-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
  }
  .sealer-showcase-compact-controls .sealer-showcase-models { min-width: 0; gap: 4px; }
  .sealer-showcase-compact-controls .sealer-showcase-models label span { display: none; }
  .sealer-showcase-compact-controls .sealer-showcase-models select {
    min-height: 46px;
    min-width: 0;
    font-size: 1rem;
  }
  .sealer-showcase-compact-controls [data-sealer-details] {
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    padding: 7px 10px;
    border: 1px solid var(--fv-active, #26352b);
    border-radius: var(--fv-radius, 6px);
    background: var(--fv-active, #26352b);
    color: #fff;
    font-size: .875rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .sealer-showcase-compact-controls [data-sealer-details]:hover {
    background: var(--fv-ink, #364c3d);
    color: #fff;
  }
  .sealer-showcase--ready .sealer-showcase-actions:not(:has(a, button)) { display: none; }
}
