:root {
  --bg: #0b0b0b;
  --ink: #e6e6e6;
  --ink-dim: #9a9a9a;
  --line: rgba(255, 255, 255, 0.22);
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  text-transform: uppercase;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  cursor: grab;
}
#scene.dragging { cursor: grabbing; }

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 2;
}

/* ---------- chrome ---------- */
.chrome {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 18px 24px;
  z-index: 10;
  pointer-events: none;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.chrome > * { pointer-events: auto; }
.chrome-top { top: 0; }
.chrome-bottom { bottom: 0; align-items: flex-end; }

.logo { display: flex; align-items: flex-start; gap: 2px; color: #fff; }
.logo-r { font-size: 9px; }

.sound-toggle {
  background: none;
  border: 0;
  color: var(--ink-dim);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  margin-top: 4px;
  white-space: nowrap;
}
.sound-bars { font-size: 7px; letter-spacing: 1px; vertical-align: 1px; }

.blurb {
  max-width: 240px;
  color: var(--ink);
  line-height: 1.5;
  margin-left: auto;
  margin-top: 2px;
}

.clocks { display: flex; gap: 22px; color: var(--ink-dim); line-height: 1.6; white-space: nowrap; margin-top: 2px; }

.pill {
  font: inherit;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink);
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.25s, color 0.25s;
  font-size: 13px;
}
.pill:hover { background: rgba(255, 255, 255, 0.12); }
.pill-solid { background: #fff; color: #111; border-color: #fff; font-weight: 600; }
.pill-solid:hover { background: #e2e2e2; }
.pill.active { background: #fff; color: #111; }

.nav-pills {
  margin: 0 auto;
  display: flex;
  gap: 4px;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(6px);
}
.nav-pills .pill { border: 0; background: none; padding: 8px 18px; }
.nav-pills .pill.active { background: #fff; color: #111; }

.view-toggle {
  display: flex;
  gap: 6px;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--ink-dim);
}
.view-toggle .vt.active { color: #fff; }

/* ---------- search ---------- */
.search-wrap {
  position: relative;
  width: min(420px, 38vw);
  margin-top: -2px;
}
.search-wrap::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: conic-gradient(#ff5e62, #ffb347, #7bffb2, #6fc3ff, #b06fff, #ff5e62);
  filter: blur(7px);
  opacity: 0;
  transition: opacity 0.45s;
  animation: prism-hue 7s linear infinite;
  pointer-events: none;
  z-index: -1;
}
.search-wrap:focus-within::before { opacity: 0.55; }
@keyframes prism-hue {
  to { filter: blur(7px) hue-rotate(360deg); }
}
#searchInput {
  width: 100%;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(16, 16, 16, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 20px;
  outline: none;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, background 0.25s;
}
#searchInput::placeholder { color: var(--ink-dim); }
#searchInput:focus { border-color: rgba(255, 255, 255, 0.65); background: rgba(10, 10, 10, 0.9); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  list-style: none;
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.search-results li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 11px 18px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  cursor: pointer;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.search-results li:first-child { border-top: 0; }
.search-results li .num { color: var(--ink-dim); }
.search-results li .meta { margin-left: auto; color: var(--ink-dim); font-size: 10px; }
.search-results li.sel, .search-results li:hover { background: rgba(255, 255, 255, 0.14); }
.search-results li.none { color: var(--ink-dim); cursor: default; }

/* ---------- detail overlay ---------- */
#detail {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #0d0d0d;
  transform: translateY(100%);
  visibility: hidden;
}
.detail-scroll { height: 100%; overflow-y: auto; padding: 90px 0 120px; }

#backBtn {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 21;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
}
#backBtn:hover { background: rgba(255, 255, 255, 0.12); }

.detail-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 28px;
}
.detail-hero {
  height: min(46vh, 420px);
  border-radius: 6px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
}
.detail-meta {
  display: flex;
  justify-content: space-between;
  color: var(--ink-dim);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin: 26px 0 10px;
}
#detail h1 { font-size: clamp(28px, 5vw, 54px); letter-spacing: 0.02em; line-height: 1.05; margin-bottom: 18px; }
.detail-tags { display: flex; gap: 8px; margin-bottom: 34px; }
.detail-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink);
}
#detail p {
  text-transform: none;
  color: #b9b9b9;
  line-height: 1.75;
  font-size: 14px;
  max-width: 60ch;
  margin-bottom: 18px;
}

.detail-link {
  display: inline-block;
  text-decoration: none;
  margin-top: 6px;
}

/* ---------- zoom-into-card site visit ---------- */
#visit {
  position: fixed;
  inset: 0;
  z-index: 25;
  visibility: hidden;
}
#visitShade {
  position: absolute;
  inset: 0;
  opacity: 0;
}
#visitFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  background: transparent;
}
#visitBack {
  position: absolute;
  top: 18px;
  left: 24px;
  opacity: 0;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(14, 14, 14, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 22px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
#visitBack:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 0 18px rgba(155, 120, 255, 0.35), 0 0 30px rgba(110, 195, 255, 0.2);
}

/* ---------- center console dialog ---------- */
#console {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  visibility: hidden;
}
.console-box {
  width: min(560px, 92vw);
  background: #0c0f0c;
  border: 1px solid #39ff6a;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(57, 255, 106, 0.18);
  overflow: hidden;
}
.console-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(57, 255, 106, 0.35);
  color: #39ff6a;
  font-size: 13px;
  letter-spacing: 0.14em;
}
.console-head button {
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #9fdcb2;
  background: none;
  border: 0;
  cursor: pointer;
}
.console-head button:hover { color: #39ff6a; }
.console-body {
  padding: 22px 20px 26px;
  color: #d7ffe2;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 2.1;
}
.console-cursor { color: #39ff6a; font-size: 16px; margin-top: 10px; }
.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .blurb, .clocks { display: none; }
  .search-wrap { width: min(420px, 52vw); }
}
