/* 프로젝트 페이지 — Pancake Tycoon */

/* 첫 화면 */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 24px; padding: 110px var(--gutter) 80px; overflow: hidden;
  background: radial-gradient(circle at 75% 55%, rgba(255, 200, 61, .16), transparent 55%), var(--ink); }
.title { margin: 18px 0 0; font-family: var(--display); font-weight: 900; font-size: clamp(48px, 8.4vw, 136px); line-height: .92; letter-spacing: -.03em; display: flex; flex-direction: column; }
.title .y { color: var(--butter); }
.tagline { margin: 26px 0 0; font-size: clamp(16px, 1.6vw, 21px); color: var(--text-2); max-width: 30em; word-break: keep-all; }
.chips { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-family: var(--mono); font-size: 12px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--text-2); }
.hero-art { --mx: 0; --my: 0; position: relative; aspect-ratio: 1; width: min(100%, 560px); justify-self: center; }
.hero-art .ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 24s linear infinite; }
.hero-art .ring text { font-family: var(--mono); font-size: 9.4px; letter-spacing: 2px; fill: var(--text-3); }
@keyframes spin { to { transform: rotate(360deg); } }
.stack { position: absolute; left: 50%; top: 72%; width: 58%; transform: translate(-50%, -50%) translate(calc(var(--mx) * -14px), calc(var(--my) * -8px)); }
.stack i { position: absolute; left: 0; right: 0; height: 0; padding-bottom: 30%; border-radius: 50%; top: 0; margin-top: calc(var(--j) * -6%);
  background: radial-gradient(ellipse at 45% 35%, #ffd98a, #e59a3a 70%); box-shadow: 0 7px 0 #b86a22; animation: drop .8s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(.2s + var(--j) * .12s); }
.stack .butter { position: absolute; left: 41%; width: 18%; height: 0; padding-bottom: 9%; top: 0; margin-top: calc(-18% - 4%); background: #fff1a8; border-radius: 4px; transform: rotate(-8deg) skewX(-14deg); box-shadow: 0 4px 0 #e9c64a; animation: drop .8s cubic-bezier(.3, 1.4, .5, 1) .8s both; }
@keyframes drop { from { transform: translateY(-260%); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-art .duck { position: absolute; left: 50%; top: 10%; width: 46%; transform: translateX(-50%) translate(calc(var(--mx) * 22px), calc(var(--my) * 14px)) rotate(calc(var(--mx) * 8deg)); filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .35)); animation: duckIn 1s cubic-bezier(.3, 1.5, .5, 1) 1s both, float 3.2s ease-in-out 2s infinite; }
@keyframes duckIn { from { translate: 0 -120%; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes float { 50% { translate: 0 -3%; } }
.hero-down { position: absolute; left: var(--gutter); bottom: 28px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; }
.bob { display: inline-block; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* 하루 스크롤 */
.story .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(20px, 4vw, 64px); padding: 90px var(--gutter) 40px; }
.story { --c: var(--butter); }
.story[data-step="1"] { --c: #ff9a3d; }
.story[data-step="2"] { --c: var(--mint); }
.story[data-step="3"] { --c: #8fd16a; }
.story[data-step="4"] { --c: var(--berry); }
.story[data-step="5"] { --c: var(--lilac); }
.story-visual { position: relative; aspect-ratio: 1; width: min(100%, 72vh); justify-self: center; }
.story-visual .disc { position: absolute; inset: 6%; border-radius: 50%; background: var(--c); transition: background .7s var(--ease), transform .7s var(--ease); transform: scale(calc(.92 + var(--sp-local, 0) * .08)); }
.big-no { position: absolute; left: -2%; top: -4%; height: 1.05em; overflow: hidden; font-family: var(--display); font-weight: 900; font-size: clamp(56px, 9vw, 140px); line-height: 1.05; color: var(--text); mix-blend-mode: difference; z-index: 3; }
.big-no span { display: block; transform: translateY(calc(var(--step, 0) * -100%)); transition: transform .7s var(--ease); }
.story-duck { position: absolute; width: 34%; left: 33%; top: 30%; z-index: 4; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .3)); transition: left .8s var(--ease), top .8s var(--ease), width .8s var(--ease), transform .8s var(--ease); }
.story[data-step="0"] .story-duck { left: 18%; top: 34%; transform: rotate(-6deg); }
.story[data-step="1"] .story-duck { left: 44%; top: 10%; width: 30%; transform: rotate(14deg); }
.story[data-step="2"] .story-duck { left: 8%; top: 46%; transform: scaleX(-1) rotate(-10deg); }
.story[data-step="3"] .story-duck { left: 52%; top: 44%; width: 30%; transform: rotate(4deg); }
.story[data-step="4"] .story-duck { left: 12%; top: 52%; width: 28%; transform: rotate(-4deg); }
.story[data-step="5"] .story-duck { left: 36%; top: 54%; width: 26%; transform: scaleX(-1); }

.props { position: absolute; inset: 0; z-index: 2; }
.prop { position: absolute; inset: 0; opacity: 0; transform: scale(.85) rotate(-6deg); transition: opacity .5s, transform .7s var(--ease); }
.story[data-step="0"] .p0, .story[data-step="1"] .p1, .story[data-step="2"] .p2, .story[data-step="3"] .p3, .story[data-step="4"] .p4, .story[data-step="5"] .p5 { opacity: 1; transform: none; }
.prop i { position: absolute; display: block; }
.receipt { left: 52%; top: 18%; width: 28%; height: 52%; background: #fffdf6; border-radius: 4px 4px 0 0; transform: translateY(calc((1 - var(--sp-local, 0)) * -20%)) rotate(4deg);
  background-image: repeating-linear-gradient(180deg, transparent 0 14%, rgba(13, 8, 22, .18) 14% 16%); background-size: 70% 100%; background-position: 50% 30%; background-repeat: no-repeat;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 94% no-repeat, radial-gradient(circle at 50% 0, transparent 40%, #000 42%) bottom / 10% 6% repeat-x; mask: linear-gradient(#000 0 0) top / 100% 94% no-repeat, radial-gradient(circle at 50% 0, transparent 40%, #000 42%) bottom / 10% 6% repeat-x; }
.pan { left: 14%; top: 54%; width: 60%; height: 26%; border-radius: 50%; background: #2a2233; box-shadow: 0 10px 0 #1c1624; }
.pan::before { content: ""; position: absolute; left: 92%; top: 40%; width: 50%; height: 14%; background: #1c1624; border-radius: 6px; transform: rotate(8deg); }
.pan::after { content: ""; position: absolute; inset: 18% 20%; border-radius: 50%; background: radial-gradient(ellipse at 45% 40%, #ffd98a, #e59a3a); transform: translateY(calc(sin(var(--sp-local, 0) * 3.14159rad) * -120%)) scaleY(calc(cos(var(--sp-local, 0) * 6.28318rad))); }
.knife { left: 30%; top: 30%; width: 44%; height: 7%; background: linear-gradient(90deg, #6b5a7d 0 28%, #e9e6f2 28%); border-radius: 2px 40% 40% 2px; transform: rotate(calc(-30deg + var(--sp-local, 0) * 60deg)); transform-origin: 20% 50%; }
.fruit { width: 13%; height: 13%; border-radius: 50%; background: var(--berry); }
.fruit.a { left: 62%; top: 20%; } .fruit.b { left: 72%; top: 38%; background: #ffd34d; } .fruit.c { left: 58%; top: 56%; background: #8fd16a; }
.prop.p2 .fruit { transform: translateY(calc(var(--sp-local, 0) * -40%)); }
.egg { width: 14%; height: 18%; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%; background: #fffaf0; }
.egg.a { left: 16%; top: 30%; } .egg.b { left: 28%; top: 22%; transform: rotate(14deg); }
.milk { left: 20%; top: 46%; width: 14%; height: 26%; border-radius: 8px 8px 6px 6px; background: linear-gradient(#fff 0 62%, #5ab0ff 62%); }
.milk::before { content: ""; position: absolute; left: 25%; top: -16%; width: 50%; height: 18%; background: #fff; border-radius: 3px; }
.sign { left: 50%; top: 18%; width: 34%; height: 18%; perspective: 400px; }
.sign span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: clamp(12px, 2.2vw, 30px); border-radius: 8px; backface-visibility: hidden; transition: transform .8s var(--ease); }
.sign span:first-child { background: #fffdf6; color: var(--berry); transform: rotateY(calc(var(--sp-local, 0) * 180deg)); }
.sign span:last-child { background: var(--ink); color: var(--butter); transform: rotateY(calc(var(--sp-local, 0) * 180deg - 180deg)); }
.moon { left: 56%; top: 14%; width: 22%; height: 22%; border-radius: 50%; box-shadow: inset -14px 6px 0 0 #fffbe6; transform: rotate(calc(var(--sp-local, 0) * 30deg)); }

.story-steps { position: relative; display: flex; flex-direction: column; gap: 18px; }
.steps { position: relative; min-height: 300px; }
.steps article { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(30px); transition: opacity .5s var(--ease), transform .6s var(--ease); pointer-events: none; }
.steps article.on { opacity: 1; transform: none; pointer-events: auto; }
.steps .k { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--c); transition: color .5s; }
.steps h2 { margin: 10px 0 0; font-family: var(--kr-display); font-weight: 400; font-size: clamp(40px, 5.6vw, 88px); line-height: 1.02; }
.steps p { margin: 18px 0 0; font-size: clamp(15px, 1.4vw, 19px); color: var(--text-2); max-width: 26em; word-break: keep-all; }
.dots { display: flex; gap: 8px; }
.dots i { width: 22px; height: 3px; border-radius: 3px; background: var(--line-2); transition: background .4s, width .4s var(--ease); }
.story[data-step="0"] .dots i:nth-child(1), .story[data-step="1"] .dots i:nth-child(2), .story[data-step="2"] .dots i:nth-child(3),
.story[data-step="3"] .dots i:nth-child(4), .story[data-step="4"] .dots i:nth-child(5), .story[data-step="5"] .dots i:nth-child(6) { background: var(--c); width: 44px; }

/* 정보 */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.fact { padding: 36px var(--gutter); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fact:last-child { border-right: 0; }
.fact span { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--text-3); text-transform: uppercase; }
.fact b { font-size: clamp(17px, 1.6vw, 22px); }
.fact small { color: var(--text-3); font-size: 13px; }

.credits, .next { padding: 90px var(--gutter) 0; }
.credits ul { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.credits li { border-top: 1px solid var(--line-2); padding-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.credits b { font-size: 20px; }
.credits span { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.next-row { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nx { border: 1px dashed var(--line-2); border-radius: 22px; padding: 26px 24px; display: flex; flex-direction: column; gap: 4px; cursor: not-allowed; color: var(--text-3); }
.nx span { font-family: var(--mono); font-size: 12px; }
.nx b { font-family: var(--display); font-size: clamp(22px, 2.6vw, 36px); font-weight: 900; color: var(--text-2); }
.nx em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }

.cta { padding: 16vh var(--gutter) 14vh; display: flex; flex-direction: column; gap: 28px; }
.cta h2 { margin: 0; font-family: var(--kr-display); font-weight: 400; font-size: clamp(52px, 10vw, 160px); line-height: .98; }
.cta .y { color: var(--butter); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* 플레이 영상 */
.gameplay { padding: 110px var(--gutter) 60px; }
.gp-title, .gal-title { margin: 14px 0 0; font-family: var(--kr-display); font-weight: 400; font-size: clamp(36px, 5.4vw, 80px); line-height: 1.04; }
.vframe { position: relative; margin: 32px auto 0; width: min(100%, calc(78vh * 16 / 9)); aspect-ratio: 16 / 9; border-radius: 26px; overflow: hidden; border: 1px solid var(--line-2); background: var(--ink-2); box-shadow: 0 40px 80px -30px rgba(255, 200, 61, .25); }
.vframe video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slides img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 1s var(--ease), transform 4.2s linear; }
.slides img.on { opacity: 1; transform: scale(1); }
.vtag { position: absolute; left: 18px; top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; padding: 6px 12px; border-radius: 999px; background: rgba(13, 8, 22, .65); backdrop-filter: blur(6px); color: var(--text); }
.vbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(13, 8, 22, .4); }
.vbar i { display: block; height: 100%; width: calc((var(--slide, 0) + 1) / 8 * 100%); background: var(--butter); transition: width .6s var(--ease); }

/* 스크린샷 가로 흐름 */
.gal-stage { justify-content: center; gap: 30px; }
.gal-track { display: flex; gap: clamp(14px, 2vw, 28px); width: max-content; will-change: transform; }
.shot { margin: 0; width: clamp(280px, 46vw, 720px); flex: none; cursor: zoom-in; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); transition: transform .6s var(--ease), border-color .3s; }
.shot:hover img { transform: translateY(-6px); border-color: var(--butter); }
.shot figcaption { margin-top: 12px; display: flex; gap: 10px; align-items: baseline; color: var(--text-2); font-size: 14px; }
.shot figcaption span { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.crew-progress { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; flex: none; }
.crew-progress i { display: block; height: 100%; width: 100%; background: var(--butter); transform-origin: left; transform: scaleX(0); }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(13, 8, 22, .92); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.lightbox .rb { position: absolute; right: 20px; top: 20px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(13, 8, 22, .6); cursor: pointer; }
.lightbox .lb-prev, .lightbox .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 18px; }
.lightbox .lb-prev { left: 20px; right: auto; }
.lightbox .lb-next { right: 20px; }
.lightbox .rb:hover { background: var(--text); color: var(--ink); }
.shot:focus-visible { outline: 2px solid var(--butter); outline-offset: 6px; border-radius: 18px; }

/* 세계관 */
.world .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(20px, 4vw, 64px); padding: 90px var(--gutter) 40px; }
.world-art { position: relative; aspect-ratio: 1; width: min(100%, 66vh); justify-self: center; }
.world-art > div { position: absolute; inset: 0; opacity: 0; transform: scale(.8); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.world[data-wstep="0"] .w-grid, .world[data-wstep="1"] .w-duck, .world[data-wstep="2"] .w-tri, .world[data-wstep="3"] .w-mix { opacity: 1; transform: none; }
.w-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6%; padding: 8%; }
.w-grid i { border-radius: 50%; background: var(--lilac); opacity: .85; animation: breathe 3s ease-in-out infinite; animation-delay: calc(var(--n, 0) * .1s); }
.w-grid i:nth-child(odd) { background: var(--butter); }
.w-grid i:nth-child(3n) { background: var(--berry); }
@keyframes breathe { 50% { transform: scale(.86); } }
.w-duck { display: grid; place-items: center; }
.w-duck::before { content: ""; position: absolute; inset: 8%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe3a6, #ffb547 75%); }
.w-duck img { position: relative; width: 52%; animation: float 3.2s ease-in-out infinite; }
.w-tri b { position: absolute; left: 22%; top: 22%; width: 56%; height: 56%; background: var(--butter); clip-path: polygon(50% 4%, 96% 92%, 4% 92%); animation: wobble 2.6s ease-in-out infinite; }
.w-tri i { position: absolute; inset: 12%; border-radius: 50%; border: 3px dashed var(--berry); animation: spin 18s linear infinite; }
@keyframes wobble { 50% { transform: rotate(-6deg) translateY(-3%); } }
.w-mix i { position: absolute; width: 34%; height: 34%; animation: float 3.4s ease-in-out infinite; }
.w-mix .c { left: 12%; top: 14%; border-radius: 50%; background: var(--lilac); }
.w-mix .t { right: 10%; top: 10%; background: var(--butter); clip-path: polygon(50% 0, 100% 100%, 0 100%); animation-delay: .4s; }
.w-mix .s { left: 16%; bottom: 12%; border-radius: 14%; background: var(--mint); transform: rotate(12deg); animation-delay: .8s; }
.w-mix .r { right: 12%; bottom: 14%; background: var(--berry); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); animation-delay: 1.2s; }
.w-lines { position: relative; min-height: 320px; margin-top: 18px; }
.w-lines article { position: absolute; inset: 0 0 auto 0; opacity: 0; transform: translateY(30px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.w-lines article.on { opacity: 1; transform: none; }
.w-lines .k { font-family: var(--display); font-weight: 900; font-size: 14px; color: var(--butter); }
.w-lines h2 { margin: 10px 0 0; font-family: var(--kr-display); font-weight: 400; font-size: clamp(34px, 4.6vw, 72px); line-height: 1.08; word-break: keep-all; }
.w-lines h2 .y { color: var(--butter); }
.w-lines p { margin: 18px 0 0; font-size: clamp(15px, 1.4vw, 19px); color: var(--text-2); max-width: 26em; word-break: keep-all; }
.w-lines q { color: var(--text); font-weight: 700; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 96px; }
  .hero-art { width: min(80vw, 420px); order: -1; }
  .story .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; padding-top: 76px; gap: 10px; }
  .story-visual { width: min(78vw, 42vh); }
  .steps { min-height: 220px; }
  .steps h2 { font-size: clamp(32px, 9vw, 52px); }
  .steps p { margin-top: 10px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(2) { border-right: 0; }
  .fact:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .credits ul { grid-template-columns: 1fr 1fr; }
  .next-row { grid-template-columns: 1fr; }
  .gameplay { padding-top: 80px; }
  .world .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; padding-top: 76px; gap: 10px; }
  .world-art { width: min(70vw, 36vh); }
  .w-lines { min-height: 260px; }
  .vframe { border-radius: 16px; }
  .shot { width: 78vw; }
}
@media (max-width: 520px) {
  .nav .links a[href="#video"], .nav .links a[href="#world"] { display: none; }
}

/* 웹 체험판 */
.try-sub { margin: 16px 0 0; max-width: 640px; color: var(--text-2, #c9bfdc); line-height: 1.6; }
.playframe .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.45) saturate(.9); }
.playframe .play-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 16px; }
.playframe .play-cover .btn { font-size: 18px; padding: 16px 28px; }
.playframe .play-note { font-family: var(--mono, monospace); font-size: 12px; color: var(--text, #f6f1ff); opacity: .8; }
.playframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.playframe.playing .poster, .playframe.playing .play-cover { display: none; }
.playframe .play-fs { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(13, 8, 22, .7); color: var(--text, #f6f1ff); font-size: 18px; cursor: pointer; }
.playframe .play-fs:hover { background: var(--text, #f6f1ff); color: var(--ink, #0d0816); }
/* 전체 화면 — 진짜 전체 화면(:fullscreen)과, 그게 안 되는 iPhone 용 가짜 전체 화면(.fake-fs) */
.playframe:fullscreen { border-radius: 0; border: 0; background: #000; }
.playframe.fake-fs { position: fixed; inset: 0; z-index: 120; width: 100%; height: 100%; height: 100dvh; margin: 0; aspect-ratio: auto; border-radius: 0; border: 0; transform: none !important; opacity: 1 !important; background: #000; }
.playframe .rotate-hint { display: none; position: absolute; inset: 0; z-index: 3; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(13, 8, 22, .92); color: var(--text, #f6f1ff); font-size: 16px; text-align: center; padding: 24px; pointer-events: none; }
.playframe .rotate-hint b { font-size: 44px; line-height: 1; animation: rot-hint 1.6s var(--ease) infinite; }
@keyframes rot-hint { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) {
  .playframe.full .rotate-hint { display: flex; }
}
