/**
 * HENGDE durable layout system.
 *
 * Geometry only. See docs/HENGDE-LAYOUT-CONTRACT.md.
 * This file intentionally contains no !important declarations.
 */

:root {
  --hd-layout-max: 1440px;
  --hd-gutter: clamp(16px, 3vw, 40px);
  --hd-section-space: clamp(64px, 7vw, 112px);
  --hd-layout-gap: clamp(24px, 4vw, 64px);
  --hd-radius: 14px;
  --hd-z-content: 0;
  --hd-z-sticky: 20;
  --hd-z-float: 50;
  --hd-z-header: 60;
  --hd-z-dropdown: 70;
  --hd-z-consent: 80;
  --hd-z-mobile-nav: 90;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 92px;
}

body {
  min-width: 320px;
}

img,
svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

.site-main,
.site-main > *,
.v8-home,
.v8-home > *,
.hd-container,
.shell,
.container {
  min-width: 0;
}

.hd-container,
.shell,
.container {
  width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
  margin-inline: auto;
}

.hd-section,
.content-section {
  padding-block: var(--hd-section-space);
}

.hd-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
}

.hd-split,
.home-hero-grid,
.hero-grid,
.inner-hero-grid,
.wpkg-hero-grid,
.v5-product-hero-grid,
.v6-article-hero-grid,
.complete-line-grid,
.form-layout,
.contact-layout,
.contact-stage-grid,
.home-company-grid,
.spotlight-grid,
.process-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: var(--hd-layout-gap);
  min-width: 0;
}

.hd-split > *,
.home-hero-grid > *,
.hero-grid > *,
.inner-hero-grid > *,
.wpkg-hero-grid > *,
.v5-product-hero-grid > *,
.v6-article-hero-grid > *,
.complete-line-grid > *,
.form-layout > *,
.contact-layout > *,
.contact-stage-grid > *,
.home-company-grid > *,
.spotlight-grid > *,
.process-grid > * {
  min-width: 0;
}

.hd-grid,
.content-card-grid,
.content-card-grid.dense,
.wpkg-card-grid,
.wpkg-equipment-grid,
.wpkg-feature-grid,
.v7-detail-grid,
.v7-module-grid,
.v5-cutting-grid,
.solution-grid,
.equipment-grid,
.project-grid,
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: clamp(16px, 2vw, 28px);
  min-width: 0;
}

.hd-grid > *,
.content-card-grid > *,
.wpkg-card-grid > *,
.wpkg-equipment-grid > *,
.wpkg-feature-grid > *,
.v7-detail-grid > *,
.v7-module-grid > *,
.v5-cutting-grid > *,
.solution-grid > *,
.equipment-grid > *,
.project-grid > *,
.news-grid > * {
  min-width: 0;
}

.hd-card,
.family-card,
.hengde-card,
.content-card,
.wpkg-card,
.equipment-card,
.project-card,
.news-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  min-width: 0;
}

.content-card {
  overflow: visible;
}

.hd-media,
.family-media,
.hengde-card__media,
.equipment-thumb,
.project-card__media,
.news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  min-width: 0;
  overflow: clip;
  background: #e9f0f4;
}

.hd-media > img,
.family-media > img,
.hengde-card__media > img,
.equipment-thumb > img,
.project-card__media > img,
.news-card__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-card > .equipment-thumb {
  width: 100%;
  height: auto;
  margin: 0;
}

.hd-media--drawing > img,
.drawing-thumb > img,
.engineering-layout img,
.complete-line-visual img,
.inner-engineering-panel img,
.hero-line-layout-card {
  object-fit: contain;
}

.hd-carousel,
.hengde-carousel {
  min-width: 0;
  max-width: 100%;
}

.hd-carousel__viewport,
.hengde-carousel__viewport,
.swiper {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.swiper-wrapper,
.swiper-slide {
  min-width: 0;
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--hd-z-header);
}

.header-inner {
  min-height: 76px;
  gap: clamp(14px, 2vw, 26px);
}

.header-inner .brand {
  flex: 0 1 auto;
  min-width: 190px;
}

.desktop-nav {
  min-width: 0;
  gap: clamp(8px, 1.1vw, 16px);
}

.desktop-nav .nav-group > a {
  white-space: nowrap;
}

.nav-dropdown {
  z-index: var(--hd-z-dropdown);
}

.mobile-menu {
  z-index: var(--hd-z-mobile-nav);
}

.mobile-menu nav {
  z-index: var(--hd-z-mobile-nav);
}

/* Home hero: copy and evidence are peers in normal flow. */
.home-hero {
  position: relative;
  display: block;
  min-height: 0;
  overflow: clip;
  isolation: isolate;
}

.home-hero-bg,
.home-hero-shade {
  position: absolute;
  inset: 0;
}

.home-hero .home-hero-grid {
  position: relative;
  z-index: 3;
  width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
  padding-block: clamp(64px, 7vw, 112px);
  grid-template-columns: minmax(0, 1.03fr) minmax(440px, .97fr);
}

.home-hero .hero-copy {
  align-self: center;
  padding: 0;
}

.home-hero h1,
.inner-hero h1,
.wpkg-hero h1,
.v5-product-hero h1,
.v6-article-hero h1 {
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-visual-proof {
  position: relative;
  display: block;
  align-self: center;
  min-height: 0;
}

.hero-evidence-carousel {
  width: 100%;
  color: #fff;
}

.hero-evidence-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(139, 216, 251, .5);
  border-radius: 4px;
  background: rgba(4, 35, 59, .82);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .34);
  backdrop-filter: blur(12px);
}

.hero-evidence-carousel:not(.is-ready):not(.is-initializing) {
  --hengde-fallback-gap: 0px;
  --hengde-fallback-slide-width: 100%;
}

.hero-evidence-carousel .hengde-carousel__viewport {
  width: 100%;
  overflow: hidden;
}

.hero-evidence-slide {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  height: auto;
  background: #08253b;
  color: #fff;
  text-decoration: none;
}

.hero-evidence-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e9f0f4;
}

.hero-evidence-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.hero-evidence-slide--layout .hero-evidence-media {
  background: #f7f9fb;
}

.hero-evidence-slide--layout .hero-evidence-media img {
  object-fit: contain;
}

.hero-evidence-caption {
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 16px 20px;
  border-top: 1px solid rgba(139, 216, 251, .28);
  background: linear-gradient(135deg, rgba(4, 35, 59, .98), rgba(10, 73, 105, .92));
}

.hero-evidence-caption b {
  color: #72d8ff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
}

.hero-evidence-caption strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
}

.hero-evidence-caption small {
  color: #c4dcea;
  font-size: 11px;
  line-height: 1.4;
}

.hero-evidence-carousel .hengde-carousel__controls {
  position: absolute;
  z-index: 5;
  top: calc((100% - 104px) / 2 - 21px);
  right: 12px;
  left: 12px;
  justify-content: space-between;
  gap: 0;
  margin: 0;
  pointer-events: none;
}

.hero-evidence-carousel .hengde-carousel__button {
  width: 42px;
  height: 42px;
  border-color: rgba(255, 255, 255, .48);
  background: rgba(255, 255, 255, .94);
  color: #08253b;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
  pointer-events: auto;
}

.hero-evidence-carousel .hengde-carousel__button:hover,
.hero-evidence-carousel .hengde-carousel__button:focus-visible {
  border-color: #d95100;
  background: #d95100;
  color: #fff;
}

.hero-evidence-slide:hover .hero-evidence-media img {
  transform: scale(1.018);
}

.hero-evidence-slide--layout:hover .hero-evidence-media img {
  transform: none;
}

.hero-evidence-instruction {
  margin: 10px 2px 0;
  color: #bfd0dc;
  font-size: 11px;
  line-height: 1.45;
  text-align: right;
}

.engineering-panel,
.entrance-card {
  position: relative;
  inset: auto;
  width: auto;
  height: auto;
  min-width: 0;
  overflow: clip;
  clip-path: none;
  aspect-ratio: auto;
}

.engineering-panel {
  display: grid;
  grid-template-rows: auto minmax(230px, 1fr) auto;
  padding: 18px;
}

.engineering-panel-head,
.engineering-panel-foot {
  position: relative;
  inset: auto;
  z-index: 3;
}

.engineering-panel-head {
  align-items: start;
  padding-bottom: 12px;
}

.engineering-panel-foot {
  padding-top: 12px;
}

.hero-line-layout-card {
  position: relative;
  inset: auto;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 230px;
  background: rgba(245, 249, 252, .97);
}

.entrance-card {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  background: #08253b;
}

.entrance-card.entrance-card--hengde img {
  position: relative;
  inset: auto;
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.entrance-card::after {
  content: none;
}

.entrance-card span {
  position: relative;
  inset: auto;
  z-index: 1;
  padding: 14px 16px;
}

/* Inner page heroes */
.inner-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(380px, .86fr);
}

.inner-engineering-panel {
  min-height: 0;
  aspect-ratio: 16 / 11;
}

.inner-engineering-panel img,
.wpkg-hero-media img,
.v5-product-hero-media img,
.v6-article-hero-media img {
  width: 100%;
  height: 100%;
}

.feature-media,
.section-context-media {
  position: relative;
  min-width: 0;
  margin-inline: 0;
  overflow: clip;
  background: #e9f0f4;
}

.feature-media img,
.section-context-media img {
  width: 100%;
  height: auto;
  max-height: min(70svh, 760px);
  object-fit: cover;
}

.drawing-context img {
  object-fit: contain;
}

/* Home sections */
.section-heading,
.split-heading,
.home-inquiry-heading {
  min-width: 0;
}

.split-heading,
.home-inquiry-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  align-items: end;
  gap: clamp(24px, 4vw, 64px);
}

.family-card {
  min-height: 0;
}

.family-copy,
.hengde-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.family-copy .text-link,
.hengde-card__body .hengde-card__link {
  margin-top: auto;
}

.home-complete-line {
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(48px, 6vw, 80px);
  border-top: 1px solid rgba(6, 30, 51, .14);
}

.home-product-output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: clamp(28px, 4vw, 48px);
}

.home-product-output,
.home-why-grid > article {
  gap: 14px;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid rgba(6, 30, 51, .13);
  background: #fff;
  box-shadow: 0 14px 38px rgba(6, 30, 51, .06);
}

.home-product-output h3,
.home-why-grid h3,
.home-product-output p,
.home-why-grid p {
  margin: 0;
}

.home-why-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(28px, 4vw, 48px);
}

.home-why-grid > article > span {
  color: var(--orange, #ef6c1a);
  font-weight: 900;
  letter-spacing: .08em;
}

.proof-gallery {
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, .75fr);
  grid-template-rows: repeat(2, minmax(220px, 1fr));
}

/* Evidence is an intentional dark trust surface. This selector resolves the
   existing tinted-section specificity without an override escalation. */
.content-section.home-company {
  background: var(--navy, #061e33);
  color: #fff;
}

.content-section.home-company h2,
.content-section.home-company h3,
.content-section.home-company p {
  color: inherit;
}

.content-section.home-company p {
  color: #b9cbd9;
}

.content-section.home-company .proof-gallery figure {
  min-width: 0;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
}

.content-section.home-company .proof-gallery img,
.content-section.home-company .proof-gallery .v8-media-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}

.proof-gallery figure.large {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.proof-gallery figure:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

.proof-gallery figure:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.complete-line-grid {
  grid-template-columns: minmax(0, .82fr) minmax(460px, 1.18fr);
}

.complete-line-visual {
  display: grid;
  grid-template-rows: minmax(320px, 1fr) auto;
  min-height: 0;
  clip-path: none;
}

.complete-line-visual > a {
  display: grid;
  min-height: 320px;
}

.complete-line-visual img {
  width: 100%;
  height: 100%;
  padding: clamp(16px, 3vw, 34px);
}

.complete-line-visual figcaption {
  position: relative;
  inset: auto;
  margin: 0;
}

.delivery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.delivery-grid article {
  min-height: 0;
}

/* Forms and contact */
.form-layout,
.contact-layout,
.contact-stage-grid {
  align-items: start;
}

.form-layout form,
.home-inquiry-section form,
.contact-stage form {
  min-width: 0;
}

.form-layout input,
.form-layout select,
.form-layout textarea,
.home-inquiry-section input,
.home-inquiry-section select,
.home-inquiry-section textarea,
.contact-stage input,
.contact-stage select,
.contact-stage textarea {
  max-width: 100%;
}

/* Tables own their horizontal scroll. */
.v14-table-wrap,
.configuration-table-wrap,
.table-wrap,
.ls-table-wrap,
.wpkg-table-wrap,
.spec-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.v14-table-wrap table,
.configuration-table-wrap table,
.table-wrap table,
.ls-table-wrap table,
.wpkg-table-wrap table,
.spec-table-wrap table {
  width: max(100%, 720px);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: var(--hd-z-content);
}

.footer-grid {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(170px, 1fr));
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
}

.footer-grid > *,
.footer-contacts,
.footer-contacts > * {
  min-width: 0;
}

.footer-grid a,
.footer-grid address,
.footer-grid strong {
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}

/* The long-term CTA sits below consent/nav in the scale and yields to content. */
.hd-wa-cta-root,
.hd-wa-cta-desktop,
.hd-wa-cta-mobile {
  z-index: var(--hd-z-float);
}

body.hd-wa-form-visible .hd-wa-cta-root,
body.hd-wa-menu-open .hd-wa-cta-root,
body.hd-wa-footer-visible .hd-wa-cta-root,
body.hd-wa-consent-visible .hd-wa-cta-root {
  pointer-events: none;
}

.hd-consent-banner .button-outline {
  border-color: #fff;
  background: #fff;
  color: #061e33;
}

@media (max-width: 1179px) {
  .desktop-nav,
  .header-cta {
    display: none;
  }

  .mobile-menu {
    display: block;
    margin-left: auto;
  }

  .mobile-menu nav {
    position: fixed;
    top: 76px;
    right: var(--hd-gutter);
    width: min(420px, calc(100vw - (2 * var(--hd-gutter))));
    max-height: calc(100svh - 92px);
  }

  .home-hero .home-hero-grid,
  .hd-split,
  .hero-grid,
  .inner-hero-grid,
  .wpkg-hero-grid,
  .v5-product-hero-grid,
  .v6-article-hero-grid,
  .complete-line-grid,
  .form-layout,
  .contact-layout,
  .contact-stage-grid,
  .home-company-grid,
  .spotlight-grid,
  .process-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero .home-hero-grid {
    max-width: 900px;
  }

  .contact-card {
    position: static;
    inset: auto;
  }

  .hero-visual-proof {
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  }

  .delivery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-why-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  :root {
    --hd-section-space: clamp(48px, 13vw, 72px);
    --hd-layout-gap: 28px;
  }

  html {
    scroll-padding-top: 78px;
  }

  .header-inner {
    min-height: 68px;
  }

  .header-inner .brand {
    min-width: 0;
  }

  .header-inner .brand small {
    display: none;
  }

  .mobile-menu nav {
    top: 68px;
    right: var(--hd-gutter);
    left: var(--hd-gutter);
    width: auto;
    max-height: calc(100svh - 82px);
  }

  .home-hero .home-hero-grid {
    width: min(calc(100% - (2 * var(--hd-gutter))), var(--hd-layout-max));
    padding-block: clamp(48px, 12vw, 72px);
  }

  .home-hero .hero-copy > p {
    font-size: clamp(16px, 4.4vw, 18px);
  }

  .hero-actions,
  .hero-actions .button {
    width: 100%;
  }

  .hero-actions .button {
    justify-content: center;
  }

  .hero-proof-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-visual-proof {
    grid-template-columns: minmax(0, 1fr);
  }

  .engineering-panel {
    grid-template-rows: auto minmax(190px, 1fr) auto;
    padding: 14px;
  }

  .engineering-panel-head {
    display: grid;
    gap: 4px;
  }

  .hero-line-layout-card {
    min-height: 190px;
  }

  .entrance-card,
  .entrance-card.entrance-card--hengde img {
    min-height: 0;
  }

  .entrance-card.entrance-card--hengde img {
    aspect-ratio: 16 / 10;
  }

  .split-heading,
  .home-inquiry-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .proof-gallery {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .proof-gallery figure,
  .proof-gallery figure.large {
    grid-column: auto;
    grid-row: auto;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .delivery-grid,
  .home-product-output-grid,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .delivery-grid article {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 22px 18px;
  }

  .complete-line-visual,
  .complete-line-visual > a {
    min-height: 0;
  }

  .complete-line-visual > a {
    aspect-ratio: 16 / 11;
  }

  .home-inquiry-section .form-grid,
  .contact-stage .form-grid,
  .form-layout .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
  }

  body.hd-wa-cta-mobile-enabled {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 389px) {
  :root {
    --hd-gutter: 14px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
  }

  .header-inner .brand strong {
    font-size: 18px;
  }

  .engineering-panel-foot {
    grid-template-columns: minmax(0, 1fr);
  }

  .engineering-panel-foot span {
    padding-top: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
  }

  [data-hengde-reveal] {
    opacity: 1;
    transform: none;
  }
}
