:root {
  --bg: #040807;
  --panel: rgba(9, 17, 15, 0.58);
  --panel-strong: rgba(8, 15, 13, 0.78);
  --line: rgba(244, 211, 146, 0.16);
  --line-bright: rgba(250, 224, 168, 0.48);
  --glass-hi: rgba(255, 255, 255, 0.09);
  --gold: #eab968;
  --gold-hi: #fce4ae;
  --gold-dim: rgba(234, 185, 104, 0.14);
  --ice: #8ce7ff;
  --ice-dim: rgba(140, 231, 255, 0.12);
  --green: #69e5a6;
  --text: #f5f1e8;
  --muted: #93a7a1;
  --radius: 18px;
  --font-display: "Instrument Serif", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(920px 540px at 78% 14%, rgba(234, 185, 104, 0.11), transparent 62%),
    radial-gradient(840px 560px at 14% 20%, rgba(112, 220, 255, 0.08), transparent 62%),
    linear-gradient(180deg, #040807 0%, #060e0c 55%, #030706 100%);
  overflow-x: hidden;
}

/* Full-bleed Three.js Canvas */
#vault-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.ambient-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 70% 34%, transparent 22%, rgba(4, 8, 7, 0.62) 78%),
    linear-gradient(180deg, rgba(4, 8, 7, 0.25) 0%, transparent 28%, rgba(4, 8, 7, 0.72) 100%);
}

.noise-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.03;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 1220px;
  margin: 0 auto;
  padding: 16px 20px 52px;
}

/* Sticky Spatial Pill Header */
.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 13, 11, 0.7);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 12px 36px rgba(0, 0, 0, 0.42);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background: radial-gradient(circle at 30% 25%, #233329, #08100d);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--gold-hi);
  box-shadow: 0 0 22px rgba(234, 185, 104, 0.24);
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.16em;
  font-size: 13px;
}

.ticker-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-hi);
  background: var(--gold-dim);
  border: 1px solid rgba(234, 185, 104, 0.34);
  padding: 3px 9px;
  border-radius: 999px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.84); }
}

.ca-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text);
  background: rgba(234, 185, 104, 0.1);
  border: 1px solid rgba(234, 185, 104, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.ca-btn:hover { border-color: var(--line-bright); background: rgba(234, 185, 104, 0.18); }

.nav-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition: all 0.18s ease;
}
.nav-link:hover { border-color: var(--line-bright); color: var(--gold-hi); }
.nav-link.disabled { opacity: 0.42; pointer-events: none; }

/* Open-Canvas 3D Hero */
.hero-stage {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: center;
  min-height: 440px;
  padding: 36px 4px 26px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-hi);
  background: rgba(234, 185, 104, 0.09);
  border: 1px solid rgba(234, 185, 104, 0.24);
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-hi);
  box-shadow: 0 0 10px var(--gold-hi);
}

h1 {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 6.2vw, 76px);
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
}

h1 span {
  background: linear-gradient(110deg, #fff1cb 10%, #eab968 55%, #8ce7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.sub {
  margin: 14px 0 22px;
  font-size: 15.5px;
  line-height: 1.55;
  color: #b7c8c2;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.btn-primary {
  font-size: 13px;
  font-weight: 700;
  color: #07100c;
  text-decoration: none;
  background: linear-gradient(135deg, #fff0c7, #eab968);
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(234, 185, 104, 0.26);
  transition: transform 0.16s ease, filter 0.16s ease;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }

.btn-ghost {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  background: rgba(10, 19, 17, 0.65);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.btn-ghost:hover { border-color: var(--line-bright); background: rgba(16, 29, 26, 0.78); }

.hud-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ice);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(140, 231, 255, 0.26);
  background: rgba(7, 22, 26, 0.55);
  backdrop-filter: blur(10px);
}

.hero-spacer {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 360px;
  pointer-events: none;
}

.stage-reticle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 11, 10, 0.42);
  backdrop-filter: blur(10px);
}

.reticle-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--gold-hi);
}

.reticle-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Spotlight Glass KPIs & Cards */
.spot {
  position: relative;
  overflow: hidden;
}

.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(250, 224, 168, 0.11), transparent 62%);
}
.spot:hover::before { opacity: 1; }

.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.kpi {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 14, 12, 0.66);
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.kpi-val {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-val.gold { color: var(--gold-hi); }
.kpi-val.ice { color: var(--ice); }

.kpi-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.mini-prog {
  margin-top: 9px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.mini-prog i {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, #54c8ee, #fce4ae);
  transition: width 0.5s linear;
}

/* Mid Bento Row */
.bento-mid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  margin-top: 8px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 20px 22px;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 16px 42px rgba(0, 0, 0, 0.36);
}

.insp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insp-day {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--gold-hi);
  background: var(--gold-dim);
  border: 1px solid rgba(234, 185, 104, 0.34);
  padding: 4px 10px;
  border-radius: 999px;
}

.insp-mult {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ice);
  background: var(--ice-dim);
  border: 1px solid rgba(140, 231, 255, 0.28);
  padding: 4px 10px;
  border-radius: 999px;
}

.insp-title {
  margin: 10px 0 4px;
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.02;
}

.insp-rule {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: #b1c3bd;
}

.split-bar {
  display: flex;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  margin: 14px 0 9px;
}
.split-a { background: linear-gradient(90deg, #d79c3f, #fce4ae); }
.split-b { background: linear-gradient(90deg, #4ec6ea, #94ecff); }
.split-c { background: linear-gradient(90deg, #48c98a, #8cf2be); }

.split-legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.split-legend b { color: var(--text); }

.check-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.check-form {
  display: flex;
  gap: 8px;
}

.check-input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(4, 9, 8, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.check-input:focus {
  border-color: var(--line-bright);
  box-shadow: 0 0 0 3px rgba(234, 185, 104, 0.12);
}

.check-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #07100c;
  background: linear-gradient(135deg, #fff0c7, #eab968);
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s ease;
}
.check-btn:hover { filter: brightness(1.07); }

.check-res {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 20px;
}
.check-res.ok { color: var(--green); }
.check-res.warn { color: var(--gold-hi); }
.check-res.err { color: #ff8e8e; }

/* Section Head & Filters */
.section-head {
  margin: 28px 0 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-hi);
}

.section-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: rgba(8, 16, 14, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.filter-pill:hover { color: var(--text); border-color: var(--line); }
.filter-pill.active {
  color: #07100c;
  background: linear-gradient(135deg, #fff0c7, #eab968);
  border-color: transparent;
  font-weight: 700;
}

/* 24-Door Spatial 3D Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  perspective: 1200px;
}

.door-slot {
  position: relative;
  aspect-ratio: 1 / 1.08;
  border-radius: 15px;
  background: radial-gradient(circle at 50% 28%, rgba(234, 185, 104, 0.16), rgba(5, 10, 9, 0.88));
  border: 1px solid rgba(234, 185, 104, 0.2);
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  backdrop-filter: blur(12px);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.door-slot.dimmed {
  opacity: 0.24;
  transform: scale(0.97);
}

.door-slot:hover {
  transform: translateY(-3px);
  border-color: var(--line-bright);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(234, 185, 104, 0.16);
}

.door-slot.selected {
  border-color: var(--gold-hi);
  box-shadow: 0 0 0 1px rgba(252, 228, 174, 0.52), 0 0 28px rgba(234, 185, 104, 0.28);
}

.door-slot.milestone {
  border-color: rgba(244, 211, 146, 0.44);
}

.door-inside {
  position: absolute;
  inset: 0;
  padding: 13px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(circle at 50% 22%, rgba(234, 185, 104, 0.22), rgba(6, 12, 11, 0.96) 72%);
}

.inside-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  color: var(--ice);
}

.inside-title {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.02;
  color: var(--gold-hi);
}

.inside-mult {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

.door-leaf {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(150deg, #12211d 0%, #091210 68%, #060b0a 100%);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease;
  backface-visibility: hidden;
  border-right: 1px solid rgba(252, 228, 174, 0.2);
}

.door-leaf::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 1px solid rgba(234, 185, 104, 0.13);
  pointer-events: none;
}

.door-slot.milestone .door-leaf {
  background: linear-gradient(150deg, #2b2313 0%, #0e1512 72%);
}
.door-slot.milestone .door-leaf::after {
  border-color: rgba(252, 228, 174, 0.35);
}

.door-slot.open .door-leaf {
  transform: rotateY(-108deg);
  opacity: 0.12;
}

.door-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}

.door-num {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 0.9;
  color: var(--text);
  letter-spacing: -0.02em;
}
.door-slot.milestone .door-num { color: var(--gold-hi); }

.door-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--muted);
}

.door-foot > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.door-badge {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 8.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-active, .badge-next { color: #060f0c; background: var(--gold-hi); font-weight: 700; }
.badge-opened { color: var(--green); background: rgba(105, 229, 166, 0.15); }
.badge-locked { color: var(--muted); background: rgba(255, 255, 255, 0.06); }

/* Bottom Row */
.bottom {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 14px;
}

.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(5, 10, 9, 0.62);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ledger-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(234, 185, 104, 0.24);
  background: rgba(5, 10, 9, 0.45);
}

.stats-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.mini-cell {
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(5, 10, 9, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.mini-cell .k {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}
.mini-cell .v {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mini-cell .v.gold { color: var(--gold-hi); }
.mini-cell .v.ice { color: var(--ice); }

.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 1020px) {
  .hero-stage { grid-template-columns: 1fr; min-height: auto; padding-top: 22px; }
  .hero-spacer { display: none; }
  .bento-mid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .bottom { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .wrap { padding: 12px 12px 36px; }
  .topbar { border-radius: 18px; padding: 10px 12px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpis { grid-template-columns: 1fr; }
  .door-num { font-size: 32px; }
  .inside-title { font-size: 17px; }
  .check-form { flex-direction: column; }
}
