/* ============================================================
   OBSIDIAN HALL — style.css
   ============================================================ */

/* ── DOM OVERLAY ── */
#obsidian-hall-3d {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  background-color: var(--color-obsidian, #0B0B0C);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}
#obsidian-hall-3d.active {
  opacity: 1;
  pointer-events: auto;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* ── OVERLAYS (shared) ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.overlay.active {
  opacity: 1;
  pointer-events: none; /* Let pointer events through to canvas */
}

/* ============================================================
   NAV OVERLAY
   ============================================================ */
#overlay-nav       { pointer-events: none; }
#overlay-nav.active{ pointer-events: none; }

/* Top bar */
.nav-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 2.5rem;
  pointer-events: none;
}

.hall-logo {
  font-family: var(--font-heading, 'Palatino Linotype', serif);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-gold, #e9a92b);
  pointer-events: auto;
}

.exit-btn {
  background: transparent;
  border: 1px solid rgba(233,169,43,0.3);
  color: var(--color-gold, #e9a92b);
  font-family: var(--font-heading, "Palatino Linotype", serif);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: auto;
}
.exit-btn:hover {
  border-color: #ffd966;
  color: #ffd966;
  box-shadow: 0 0 15px rgba(233,169,43,0.2);
}

/* Bottom nav */
.nav-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 3.5rem;
  pointer-events: none;
}

.nav-panel {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  pointer-events: auto;
}

.nav-arrow {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-gold, #e9a92b);
  font-family: var(--font-heading, "Palatino Linotype", serif);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 0.5rem 0;
  transition: color 0.3s, transform 0.3s;
}
.nav-arrow:hover       { color: #ffd966; transform: translateX(-3px); }
.nav-arrow.next:hover  { transform: translateX(3px); }
.nav-arrow svg { width: 18px; height: 18px; }

/* Nav dots */
.nav-dots {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.nav-dot {
  width: 5px;
  height: 5px;
  border-radius: 50% !important;
  border: 1px solid var(--color-gold, #e9a92b);
  cursor: pointer;
  transition: all 0.3s;
  pointer-events: auto;
}
.nav-dot.active {
  background: var(--color-gold, #e9a92b);
  border-color: var(--color-gold, #e9a92b);
  box-shadow: 0 0 8px var(--color-gold, #e9a92b);
  transform: scale(1.4);
}
.nav-dot:hover { border-color: #ffd966; }


/* ── COUNTER (bottom-left) ── */
.slab-counter {
  position: absolute;
  left: 2.5rem;
  bottom: 3.8rem;
  font-family: var(--font-heading, "Palatino Linotype", serif);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--color-gold, #e9a92b);
  pointer-events: none;
}
.slab-counter .current {
  color: #ffd966;
  font-size: 1.4rem;
}

/* ── FLIP HINT ── */
.flip-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading, "Palatino Linotype", serif);
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(233,169,43,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
  white-space: nowrap;
}
.flip-hint.show { opacity: 1; }

/* ── RESPONSIVE / MOBILE ── */
@media (max-width: 768px) {
  .nav-top {
    padding: 1.5rem;
  }
  
  .nav-bottom {
    padding-bottom: 2rem;
  }
  
  .nav-panel {
    gap: 1rem;
  }

  .slab-counter {
    left: 1.5rem;
    bottom: 5.5rem;
  }
}

/* ============================================================
   OBSIDIAN GLITCH MODAL
   ============================================================ */
.obsidian-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: var(--color-obsidian, #0B0B0C);
  z-index: 99990; /* High enough to overlay hall */
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 1.5s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.obsidian-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.obsidian-modal-close-btn {
  position: fixed;
  top: 2rem;
  right: 3rem;
  background: rgba(11, 11, 12, 0.8);
  border: 1px solid rgba(233, 169, 43, 0.5);
  color: var(--color-gold, #e9a92b);
  width: 54px; height: 54px;
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: 50% !important;
  transition: transform 0.3s ease, opacity 0.5s ease;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.obsidian-modal-close-btn.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.5s ease 0.8s, transform 0.3s ease;
}

.obsidian-modal-close-btn:hover {
  transform: scale(1.1) rotate(90deg);
  filter: drop-shadow(0 0 15px var(--color-gold, #e9a92b));
}

.obsidian-modal-close-btn svg {
  width: 28px; height: 28px;
  pointer-events: none;
}

.obsidian-modal-content-wrapper {
  display: flex;
  width: 90vw;
  max-width: 1400px;
  height: 85vh;
  position: relative;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
}

.obsidian-modal-overlay.active .obsidian-modal-content-wrapper {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: all 0.8s ease 0.5s;
}

.obsidian-modal-left {
  flex: 1;
  padding: 2rem;
  display: flex;
  align-items: center; justify-content: center;
  border-right: 1px solid rgba(233, 169, 43, 0.15);
  position: relative;
  pointer-events: auto;
}

.obsidian-modal-left img {
  width: 100%; height: 100%;
  object-fit: cover;
  border: 1px solid rgba(233,169,43,0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
  filter: contrast(1.15) saturate(0.85);
}

.obsidian-modal-right-container {
  flex: 1.2;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.obsidian-modal-right {
  width: 100%; height: 100%;
  padding: 4rem;
  display: flex; flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 150px, black calc(100% - 150px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 150px, black calc(100% - 150px), transparent 100%);
  transition: -webkit-mask-image 0.8s ease, mask-image 0.8s ease;
}
.obsidian-modal-right::-webkit-scrollbar { display: none; }
.obsidian-modal-right.at-top {
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 150px), transparent 100%);
  mask-image: linear-gradient(to bottom, black calc(100% - 150px), transparent 100%);
}
.obsidian-modal-right.at-bottom {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 150px, black 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 150px, black 100%);
}
.obsidian-modal-right.at-top.at-bottom {
  -webkit-mask-image: none; mask-image: none;
}

.obsidian-modal-title {
  font-family: var(--font-heading, "Palatino Linotype", serif);
  font-size: 3.5rem;
  color: var(--color-gold, #e9a92b);
  margin: 0 0 2rem 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-shadow: 0 0 25px rgba(233, 169, 43, 0.5);
  font-weight: normal;
}

.obsidian-modal-text {
  font-family: Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: #d0d0d0;
}
.obsidian-modal-text p { margin-bottom: 1.5rem; }

/* Cinematic scroll indication fades */
.obsidian-modal-scroll-fade {
  position: absolute; left: 0; right: 0; pointer-events: none; z-index: 10; height: 150px;
  bottom: 0; background: linear-gradient(to top, var(--color-obsidian, #0B0B0C) 0%, transparent 100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.obsidian-modal-scroll-fade-top {
  position: absolute; left: 0; right: 0; pointer-events: none; z-index: 10; height: 150px;
  top: 0; background: linear-gradient(to bottom, var(--color-obsidian, #0B0B0C) 0%, transparent 100%);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.obsidian-modal-scroll-fade.fade-hidden { opacity: 0; transform: translateY(10px); }
.obsidian-modal-scroll-fade-top.fade-hidden { opacity: 0; transform: translateY(-10px); }

/* Glitch Effects (Obsidian theme) */
.obsidian-glitch-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 100; pointer-events: none; mix-blend-mode: overlay;
}
.obsidian-glitch-scanlines {
  position: absolute; inset: 0; z-index: 101; pointer-events: none; opacity: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.2));
  background-size: 100% 4px;
}
.obsidian-glitch-noise {
  position: absolute; inset: 0; z-index: 102; pointer-events: none; opacity: 0;
  background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
  mix-blend-mode: overlay;
}
.obsidian-glitch-rgb-r {
  position: absolute; inset: 0; z-index: 90; opacity: 0; pointer-events: none;
  background: inherit; mix-blend-mode: screen; filter: drop-shadow(5px 0 0 rgba(255, 150, 0, 0.8));
}
.obsidian-glitch-rgb-b {
  position: absolute; inset: 0; z-index: 90; opacity: 0; pointer-events: none;
  background: inherit; mix-blend-mode: screen; filter: drop-shadow(-5px 0 0 rgba(200, 200, 200, 0.5));
}
.obsidian-glitch-tear {
  position: absolute; left: 0; width: 100%; height: 10px; background: rgba(233,169,43,0.3);
  z-index: 105; opacity: 0; pointer-events: none; transform-origin: left center;
}
.obsidian-img-glitch-r, .obsidian-img-glitch-b {
  position: absolute; inset: 2rem; background-size: cover; background-position: center;
  opacity: 0; pointer-events: none; z-index: 10;
}
.obsidian-img-glitch-r { mix-blend-mode: screen; filter: sepia(1) hue-rotate(-30deg) saturate(3); }
.obsidian-img-glitch-b { mix-blend-mode: screen; filter: grayscale(1) brightness(1.5); }

/* Mobile Responsiveness for Obsidian Modal */
@media (max-width: 768px) {
  .obsidian-modal-overlay {
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .obsidian-modal-content-wrapper {
    flex-direction: column;
    width: 100vw;
    height: auto;
    min-height: 100dvh;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-top: 85px;
    pointer-events: none;
  }

  .obsidian-modal-left {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid rgba(233, 169, 43, 0.1);
    padding: 0;
    background: radial-gradient(circle at center, rgba(233, 169, 43, 0.05), transparent);
  }

  .obsidian-modal-left img {
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    object-position: top center;
    border-radius: 0;
  }

  .obsidian-modal-right-container {
    flex: none;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .obsidian-modal-right {
    height: auto;
    min-height: 60dvh;
    padding: 2rem 1.5rem 4rem;
    overflow-y: visible;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .obsidian-modal-title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    margin-bottom: 1.2rem;
  }

  .obsidian-modal-text {
    font-size: 1rem;
    line-height: 1.7;
  }

  .obsidian-modal-close-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 48px; 
    height: 48px;
    background: rgba(11, 11, 12, 0.95);
    border-radius: 50% !important;
    backdrop-filter: blur(8px);
    z-index: 10000000;
    pointer-events: auto !important;
    touch-action: manipulation;
  }
}
