/* altolab.ai — 불 꺼진 상영관. 바탕은 검정 모노톤이고,
   블루(--glow)는 지금 보고 있는 자리를 알려 주는 곳에만 쓴다(화면의 5% 안쪽). */

:root {
  --bg: #09090a;
  --bg-2: #131314;
  --ink: #f2f2f1;
  --ink-2: #bdbdc0;
  --ink-3: #8f8f95;
  --line: rgba(255, 255, 255, 0.13);
  --glow: #2f66ff;
  --glow-text: #6f97ff;
  --glow-core: #b9ccff;

  --body: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;

  --top-h: 72px;
  --scrub-h: 76px;
  --poster-h: min(52dvh, 600px, 44vw);
  --item-w: calc(var(--poster-h) * 1.6);
  --gap: clamp(28px, 4vw, 72px);
  --r: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 720px) {
  :root {
    --top-h: 56px;
    --scrub-h: 92px;
    --poster-h: min(44dvh, 100vw);
    --item-w: calc(var(--poster-h) * 0.8);
    --gap: 18px;
  }
}

/* 높이가 낮은 노트북 화면에서는 설명 글이 잘리지 않게 포스터를 줄인다 */
@media (min-width: 721px) and (max-height: 720px) {
  :root {
    --top-h: 60px;
    --scrub-h: 60px;
    --poster-h: min(46dvh, 44vw);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: var(--top-h) minmax(0, 1fr) var(--scrub-h);
  height: 100dvh;
}

/* 방: 가운데만 아주 옅게 밝은 무채색 바탕 */
.room {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(64vw 56dvh at 50% 42%, rgba(255, 255, 255, 0.045), transparent 72%), var(--bg);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.1;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 6px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--glow-core);
  outline-offset: 4px;
}

/* 상단 */
.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(16px, 3.2vw, 48px);
}

.mark {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.12em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.count {
  margin: 0 10px 0 0;
  font-size: 15px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count b {
  color: var(--ink);
  font-weight: 600;
}

.step {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.step:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

.step[disabled] {
  opacity: 0.32;
  cursor: default;
}

/* 가로 레일 */
.rail {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  padding-inline: calc(50vw - var(--item-w) / 2);
  padding-top: max(8px, calc((100dvh - var(--top-h) - var(--scrub-h) - var(--poster-h) - 200px) / 2));
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  outline-offset: -4px;
}

.rail::-webkit-scrollbar {
  display: none;
}

.item {
  flex: 0 0 var(--item-w);
  width: var(--item-w);
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

/* 첫 화면 */
.intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--poster-h);
}

.intro h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(52px, 8.6vw, 132px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.intro h1 span {
  display: block;
}

.intro .hint {
  margin: clamp(20px, 4dvh, 44px) 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: var(--ink-3);
}

.hint .beam {
  flex: 0 0 auto;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow-core));
  box-shadow: 0 0 12px 1px rgba(47, 102, 255, 0.9);
}

/* 작품 카드 */
.poster {
  position: relative;
  display: block;
  height: var(--poster-h);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line);
  filter: brightness(0.5) saturate(0.75);
  transition: filter 420ms var(--ease), box-shadow 420ms var(--ease);
}

.poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 화면 위쪽 모서리에 맺히는 빛 */
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

/* 초점이 옮겨 올 때 한 번 지나가는 빛 */
.poster::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 46%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14) 45%, rgba(255, 255, 255, 0.26) 50%, rgba(255, 255, 255, 0.14) 55%, transparent);
  transform: skewX(-14deg);
  opacity: 0;
  pointer-events: none;
}

.item.is-on .poster {
  filter: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 36px 80px -34px rgba(0, 0, 0, 0.95);
}

.item.is-on .poster::after {
  animation: sweep 1100ms var(--ease) 120ms 1 both;
}

.item.is-on .poster:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5), 0 36px 80px -34px rgba(0, 0, 0, 0.95);
}

/* 핵심 포인트: 지금 보는 카드 아랫변에만 켜지는 블루 조명 */
.item {
  position: relative;
}

.item:not(.intro)::before,
.item:not(.intro)::after {
  content: "";
  position: absolute;
  top: var(--poster-h);
  left: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 520ms var(--ease);
}

.item:not(.intro)::before {
  z-index: 2;
  width: 34%;
  height: 2px;
  margin: -1px 0 0 -17%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--glow) 22%, var(--glow-core) 50%, var(--glow) 78%, transparent);
}

.item:not(.intro)::after {
  width: 46%;
  height: 46px;
  margin: -6px 0 0 -23%;
  background: radial-gradient(50% 100% at 50% 0%, rgba(47, 102, 255, 0.5), transparent 100%);
  filter: blur(10px);
}

.item.is-on::before,
.item.is-on::after {
  opacity: 1;
}

@keyframes sweep {
  0% {
    left: -60%;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    left: 120%;
    opacity: 0;
  }
}

.info {
  margin-top: clamp(16px, 2.6dvh, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 32px;
  row-gap: 6px;
  align-items: start;
  opacity: 0.3;
  transition: opacity 420ms var(--ease);
}

.item.is-on .info {
  opacity: 1;
}

.info h2 {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.info .no {
  color: var(--glow-text);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.info .kind {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-3);
}

.info .desc {
  margin: 0;
  max-width: 33em;
  color: var(--ink-2);
  text-wrap: pretty;
}

.info .go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: -6px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}

.info .go:hover {
  color: var(--glow-core);
}

.info .go svg {
  flex: 0 0 auto;
}

/* 하단 진행선: 재생 막대처럼 지금 몇 번째인지 보여 준다 */
.scrub {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 24px;
  padding-inline: clamp(16px, 3.2vw, 48px);
}

.scrub ol {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scrub ol::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 8px;
  height: 1px;
  background: var(--line);
}

.scrub .head {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 8px;
  height: 0;
  pointer-events: none;
}

.scrub .head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--p, 0) * 100%);
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.42));
}

.scrub .head::after {
  content: "";
  position: absolute;
  left: calc(var(--p, 0) * 100%);
  top: 0;
  width: 30px;
  height: 2px;
  margin: -0.5px 0 0 -15px;
  border-radius: 2px;
  background: var(--glow-core);
  box-shadow: 0 0 10px 2px rgba(47, 102, 255, 0.95), 0 0 34px 8px rgba(47, 102, 255, 0.55);
}

.scrub button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 160ms ease;
}

.scrub button span {
  position: relative;
  top: 8px;
}

.scrub button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, 0.3);
}

.scrub button:hover,
.scrub button[aria-current="true"] {
  color: var(--ink);
}

.scrub .sign {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  color: var(--ink-3);
  white-space: nowrap;
}

.scrub .sign a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 160ms ease;
}

.scrub .sign a:hover {
  color: var(--ink);
}

/* 첫 진입 연출 한 가지: 오른쪽에서 차례로 들어온다 */
@media (prefers-reduced-motion: no-preference) {
  .item {
    animation: enter 900ms var(--ease) both;
    animation-delay: calc(var(--i, 0) * 70ms + 80ms);
  }

  @keyframes enter {
    from {
      opacity: 0;
      transform: translateX(56px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .poster,
  .info,
  .step,
  .scrub button,
  .item::before,
  .item::after {
    transition: none;
  }

  .item.is-on .poster::after {
    animation: none;
  }
}

@media (max-width: 720px) {
  .mark {
    font-size: 16px;
  }

  .count {
    margin-right: 4px;
  }

  .step {
    display: none;
  }

  .rail {
    padding-top: 8px;
  }

  .intro h1 {
    font-size: clamp(50px, 17vw, 76px);
  }

  .info {
    grid-template-columns: minmax(0, 1fr);
  }

  .info .go {
    margin-top: 0;
  }

  .scrub {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0;
  }

  .scrub .sign {
    justify-content: center;
  }

  .scrub .sign span {
    display: none;
  }

}
