/* 첫 진입의 한 번: 사진의 현상, 종이의 펼침, 두 사람의 만남을 각 표지의 소재로 표현한다.
   backwards만 채워 재생 뒤에는 원래 사진 위치·회전·색감과 편집 동작으로 돌려준다. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes cover-fade { from { opacity: 0; } }
  @keyframes cover-lift { from { opacity: 0; transform: translateY(14px); } }
  @keyframes cover-settle { from { opacity: 0; } }
  @keyframes cover-press { from { opacity: 0; scale: 1.12; } }
  @keyframes cover-left { from { opacity: 0; transform: translateX(-14px); } }
  @keyframes cover-right { from { opacity: 0; transform: translateX(14px); } }
  @keyframes cover-unroll { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
  @keyframes cover-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
  @keyframes cover-develop { from { opacity: 0; filter: saturate(0) brightness(1.65); } }

  /* 미니멀: 여백을 움직이지 않고 사진과 이름만 천천히 스민다. */
  [data-design="minimal"] .hero-img { animation: cover-fade 1.8s .1s ease backwards; }
  [data-design="minimal"] .hero-title-box { animation: cover-fade 1.2s .45s ease backwards; }

  /* 필름 다크: 밝은 인화지에서 원래의 필름 색감으로 현상한다. */
  [data-design="filmdark"] .hero-img { animation: cover-develop 1.8s .1s ease backwards; }
  [data-design="filmdark"] .hero-overlay > div:last-child { animation: cover-fade 1s .65s ease backwards; }

  /* 에디토리얼: 큰 활자와 사진이 인쇄 방향을 따라 차례로 열린다. */
  [data-design="editorial"] .hero-title-box::before { animation: cover-unroll .9s .1s cubic-bezier(.2,.7,.2,1) backwards; }
  [data-design="editorial"] .hero-img { animation: cover-wipe 1.1s .35s cubic-bezier(.2,.7,.2,1) backwards; }

  /* 클래식 아치: 액자의 윤곽을 그대로 두고 사진을 조용히 올려놓는다. */
  [data-design="arch"] .hero-img { animation: cover-lift 1.6s .1s cubic-bezier(.2,.7,.2,1) backwards; }
  [data-design="arch"] .hero-eyebrow { animation: cover-fade 1.2s .2s ease backwards; }

  /* 모노 라인: 사진을 가로로 긋고, 그 아래 이름을 조판한다. */
  [data-design="monoline"] .hero-img { animation: cover-wipe 1.2s .1s cubic-bezier(.4,0,.2,1) backwards; }
  [data-design="monoline"] .hero-korean-names { animation: cover-lift .9s .45s ease backwards; }

  /* 한지 여백: 세로 두루마리처럼 사진이 열리고 마지막에 혼인 인장을 누른다. */
  [data-design="hanji"] .hero-img { animation: cover-unroll 1.6s .1s cubic-bezier(.4,0,.2,1) backwards; }
  [data-design="hanji"] .hero-korean-names { animation: cover-fade 1.2s .3s ease backwards; }
  [data-design="hanji"] .hero-section::after { animation: cover-press .5s 1.1s ease-out backwards; }

  /* 미드센추리: 둥근 사진과 작은 해가 색면 위에 차례로 앉는다. */
  [data-design="midcentury"] .hero-img { animation: cover-settle 1.3s .1s cubic-bezier(.2,.7,.2,1) backwards; }
  [data-design="midcentury"] .hero-section::before { animation: cover-settle .9s .45s ease-out backwards; }

  /* 백자개: 사진과 양쪽 자개 꽃에 차례로 빛이 든다. */
  :is([data-design="nacre"]) .hero-img { animation: cover-fade 1.8s .1s ease backwards; }
  :is([data-design="nacre"]) .hero-section::before { animation: cover-fade 1.3s .35s ease backwards; }
  :is([data-design="nacre"]) .hero-section::after { animation: cover-fade 1.3s .6s ease backwards; }

  /* 모던 카드: 도록의 사진이 위에서 아래로 열리는 한 번. */
  [data-design="card"] .hero-img { animation: cover-unroll 1.3s .1s cubic-bezier(.2,.7,.2,1) backwards; }
  [data-design="card"] .hero-korean-names { animation: cover-fade 1s .2s ease backwards; }

  /* 인장: 표지의 음각을 한 번 누른다. 붉은 인주는 기존처럼 마무리에만 쓴다. */
  [data-design="seal"] .hero-korean-names { animation: cover-fade 1.1s .1s ease backwards; }
  [data-design="seal"] .hero-title-box .mark { animation: cover-press .7s .55s cubic-bezier(.2,.7,.2,1) backwards; }

  /* 두 선: 두 사람의 이름이 가까워진 뒤 연표의 스크롤 흐름으로 이어진다. */
  [data-design="lines"] .lines-title { animation: cover-lift 1.1s .1s ease-out backwards; }
  [data-design="lines"] .hero-korean-names > :first-child { animation: cover-left 1.2s .3s ease-out backwards; }
  [data-design="lines"] .hero-korean-names > :last-child { animation: cover-right 1.2s .3s ease-out backwards; }

}

/* 표지 사진 색감·등장 (invitationData.coverTone·coverIn → html[data-cover-*]): 고르면 테마의 사진 연출 대신 쓴다.
   편집 중(.pv)에는 빌더에서 바꾼 순간(body.cover-in-play)만 한 번 튼다. */
/* 색감: invite.js가 --cover-tone(1번 사진)·--cover-tone2~4(여러 장 표지의 2~4번째)에 아래 --tone-* 하나를 넣는다 */
:root { --tone-original: none; --tone-bw: grayscale(1) contrast(1.05); --tone-film: saturate(.75) sepia(.14) contrast(1.06); --tone-warm: sepia(.22) saturate(1.12) brightness(1.03); --tone-soft: saturate(.8) contrast(.92) brightness(1.06);
  --tone-kodak: url(#lut-kodak); --tone-cine: url(#lut-cine); --tone-matte: url(#lut-matte); } /* 필름 LUT: Maji.FILM_LUTS를 invite.js가 SVG 필터로 심는다 */
html[data-cover-tone] .hero-img,
html[data-cover-tone]:is([data-design="fade"], [data-design="line"]) [data-anchor="greeting"]::after,
html[data-cover-tone]:is([data-design="fade"], [data-design="line"]) .inv-footer::before { filter: var(--cover-tone); }
/* Maji.PHOTO_FRAMES의 '표지 사진 2~4' 칸: 칸마다 */

html[data-cover-tone2]:is([data-design="reel"], [data-design="kinetic"], [data-design="cinema"], [data-design="opening"], [data-design="collage"], [data-design="phone"], [data-design="vhs"], [data-design="bloom"], [data-design="news"], [data-design="projector"], [data-design="seasons"], [data-design="ribbon"], [data-design="envelope"], [data-design="frame"], [data-design="verse"]) .hero-overlay::before { filter: var(--cover-tone2); }
html[data-cover-tone]:is([data-design="kinetic"], [data-design="cinema"], [data-design="opening"], [data-design="collage"], [data-design="phone"], [data-design="vhs"], [data-design="bloom"], [data-design="news"], [data-design="projector"], [data-design="seasons"], [data-design="ribbon"], [data-design="envelope"], [data-design="frame"], [data-design="verse"]) .hero-overlay .mark { filter: var(--cover-tone); } /* kinetic은 움직일 때 표지 사진도 무대 안의 층으로 그린다 */

html[data-cover-tone3]:is([data-design="reel"], [data-design="kinetic"], [data-design="cinema"], [data-design="opening"], [data-design="collage"], [data-design="phone"], [data-design="vhs"], [data-design="bloom"], [data-design="news"], [data-design="projector"], [data-design="seasons"], [data-design="ribbon"], [data-design="envelope"], [data-design="frame"], [data-design="verse"]) .hero-overlay::after { filter: var(--cover-tone3); }

/* 갤러리·본문 사진 색감 (invitationData.photoTone → html[data-photo-tone]): 표지와 같은 --tone-*를 쓴다 */
html[data-photo-tone] :is(.gallery-item img, #lightbox-img, .story-photo, .sec-photo, .sec-photos img) { filter: var(--photo-tone); }
/* 등장: invite.js가 사진마다 --cover-in(메인)·--cover-in2~4(여러 장 표지의 2~4번째)에 아래 --in-* 하나를 넣는다. 테마처럼 0.2초씩 늦게 차례로 */
:root { --in-fade: cover-fade 1.8s ease backwards; --in-lift: cover-lift 1.6s cubic-bezier(.2,.7,.2,1) backwards; --in-develop: cover-develop 1.8s ease backwards; --in-unroll: cover-unroll 1.6s cubic-bezier(.4,0,.2,1) backwards; --in-none: none; }
@media (prefers-reduced-motion: no-preference) {
  html[data-cover-in]:not(.thumb-mode) body:is(:not(.pv), .cover-in-play) .hero-img { animation: var(--cover-in) !important; animation-delay: .1s !important; }
  /* Maji.PHOTO_FRAMES의 '표지 사진 2~4' 칸 */

}

/* 정지 썸네일은 지연 구간의 빈 사진 대신 완성된 표지를 보여준다. 편집 중에는 기존 .pv 규칙이 끈다. */
html.thumb-mode :is(.hero-section, .hero-section *),
html.thumb-mode :is(.hero-section, .hero-section *)::before,
html.thumb-mode :is(.hero-section, .hero-section *)::after { animation: none !important; }
