/* ============================================================
   three-d-section.css  —  BIM Ecosystem 3D Scrollytelling
   
   Pattern (mirrors two/index.html exactly):
     • #bim3d-canvas-anchor  : position:sticky + height:0
       → its child canvas is position:absolute, 100vh tall
       → canvas appears FIXED while #bim-3d-section is in view
     • .bim3d-slide          : normal flow, min-height:120vh
       → slides actually scroll down over the fixed-like canvas
     • #bim3d-progress       : position:fixed, shown via JS class
   ============================================================ */

/* ── Scoped variables ── */
#bim-3d-section {
  --bim3d-primary: #ff4d54;
  /* --bim3d-dark:         #1a1a1a;
  --bim3d-light:        #fcfcfc;
  --bim3d-grid:         #eef1f5; */
  --bim3d-glass: rgba(255, 255, 255, 0.377);
  --bim3d-glass-border: rgba(0, 0, 0, 0.05);
}

/* ── Outer section: clips overflow WITHOUT breaking sticky children ── */
#bim-3d-section {
  position: relative;
  overflow: clip;
  /* clips canvas overflow; does NOT break sticky */
}

/* ─────────────────────────────────────────────────────────────
   CANVAS ANCHOR — zero-height sticky element.
   The canvas inside appears "fixed" while the section is in view.
───────────────────────────────────────────────────────────── */
#bim3d-canvas-anchor {
  position: sticky;
  top: 0;
  height: 0;
  /* takes no space in the flow */
  overflow: visible;
  z-index: 1;
  pointer-events: none;
}

/* Canvas fills the viewport from the anchor point */
#bim3d-canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  /* Grid background — same as two/index.html body */
  background-color: var(--bim3d-light);
  background-image:
    linear-gradient(var(--bim3d-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bim3d-grid) 1px, transparent 1px);
  background-size: 60px 60px;
}

#bim3d-canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Ambient glow blobs (inside canvas container) */
.bim3d-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
  z-index: 0;
}

.bim3d-glow-1 {
  top: -20%;
  left: -10%;
  background: radial-gradient(circle, rgba(0, 87, 255, 0.05) 0%, transparent 70%);
}

.bim3d-glow-2 {
  bottom: -20%;
  right: -10%;
  background: radial-gradient(circle, rgba(45, 52, 54, 0.03) 0%, transparent 70%);
}

/* Model loading bar */
#bim3d-model-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#bim3d-model-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.bim3d-spinner {
  width: 100px;
  height: 2px;
  background: rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  margin: 0 auto 15px;
}

.bim3d-spinner::after {
  content: '';
  position: absolute;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--bim3d-primary);
  animation: bim3d-load 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes bim3d-load {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

#bim3d-model-loader p {
  font-family: 'Outfit', sans-serif;
  letter-spacing: 10px;
  font-size: 0.7rem;
  color: #999;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   SLIDES — stack vertically in normal flow, OVER the canvas
   z-index:2 puts them above the canvas (z-index:1)
───────────────────────────────────────────────────────────── */
#bim3d-slides {
  position: relative;
  z-index: 2;
}

.bim3d-slide {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 0 10%;
  z-index: 2;
}

/* Even slides align right (same as two/index.html) */
.bim3d-slide:nth-child(even) {
  justify-content: flex-end;
}

/* ── Glass content card ── */
.bim3d-content {
  max-width: 550px;
  padding: 50px;
  background: var(--bim3d-glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--bim3d-glass-border);
  border-radius: 20px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bim3d-content.visible {
  opacity: 1;
  transform: translateX(0);
}

.bim3d-slide:nth-child(even) .bim3d-content {
  transform: translateX(30px);
}

.bim3d-slide:nth-child(even) .bim3d-content.visible {
  transform: translateX(0);
}

/* Hero slide: card is immediately visible */
#bim3d-slide-hero .bim3d-content {
  opacity: 1;
  transform: translateX(0);
}

/* ── Headings ── */
.bim3d-hero-title {
  font-family: 'Syne', 'Bebas Neue', sans-serif;
  font-size: 7rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -3px;
  color: var(--bim3d-dark);
  margin: 0 0 25px;
}

.bim3d-hero-title span {
  color: transparent;
  -webkit-text-stroke: 1px var(--bim3d-dark);
  display: block;
}

.bim3d-hero-title .bim3d-filled {
  color: var(--bim3d-dark);
  -webkit-text-stroke: 0;
}

.bim3d-service-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--bim3d-dark);
  text-transform: uppercase;
  line-height: 0.9;
  position: relative;
  margin-bottom: 25px;
}

.bim3d-service-title .bim3d-label {
  font-family: 'Outfit', sans-serif;
  color: var(--bim3d-primary);
  display: block;
  font-size: 1rem;
  letter-spacing: 10px;
  margin-bottom: 15px;
  font-weight: 700;
  text-transform: uppercase;
}

.bim3d-service-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 0;
  width: 80px;
  height: 3px;
  background: var(--bim3d-primary);
}

.bim3d-slide:nth-child(even) .bim3d-service-title::after {
  left: 0;

}

/* ── Body text ── */
.bim3d-content p {
  font-family: var(--font-body);
  font-size: 1.15rem;
  line-height: 1.5;
  color: #666666;
  margin-bottom: 35px;
  font-weight: 400;
}

/* ── Feature list ── */
.bim3d-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bim3d-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
}

.bim3d-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CTA button ── */
.bim3d-btn {
  display: inline-block;
  padding: 18px 45px;
  background: var(--bim3d-dark);
  color: white;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  border-radius: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bim3d-btn:hover {
  background: var(--bim3d-primary);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 87, 255, 0.2);
}

/* ── Scroll indicator inside hero ── */
.bim3d-scroll-down {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: #888;
  font-family: 'Outfit', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  z-index: 3;
  pointer-events: none;
}

.bim3d-mouse {
  width: 2px;
  height: 60px;
  background: rgba(0, 0, 0, 0.1);
  position: relative;
}

.bim3d-wheel {
  width: 2px;
  height: 20px;
  background: var(--bim3d-primary);
  position: absolute;
  top: 0;
  left: 0;
  animation: bim3d-scroll-line 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes bim3d-scroll-line {
  0% {
    top: 0;
    height: 0;
    opacity: 1;
  }

  50% {
    top: 0;
    height: 20px;
    opacity: 1;
  }

  100% {
    top: 60px;
    height: 0;
    opacity: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   PROGRESS DOTS  —  position:fixed, JS shows/hides via class
───────────────────────────────────────────────────────────── */
#bim3d-progress {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#bim3d-progress.visible {
  opacity: 1;
  pointer-events: auto;
}

.bim3d-dot {
  width: 6px;
  height: 6px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  transition: all 0.4s ease;
  cursor: pointer;
}

.bim3d-dot.active {
  background: var(--bim3d-primary);
  transform: scale(2.5);
}

/* ─────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root {
    --bim3d-glass: rgba(223, 223, 223, 0.767);
  }

  .bim3d-hero-title {
    font-size: 5rem;
  }

  .bim3d-slide {
    padding: 0 5%;
  }

  .bim3d-content {
    max-width: 460px;
    padding: 40px;
  }

}

@media (max-width: 991px) {
  .bim3d-content p {
    font-size: 16px;
    line-height: 1.3;
    color: #2b2b2b;
    margin-bottom: 16px;
  }

  .bim3d-feature-list {
    gap: 4px;
    
  }
}

@media (max-width: 768px) {
  .bim3d-hero-title {
    font-size: 3.5rem;
  }

  .bim3d-slide {
    justify-content: center !important;
  }

  .bim3d-content {
    max-width: 90%;
    text-align: center;
    transform: translateY(30px) !important;
  }

  .bim3d-content.visible {
    transform: translateY(0) !important;
  }

  .bim3d-service-title::after,
  .bim3d-slide:nth-child(even) .bim3d-service-title::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .bim3d-feature-item {
    justify-content: center;
  }

  #bim3d-progress {
    display: none;
  }
}

@media (max-width: 480px) {
  .bim3d-hero-title {
    font-size: 2.8rem;
    letter-spacing: -1px;
  }

  .bim3d-content {
    max-width: 100%;
    padding: 28px 20px;
  }

  .bim3d-service-title {
    font-size: 2rem;
  }
}