/* Built Environment — page-specific styles */

.be-page {
  --be-cyan: #00cfff;
  --be-cyan-deep: #00aed9;
  --be-cyan-soft: rgba(0, 207, 255, 0.45);
  --be-text: #ffffff;
  --be-muted: rgba(255, 255, 255, 0.92);
  --be-card-bg: rgba(4, 12, 24, 0.72);
  
  color: var(--be-text);
  font-family: Montserrat, sans-serif;
}

.be-page .be-accent {
  color: var(--be-cyan);
}

.be-inner {
  width: min(88vw, 90%);
  margin: 0 auto;
}

.be-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 13.5rem;
  height: 3rem;
  padding: 0 1.75rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #00b4e6 0%, #00d8ff 100%);
  box-shadow: 0 0 22px rgba(0, 200, 255, 0.45);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.be-btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 200, 255, 0.55);
}

.be-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

/* ========== 1. Hero ========== */
.be-hero {
  position: relative;
  min-height: min(92vh, 920px);
  display: flex;
  align-items: center;
  padding: 9.5rem 0 6rem;
  background: #000 url("../../assets/img/sector/built-environment.jpg") no-repeat;
  background-size: 100% 100%;
}

.be-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.78) 0%,
    rgba(0, 0, 0, 0.55) 42%,
    rgba(0, 0, 0, 0.28) 100%
  );
  pointer-events: none;
}

.be-hero .be-inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin-left: max(6vw, calc((100% - min(88vw, 90%)) / 2));
  margin-right: auto;
}

.be-hero-title {
  margin: 0 0 1.4rem;
  color: #fff;
  font-size: clamp(1.85rem, 3.5vw, 3.35rem);
  font-weight: 700;
  line-height: 1.18;
}

.be-hero-desc {
  max-width: 38rem;
  margin: 0 0 2rem;
  color: var(--be-muted);
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  line-height: 1.75;
}

/* ========== 2. Key Challenges ========== */
.be-challenges {
  padding: 5.5rem 0;
  background: url("../../assets/img/sector/bg-be-1.jpg") no-repeat;
  background-size: 100% 100%;
}

.bg-be-2{
  background: url("../../assets/img/sector/bg-be-2.jpg") no-repeat;
  background-size: 100% 100%;
  margin-top: -1px;
  overflow-x: clip;
}

.be-challenges-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr);
  gap: 1.25rem;
  align-items: stretch;
}

.be-challenge-main,
.be-challenge-card {
  border: 1px solid var(--be-cyan-deep);
  border-radius: 14px;
  background: rgba(2, 14, 28, 0.65);
  box-shadow: 0 0 14px rgba(0, 174, 217, 0.18);
}

.be-challenge-main {
  padding: 1.75rem 1.6rem;
}

.be-challenge-label {
  margin: 0 0 0.85rem;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.be-challenge-main h2 {
  margin: 0 0 1.15rem;
  color: #fff;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
}

.be-challenge-main p {
  margin: 0 0 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.7;
}

.be-challenge-main p:last-child {
  margin-bottom: 0;
}

.be-challenge-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.be-challenge-card {
  display: flex;
  gap: 0.95rem;
  align-items: flex-start;
  padding: 1.35rem 1.2rem;
}

.be-challenge-icon {
  flex: 0 0 2.6rem;
  width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 174, 217, 0.18);
  color: var(--be-cyan);
  box-shadow: 0 0 12px rgba(0, 207, 255, 0.25);
}

.be-challenge-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.be-challenge-card h3 {
  margin: 0 0 0.45rem;
  color: var(--be-cyan-deep);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.be-challenge-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ========== 3. How Solution Helps ========== */
.be-helps {
  position: relative;
  padding: clamp(3.5rem, 6vw, 5.5rem) 0 5rem;
  overflow: visible;
}

.be-helps .be-inner {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.be-helps-head {
  width: min(70%, 52rem);
  margin: 0 auto;
  text-align: center;
  flex-shrink: 0;
  padding-bottom: 10vh;
}

.be-helps-head h2 {
  margin: 0 0 1.15rem;
  color: #fff;
  font-size: clamp(1.7rem, 2.8vw, 2.75rem);
  font-weight: 700;
}

.be-helps-head p {
  margin: 0;
  color: var(--be-muted);
  font-size: clamp(0.95rem, 1.2vw, 1.08rem);
  line-height: 1.75;
}

.be-helps-carousel {
  --be-card-w: min(905px, 42vw);
  --be-card-ratio: 905 / 700;
  --be-card-h: calc(var(--be-card-w) / var(--be-card-ratio));
  --be-offset: min(300px, 31vw);
  --be-offset-far: min(460px, 44vw);
  --be-side-scale: 0.76;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  flex-shrink: 0;
  padding: 10vh 0;
}

.be-helps-viewport {
  position: relative;
  width: 100%;
  min-height: var(--be-card-h);
}

.be-helps-track {
  position: relative;
  width: 100%;
  min-height: var(--be-card-h);
}

.be-helps-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--be-card-w);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 20px;
  overflow: hidden;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  z-index: 1;
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.4s ease,
    filter 0.4s ease;
}

.be-helps-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 905 / 700;
  object-fit: cover;
  border-radius: 20px;
  pointer-events: none;
}

/* default — middle active (data-active="1") */
.be-helps-track[data-active="1"] .be-helps-card[data-index="0"] {
  transform: translate(calc(-50% - var(--be-offset)), -50%) scale(var(--be-side-scale));
  z-index: 2;
  opacity: 0.92;
  filter: brightness(0.58);
}

.be-helps-track[data-active="1"] .be-helps-card[data-index="1"] {
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  opacity: 1;
  filter: none;
}

.be-helps-track[data-active="1"] .be-helps-card[data-index="2"] {
  transform: translate(calc(-50% + var(--be-offset)), -50%) scale(var(--be-side-scale));
  z-index: 2;
  opacity: 0.92;
  filter: brightness(0.58);
}

/* left active */
.be-helps-track[data-active="0"] .be-helps-card[data-index="0"] {
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  opacity: 1;
  filter: none;
}

.be-helps-track[data-active="0"] .be-helps-card[data-index="1"] {
  transform: translate(calc(-50% + var(--be-offset)), -50%) scale(var(--be-side-scale));
  z-index: 3;
  opacity: 0.92;
  filter: brightness(0.58);
}

.be-helps-track[data-active="0"] .be-helps-card[data-index="2"] {
  transform: translate(calc(-50% + var(--be-offset-far)), -50%) scale(0.66);
  z-index: 1;
  opacity: 0.55;
  filter: brightness(0.45);
}

/* right active */
.be-helps-track[data-active="2"] .be-helps-card[data-index="2"] {
  transform: translate(-50%, -50%) scale(1);
  z-index: 5;
  opacity: 1;
  filter: none;
}

.be-helps-track[data-active="2"] .be-helps-card[data-index="1"] {
  transform: translate(calc(-50% - var(--be-offset)), -50%) scale(var(--be-side-scale));
  z-index: 3;
  opacity: 0.92;
  filter: brightness(0.58);
}

.be-helps-track[data-active="2"] .be-helps-card[data-index="0"] {
  transform: translate(calc(-50% - var(--be-offset-far)), -50%) scale(0.66);
  z-index: 1;
  opacity: 0.55;
  filter: brightness(0.45);
}

.be-helps-card:focus-visible {
  outline: 2px solid var(--be-cyan);
  outline-offset: 4px;
}

.be-helps-glow {
  width: var(--be-card-w);
  margin-top:10rem;
  line-height: 0;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.be-helps-glow img {
  display: block;
  width: 100%;
  height: auto;
}

.be-helps-dots {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.25rem;
}

.be-helps-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.be-helps-dots button.is-active {
  background: var(--be-cyan);
  transform: scale(1.35);
}

/* ========== 4. Areas of Application ========== */
.be-areas {
  padding: 5.5rem 0;
  background: url("../../assets/img/sector/bg-be-3.jpg") no-repeat;
  background-size: 100% 100%;
}

.be-areas-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.be-areas-copy,
.be-areas-cards {
  width: 100%;
  min-width: 0;
}

.be-areas-copy h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
  color: #fff;
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
}

.be-areas-bar {
  display: inline-block;
  width: 3.25rem;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--be-cyan), transparent);
  box-shadow: 0 0 12px rgba(0, 207, 255, 0.55);
  flex-shrink: 0;
}

.be-areas-copy p {
  margin: 0 0 1.75rem;
  color: var(--be-muted);
  font-size: clamp(0.95rem, 1.15vw, 1.05rem);
  line-height: 1.75;
}

.be-areas-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.9rem;
  align-items: center;
}

.be-areas-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.be-areas-col--offset {
  transform: translateY(0);
  padding-top: 2.4rem;
  padding-bottom: 2.4rem;
}

.be-area-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 7.5rem;
  padding: 1.1rem 0.75rem;
  border: 1px solid rgba(0, 207, 255, 0.75);
  border-radius: 14px;
  background: rgba(4, 12, 24, 0.8);
  box-shadow: 0 0 14px rgba(0, 207, 255, 0.22);
  text-align: center;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.be-area-icon {
  color: var(--be-cyan);
  display: inline-flex;
}

.be-area-icon svg {
  width: 2.35rem;
  height: 2.35rem;
}

/* ========== 5. Lifecycle diagram ========== */
.be-lifecycle {
  padding: 6rem 0 5.5rem;
}

.be-lifecycle-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.be-lifecycle-inner img {
  display: block;
  width: min(100%, 90%);
  height: auto;
  margin: 0 auto;
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
  .be-challenges-grid {
    grid-template-columns: 1fr;
  }

  .be-areas-grid {
    grid-template-columns: 1fr;
  }

  .be-areas-col--offset {
    padding-top: 0;
    padding-bottom: 0;
  }

  .be-areas-cards {
    grid-template-columns: 1fr;
  }

  .be-areas-col:last-child {
    grid-column: auto;
    display: flex;
    flex-direction: column;
  }

  .be-helps-carousel {
    --be-card-w: min(905px, 58vw);
    --be-offset: min(240px, 26vw);
    --be-offset-far: min(560px, 38vw);
  }

  .be-helps-head {
    width: min(88%, 100%);
  }
}

@media (max-width: 900px) {
  .be-helps {
    padding: 3.5rem 0 5rem;
  }

  .be-helps .be-inner {
    gap: 5rem;
  }

  .be-helps-head {
    width: 100%;
  }

  .be-helps-carousel {
    --be-card-w: min(905px, 88vw);
    --be-offset: 0px;
    --be-offset-far: 0px;
    --be-side-scale: 1;
  }

  .be-helps-viewport,
  .be-helps-track {
    min-height: var(--be-card-h);
  }

  .be-helps-card,
  .be-helps-track[data-active="0"] .be-helps-card[data-index="0"],
  .be-helps-track[data-active="0"] .be-helps-card[data-index="1"],
  .be-helps-track[data-active="0"] .be-helps-card[data-index="2"],
  .be-helps-track[data-active="1"] .be-helps-card[data-index="0"],
  .be-helps-track[data-active="1"] .be-helps-card[data-index="1"],
  .be-helps-track[data-active="1"] .be-helps-card[data-index="2"],
  .be-helps-track[data-active="2"] .be-helps-card[data-index="0"],
  .be-helps-track[data-active="2"] .be-helps-card[data-index="1"],
  .be-helps-track[data-active="2"] .be-helps-card[data-index="2"] {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    filter: none;
    pointer-events: none;
    z-index: 1;
  }

  .be-helps-track[data-active="0"] .be-helps-card[data-index="0"],
  .be-helps-track[data-active="1"] .be-helps-card[data-index="1"],
  .be-helps-track[data-active="2"] .be-helps-card[data-index="2"] {
    opacity: 1;
    pointer-events: auto;
    z-index: 5;
  }

  .be-helps-glow {
    margin-top: 0.5rem;
  }

  .be-helps-dots {
    display: flex;
  }
}

@media (max-width: 720px) {
  .be-hero {
    min-height: auto;
    padding: 8rem 0 4rem;
    background-size: cover;
    background-position: center;
  }

  .be-hero .be-inner {
    margin-left: auto;
    max-width: none;
  }

  .be-challenges {
    padding: 4rem 0;
    background-size: cover;
    background-position: center;
  }

  .bg-be-2 {
    background-size: cover;
    background-position: center top;
  }

  .be-lifecycle {
    padding: 4rem 0;
  }

  .be-challenge-cards {
    grid-template-columns: 1fr;
  }

  .be-helps-carousel {
    --be-card-w: min(905px, 94vw);
  }

  .be-areas {
    padding: 4rem clamp(1rem, 5vw, 1.5rem);
    background-size: cover;
    background-position: center;
  }

  .be-areas .be-inner {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .be-areas-copy h2 {
    flex-wrap: wrap;
  }

  .be-areas-cards {
    grid-template-columns: 1fr;
  }

  .be-areas-col:last-child {
    grid-column: auto;
    display: flex;
    flex-direction: column;
  }

  .be-btn {
    min-width: 0;
    width: 100%;
  }

  .be-btn-row {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .be-areas {
    padding-inline: 1rem;
  }
}
