/* ==========================================================
   Avanlabs — Hero 3D Immersive Section
   Depends on: tokens.css
   ========================================================== */

/* ── Section wrapper ── */
#hero-3d-section {
  background: var(--surface-dark-bg);
  min-height: 85vh;
}

/* ── Three.js canvas ── */
#hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* ── Readability scrim ──
   Left side fades to page cream so dark text stays readable.
   Right side opens up so the 3D scene shows through fully.   */
#hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      110% 95% at 10% 50%,
      rgba(255, 253, 247, 0.97)  0%,
      rgba(255, 253, 247, 0.90) 32%,
      rgba(255, 253, 247, 0.55) 55%,
      transparent               78%
    ),
    linear-gradient(
      180deg,
      rgba(10, 10, 18, 0.30)  0%,
      transparent             18%,
      transparent             80%,
      rgba(10, 10, 18, 0.30) 100%
    );
  transition: opacity var(--dur-slow) var(--ease-out);
}

/* ── Director panel ── */
.director {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  width: 280px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(18, 18, 28, 0.82);
  border: 1px solid var(--surface-dark-border);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--shadow-panel);
  color: var(--fg-on-dark);
  font-family: var(--font-body);
  transition: transform var(--dur-slow) var(--ease-out);
}
.director.min {
  transform: translateY(calc(100% - 50px));
}

.dir-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.dir-head .t {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.02em;
}
.dir-head .t .dir-icon {
  font-size: 16px;
  color: #8e93ff;
}
.dir-head .chev {
  font-size: 18px;
  opacity: 0.6;
  transition: transform var(--dur-slow) var(--ease-out);
}
.director.min .dir-head .chev {
  transform: rotate(180deg);
}

.dir-body {
  padding: 4px 16px 18px;
}

.dir-field {
  margin-top: 16px;
}
.dir-field > label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.55;
  display: block;
  margin-bottom: 8px;
}

/* ── Segmented buttons ── */
.dir-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.dir-seg.three {
  grid-template-columns: repeat(3, 1fr);
}
.dir-seg button {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.70);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--dur-base) var(--ease-out);
}
.dir-seg button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.dir-seg button.on {
  background: var(--brand-indigo);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(97, 103, 238, 0.40);
}

/* ── Palette swatches ── */
.sw-row {
  display: flex;
  gap: 8px;
}
.sw {
  flex: 1;
  height: 30px;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    transform  var(--dur-fast) var(--ease-out),
    border-color var(--dur-base) var(--ease-out);
}
.sw:hover { transform: translateY(-2px); }
.sw.on    { border-color: #fff; }
.sw.indigo { background: linear-gradient(120deg, #6167EE, #9AA0FF); }
.sw.mint   { background: linear-gradient(120deg, #3FC2F0, #56E1A4); }
.sw.purple { background: linear-gradient(120deg, #A66CF2, #6167EE); }
.sw.multi  { background: linear-gradient(120deg, #6167EE, #F2B544, #1FCE7C, #A66CF2); }

/* ── Speed / Density sliders ── */
.dir-slider {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dir-slider input[type="range"] {
  flex: 1;
  accent-color: var(--brand-indigo);
}
.dir-slider .val {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.6;
  width: 30px;
  text-align: right;
}
.dir-row2 {
  display: flex;
  gap: 12px;
}
.dir-row2 .dir-field {
  flex: 1;
}

/* ── Toggle ── */
.dir-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.dir-toggle span {
  font-size: 12.5px;
  font-weight: 600;
  opacity: 0.85;
}
.tg {
  width: 42px;
  height: 24px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.16);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out);
  border: none;
}
.tg.on { background: var(--brand-indigo); }
.tg::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur-base) var(--ease-out);
}
.tg.on::after { transform: translateX(18px); }

@media (max-width: 560px) {
  .director { right: 12px; left: 12px; width: auto; }
}

/* ── W·Vortex scene overrides (scoped — no impact on other scenes) ── */
#hero-3d-section.wvortex-active {
  /* glossy white base instead of dark */
  background: linear-gradient(135deg, #ffffff 0%, #f3eeff 55%, #e6f4fd 100%);
}

#hero-3d-section.wvortex-active #hero-scrim {
  /* remove black gradient; keep only a soft white vignette on the text side */
  background:
    radial-gradient(
      110% 95% at 10% 50%,
      rgba(255, 255, 255, 0.96)  0%,
      rgba(255, 255, 255, 0.84) 35%,
      rgba(255, 255, 255, 0.30) 60%,
      transparent               82%
    );
}
