﻿/* =========================================================
   NOCTURNE — cover wall, scroll rhythm, chapter navigation
   ========================================================= */

.hero-card {
  background: #3a0b14;
}

.hero-wall {
  position: absolute;
  inset: -4% -2% -4%;
  z-index: 0;
  display: flex;
  gap: 6px;
  overflow: hidden;
  pointer-events: none;
  transform: translate3d(var(--wall-x, 0px), var(--wall-y, 0px), 0) scale(1.04);
  transform-origin: center;
  will-change: transform;
}

.wall-column {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  will-change: transform;
}

.wall-column:nth-child(1) { transform: translate3d(0, -140px, 0); }
.wall-column:nth-child(2) { transform: translate3d(0, -110px, 0); }
.wall-column:nth-child(3) { transform: translate3d(0, -155px, 0); }
.wall-column:nth-child(4) { transform: translate3d(0, -125px, 0); }
.wall-column:nth-child(5) { transform: translate3d(0, -145px, 0); }
.wall-column:nth-child(6) { transform: translate3d(0, -120px, 0); }
.wall-column:nth-child(7) { transform: translate3d(0, -160px, 0); }
.wall-column:nth-child(8) { transform: translate3d(0, -135px, 0); }

.wall-column img {
  flex: 0 0 auto;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 2px;
  background: #2a080e;
  filter: saturate(0.9) contrast(1.02);
  opacity: 0.92;
}

.hero-spot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 620px;
  height: 620px;
  margin: -310px 0 0 -310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 208, 170, 0.18), transparent 68%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.hero-card:hover .hero-spot {
  opacity: 1;
}

.hero-inner {
  z-index: 3;
}

.hero-wash {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(45, 6, 13, 0.54) 0%, rgba(45, 6, 13, 0.03) 19%, transparent 43%, rgba(45, 6, 13, 0.85) 100%),
    linear-gradient(90deg, rgba(45, 6, 13, 0.92) 0%, rgba(45, 6, 13, 0.76) 27%, rgba(45, 6, 13, 0.2) 61%, rgba(45, 6, 13, 0.4) 100%),
    radial-gradient(circle at 91% 56%, rgba(36, 4, 9, 0.63), transparent 31%),
    linear-gradient(135deg, rgba(132, 34, 40, 0.24), transparent 55%);
}

.hero-glow {
  z-index: 1;
}

/* ---------------------------------------------------------
   Scroll progress + chapter rail
   --------------------------------------------------------- */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 2px;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #b8794f, var(--gold-bright));
  box-shadow: 0 0 14px rgba(255, 203, 144, 0.5);
}

.chapter-rail {
  position: fixed;
  top: 50%;
  right: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 10px;
  border: 1px solid rgba(255, 235, 220, 0.18);
  border-radius: 999px;
  background: rgba(49, 8, 16, 0.52);
  transform: translateY(-50%);
}

.chapter-rail a {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 25px;
  height: 22px;
  color: rgba(255, 241, 229, 0.38);
  transition: color 0.3s ease;
}

.chapter-rail a:hover {
  color: rgba(255, 241, 229, 0.78);
}

.chapter-rail a.is-active {
  color: var(--gold-bright);
}

.chapter-rail span {
  font-family: var(--serif-en);
  font-size: 9px;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0.03em;
}

.chapter-rail i {
  display: block;
  width: 0;
  height: 1px;
  background: var(--gold-bright);
  transition: width 0.35s var(--ease);
}

.chapter-rail a.is-active i {
  width: 14px;
}

/* ---------------------------------------------------------
   Scroll reveal refinement
   --------------------------------------------------------- */

.new-card.reveal {
  clip-path: inset(0 0 100% 0 round 3px);
  transform: translateY(22px) scale(0.985);
  transition:
    opacity 0.8s var(--ease),
    transform 0.9s var(--ease),
    clip-path 1s var(--ease);
}

.new-card.reveal.is-visible {
  clip-path: inset(0 0 0 0 round 3px);
  transform: translateY(0) scale(1);
}

.rank-item.reveal {
  opacity: 0;
  transform: translate3d(calc(-1 * clamp(64px, 7vw, 112px)), 0, 0);
  transition: none;
  will-change: transform, opacity;
}

@media (max-width: 1360px) {
  .chapter-rail {
    display: none;
  }
}

@media (max-width: 980px) {
  .hero-wall {
    inset: -2% -4% 0;
    gap: 4px;
  }

  .wall-column {
    transform: none !important;
  }

  .wall-column:nth-child(n + 5) {
    display: none;
  }

  .wall-column img {
    opacity: 0.9;
  }

  .hero-spot {
    display: none;
  }
}

@media (max-width: 760px) {
  .hero-wash {
    background:
      linear-gradient(180deg, rgba(45, 6, 13, 0.36) 0%, transparent 23%, rgba(45, 6, 13, 0.7) 58%, rgba(45, 6, 13, 0.92) 100%),
      linear-gradient(90deg, rgba(45, 6, 13, 0.84), rgba(45, 6, 13, 0.28) 78%, rgba(45, 6, 13, 0.52)),
      linear-gradient(135deg, rgba(132, 34, 40, 0.18), transparent 58%);
  }

  .scroll-progress {
    height: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .new-card.reveal {
    clip-path: none;
    transform: none;
  }
}
