/* ═══════════════════════════════════════════════════════════
   cinema.css — 홈이 한 편의 장면이 된다 (index.html 전용)
   서막 → 첫 화면 → 오행 전환 → 정렬 → 숫자 → 다섯 걸음 → 財曆
   ═══════════════════════════════════════════════════════════ */

/* ── 오행 색: html[data-el]이 바뀌면 온 페이지가 그 기운으로 ── */
html { --tint: #cfa650; --tint-rgb: 207, 166, 80; --tint-word: '金'; }
html[data-el="목"] { --tint: #6fd3a8; --tint-rgb: 111, 211, 168; }
html[data-el="화"] { --tint: #ff8a74; --tint-rgb: 255, 138, 116; }
html[data-el="토"] { --tint: #f0c25c; --tint-rgb: 240, 194, 92; }
html[data-el="금"] { --tint: #dfe4f2; --tint-rgb: 223, 228, 242; }
html[data-el="수"] { --tint: #7fb2ff; --tint-rgb: 127, 178, 255; }

.big {
  font-family: var(--serif); font-weight: 900; letter-spacing: -0.035em; line-height: 1.12;
  font-size: clamp(2.1rem, 5.6vw, 4.6rem); color: #fffaf0; margin: 0; text-wrap: balance;
}
.big em { font-style: normal; color: var(--tint); transition: color 1.1s ease; text-shadow: 0 0 40px rgba(var(--tint-rgb), 0.35); }

/* ── 0. 서막 ─────────────────────────────────────────── */
html.ov-on { overflow: hidden; }
#overture { position: fixed; inset: 0; z-index: 200; cursor: pointer; }
#overture .ov-half { position: absolute; left: 0; right: 0; height: 50.5%; background: #070910; transition: transform 1.15s cubic-bezier(.85, 0, .15, 1); }
#overture .ov-half.top { top: 0; }
#overture .ov-half.bot { bottom: 0; }
#overture .ov-half.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(207, 166, 80, 0.55), transparent); }
#overture .ov-core { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .6s, transform 1s cubic-bezier(.2, .7, .2, 1); }
#overture .ov-ring {
  position: absolute; left: 50%; top: 50%; width: min(72vmin, 520px); height: min(72vmin, 520px);
  margin: calc(min(72vmin, 520px) / -2) 0 0 calc(min(72vmin, 520px) / -2);
  border-radius: 50%; border: 1px solid rgba(207, 166, 80, 0.22);
  opacity: 0; transform: rotate(-70deg) scale(0.86);
}
#overture .ov-ring span {
  position: absolute; left: 50%; top: 50%; width: 1.4em; height: 1.4em; margin: -0.7em 0 0 -0.7em;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: clamp(0.95rem, 2.6vmin, 1.3rem); color: rgba(241, 220, 163, 0.7);
  transform: rotate(var(--a)) translateY(calc(min(72vmin, 520px) / -2)) rotate(calc(var(--a) * -1));
  transition: color .6s ease, text-shadow .6s ease, filter .6s ease;
}
#overture .ov-ring span.lit { color: #fffaf0; text-shadow: 0 0 14px rgba(241, 220, 163, 0.9), 0 0 36px rgba(207, 166, 80, 0.6); filter: brightness(1.25); }
#overture.formed .ov-ring { border-color: rgba(207, 166, 80, 0.5); transition: border-color .6s ease; }
#overture #ov-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; }
#overture .ov-core { z-index: 2; }
#overture .ov-glyph {
  font-family: var(--serif); font-weight: 900; font-size: clamp(5.5rem, 24vmin, 12rem); line-height: 1; color: #fffaf0;
  letter-spacing: 0.04em; opacity: 0; filter: blur(18px); transform: scale(1.12);
  text-shadow: 0 0 60px rgba(207, 166, 80, 0.35);
}
#overture .ov-line { position: absolute; left: 0; right: 0; top: calc(50% + min(36vmin, 260px) + 26px); text-align: center; font-family: var(--serif); font-size: clamp(0.8rem, 2vmin, 1rem); letter-spacing: 0.22em; color: rgba(245, 237, 217, 0.62); opacity: 0; transform: translateY(10px); }
#overture .ov-line b { color: var(--gold-lit); font-weight: 900; }
#overture .ov-skip { position: absolute; right: 22px; bottom: calc(18px + var(--safe-b, 0px)); font-size: 0.74rem; letter-spacing: 0.16em; color: rgba(245, 237, 217, 0.32); opacity: 0; }
#overture.go .ov-ring { animation: ov-ring 1.5s cubic-bezier(.2, .7, .2, 1) forwards; }
#overture.go .ov-glyph { display: none; }
#overture.go .ov-line { animation: ov-line .8s ease 2.2s forwards; }
#overture.go .ov-skip { animation: ov-line .6s ease 1.2s forwards; }
@keyframes ov-ring { to { opacity: 1; transform: rotate(0) scale(1); } }
@keyframes ov-glyph { to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes ov-line { to { opacity: 1; transform: none; } }
#overture.out { pointer-events: none; }
#overture.out .ov-half.top { transform: translateY(-101%); }
#overture.out .ov-half.bot { transform: translateY(101%); }
#overture.out .ov-core { opacity: 0; transform: scale(1.35); }
/* 막이 걷히기 전에는 첫 화면이 움직이지 않는다 — 막 뒤에서 미리 끝나 버리지 않게 */
html.ov-on .sky-hero .rise, html.ov-on .sky-hero .ch, html.ov-on .sky-hero .shimmer { animation-play-state: paused !important; }

/* ── 1. 첫 화면 ──────────────────────────────────────── */
.sky-hero .tint-wash {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-color: var(--tint); opacity: 0.16;
  -webkit-mask: radial-gradient(52% 60% at 74% 44%, #000, transparent 72%); mask: radial-gradient(52% 60% at 74% 44%, #000, transparent 72%);
  transition: background-color 1.2s ease;
}
.sky-hero .spot {
  position: absolute; left: -450px; top: -450px; width: 900px; height: 900px; border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--tint-rgb), 0.16), rgba(var(--tint-rgb), 0.05) 40%, transparent 70%);
  transform: translate3d(30vw, 40vh, 0); will-change: transform; transition: background 1.2s ease;
}
.sky-hero .sky-glyph {
  position: absolute; right: 6vw; top: 50%; z-index: -1; pointer-events: none;
  font-family: var(--serif); font-weight: 900; font-size: clamp(18rem, 44vw, 46rem); line-height: 1; margin-top: -0.5em;
  color: rgba(var(--tint-rgb), 0.045); -webkit-text-stroke: 1px rgba(var(--tint-rgb), 0.32);
  text-shadow: none; opacity: 0; animation: glyph-in 2.2s cubic-bezier(.2, .7, .2, 1) .4s forwards; will-change: transform;
}
@keyframes glyph-in { to { opacity: 1; } }
.sky-copy h1 { font-size: clamp(2.5rem, 6.2vw, 4.9rem); line-height: 1.08; margin-bottom: 20px; }
.sky-copy .lead { font-size: clamp(1.02rem, 1.4vw, 1.2rem); max-width: 26em; margin-bottom: 20px; }
.sky-trust { margin: 18px 0 0; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--text-dim); }
.sky-cta .btn { transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, filter .2s; will-change: transform; }
.form-panel { transform-style: preserve-3d; transition: box-shadow .6s; will-change: transform; }
.form-panel .btn { transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s; }

/* ── 2. 오행 전환 ────────────────────────────────────── */
.el-stage { position: relative; overflow: hidden; padding: 110px 0 96px; background: var(--ink); isolation: isolate; }
.el-stage .el-glow {
  position: absolute; inset: -20% -10%; z-index: -1; pointer-events: none;
  background: radial-gradient(38% 46% at 50% 62%, rgba(var(--tint-rgb), 0.28), transparent 70%);
  opacity: 0.9; transition: background 1.2s ease;
}
.el-stage .el-glow::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(60% 40% at 50% 100%, var(--tint), transparent 70%);
  opacity: 0.12; transition: background 1.2s ease;
}
.el-head { text-align: center; max-width: 44em; margin: 0 auto 44px; }
.el-head .eyebrow { display: inline-flex; font-family: var(--serif); font-size: 0.82rem; letter-spacing: 0.34em; color: var(--tint); margin-bottom: 18px; transition: color 1s; }
.el-line { font-family: var(--serif); font-size: clamp(1.12rem, 1.9vw, 1.5rem); color: var(--hanji); margin: 26px 0 8px; line-height: 1.6; }
.el-money { color: var(--text-2); font-size: clamp(0.98rem, 1.3vw, 1.08rem); margin: 0 0 14px; line-height: 1.7; }
.el-who { font-size: 0.84rem; color: var(--text-dim); margin: 0; letter-spacing: 0.02em; }
.el-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(8px, 1.4vw, 18px); max-width: 980px; margin: 0 auto; }
.el-tile {
  position: relative; appearance: none; border: 1px solid rgba(255, 255, 255, 0.07); cursor: pointer;
  border-radius: 22px; aspect-ratio: 3 / 4; padding: 0; overflow: hidden;
  background: linear-gradient(170deg, rgba(20, 25, 44, 0.85), rgba(10, 13, 23, 0.9)); color: rgba(245, 237, 217, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .55s cubic-bezier(.2, .7, .2, 1), border-color .5s, color .5s, box-shadow .5s, background .5s;
}
.el-tile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 60% at 50% 100%, var(--c, var(--gold)), transparent 70%); opacity: 0; transition: opacity .6s; }
.el-tile .hj { position: relative; font-family: var(--serif); font-weight: 900; font-size: clamp(2.2rem, 7vw, 6rem); line-height: 1; transition: transform .6s cubic-bezier(.2, .7, .2, 1), text-shadow .6s; }
.el-tile .nm { position: relative; font-size: clamp(0.74rem, 1.2vw, 0.95rem); letter-spacing: 0.22em; color: var(--text-dim); }
.el-tile[data-el="목"] { --c: #6fd3a8; } .el-tile[data-el="화"] { --c: #ff8a74; } .el-tile[data-el="토"] { --c: #f0c25c; } .el-tile[data-el="금"] { --c: #dfe4f2; } .el-tile[data-el="수"] { --c: #7fb2ff; }
.el-tile:hover, .el-tile.on { color: #fffaf0; border-color: rgba(255, 255, 255, 0.18); transform: translateY(-14px); box-shadow: 0 40px 70px -30px var(--c), 0 0 0 1px rgba(255, 255, 255, 0.06) inset; }
.el-tile:hover::before, .el-tile.on::before { opacity: 0.55; }
.el-tile:hover .hj, .el-tile.on .hj { transform: translateY(-6px) scale(1.08); text-shadow: 0 0 40px var(--c); }
.el-tile.on .nm { color: #fffaf0; }
.el-tile:focus-visible { outline: 2px solid var(--gold-lit); outline-offset: 3px; }
.el-foot { text-align: center; margin: 36px 0 0; font-size: 0.92rem; }
.el-foot a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(207, 166, 80, 0.35); padding-bottom: 2px; }
.el-foot a:hover { color: var(--gold-lit); border-color: var(--gold-lit); }

/* ── 3. 정렬 ─────────────────────────────────────────── */
.formation { position: relative; height: 300vh; background: #070910; --fp: 0; }
.f-pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; grid-template-rows: auto 1fr; padding-top: calc(70px + var(--safe-t)); }
.f-pin::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 45% at 50% 62%, rgba(var(--tint-rgb), calc(0.08 + var(--fp) * 0.16)), transparent 70%);
  transition: background .3s linear;
}
.f-copy { position: relative; z-index: 2; text-align: center; padding: 0 var(--pad-x); }
.f-copy .eyebrow { display: inline-flex; font-family: var(--serif); font-size: 0.82rem; letter-spacing: 0.34em; color: var(--gold); margin-bottom: 14px; }
.f-cap { color: var(--text-2); font-size: clamp(0.92rem, 1.3vw, 1.06rem); margin: 16px auto 0; max-width: 34em; line-height: 1.7; opacity: calc(0.35 + var(--fp) * 0.65); }
.f-cap b { color: var(--gold-lit); font-family: var(--serif); }
.f-field { position: relative; width: min(100%, 1120px); margin: 0 auto; }
#f-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.f-col { position: absolute; left: 50%; top: 50%; width: 0; display: grid; justify-items: center; opacity: 0; transition: opacity .7s ease; }
.f-col .f-lb { white-space: nowrap; font-size: 0.78rem; letter-spacing: 0.22em; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.f-col .f-lb em { font-style: normal; font-size: 0.62rem; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: #1a1408; font-weight: 800; letter-spacing: 0; }
.formation.formed .f-col { opacity: 1; }
.f-hint { position: absolute; left: 0; right: 0; bottom: calc(22px + var(--safe-b, 0px)); text-align: center; font-size: 0.74rem; letter-spacing: 0.2em; color: rgba(245, 237, 217, 0.4); opacity: calc(1 - var(--fp) * 3); }
.f-hint i { display: block; width: 1px; height: 34px; margin: 0 auto 8px; background: linear-gradient(180deg, transparent, var(--gold)); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: scaleY(.4); transform-origin: top; opacity: .3; } 50% { transform: scaleY(1); opacity: 1; } }

/* ── 3b. 숫자 ────────────────────────────────────────── */
.facts { background: #070910; padding: 70px 0 84px; border-top: 1px solid rgba(207, 166, 80, 0.1); }
.facts-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.fact b { display: block; font-family: var(--serif); font-weight: 900; font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; color: #fffaf0; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.fact b span { color: var(--gold-lit); }
.fact > span { display: block; color: var(--text-2); font-size: 0.92rem; line-height: 1.6; max-width: 18em; }

/* 다섯 걸음 — 종이가 닦여 나오듯 */
.band.paper .walk-item[data-reveal] { clip-path: inset(0 100% 0 0); transform: none; opacity: 1; transition: clip-path .9s cubic-bezier(.2, .7, .2, 1); }
.band.paper .walk-item[data-reveal].in { clip-path: inset(0 0 0 0); }
.band.paper .walk-item.d1 { transition-delay: .08s; } .band.paper .walk-item.d2 { transition-delay: .16s; } .band.paper .walk-item.d3 { transition-delay: .24s; } .band.paper .walk-item.d4 { transition-delay: .32s; }

/* ── 4. 財曆 ─────────────────────────────────────────── */
.ledger { position: relative; background: var(--ink); }
.l-pin { position: sticky; top: 0; min-height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 34px; padding: calc(80px + var(--safe-t)) 0 60px; isolation: isolate; }
.l-pin::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 20% 30%, rgba(var(--tint-rgb), 0.12), transparent 70%), radial-gradient(40% 50% at 90% 90%, rgba(207, 166, 80, 0.14), transparent 70%); }
.l-head .eyebrow { display: inline-flex; font-family: var(--serif); font-size: 0.82rem; letter-spacing: 0.34em; color: var(--gold); margin-bottom: 14px; }
.l-head .big em { color: #ff8a74; }
.l-sub { margin: 16px 0 0; color: var(--text-2); font-size: clamp(0.96rem, 1.3vw, 1.08rem); }
.l-sub b { color: var(--gold-lit); font-family: var(--serif); }
.l-track { display: flex; gap: 16px; padding: 10px calc(var(--pad-x) + var(--safe-l)) 20px max(calc(var(--pad-x) + var(--safe-l)), calc((100vw - var(--stage)) / 2)); will-change: transform; width: max-content; }
.lc {
  position: relative; flex: none; width: clamp(224px, 22vw, 290px); min-height: 330px; border-radius: 24px; padding: 22px 20px 20px;
  background: linear-gradient(165deg, rgba(22, 27, 48, 0.9), rgba(11, 14, 26, 0.95)); border: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; flex-direction: column; gap: 8px; color: var(--text-2);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.lc .mo { font-family: var(--serif); font-weight: 900; font-size: 2.6rem; line-height: 1; color: #fffaf0; letter-spacing: -0.03em; }
.lc .mo small { font-size: 1rem; margin-left: 2px; color: var(--text-dim); }
.lc .hj { font-family: var(--serif); font-weight: 800; font-size: 1.2rem; letter-spacing: 0.14em; color: var(--gold-lit); }
.lc .kd { font-family: var(--serif); font-weight: 900; font-size: 1.28rem; color: #fffaf0; margin-top: 10px; }
.lc .ln { font-size: 0.92rem; line-height: 1.7; }
.lc .free { margin-top: auto; font-size: 0.78rem; letter-spacing: 0.06em; color: var(--k-chance, #5fd1a6); }
.lc.open { border-color: rgba(207, 166, 80, 0.55); background: linear-gradient(165deg, rgba(34, 38, 62, 0.95), rgba(14, 18, 34, 0.98)); box-shadow: 0 0 0 1px rgba(241, 220, 163, 0.25), 0 40px 80px -30px rgba(207, 166, 80, 0.5); }
.lc.open::after { content: '지금'; position: absolute; right: 16px; top: 16px; font-size: 0.7rem; letter-spacing: 0.16em; padding: 4px 9px; border-radius: 999px; background: var(--gold); color: #1a1408; font-weight: 800; }
.lc.locked .veil { filter: blur(5px); user-select: none; color: rgba(245, 237, 217, 0.55); }
.lc.locked .lk { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; letter-spacing: 0.1em; color: var(--text-dim); }
.lc.locked .lk i { width: 12px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; }
.lc.locked .lk i::before { content: ''; position: absolute; left: 2px; top: -6px; width: 5px; height: 6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.lc.locked::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 255, 255, 0.015) 14px 15px); pointer-events: none; }
.lc.intro, .lc.cta { justify-content: center; gap: 12px; }
.lc .k { font-family: var(--serif); font-size: 0.8rem; letter-spacing: 0.3em; color: var(--gold); }
.lc.intro b, .lc.cta b { font-family: var(--serif); font-weight: 900; font-size: 2rem; line-height: 1.18; color: #fffaf0; letter-spacing: -0.03em; }
.lc .d { font-size: 0.92rem; line-height: 1.65; }
.lc .d i { font-style: normal; color: var(--gold-lit); font-family: var(--serif); font-weight: 800; }
.lc .arrow { margin-top: 10px; font-size: 1.6rem; color: var(--gold); animation: arrow 1.6s ease-in-out infinite; }
@keyframes arrow { 50% { transform: translateX(8px); } }
.lc.cta { width: clamp(260px, 26vw, 340px); border-color: rgba(207, 166, 80, 0.6); background: linear-gradient(165deg, rgba(40, 32, 22, 0.96), rgba(16, 14, 20, 0.98)); box-shadow: 0 0 0 1px rgba(241, 220, 163, 0.3), 0 50px 100px -30px rgba(207, 166, 80, 0.55); }
.lc.cta .btn { margin-top: 8px; }
.lc.cta .btn b { font-family: var(--serif); font-size: 1.2em; }
.lc.cta .tiny { font-size: 0.76rem; color: var(--text-dim); line-height: 1.5; }
.ledger.at-end .lc.cta { animation: cta-pulse 2.4s ease-in-out infinite; }
@keyframes cta-pulse { 50% { box-shadow: 0 0 0 1px rgba(241, 220, 163, 0.5), 0 50px 110px -20px rgba(207, 166, 80, 0.8); } }
.l-bar { margin: 0 auto; width: min(60%, 520px); height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.l-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-lit)); transform-origin: left; transform: scaleX(0); }

/* ── 작은 화면 ───────────────────────────────────────── */
@media (max-width: 959px) {
  .sky-hero .sky-glyph { right: -14vw; top: 30%; font-size: 60vw; opacity: 0; }
  .el-stage { padding: 80px 0 70px; }
  .el-tile { border-radius: 14px; }
  .el-tile:hover, .el-tile.on { transform: translateY(-6px); }
  .facts { padding: 56px 0 64px; }
  .facts-row { grid-template-columns: 1fr 1fr; gap: 28px 18px; }
}
@media (max-width: 759px) {
  .ledger { height: auto !important; }
  .l-pin { position: static; min-height: 0; padding: 70px 0 50px; }
  .l-track {
    width: auto; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    padding-right: calc(var(--pad-x) + var(--safe-r)); scrollbar-width: none;
  }
  .l-track::-webkit-scrollbar { display: none; }
  .lc { scroll-snap-align: center; width: 78vw; min-height: 300px; }
  .lc.cta { width: 82vw; }
  .l-bar { display: none; }
  .l-head::after { content: '옆으로 밀어 보세요 →'; display: block; margin-top: 12px; font-size: 0.78rem; letter-spacing: 0.14em; color: var(--text-dim); }
}
@media (max-width: 559px) {
  .facts-row { grid-template-columns: 1fr 1fr; }
  .fact b { font-size: 2.2rem; }
  .el-tiles { gap: 6px; }
  .el-tile .nm { display: none; }
  .formation { height: 240vh; }
  .f-pin { padding-top: calc(64px + var(--safe-t)); }
}
