/* 원더시티 사전예약 — 연출 층(12-01 대표 "퍼블리싱 효과·연출·심미성"): 첫 화면 등장·빛 먼지, 읽은 만큼 금빛 줄,
   제목 줄 가림 올라오기, 카드 차례 등장·기울기, 종이 결, 편지지(봉투·우표·소인·마스킹테이프·손글씨·줄·접힌 자국)
   움직임 줄이기 설정이면 모두 멈춤(맨 아래) */

/* 종이 결: 화면 전체에 아주 옅은 잡결 */
body::after { content: ""; position: fixed; inset: 0; z-index: 99; pointer-events: none; opacity: .07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* 읽은 만큼 금빛 줄 */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 70; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* 첫 화면 등장 */
.motes { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero-shade { z-index: 1; }
.hero-in { z-index: 2; }
.hero-art img { transition: filter 1.8s ease; }
html.intro .hero-art img { filter: blur(14px) brightness(.6); }
.hero .reveal { transition-duration: 1.1s; }
.hero .logo-big.reveal { transform: translateY(-18px) scale(.92); filter: blur(10px); transition: opacity 1.2s ease .5s, transform 1.4s cubic-bezier(.16,1,.3,1) .5s, filter 1.2s ease .5s; }
.hero .logo-big.reveal.in { transform: none; filter: none; }
.hero .logo-big img { animation: float 6s ease-in-out 2s infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.hero .hero-line.reveal { transition-delay: 1s; }
.hero .hero-cta.reveal { transition-delay: 1.25s; }
.hero .hero-count.reveal { transition-delay: 1.4s; }

/* 금빛 단추: 가끔 빛이 한 번 스침 */
.btn-glow { position: relative; overflow: hidden; isolation: isolate; }
.btn-glow::after { content: ""; position: absolute; inset: -20% auto -20% -60%; width: 40%; z-index: -1; background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent); transform: skewX(-18deg); animation: sheen 5.5s ease-in-out 2.5s infinite; }
@keyframes sheen { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* 제목: 줄마다 가림 속에서 올라옴 */
.h2.split { opacity: 1; transform: none; }
.h2 .ln { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.h2 .ln > span { display: block; transform: translateY(105%); transition: transform 1s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--l, 0) * 110ms); }
.h2.in .ln > span { transform: none; }

/* 카드·목록: 차례로 등장 */
.stagger { transition-delay: calc(var(--i, 0) * 80ms); }
.reveal.stagger { transform: translateY(34px) scale(.98); }
.reveal.stagger.in { transform: none; }

/* 신기함 카드: 손 따라 기울고 빛이 비침(마우스 있는 화면만) */
@media (hover: hover) and (pointer: fine) {
  .w-img, .pick-card, .person { transform-style: preserve-3d; }
  .tilt-on { transition: transform .25s ease-out !important; }
  .w-img { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s cubic-bezier(.2,.8,.2,1), box-shadow .4s; }
  .w-img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,236,190,.38), transparent 55%); mix-blend-mode: soft-light; }
  .wonder:hover .w-img { box-shadow: 0 24px 50px -18px rgba(246,196,83,.35); }
  .wonder:hover .w-img::after { opacity: 1; }
}

/* 시민 제안 고리: 윗줄이 그어지며 등장 */
.loop li { border-top-color: transparent; }
.loop li::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s cubic-bezier(.16,1,.3,1); transition-delay: calc(var(--i, 0) * 140ms + .1s); }
.loop li.in::before { transform: scaleX(1); }

/* 추억: 큰 글 금빛이 한 번 흐름 */
.memory-big.in strong { background: linear-gradient(100deg, var(--gold) 40%, #fff4cf 50%, var(--gold) 60%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.6s ease .6s both; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ── 편지지 ── */
.maker { overflow: hidden; background: radial-gradient(ellipse 70% 55% at 50% 62%, #252b52 0%, var(--night) 70%); }
.desk { position: relative; margin: 36px auto 56px; max-width: 660px; perspective: 1400px; }
.envelope { position: absolute; z-index: 0; top: 10px; right: -170px; width: 430px; aspect-ratio: 1.62; border-radius: 4px;
  background: linear-gradient(160deg, #efe2c8, #e2d0ae); box-shadow: 0 30px 60px -20px rgba(0,0,0,.55), 0 2px 0 rgba(255,255,255,.4) inset;
  transform: rotate(9deg) translate(40px, 30px); opacity: 0; transition: transform 1.2s cubic-bezier(.16,1,.3,1), opacity .8s ease; }
.env-flap { position: absolute; inset: 0 0 auto; height: 58%; background: linear-gradient(180deg, #e6d5b5, #d9c39c); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; filter: drop-shadow(0 2px 2px rgba(0,0,0,.12)); }
.env-stamp { position: absolute; top: 16px; right: 18px; width: 78px; height: 96px; padding: 6px; background: #fffdf6;
  -webkit-mask: radial-gradient(circle 3.2px, transparent 96%, #000) -5px -5px / 10px 10px, linear-gradient(#000 0 0) 50% 50% / calc(100% - 9px) calc(100% - 9px) no-repeat;
          mask: radial-gradient(circle 3.2px, transparent 96%, #000) -5px -5px / 10px 10px, linear-gradient(#000 0 0) 50% 50% / calc(100% - 9px) calc(100% - 9px) no-repeat;
  transform: rotate(3deg); filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.env-stamp img { width: 100%; height: 72px; object-fit: cover; object-position: 50% 30%; }
.env-stamp i { display: block; font: 700 9px/1 var(--body); font-style: normal; letter-spacing: .2em; text-align: center; margin-top: 4px; color: var(--coral); }
.env-mark { position: absolute; top: 74px; right: 88px; width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(70, 52, 110, .55); display: grid; place-content: center; text-align: center; transform: rotate(-14deg); color: rgba(70, 52, 110, .7); }
.env-mark b { font: 700 9.5px/1.25 var(--body); letter-spacing: .02em; }
.env-mark small { font: 600 9px/1.4 var(--body); }
.env-waves { position: absolute; top: 52px; right: 150px; width: 90px; height: 34px; opacity: .45; transform: rotate(-14deg);
  background: repeating-linear-gradient(180deg, transparent 0 6px, rgba(70,52,110,.8) 6px 8px); -webkit-mask: linear-gradient(90deg, transparent, #000 35%); mask: linear-gradient(90deg, transparent, #000 35%); }
.env-to { position: absolute; left: 34px; bottom: 36px; font: 400 24px/1 "Nanum Pen Script", var(--serif); color: #3b3550; transform: rotate(-2deg); }

.letter { position: relative; z-index: 1; text-align: left; color: #2b2638;
  --fs: clamp(21px, 2.7vw, 25px); --lh: calc(var(--fs) * 1.62);
  padding: calc(var(--lh) * 2) clamp(26px, 6vw, 64px) calc(var(--lh) * 1.5) clamp(44px, 8vw, 88px);
  font: 400 var(--fs)/var(--lh) "Nanum Pen Script", var(--serif); letter-spacing: 0;
  background-color: #fbf6ea;
  background-image:
    linear-gradient(90deg, transparent calc(clamp(44px, 8vw, 88px) - 14px), rgba(217,85,60,.35) calc(clamp(44px, 8vw, 88px) - 14px), rgba(217,85,60,.35) calc(clamp(44px, 8vw, 88px) - 13px), transparent calc(clamp(44px, 8vw, 88px) - 13px)),
    repeating-linear-gradient(180deg, transparent 0 calc(var(--lh) - 1px), rgba(84, 122, 170, .22) calc(var(--lh) - 1px) var(--lh)),
    radial-gradient(ellipse at 30% 0%, rgba(255,255,255,.7), transparent 60%);
  background-origin: content-box, content-box, border-box; background-clip: border-box;
  background-position: 0 0, 0 calc(var(--fs) * -.36), 0 0;   /* 줄을 글씨 바로 밑으로 */
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 0 60px rgba(160,130,80,.12) inset, 0 40px 80px -30px rgba(0,0,0,.7), 0 12px 24px -12px rgba(0,0,0,.4);
  transform: translateY(70px) rotate(4deg) scale(.96); opacity: 0;
  transition: transform 1.4s cubic-bezier(.16,1,.3,1) .35s, opacity .9s ease .35s; }
/* 세 번 접었다 편 자국 */
.letter::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; mix-blend-mode: multiply; opacity: .9; transition: opacity 2.4s ease 1.2s;
  background: linear-gradient(180deg, transparent 32.6%, rgba(120,95,60,.10) 33.2%, rgba(255,255,255,.0) 33.4%, rgba(255,255,255,.55) 33.6%, transparent 35%, transparent 65.6%, rgba(120,95,60,.10) 66.2%, rgba(255,255,255,.55) 66.6%, transparent 68%); }
.letter::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .45 0 0 0 0 .3 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"); }
.letter p { margin: 0 0 var(--lh); position: relative; z-index: 1;
  -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 55%); mask-image: linear-gradient(90deg, #000 45%, transparent 55%);
  -webkit-mask-size: 240% 100%; mask-size: 240% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0;
  transition: -webkit-mask-position 1.6s ease, mask-position 1.6s ease; transition-delay: calc(1s + var(--i, 0) * .45s); }
.letter b { font-weight: 400; color: #2b2638; background: linear-gradient(180deg, transparent 58%, rgba(246,196,83,.65) 58%, rgba(246,196,83,.65) 92%, transparent 92%); padding: 0 2px; }
.letter .sign { margin: var(--lh) 0 0; text-align: right; font-size: 1.25em; transform: rotate(-2deg); }
.letter .date { display: block; font-size: .7em; opacity: .65; }
.tape { position: absolute; z-index: 2; top: -18px; left: 50%; width: 160px; height: 36px; margin-left: -80px; transform: rotate(-3deg);
  background: linear-gradient(180deg, rgba(255,255,255,.25), transparent 40%), repeating-linear-gradient(-45deg, rgba(246,196,83,.82) 0 9px, rgba(252,214,128,.82) 9px 18px);
  clip-path: polygon(0 0, 4% 12%, 0 25%, 4% 37%, 0 50%, 4% 62%, 0 75%, 4% 87%, 0 100%, 100% 100%, 96% 87%, 100% 75%, 96% 62%, 100% 50%, 96% 37%, 100% 25%, 96% 12%, 100% 0);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); opacity: 0; transition: opacity .4s ease 1.3s, transform .5s cubic-bezier(.3,1.6,.5,1) 1.3s; }

.desk.in .envelope { opacity: 1; transform: rotate(9deg); }
.desk.in .letter { opacity: 1; transform: rotate(-1.2deg); }
.desk.in .letter::before { opacity: .45; }
.desk.in .letter p { -webkit-mask-position: 0 0; mask-position: 0 0; }
.desk.in .tape { opacity: 1; transform: rotate(-4deg); }

@media (max-width: 820px) {
  .envelope { width: 300px; top: -96px; right: -40px; }
  .env-to { font-size: 19px; left: 22px; bottom: 22px; }
  .env-stamp { width: 60px; height: 76px; } .env-stamp img { height: 54px; }
  .env-mark { right: 56px; width: 70px; height: 70px; top: 22px; }
  .env-waves { display: none; }
  .desk { margin-top: 110px; }
}
@media (max-width: 640px) {
  .letter { --fs: 20px; padding-left: 40px; padding-right: 20px;
    background-image:
      linear-gradient(90deg, transparent 26px, rgba(217,85,60,.35) 26px 27px, transparent 27px),
      repeating-linear-gradient(180deg, transparent 0 calc(var(--lh) - 1px), rgba(84, 122, 170, .22) calc(var(--lh) - 1px) var(--lh)),
      radial-gradient(ellipse at 30% 0%, rgba(255,255,255,.7), transparent 60%);
    background-origin: border-box, content-box, border-box; }
}

/* 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
  .motes, .btn-glow::after { display: none; }
  html.intro .hero-art img { filter: none; }
  .hero .logo-big.reveal, .hero .logo-big img { transform: none; filter: none; animation: none; transition: none; }
  .h2 .ln > span, .loop li::before { transform: none; transition: none; }
  .envelope, .letter, .tape { opacity: 1; transition: none; }
  .envelope { transform: rotate(9deg); } .letter { transform: rotate(-1.2deg); }
  .letter p { -webkit-mask-image: none; mask-image: none; }
  .memory-big.in strong { animation: none; background: none; color: var(--gold); }
}
