/* ═══════════════════════════════════════════════════════════════════════════════
   THE DIGITAL VAULT — SCROLLYTELLING COMPONENT
   Sticky cinematic narrative triggered by scroll movement, revealing sequential
   story, live telemetry data, and interactive 3D holographic vault core.
   ═══════════════════════════════════════════════════════════════════════════════ */

.scrolly-section {
  position: relative;
  padding: 40px 0 0;
  margin-bottom: 0;
  overflow: visible;
  clear: both;
}

.scrolly-track {
  position: relative;
  height: 200vh;
  min-height: 1400px;
}

/* Sticky Console Viewport */
.scrolly-sticky {
  position: sticky;
  top: 90px;
  height: min(calc(100vh - 120px), 560px);
  max-height: 560px;
  min-height: 440px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 32px;
  align-items: center;
  z-index: 2;
  overflow: hidden;
}

/* ── Left Column: Cyber Holographic Stage ── */
.scrolly-visual {
  position: relative;
  height: 100%;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.12), transparent 70%),
              linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(246, 247, 251, 0.92));
  border: 1px solid rgba(197, 160, 89, 0.32);
  box-shadow: 0 24px 60px -20px rgba(184, 134, 11, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
}

body:not(.white) .scrolly-visual {
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.15), transparent 70%),
              linear-gradient(145deg, rgba(16, 14, 20, 0.94), rgba(7, 6, 9, 0.96));
  border-color: rgba(212, 175, 55, 0.22);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Visual Top Bar / Telemetry */
.scrolly-vtop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

.scrolly-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.28);
  color: var(--gold-deep, #684503);
}

body:not(.white) .scrolly-badge {
  color: #f7d560;
  background: rgba(232, 185, 35, 0.1);
}

.scrolly-ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--good, #059669);
  box-shadow: 0 0 10px var(--good, #059669);
  animation: ping 2s infinite;
}

.scrolly-vstep-tag {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--muted, #596070);
  font-family: "Space Grotesk", sans-serif;
}

/* Hologram Core Display Area */
.scrolly-core-area {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  margin: 16px 0;
  overflow: hidden;
}

/* Orbital Concentric Rings */
.scrolly-orbital-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(184, 134, 11, 0.28);
  pointer-events: none;
  animation: rotateClockwise 26s linear infinite;
}

.scrolly-orbital-ring.ring-1 {
  width: 320px;
  height: 320px;
  border-style: solid;
  border-color: rgba(184, 134, 11, 0.18);
}

.scrolly-orbital-ring.ring-2 {
  width: 240px;
  height: 240px;
  border-style: dashed;
  animation-duration: 18s;
  animation-direction: reverse;
}

.scrolly-orbital-ring.ring-3 {
  width: 170px;
  height: 170px;
  border-style: dotted;
  border-color: rgba(212, 175, 55, 0.4);
  animation-duration: 12s;
}

@keyframes rotateClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Visual Stage Panels (Crossfaded by scroll position) */
.scrolly-vstage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: scale(0.92) translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 2;
  padding: 10px;
}

.scrolly-vstage.active {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.scrolly-stage-icon {
  width: 90px;
  height: 90px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 240, 180, 0.8), rgba(212, 175, 55, 0.25));
  border: 1.5px solid rgba(184, 134, 11, 0.45);
  box-shadow: 0 16px 36px -8px rgba(184, 134, 11, 0.35);
  display: grid;
  place-items: center;
  font-size: 42px;
  margin-bottom: 20px;
  position: relative;
  animation: pulseFloat 4s ease-in-out infinite;
}

@keyframes pulseFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.04); }
}

.scrolly-stage-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: var(--text-strong, #090a0d);
}

.scrolly-stage-desc {
  font-size: 13.5px;
  color: var(--muted, #596070);
  max-width: 340px;
  line-height: 1.55;
  margin-bottom: 20px;
}

/* Dynamic Live Visual Widgets inside Stages */
.scrolly-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 360px;
}

.scrolly-telemetry-card {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(184, 134, 11, 0.2);
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

body:not(.white) .scrolly-telemetry-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.scrolly-telemetry-card small {
  display: block;
  font-size: 10.5px;
  color: var(--muted, #596070);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.scrolly-telemetry-card b {
  display: block;
  font-size: 14px;
  color: var(--gold-deep, #684503);
  font-weight: 800;
  margin-top: 3px;
  font-family: "Space Grotesk", sans-serif;
}

body:not(.white) .scrolly-telemetry-card b {
  color: #ffd76a;
}

/* Stage 3 Crypto Scramble Box */
.scrolly-crypto-box {
  width: 100%;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(184, 134, 11, 0.35);
  font-family: monospace;
  font-size: 11.5px;
  color: var(--gold-dark, #8c600b);
  word-break: break-all;
  margin-top: 4px;
}

body:not(.white) .scrolly-crypto-box {
  background: rgba(0, 0, 0, 0.4);
  color: #f7d560;
}

/* Stage 2 Live Ticket Dispatch Mockup */
.scrolly-ticket-mock {
  width: 100%;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.scrolly-ticket-mock .discord-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #5865f2;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Visual Bottom Progress scrubber */
.scrolly-vbot {
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 5;
}

.scrolly-vbot-bar {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: rgba(184, 134, 11, 0.16);
  overflow: hidden;
  position: relative;
}

.scrolly-vbot-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 25%;
  border-radius: 99px;
  background: linear-gradient(90deg, #b8860b, #e8b923, #ffd76a);
  transition: width 0.25s cubic-bezier(0.1, 0.8, 0.2, 1);
}

.scrolly-vbot-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted, #596070);
  font-family: monospace;
}

/* ── Right Column: Narrative Story Chapters ── */
.scrolly-narrative {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: center;
  max-height: 100%;
}

/* Interactive Chapter Selector Pills */
.scrolly-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.scrolly-pill {
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(197, 160, 89, 0.25);
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted, #596070);
  cursor: pointer;
  transition: all 0.25s ease;
}

.scrolly-pill:hover {
  background: #fff;
  color: var(--text-strong, #090a0d);
  border-color: var(--gold, #b8860b);
}

.scrolly-pill.active {
  background: linear-gradient(135deg, #f7d560, #e8b923 45%, #b8860b);
  color: #1a1200;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.3);
}

/* Narrative Cards — Compact Accordion to Guarantee Zero Overflow */
.scrolly-card {
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.4);
  transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  max-height: 50px;
}

body:not(.white) .scrolly-card {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.07);
}

.scrolly-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #f7d560, #b8860b);
  opacity: 0;
  transition: opacity 0.3s;
}

.scrolly-card:hover {
  border-color: rgba(184, 134, 11, 0.45);
  transform: translateY(-1px);
}

.scrolly-card h3 {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 2px 0 0;
  color: var(--muted, #a49fae);
  transition: color 0.25s, font-size 0.3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scrolly-card p {
  color: var(--muted, #a49fae);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
}

.scrolly-card .scrolly-card-footer {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold, #d4af37);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.3s ease;
}

/* Active card smoothly expands with glowing bullion gold border */
.scrolly-card.active {
  padding: 16px 20px;
  border-radius: 16px;
  border-color: var(--gold, #d4af37) !important;
  background: rgba(212, 175, 55, 0.08) !important;
  box-shadow: 0 12px 35px -10px rgba(212, 175, 55, 0.35), 0 0 16px rgba(212, 175, 55, 0.15) !important;
  transform: scale(1.01);
  max-height: 240px;
}

.scrolly-card.active::before {
  opacity: 1;
}

.scrolly-card.active h3 {
  font-size: 16.5px;
  font-weight: 800;
  margin: 4px 0 6px;
  color: #fff;
  white-space: normal;
}

.scrolly-card.active p {
  max-height: 85px;
  opacity: 1;
  margin-top: 6px;
}

.scrolly-card.active .scrolly-card-footer {
  max-height: 28px;
  opacity: 1;
  margin-top: 10px;
}

.scrolly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.scrolly-step-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--gold, #b8860b);
}

.scrolly-step-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(184, 134, 11, 0.08);
  color: var(--gold-deep, #684503);
}

body:not(.white) .scrolly-step-badge {
  color: #f7d560;
  background: rgba(232, 185, 35, 0.12);
}

/* Mobile & Tablet Responsiveness */
@media (max-width: 960px) {
  .scrolly-sticky {
    position: relative;
    top: 0;
    height: auto;
    min-height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .scrolly-visual {
    height: 480px;
  }
  .scrolly-track {
    min-height: auto;
  }
}
