/* ── tokens ─────────────────────────────── */
:root {
  --night: #100a12;
  --night-2: #23141f;
  --champagne: #f3e3c3;
  --gold: #c9a063;
  --gold-deep: #8a6634;
  --paper: #f7efec;
  --mat: #fffcf9;
  --ink: #2e1a24;
  --berry: #7a2348;
  --muted: #7a5d6b;
  --pale: #f4e9ec;

  --foil: linear-gradient(105deg, #9c7640 0%, #e9cf9b 20%, #fff4d8 32%, #d6ae6c 50%, #f3dfb2 68%, #a07a43 86%, #e6c98f 100%);

  --serif: "Gowun Batang", "Noto Serif KR", "AppleMyungjo", serif;
  --hand: "Nanum Pen Script", "Gowun Batang", cursive;
  --num: "Cormorant Garamond", "Gowun Batang", serif;

  --shadow-photo:
    0 1px 1px rgba(46, 26, 36, 0.08),
    0 6px 12px -4px rgba(46, 26, 36, 0.12),
    0 24px 48px -18px rgba(46, 26, 36, 0.38);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-io: cubic-bezier(0.7, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-dark { background: var(--night); }
body { overflow: hidden; height: 100%; }
html { height: 100%; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.hand { font-family: var(--hand); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 8px; }

.foil {
  background: var(--foil);
  background-size: 220% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* fine paper grain on the lit page */
body:not(.is-dark)::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.5;
  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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .2 0 0 0 0 .22 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── buttons ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 28px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 15.5px; letter-spacing: 0.04em;
  background: none;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn--gold {
  color: var(--champagne);
  border-color: rgba(201, 160, 99, 0.55);
  background: linear-gradient(180deg, rgba(243, 227, 195, 0.07), rgba(243, 227, 195, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 244, 216, 0.12);
}
@media (hover: hover) { .btn--gold:hover { border-color: var(--gold); box-shadow: inset 0 1px 0 rgba(255, 244, 216, 0.2), 0 0 24px -6px rgba(201, 160, 99, 0.5); } }
.btn--gold[aria-busy="true"] { border-color: var(--champagne); color: #fff4d8; }
.btn--line { color: var(--ink); border-color: rgba(138, 102, 52, 0.45); }
@media (hover: hover) { .btn--line:hover { border-color: var(--gold-deep); background: rgba(201, 160, 99, 0.08); } }

.round-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(138, 102, 52, 0.35); background: var(--mat);
  color: var(--ink);
  box-shadow: 0 6px 16px -10px rgba(46, 26, 36, 0.4);
  transition: border-color 0.2s, transform 0.15s;
}
@media (hover: hover) { .round-btn:hover { border-color: var(--gold-deep); } }
.round-btn:active { transform: scale(0.94); }

/* ── gate ───────────────────────────────── */
.gate {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center; padding: 24px;
  background: var(--night); color: var(--champagne);
}
.gate__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; width: min(100%, 340px); text-align: center; justify-items: center; }
.gate__form > * { width: 100%; }
.gate__mark { width: 14px !important; height: 22px; color: var(--gold); margin-bottom: 4px; }
.gate__to { margin: 0; font-family: var(--hand); font-size: 30px; line-height: 1.1; color: var(--gold); }
.gate__q { font-size: 18px; line-height: 1.6; color: rgba(243, 227, 195, 0.85); word-break: keep-all; }
.gate__input {
  font: inherit; font-family: var(--num); font-size: 28px; text-align: center; letter-spacing: 0.3em;
  width: 100%; min-width: 0; min-height: 60px; border-radius: 14px; -webkit-appearance: none; appearance: none;
  border: 1px solid rgba(201, 160, 99, 0.45);
  background: rgba(243, 227, 195, 0.05); color: var(--champagne);
}
.gate__input:focus { outline: none; border-color: var(--gold); }
.gate__error { margin: 0; color: #f1b3c6; font-size: 15px; }

/* ── intro ──────────────────────────────── */
.intro {
  position: fixed; inset: 0; z-index: 10;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: max(24px, calc(env(safe-area-inset-top) + 12px)) 24px max(22px, env(safe-area-inset-bottom));
  background: #0a0305;
  color: var(--champagne);
  text-align: center;
  overflow: hidden;
}
.dust { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: 0.7; transition: opacity 1.4s; }
.is-out .dust { opacity: 0.25; }

.intro__text { position: relative; z-index: 3; align-self: start; padding-top: 4svh; pointer-events: none; }
.intro__to { margin: 0 0 4px; font-size: 32px; line-height: 1.2; color: var(--gold); }
.intro__title {
  margin: 0;
  font-weight: 700;
  font-size: min(18vw, 128px, 9.6svh);
  line-height: 1.04;
  letter-spacing: -0.035em;
  filter: drop-shadow(0 0 28px rgba(233, 190, 110, 0.18)) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
  transition: filter 1.4s, opacity 1.4s;
}
.intro__title .foil { animation: sheen 5s 0.6s var(--ease-io) both; }
.is-out .intro__title { opacity: 0.6; }
@keyframes sheen { from { background-position: 100% 50%; } to { background-position: 0% 50%; } }

/* candle stage (video) */
.stage { position: absolute; inset: 0; z-index: 0; background: #0a0305; overflow: hidden; }
.stage__poster, .stage__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.stage__video { opacity: 0; transition: opacity 0.5s; }
.stage.is-live .stage__video--loop { opacity: 1; }
.stage.is-out .stage__video--out { opacity: 1; transition: none; }
.stage.is-fallback .stage__poster, .stage.is-fallback .stage__video--loop { filter: brightness(0.3); transition: filter 1.4s; }
.stage::after { /* keep text readable at top and bottom */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 3, 5, 0.55) 0%, rgba(10, 3, 5, 0) 26%),
    linear-gradient(0deg, rgba(10, 3, 5, 0.85) 0%, rgba(10, 3, 5, 0.4) 14%, rgba(10, 3, 5, 0) 26%);
}
@media (min-aspect-ratio: 3/5) {
  /* iPad 가로·PC: 영상을 세로로 꽉 채우고 양옆은 어둠으로 자연스럽게 */
  .stage__poster, .stage__video {
    left: 50%; right: auto; width: auto; height: 100%;
    aspect-ratio: 9 / 16; transform: translateX(-50%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 16%, #000 84%, transparent 100%);
  }
}
.candle__hit {
  position: absolute; z-index: 2;
  border: 0; padding: 0; background: none; border-radius: 40%;
  -webkit-tap-highlight-color: transparent;
}

.intro__action { position: relative; z-index: 3; grid-row: 3; align-self: end; display: grid; justify-items: center; gap: 14px; }
.intro__hint { margin: 0; font-size: 15px; line-height: 1.6; color: rgba(243, 227, 195, 0.8); min-height: 1.6em; letter-spacing: 0.02em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.is-out .intro__action { opacity: 0; transition: opacity 0.4s; }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  18% { transform: scale(0.97, 1.05) skewX(1.4deg); }
  37% { transform: scale(1.02, 0.97) skewX(-1deg); }
  58% { transform: scale(0.98, 1.07) skewX(1.8deg); }
  79% { transform: scale(1.01, 0.99) skewX(-1.2deg); }
}
@keyframes core { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.92, 1.1); } }
@keyframes halo { 0%, 100% { opacity: 1; transform: scale(1); } 45% { opacity: 0.82; transform: scale(0.97); } 70% { opacity: 0.95; } }
@keyframes ember { 0% { opacity: 1; } 30% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes smoke-rise {
  0% { opacity: 0; transform: translateY(10px); }
  8% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-36px); }
}
@keyframes smoke-draw { to { stroke-dashoffset: 0; } }

/* the light coming on */
.bloom {
  position: fixed; inset: 0; z-index: 20;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #fff7e6 0%, #fbf1e8 22%, var(--paper) 55%);
  clip-path: circle(0px at var(--x, 50%) var(--y, 50%));
  pointer-events: none;
  visibility: hidden;
}
.bloom.is-on {
  visibility: visible;
  clip-path: circle(150vmax at var(--x, 50%) var(--y, 50%));
  transition: clip-path 1.7s var(--ease-io);
}
.bloom.is-fade { opacity: 0; transition: opacity 0.8s; }

/* ── main: horizontal slides ───────────── */
.main { position: fixed; inset: 0; z-index: 1; }
.pager {
  position: absolute; inset: 0;
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pager::-webkit-scrollbar { display: none; }
.slide {
  position: relative;
  flex: 0 0 100%; width: 100%; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior-y: contain;
  display: flex; flex-direction: column; align-items: center;
  padding: max(28px, calc(env(safe-area-inset-top) + 16px)) 24px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
}
.slide__inner {
  margin-block: auto; /* 세로 가운데, 넘치면 위에서부터 */
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}
.slide--dark { background: radial-gradient(120% 80% at 50% 30%, #2a1424 0%, var(--night) 62%); color: var(--pale); }

.section-title {
  margin: 0 0 clamp(18px, 4dvh, 40px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-weight: 400;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink);
}
.section-title__mark { width: 11px; height: 17px; color: var(--gold); }

.opening__date { margin: 0 0 22px; font-size: 16px; color: var(--gold-deep); letter-spacing: 0.04em; }
.opening__title {
  margin: 0;
  font-weight: 700;
  font-size: min(10.5vw, 78px, 8.4dvh);
  line-height: 1.24;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.opening__sub { margin: 28px 0 0; font-size: 16.5px; color: var(--muted); letter-spacing: 0.02em; }
.opening__cue {
  margin-top: 48px;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid rgba(138, 102, 52, 0.4); border-radius: 999px; background: rgba(255, 252, 249, 0.6);
  font-size: 24px; line-height: 1; color: var(--gold-deep);
}
.opening__cue-arrow { animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 0%, 60%, 100% { translate: 0 0; } 30% { translate: 6px 0; } }
.main.is-entering .opening > * { animation: rise 1.1s var(--ease-out) both; }
.main.is-entering .opening__title { animation-delay: 0.15s; }
.main.is-entering .opening__sub { animation-delay: 0.4s; }
.main.is-entering .opening__cue { animation-delay: 0.9s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* page navigation */
.pager-nav {
  position: fixed; z-index: 15; left: 50%; bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 252, 249, 0.78);
  border: 1px solid rgba(138, 102, 52, 0.22);
  box-shadow: 0 10px 30px -14px rgba(46, 26, 36, 0.45);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color 0.4s, border-color 0.4s, opacity 0.3s;
}
.pager-nav__btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 0; background: none; color: var(--ink);
  transition: opacity 0.2s, background-color 0.2s;
}
.pager-nav__btn:disabled { opacity: 0.25; cursor: default; }
@media (hover: hover) { .pager-nav__btn:not(:disabled):hover { background: rgba(201, 160, 99, 0.15); } }
.pager-nav__dots { display: flex; align-items: center; gap: 2px; }
.pager-dot {
  width: 22px; height: 44px; padding: 0; border: 0; background: none;
  display: grid; place-items: center;
}
.pager-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: rgba(46, 26, 36, 0.25);
  transition: width 0.35s var(--ease-out), background-color 0.35s;
}
.pager-dot[aria-current="true"]::before { width: 18px; background: var(--gold-deep); }
.main.on-dark .pager-nav { background: rgba(16, 10, 18, 0.55); border-color: rgba(201, 160, 99, 0.3); }
.main.on-dark .pager-nav__btn { color: var(--champagne); }
.main.on-dark .pager-dot::before { background: rgba(243, 227, 195, 0.3); }
.main.on-dark .pager-dot[aria-current="true"]::before { background: var(--gold); }

.text-btn {
  margin-top: 14px; min-height: 44px; padding: 0 12px;
  border: 0; background: none;
  font-size: 14.5px; color: var(--gold-deep);
  text-decoration: underline; text-decoration-color: rgba(138, 102, 52, 0.4); text-underline-offset: 5px;
}

/* ── photo deck ─────────────────────────── */
.deck {
  --deck-w: min(78vw, 340px);
  --deck-w: min(78vw, 420px, calc((100dvh - 365px) * 360 / 530));
  position: relative;
  width: var(--deck-w);
  aspect-ratio: 360 / 530;
  margin: 0 0 clamp(20px, 3.5dvh, 36px);
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  outline-offset: 12px;
}
.card {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column;
  padding: 13px 13px 0;
  border-radius: 3px;
  background: var(--mat);
  box-shadow: var(--shadow-photo);
  transition: transform 0.55s var(--ease-out), opacity 0.45s;
  will-change: transform;
}
.card::after { /* subtle sheen on the print */
  content: ""; position: absolute; inset: 13px 13px auto; aspect-ratio: 3 / 4;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
.card.is-dragging { transition: none; cursor: grabbing; }
.card.no-anim { transition: none !important; }
.card__img { aspect-ratio: 3 / 4; overflow: hidden; background: #efe4e0; }
.card__img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.card__cap {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 0 3px;
}
.card__text { font-family: var(--hand); font-size: max(15px, min(26px, calc(var(--deck-w) * 0.068))); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.05; color: var(--ink); }
.card__date { font-family: var(--num); font-style: italic; font-size: 15px; color: var(--gold-deep); white-space: nowrap; }

.deck-controls { display: flex; align-items: center; gap: 28px; }
.deck-count { margin: 0; min-width: 5em; text-align: center; font-family: var(--num); font-style: italic; font-size: 21px; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.deck-count span { color: var(--muted); }

.gallery { width: min(100%, 980px); margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gallery__item {
  display: block; width: 100%;
  margin: 0; padding: 6px;
  border: 0; border-radius: 2px;
  background: var(--mat);
  box-shadow: 0 1px 2px rgba(46, 26, 36, 0.08), 0 10px 24px -14px rgba(46, 26, 36, 0.4);
  transition: transform 0.25s var(--ease-out);
}
@media (hover: hover) { .gallery__item:hover { transform: translateY(-2px); } }
.gallery__item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.sheet[open] .gallery__item { animation: rise 0.6s var(--ease-out) both; }

/* ── videos ─────────────────────────────── */
.video-row {
  --cols: 2;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 12px;
  width: min(100%, calc(var(--cols) * 240px), calc((100dvh - 300px) * 3 / 4 * var(--cols) + (var(--cols) - 1) * 12px));
}
.vcard { margin: 0; display: grid; gap: 10px; justify-items: center; }
.vcard__frame {
  position: relative; display: block; width: 100%;
  aspect-ratio: 3 / 4;
  padding: 0; border: 0;
  border-radius: 14px; overflow: hidden;
  background: #1d1219;
  box-shadow: 0 0 0 1px rgba(201, 160, 99, 0.45), var(--shadow-photo);
  -webkit-tap-highlight-color: transparent;
}
.vcard__frame img { width: 100%; height: 100%; object-fit: cover; }
.vcard__play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(16, 10, 18, 0) 50%, rgba(16, 10, 18, 0.35));
}
.vcard__play span {
  width: clamp(42px, 13vw, 58px); height: clamp(42px, 13vw, 58px); border-radius: 50%;
  display: grid; place-items: center;
  color: #fff4d8;
  background: rgba(16, 10, 18, 0.35);
  border: 1px solid rgba(243, 227, 195, 0.7);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: transform 0.2s var(--ease-out), background-color 0.2s;
}
@media (hover: hover) { .vcard__frame:hover .vcard__play span { transform: scale(1.06); background: rgba(16, 10, 18, 0.5); } }
.vcard__play svg { width: 40%; height: 40%; margin-left: 6%; }
.vcard figcaption { font-family: var(--hand); font-size: clamp(18px, 5vw, 24px); line-height: 1.1; color: var(--ink); text-align: center; word-break: keep-all; }
.vplayer video { max-width: min(92vw, 900px); max-height: 74dvh; width: auto; height: auto; border-radius: 6px; background: #000; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
.vplayer figcaption { font-family: var(--hand); font-size: 28px; line-height: 1.2; text-align: center; color: var(--champagne); }

/* ── time ───────────────────────────────── */
.time { text-align: center; }
.time__days {
  margin: 0;
  font-family: var(--num);
  font-style: italic; font-weight: 600;
  font-size: min(33vw, 220px, 24dvh);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums;
  padding: 0 0.06em;
}
.time__days .foil--light { --foil: linear-gradient(105deg, #7a5428 0%, #c79a57 24%, #e8c98c 38%, #a87a3c 56%, #d3ad6c 74%, #7f5a2c 100%); }
.time__d { font-size: 0.3em; font-style: italic; color: var(--berry); margin-right: 0.06em; vertical-align: 1.5em; letter-spacing: 0; }
.time__since { margin: 18px 0 0; font-size: 15px; color: var(--muted); letter-spacing: 0.03em; }
.time__clock { margin: 26px 0 0; font-size: 17px; color: var(--ink); }
.time__clock span { display: inline-block; min-width: 1.15em; text-align: right; font-family: var(--num); font-size: 1.25em; font-weight: 500; font-variant-numeric: lining-nums tabular-nums; }
.time__next {
  margin: 22px 0 0; padding: 8px 18px;
  font-size: 14.5px; color: var(--gold-deep);
  border: 1px solid rgba(201, 160, 99, 0.45); border-radius: 999px;
}

/* ── letter ─────────────────────────────── */
.paper {
  --line: clamp(30px, calc((100dvh - 210px) / 14.8), 46px);
  text-align: left;
  position: relative;
  width: min(100%, 600px);
  padding: calc(var(--line) * 0.8) 28px var(--line);
  background-color: var(--mat);
  background-image: linear-gradient(transparent calc(var(--line) - 1px), rgba(201, 160, 99, 0.3) 1px);
  background-size: 100% var(--line);
  background-position: 0 calc(var(--line) * 0.8 - var(--line) * 0.24);
  border-radius: 3px;
  box-shadow: var(--shadow-photo);
  transform: rotate(-0.5deg);
}
.paper::before { /* left margin rule */
  content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 1px;
  background: rgba(122, 35, 72, 0.18);
}
.paper__body, .paper__from {
  margin: 0;
  font-size: max(18px, calc(var(--line) * 0.6));
  line-height: var(--line);
  color: var(--ink);
  white-space: pre-line;
  word-break: keep-all;
}
.paper__from { margin-top: calc(var(--line) * 0.5); padding-right: 64px; text-align: right; color: var(--berry); }
.seal {
  position: absolute; right: -14px; bottom: -22px;
  width: 92px; height: 92px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 6px 8px rgba(76, 16, 41, 0.35));
}

/* ── wishes ─────────────────────────────── */
.wish-list { text-align: left; list-style: none; margin: 0; padding: 0; width: min(100%, 520px); border-top: 1px solid rgba(201, 160, 99, 0.35); }
.wish { border-bottom: 1px solid rgba(201, 160, 99, 0.35); }
.wish label {
  display: flex; align-items: center; gap: 16px;
  min-height: 62px; padding: 8px 4px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wish input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wish__heart { flex: none; width: 28px; height: 28px; color: var(--berry); }
.wish__heart path { fill: transparent; transition: fill 0.25s; transform-box: fill-box; transform-origin: center; }
.wish input:checked + .wish__heart path { fill: var(--berry); animation: pop 0.45s var(--ease-out); }
.wish input:focus-visible + .wish__heart { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 50%; }
.wish__text { font-family: var(--hand); font-size: 28px; line-height: 1.2; color: var(--ink); }
@keyframes pop { 40% { transform: scale(1.25); } }

/* ── closing ────────────────────────────── */
.closing__art {
  margin: 0 0 clamp(22px, 4dvh, 44px);
  width: min(56vw, 240px, calc(31dvh * 0.75));
  aspect-ratio: 3 / 4;
  padding: 7px;
  border-radius: 999px 999px 16px 16px;
  border: 1px solid rgba(201, 160, 99, 0.6);
  opacity: 0; transform: translateY(18px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.closing__art img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 11px 11px; }
.closing__line {
  margin: 0;
  font-weight: 700;
  font-size: min(12.5vw, 96px, 7.4dvh);
  line-height: 1.18;
  letter-spacing: -0.035em;
  opacity: 0; transform: translateY(18px);
  transition: opacity 1.2s var(--ease-out), transform 1.2s var(--ease-out);
}
.closing__line:nth-of-type(2) { transition-delay: 0.35s; }
.closing__line:nth-of-type(3) { transition-delay: 0.7s; }
.closing__line:nth-of-type(3) .foil { padding: 0 0.04em; }
.closing.is-active .closing__line, .closing.is-active .closing__art { opacity: 1; transform: none; }
.closing.is-active .closing__line .foil { animation: sheen 4s 1.2s var(--ease-io) both; }
.closing .btn { margin-top: clamp(28px, 5dvh, 56px); }

/* ── viewer ─────────────────────────────── */
.viewer {
  width: 100vw; height: 100svh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(16, 10, 18, 0.96);
  color: var(--pale);
}
.viewer[open] { display: grid; place-items: center; }
.viewer::backdrop { background: rgba(16, 10, 18, 0.6); }
.viewer__fig { margin: 0; padding: 72px 16px 28px; display: grid; justify-items: center; gap: 16px; }
.viewer__fig img { max-width: min(92vw, 1100px); max-height: 74svh; width: auto; height: auto; border-radius: 2px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); }
.viewer__fig figcaption { font-family: var(--hand); font-size: 30px; line-height: 1.2; text-align: center; color: var(--champagne); }
.viewer__btn {
  position: absolute; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(201, 160, 99, 0.45); background: rgba(16, 10, 18, 0.5); color: var(--champagne);
}
@media (hover: hover) { .viewer__btn:hover { border-color: var(--champagne); } }
.viewer__close { top: max(16px, env(safe-area-inset-top)); right: 16px; }
.viewer__prev { left: 16px; top: 50%; margin-top: -26px; }
.viewer__next { right: 16px; top: 50%; margin-top: -26px; }

/* ── gallery sheet ──────────────────────── */
.sheet {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--paper); color: var(--ink);
  overflow-y: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(16, 10, 18, 0.5); }
.sheet__head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  min-height: 64px; padding: max(10px, env(safe-area-inset-top)) 72px 10px;
  background: rgba(247, 239, 236, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.sheet__title { margin: 0; font-weight: 400; font-size: 19px; letter-spacing: 0.06em; }
.sheet__close { position: absolute; right: 12px; top: max(6px, env(safe-area-inset-top)); color: var(--ink); background: var(--mat); border-color: rgba(138, 102, 52, 0.35); }
.sheet .gallery { padding: 16px 14px calc(28px + env(safe-area-inset-bottom)); }

/* ── music ──────────────────────────────── */
.music-btn {
  position: fixed; z-index: 40; right: 14px; top: max(14px, env(safe-area-inset-top));
  min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(138, 102, 52, 0.35);
  background: rgba(255, 252, 249, 0.88); color: var(--ink);
  font-size: 14px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.music-btn.on-dark { background: rgba(16, 10, 18, 0.5); color: var(--champagne); border-color: rgba(201, 160, 99, 0.35); }

/* ── larger screens ─────────────────────── */
@media (min-width: 720px) {
  body { font-size: 18px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .gallery__item { padding: 8px; }
  .video-row { gap: 20px; }
  .paper { padding-left: 64px; padding-right: 56px; }
  .paper::before { left: 36px; }
  .section-title { font-size: 23px; }
}

/* ── reduced motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .opening__cue-arrow { animation: none; }
  .intro__title .foil, .closing.is-active .closing__line .foil { animation: none; background-position: 30% 50%; }
  .bloom.is-on { transition: clip-path 0.01s; }
  .card { transition: opacity 0.2s; }
  .main.is-entering .opening > *, .sheet[open] .gallery__item { animation: none; }
  .pager { scroll-behavior: auto; }
  .closing__line, .closing__art { transition: none; opacity: 1; transform: none; }
}

/* ── phones ─────────────────────────────── */
@media (max-width: 400px) {
  .paper { padding-left: 24px; padding-right: 18px; }
  .paper::before { left: 14px; }
  .wish__text { font-size: 26px; }
}
@media (max-height: 760px) {
  .deck { --deck-w: min(78vw, 420px, calc((100dvh - 335px) * 360 / 530)); }
  .section-title { gap: 8px; font-size: 19px; }
  .section-title__mark { width: 9px; height: 14px; }
  .wish label { min-height: 52px; }
}
@media (max-height: 700px) {
  .intro__to { font-size: 26px; }
  .intro__text { padding-top: 2svh; }
  .intro__action { gap: 10px; }
  .intro__action .btn { min-height: 44px; }
}
@media (max-width: 600px) {
  .video-row { gap: 10px; }
  .vcard__frame { aspect-ratio: 9 / 16; }
}
/* 촛불 터치 영역은 보이지 않게 — 키보드(Tab)로 이동할 때만 은은한 표시 */
.candle__hit:focus { outline: none; }
.candle__hit:focus-visible { outline: none; box-shadow: 0 0 0 1px rgba(243, 227, 195, 0.18); }

/* 마이크 소리 표시 */
.mic-meter {
  width: 140px; height: 3px; border-radius: 3px; overflow: hidden;
  background: rgba(243, 227, 195, 0.16);
}
.mic-meter span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #a07a43, #f3dfb2);
  transform-origin: left center; transform: scaleX(0);
  transition: transform 0.08s linear;
}
.mic-meter.is-hot span { background: linear-gradient(90deg, #e9cf9b, #fff4d8); box-shadow: 0 0 10px rgba(255, 220, 150, 0.8); }
