/* ==========================================================================
   CAVENIQ Homepage V6 — Precision Engineering & System Architecture
   - Clean non-overlapping Header above Asymmetric Command Hero
   - Equipment Architecture, Cross-Reference Band, Industries Matrix,
     Engineering & Supply Model, Adaptive Project Spotlight, and CTA Form.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header / Hero relationship (homepage-only, clean white header)
   -------------------------------------------------------------------------- */
body.caveniq-home-header #main-container > #header {
  margin-block-end: 0;
  background: #fff;
  box-shadow: none;
}

body.caveniq-home-header .cn-utility {
  position: relative;
  z-index: 1;
  background: var(--cn-navy, #0b1f33);
  color: #dce6ef;
}

body.caveniq-home-header .cn-utility .cn-icon {
  color: #bdcfde;
}

body.caveniq-home-header .cn-header,
body.caveniq-home-header .cn-header:not(.cn-is-stuck) {
  --cn-header-logo: var(--cn-navy, #0b1f33);
  --cn-header-ink: var(--cn-ink, #17233c);
  --cn-header-active: var(--cn-blue, #2849bd);
  --cn-header-highlight: var(--cn-blue, #2849bd);
  background: #fff;
  border-bottom-color: var(--cn-line, #dce4ed);
}

body.caveniq-home-header .cn-header:not(.cn-is-stuck) .cn-menu-toggle {
  border-color: var(--cn-line, #dce4ed);
  background: #fff;
  color: var(--cn-header-logo);
}

body.caveniq-home-header .cn-header :is(.cn-brand, .cn-nav-item, .cn-nav-group > summary, .cn-menu-toggle, .cn-quote-main):focus-visible {
  outline-color: var(--cn-blue, #2849bd);
}

/* --------------------------------------------------------------------------
   2. Shared V6 Typography, Tokens & Section Rhythm
   -------------------------------------------------------------------------- */
.cn-home-sections {
  color: var(--cn-ink, #17233c);
  font-size: 16px;
  line-height: 1.7;
}

.cn-home-sections *,
.cn-home-sections *::before,
.cn-home-sections *::after {
  box-sizing: border-box;
}

.cn-home-sections .cn-home-section {
  padding-block: 96px;
}

.cn-home-sections .cn-home-section--surface {
  background: var(--cn-surface, #f7f9fc);
}

.cn-home-sections .cn-home-section-head {
  margin-bottom: 48px;
}

.cn-home-sections .cn-home-section-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.cn-home-sections .cn-home-section-head--split > div {
  max-width: 1040px;
}

.cn-home-sections .cn-home-eyebrow {
  margin: 0 0 12px;
  color: var(--cn-blue, #2849bd);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.cn-home-sections .cn-home-eyebrow--light {
  color: #9db8ff;
}

.cn-home-sections h2,
.cn-home-sections h3 {
  font-family: inherit;
  color: var(--cn-ink, #17233c);
}

.cn-home-sections h2 {
  margin: 0;
  font-size: 40px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.cn-home-sections h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.cn-home-sections .cn-home-head-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-block: 8px;
  color: var(--cn-blue, #2849bd);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transition: color .2s ease;
}

.cn-home-sections .cn-home-head-link:hover {
  color: var(--cn-blue-hover, #1e40af);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* --------------------------------------------------------------------------
   3. Shared Media & Swiss-Blueprint Architectural Placeholder
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--cn-media-ratio, 4 / 3);
  background: #f0f4f8;
}

.cn-home-sections .cn-home-media__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.cn-home-sections .cn-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background-color: #f7f9fc;
  background-image: radial-gradient(#cfd9e5 1px, transparent 1px);
  background-size: 16px 16px;
  color: #536273;
  text-align: center;
}

.cn-home-sections .cn-img-placeholder__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #dce4ed;
  border-radius: 8px;
  background: #fff;
  color: var(--cn-blue, #2849bd);
}

.cn-home-sections .cn-img-placeholder__icon svg {
  width: 20px;
  height: 20px;
}

.cn-home-sections .cn-img-placeholder__kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cn-ink, #17233c);
}

.cn-home-sections .cn-img-placeholder__desc {
  max-width: 26ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cn-muted, #637286);
}

/* --------------------------------------------------------------------------
   4. Section 1: Equipment & Filtration Architecture (2x2 Precision Cards)
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.cn-home-sections .cn-home-cat-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cn-home-sections .cn-home-cat-card .cn-home-media {
  border-bottom: 1px solid var(--cn-line, #dce4ed);
}

.cn-home-sections .cn-home-cat-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 24px 28px 28px;
}

.cn-home-sections .cn-home-cat-meta {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.cn-home-sections .cn-home-cat-code {
  color: var(--cn-blue, #2849bd);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}

.cn-home-sections .cn-home-cat-card h3 {
  transition: color .2s ease;
}

.cn-home-sections .cn-home-cat-description {
  margin-top: 8px;
  color: var(--cn-text, #536273);
  font-size: 15px;
  line-height: 1.6;
}

.cn-home-sections .cn-home-cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.cn-home-sections .cn-home-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 4px;
  background: var(--cn-surface, #f7f9fc);
  color: var(--cn-ink, #17233c);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.cn-home-sections .cn-home-cat-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--cn-line, #dce4ed);
  color: var(--cn-blue, #2849bd);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

@media (hover: hover) {
  .cn-home-sections .cn-home-cat-card:hover {
    border-color: var(--cn-blue, #2849bd);
    box-shadow: 0 12px 28px rgb(11 31 51 / .07);
    transform: translateY(-2px);
  }
  .cn-home-sections .cn-home-cat-card:hover h3 {
    color: var(--cn-blue, #2849bd);
  }
  .cn-home-sections .cn-home-cat-card:hover .cn-home-media__image {
    transform: scale(1.03);
  }
}

/* --------------------------------------------------------------------------
   5. Section 2: Cross-Reference & Replacement Finder Band
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-section--xref {
  position: relative;
  overflow: hidden;
  padding-block: 72px;
  background: var(--cn-navy, #0b1f33);
  color: #fff;
}

.cn-home-sections .cn-home-xref-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .42;
  pointer-events: none;
}

.cn-home-sections .cn-home-xref-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.cn-home-sections .cn-home-xref-copy h2 {
  color: #fff;
}

.cn-home-sections .cn-home-xref-desc {
  margin: 16px 0 0;
  color: #dce6ef;
  font-size: 16px;
  line-height: 1.65;
}

.cn-home-sections .cn-home-xref-note {
  margin: 12px 0 0;
  color: #9bb0c6;
  font-size: 13px;
  line-height: 1.5;
}

.cn-home-sections .cn-home-xref-panel {
  padding: 28px;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 8px;
  background: rgb(7 20 34 / .82);
  backdrop-filter: blur(8px);
}

.cn-home-sections .cn-home-xref-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cn-home-sections .cn-home-xref-links > li + li {
  margin-top: 12px;
}

.cn-home-sections .cn-home-xref-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgb(255 255 255 / .18);
  border-radius: 6px;
  background: rgb(255 255 255 / .04);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: border-color .2s ease, background-color .2s ease;
}

.cn-home-sections .cn-home-xref-links a:hover {
  border-color: #9db8ff;
  background: rgb(255 255 255 / .1);
}

.cn-home-sections .cn-home-xref-action {
  margin-top: 16px;
}

.cn-home-sections .cn-home-xref-action .cn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  background: var(--cn-blue, #2849bd);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background-color .2s ease;
}

.cn-home-sections .cn-home-xref-action .cn-primary:hover {
  background: var(--cn-blue-hover, #1e40af);
}

.cn-home-sections .cn-home-section--xref :focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   6. Section 3: Industries & Applications Matrix
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-industry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cn-home-sections .cn-home-industry-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 8px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cn-home-sections .cn-home-industry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cn-home-sections .cn-home-industry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--cn-tint, #eef7ff);
  color: var(--cn-blue, #2849bd);
}

.cn-home-sections .cn-home-industry-icon svg {
  width: 20px;
  height: 20px;
}

.cn-home-sections .cn-home-industry-arrow {
  color: var(--cn-blue, #2849bd);
  font-size: 16px;
  font-weight: 600;
}

.cn-home-sections .cn-home-industry-name {
  color: var(--cn-ink, #17233c);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.cn-home-sections .cn-home-industry-description {
  margin-top: 8px;
  color: var(--cn-muted, #637286);
  font-size: 14px;
  line-height: 1.55;
}

@media (hover: hover) {
  .cn-home-sections .cn-home-industry--linked .cn-home-industry-card:hover {
    border-color: var(--cn-blue, #2849bd);
    box-shadow: 0 8px 20px rgb(11 31 51 / .06);
    transform: translateY(-2px);
  }
}

/* --------------------------------------------------------------------------
   7. Section 4: Engineering & China Manufacturing Network
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 56px;
}

.cn-home-sections .cn-home-offer-media {
  overflow: hidden;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 8px;
}

.cn-home-sections .cn-home-offer-intro {
  margin: 16px 0 0;
  color: var(--cn-text, #536273);
  font-size: 16px;
  line-height: 1.7;
}

.cn-home-sections .cn-home-offer-steps {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--cn-line, #dce4ed);
}

.cn-home-sections .cn-home-offer-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--cn-line, #dce4ed);
}

.cn-home-sections .cn-home-offer-step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 6px;
  background: var(--cn-surface, #f7f9fc);
  color: var(--cn-blue, #2849bd);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cn-home-sections .cn-home-offer-step-body h3 {
  font-size: 17px;
  line-height: 1.4;
}

.cn-home-sections .cn-home-offer-step-body p {
  margin: 4px 0 0;
  color: var(--cn-text, #536273);
  font-size: 14px;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   8. Section 5: Featured Project Spotlight (Adaptive 1-case or multi-case)
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-case-grid {
  display: grid;
  gap: 24px;
}

.cn-home-sections .cn-home-case-grid--1 {
  grid-template-columns: 1fr;
}

.cn-home-sections .cn-home-case-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cn-home-sections .cn-home-case-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cn-home-sections .cn-home-case-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 8px;
  background: #fff;
}

.cn-home-sections .cn-home-case-card--spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
}

.cn-home-sections .cn-home-case-card--spotlight .cn-home-media {
  height: 100%;
  border-right: 1px solid var(--cn-line, #dce4ed);
}

.cn-home-sections .cn-home-case-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
}

.cn-home-sections .cn-home-case-tag {
  margin: 0 0 10px;
  color: var(--cn-blue, #2849bd);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cn-home-sections .cn-home-case-summary {
  margin: 12px 0 0;
  color: var(--cn-text, #536273);
  font-size: 15px;
  line-height: 1.65;
}

.cn-home-sections .cn-home-case-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--cn-blue, #2849bd);
  font-size: 15px;
  font-weight: 600;
}

.cn-home-sections .cn-home-case-status {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 20px;
  padding: 6px 12px;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 4px;
  background: var(--cn-surface, #f7f9fc);
  color: var(--cn-muted, #637286);
  font-size: 13px;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   9. Section 6: Engineering Consultation CTA + Fluent Forms ID 3
   -------------------------------------------------------------------------- */
.cn-home-sections .cn-home-quote {
  background: var(--cn-navy, #0b1f33);
  color: #fff;
}

.cn-home-sections .cn-home-quote-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: start;
  gap: 56px;
}

.cn-home-sections .cn-home-quote h2 {
  color: #fff;
}

.cn-home-sections .cn-home-quote-description {
  margin: 16px 0 0;
  max-width: 48ch;
  color: #dce6ef;
  font-size: 16px;
  line-height: 1.65;
}

.cn-home-sections .cn-home-quote-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.cn-home-sections .cn-home-quote-list > li {
  position: relative;
  padding-left: 20px;
  color: #dce6ef;
  font-size: 14px;
  line-height: 1.6;
}

.cn-home-sections .cn-home-quote-list > li + li {
  margin-top: 10px;
}

.cn-home-sections .cn-home-quote-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: #9db8ff;
}

.cn-home-sections .cn-home-quote-form-wrap {
  padding: 32px;
  border: 1px solid var(--cn-line, #dce4ed);
  border-radius: 8px;
  background: #fff;
  color: var(--cn-ink, #17233c);
  box-shadow: 0 20px 44px rgb(4 16 29 / .24);
}

.cn-home-sections .cn-home-quote-form .ff-el-group {
  margin-bottom: 16px;
}

.cn-home-sections .cn-home-quote-form .ff-el-input--label label {
  margin-bottom: 6px;
  color: var(--cn-ink, #17233c);
  font-size: 14px;
  font-weight: 600;
}

.cn-home-sections .cn-home-quote-form .ff-el-form-control {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #748293;
  border-radius: 6px;
  color: var(--cn-ink, #17233c);
  font-size: 16px;
}

.cn-home-sections .cn-home-quote-form .ff-el-form-control:focus {
  border-color: var(--cn-blue, #2849bd);
  outline: 3px solid rgb(40 73 189 / .2);
  outline-offset: 0;
}

.cn-home-sections .cn-home-quote-form .ff-btn-submit {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 8px;
  background: var(--cn-blue, #2849bd);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.cn-home-sections .cn-home-quote-form .ff-btn-submit:hover {
  background: var(--cn-blue-hover, #1e40af);
}

.cn-home-sections .cn-home-quote-form-unavailable {
  margin: 0;
  color: var(--cn-text, #536273);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   10. Scroll Reveal (matches reveal.js, safe reduced-motion)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .cn-home-sections [data-cn-reveal].cn-reveal-pending {
    opacity: 0;
    transform: translateY(14px);
  }
  .cn-home-sections [data-cn-reveal] {
    transition: opacity .5s cubic-bezier(.2, .6, .2, 1), transform .5s cubic-bezier(.2, .6, .2, 1);
  }
  .cn-home-sections [data-cn-reveal].cn-reveal-in {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   11. Responsive Breakpoints (SITE-RULES.md §14.4 & §15)
   -------------------------------------------------------------------------- */
@media (width < 1024px) {
  .cn-home-sections .cn-home-section {
    padding-block: 64px;
  }
  .cn-home-sections .cn-home-section--xref {
    padding-block: 56px;
  }
  .cn-home-sections h2 {
    font-size: 34px;
  }
  .cn-home-sections h3 {
    font-size: 22px;
  }
  .cn-home-sections .cn-home-xref-grid,
  .cn-home-sections .cn-home-offer-grid,
  .cn-home-sections .cn-home-quote-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .cn-home-sections .cn-home-industry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cn-home-sections .cn-home-case-card--spotlight {
    grid-template-columns: 1fr;
  }
  .cn-home-sections .cn-home-case-card--spotlight .cn-home-media {
    border-right: 0;
    border-bottom: 1px solid var(--cn-line, #dce4ed);
  }
}

@media (width < 768px) {
  .cn-home-sections .cn-home-section {
    padding-block: 48px;
  }
  .cn-home-sections h2 {
    font-size: 28px;
  }
  .cn-home-sections h3 {
    font-size: 20px;
  }
  .cn-home-sections .cn-home-section-head {
    margin-bottom: 32px;
  }
  .cn-home-sections .cn-home-section-head--split {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .cn-home-sections .cn-home-cat-grid,
  .cn-home-sections .cn-home-industry-grid,
  .cn-home-sections .cn-home-case-grid--2,
  .cn-home-sections .cn-home-case-grid--3 {
    grid-template-columns: 1fr;
  }
  .cn-home-sections .cn-home-cat-body,
  .cn-home-sections .cn-home-case-body,
  .cn-home-sections .cn-home-xref-panel,
  .cn-home-sections .cn-home-quote-form-wrap {
    padding: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cn-home-sections .cn-home-cat-card,
  .cn-home-sections .cn-home-media__image,
  .cn-home-sections .cn-home-industry-card,
  .cn-home-sections [data-cn-reveal] {
    transition: none;
  }
}
