:root{
  --bg0:#020617;
  --bg1:#0b1220;
  --glass: rgba(2, 6, 23, 0.55);
  --glass2: rgba(2, 6, 23, 0.35);
  --stroke: rgba(148, 163, 184, 0.25);
  --text: rgba(226, 232, 240, 0.92);
  --muted: rgba(226, 232, 240, 0.68);
  --shadow: 0 20px 70px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(1200px 800px at 20% 0%, #142035, var(--bg0));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Canvas */
#scene{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* HUD */
#hud{
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}

.brand{
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
.brand .name{ font-weight: 700; letter-spacing: 0.2px; }
.brand .role{ font-size: 13px; color: var(--muted); margin-top: 2px; }

.hint{
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--glass2);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(12px);
  color: var(--muted);
  font-size: 13px;
}

/* Nav */
#nav{
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  pointer-events: auto;
}

.navBtn{
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.45);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  user-select: none;
  font-size: 14px;
}
.navBtn:hover{ transform: translateY(-1px); background: rgba(15,23,42,0.65); }
.navBtn[aria-current="true"]{ border-color: rgba(56, 189, 248, 0.55); background: rgba(2, 132, 199, 0.18); }

/* Panel */
#panel{
  position: fixed;
  top: 72px;
  right: 16px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  overflow: auto;
  z-index: 20;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.72);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transform: translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

#panel.open{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#panelInner{
  padding: 18px 18px 16px 18px;
}

.iconBtn{
  position: sticky;
  top: 10px;
  float: right;
  margin: 10px 10px 0 0;
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.sectionTitle{
  margin: 0 0 10px 0;
  font-size: 20px;
  letter-spacing: 0.2px;
}

.p{
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.55;
}

.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip{
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.35);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
}

.card{
  border: 1px solid var(--stroke);
  background: rgba(15, 23, 42, 0.25);
  border-radius: 14px;
  padding: 12px 12px;
  margin-top: 10px;
}
.card h3{
  margin: 0;
  font-size: 15px;
}
.card .meta{
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.card ul{
  margin: 10px 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}
.card li{ margin: 6px 0; }

.actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
a.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid var(--stroke);
  background: rgba(2, 132, 199, 0.16);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  transition: transform 160ms ease, background 160ms ease;
}
a.btn:hover{ transform: translateY(-1px); background: rgba(2, 132, 199, 0.24); }

/* Scroll runway = camera travel distance */
#scrollRunway{
  height: 520vh; /* adjust to make the journey longer/shorter */
}

/* Fallback */
#fallback{
  position: relative;
  z-index: 5;
  padding: 28px 18px 80px 18px;
  max-width: 920px;
  margin: 0 auto;
}
#fallback h1{ margin: 0 0 6px 0; }
#fallback .plainCard{
  margin-top: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.25);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  .navBtn, #panel { transition: none !important; }
}
