:root {
  --bg: #030608;
  --glass: rgba(8, 14, 22, 0.55);
  --border: rgba(120, 180, 220, 0.18);
  --text: #cdd9e5;
  --dim: #5a7280;
  --accent: #4caddf;
  --leaf: #6ee7b7;
  --trunk: #fbbf24;
  --root: #e8c46a;
  --glow: rgba(76, 173, 223, 0.35);
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 300vh;
  overflow-x: hidden;
}

/* Three viewport scroll journey */
.scroll-journey {
  position: relative;
  z-index: 0;
}

.zone {
  height: 100vh;
  scroll-snap-align: start;
  pointer-events: none;
}

.zone-canopy {
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(40, 90, 70, 0.12), transparent 70%);
}

.zone-trunk {
  background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(50, 100, 140, 0.08), transparent 70%);
}

.zone-roots {
  background: radial-gradient(ellipse 70% 45% at 50% 100%, rgba(120, 90, 30, 0.1), transparent 70%);
}

/* Fixed 3D stage — tree always centered */
.tree-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  cursor: grab;
  touch-action: none;
  outline: none;
}

.tree-stage:active {
  cursor: grabbing;
}

/* Glass search header */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(3, 6, 8, 0.92) 0%, rgba(3, 6, 8, 0.4) 80%, transparent 100%);
  pointer-events: none;
}

.glass-header > * {
  pointer-events: auto;
}

.brand {
  position: absolute;
  left: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-mark {
  color: var(--accent);
  font-size: 1rem;
  text-shadow: 0 0 12px var(--glow);
}

.brand-name {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(205, 217, 229, 0.85);
}

.search-form {
  width: min(36rem, 72vw);
}

.search-input {
  width: 100%;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(76, 173, 223, 0.12);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: var(--dim);
}

.search-input:focus {
  outline: none;
  border-color: rgba(76, 173, 223, 0.55);
  box-shadow:
    0 0 0 1px rgba(76, 173, 223, 0.2) inset,
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 36px rgba(76, 173, 223, 0.22);
}

/* Zone + pattern rail */
.zone-rail {
  position: fixed;
  top: 4.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
}

.zone-tag {
  color: var(--accent);
}

.zone-divider {
  opacity: 0.4;
}

.pattern-kicker {
  color: rgba(205, 217, 229, 0.7);
}

/* Pattern dial — right rail */
.pattern-rail {
  position: fixed;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dial-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 18, 0.65);
  color: var(--dim);
  font: inherit;
  font-size: 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.dial-btn:hover {
  border-color: rgba(76, 173, 223, 0.45);
  color: var(--text);
}

.dial-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(20, 48, 68, 0.75);
  box-shadow: 0 0 16px rgba(76, 173, 223, 0.2);
}

/* Detail panel */
.detail-panel {
  position: fixed;
  left: 1.25rem;
  bottom: 5rem;
  z-index: 15;
  width: min(22rem, 42vw);
  padding: 1rem 1.1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 18, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.85rem;
  line-height: 1.55;
  pointer-events: auto;
}

.detail-placeholder {
  color: var(--dim);
}

.detail-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.35rem 0 0.5rem;
  color: var(--text);
}

.detail-card .label {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 0.65rem;
  margin-bottom: 0.15rem;
}

.detail-card .layer {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.layer-leaf { color: var(--leaf); border-color: rgba(110, 231, 183, 0.35); }
.layer-trunk { color: var(--trunk); border-color: rgba(251, 191, 36, 0.35); }
.layer-root { color: var(--root); border-color: rgba(232, 196, 106, 0.35); }

/* Pattern caption — bottom center */
.pattern-caption {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  text-align: center;
  max-width: 36rem;
  padding: 0 1rem;
  pointer-events: none;
}

.pattern-caption h1 {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(205, 217, 229, 0.92);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}

.pattern-caption p {
  font-size: 0.82rem;
  color: var(--dim);
  margin-top: 0.25rem;
}

.industries {
  font-size: 0.72rem !important;
  opacity: 0.75;
}

/* GL labels projected from 3D */
.gl-labels {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.gl-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--root);
  text-shadow: 0 0 12px rgba(232, 196, 106, 0.6);
  white-space: nowrap;
}

.flight-hud {
  position: fixed;
  top: 4.25rem;
  right: 4.5rem;
  z-index: 16;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(140, 180, 220, 0.7);
  pointer-events: none;
}

.scroll-hint {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(90, 114, 128, 0.65);
  pointer-events: none;
}

.footer {
  position: relative;
  z-index: 2;
  margin-top: calc(300vh - 100vh);
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.68rem;
  color: var(--dim);
  line-height: 1.6;
  pointer-events: none;
}

/* Interior3d flight UI (vendored) */
.i3d-flight-ui {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.i3d-flight-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(120, 180, 220, 0.45);
  background: rgba(8, 16, 28, 0.82);
  color: #9ec8e8;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.i3d-flight-fab::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  margin: 0 auto;
  border: 2px solid currentColor;
  border-radius: 2px 10px 2px 2px;
  transform: rotate(-35deg) translateY(1px);
}

.i3d-flight-fab.active {
  background: rgba(24, 56, 88, 0.92);
  border-color: rgba(140, 210, 255, 0.7);
  color: #d8f0ff;
}

.i3d-flight-bar {
  position: fixed;
  right: max(76px, calc(env(safe-area-inset-right) + 60px));
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: min(42vh, 220px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.i3d-flight-ui.armed .i3d-flight-bar {
  opacity: 1;
  pointer-events: auto;
}

.i3d-flight-bar-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: rgba(6, 12, 22, 0.72);
  border: 1px solid rgba(100, 150, 190, 0.35);
  overflow: hidden;
  touch-action: none;
}

.i3d-flight-bar-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, rgba(60, 140, 200, 0.25), rgba(90, 200, 255, 0.55));
  pointer-events: none;
}

.i3d-flight-bar-thumb {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  margin-bottom: -9px;
  border-radius: 50%;
  background: #b8e4ff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

@media (max-width: 720px) {
  .brand {
    display: none;
  }

  .detail-panel {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: 4.5rem;
  }

  .pattern-rail {
    flex-direction: row;
    right: auto;
    left: 50%;
    top: auto;
    bottom: 3.25rem;
    transform: translateX(-50%);
  }

  .flight-hud {
    right: 1rem;
    top: 3.75rem;
  }
}
