@font-face {
  font-family: 'S-CoreDream-3Light';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-3Light.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}
@font-face {
  font-family: 'S-CoreDream-5Medium';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_six@1.2/S-CoreDream-5Medium.woff') format('woff');
  font-weight: normal;
  font-display: swap;
}

:root {
  /* 포인트 색 — 샘플처럼 파랑으로 하려면: #387adf / #e8f1fc / #8fb5ee */
  --accent: #e0577f;
  --accent-soft: #fdeef3;
  --accent-mid: #f3a9bf;

  --ink: #383737;
  --ink-2: #555;
  --muted: #8d8e90;
  --line: #ececef;
  --bg: #fff;
  --outer: #f5f2ef;

  --font: 'S-CoreDream-3Light', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --font-strong: 'S-CoreDream-5Medium', 'S-CoreDream-3Light', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --hand: 'Gaegu', 'S-CoreDream-5Medium', cursive;

  --w: 480px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--outer);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
p { margin: 0; }
b, strong { font-family: var(--font-strong); font-weight: normal; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.page {
  position: relative;
  max-width: var(--w);
  margin: 0 auto;
  background: var(--bg);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- intro ---------- */
.intro { display: none; }
.js .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
  cursor: pointer;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.js .intro.is-done { opacity: 0; visibility: hidden; }
.intro-text {
  font-family: var(--hand);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--accent);
  text-align: center;
}
/* 손글씨처럼 한 글자씩 써지는 글자 (인트로, 메인 제목) */
.writable .word { white-space: nowrap; }
.writable .ch {
  display: inline-block;
  padding: 0.12em 0.04em;
  margin: 0 -0.04em;
  clip-path: inset(0 100% 0 0);
}
.writable.is-writing .ch { animation: write 0.45s ease-in-out forwards; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- photo + placeholder ---------- */
.photo { position: relative; overflow: hidden; background: #f4f4f5; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.is-empty img { display: none; }
.photo.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9b9be' stroke-width='1.5'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center calc(50% - 22px) / 30px no-repeat,
    repeating-linear-gradient(-45deg, #f6f6f7 0 10px, #f0f0f2 10px 20px);
}
.photo.is-empty::after {
  content: attr(data-label) '\A' attr(data-file);
  white-space: pre;
  margin-top: 34px;
  font-size: 11px;
  line-height: 1.5;
  color: #9a9aa0;
  text-align: center;
}
.photo.circle { border-radius: 50%; aspect-ratio: 1; }
.photo.circle.is-empty { background-position: center, 0 0; }
.photo.circle.is-empty::after { content: none; }

/* ---------- topbar & menu ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  width: 100%;
  max-width: var(--w);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
  transform: translate(-50%, -100%);
  transition: transform 0.35s ease;
}
.topbar.is-shown, .topbar.menu-open { transform: translate(-50%, 0); }
.topbar-title { font-size: 13.5px; color: var(--ink-2); }
.menu-btn {
  position: absolute;
  left: 8px;
  top: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
}
.menu-btn span {
  position: absolute;
  left: 11px;
  width: 18px;
  height: 1.5px;
  background: #777;
  transition: transform 0.3s, opacity 0.3s;
}
.menu-btn span:nth-child(1) { top: 14px; }
.menu-btn span:nth-child(2) { top: 20px; }
.menu-btn span:nth-child(3) { top: 26px; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
.menu-open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 29;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu ul {
  list-style: none;
  margin: 0 auto;
  padding: 64px 28px 28px;
  max-width: var(--w);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-12px);
  transition: transform 0.3s;
}
.menu.is-open ul { transform: none; }
.menu a {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.menu a::before { content: '›'; margin-right: 10px; color: var(--accent); }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 960px; }
.hero-photo { position: absolute; inset: 0; }
.hero-photo img { object-position: 52% center; }
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: 26%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.hero-title, .hero-names { z-index: 2; }
.hero-title {
  position: absolute;
  top: 7%;
  left: 0;
  right: 0;
  margin: 0;
  font-family: var(--hand);
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-align: center;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.7);
}
.hero-names {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 70px 16px 14px;
  font-size: 13.5px;
  color: #444;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 22%, rgba(255, 255, 255, 0));
}

/* ---------- common section ---------- */
.sec { padding: 72px 24px; text-align: center; }
.sec-title {
  margin: 0 0 26px;
  font-family: var(--font-strong);
  font-size: 17px;
  font-weight: normal;
  color: var(--accent);
}

/* ---------- greeting ---------- */
.greeting-body p + p { margin-top: 1.4em; }
.greeting-body { color: var(--ink-2); font-size: 14.5px; }

/* ---------- parents ---------- */
.parents { padding-bottom: 72px; text-align: center; }
.photo.wide { aspect-ratio: 1; }
.host { margin-top: 40px; font-size: 15px; color: var(--ink-2); line-height: 2; }
.host strong { font-size: 19px; color: var(--accent); }

/* ---------- party / calendar ---------- */
.party { padding-bottom: 40px; }
.party-date { font-size: 15px; color: var(--ink-2); }
.party-place { margin-top: 2px; font-family: var(--font-strong); font-size: 15px; color: var(--ink); }
.photo.portrait {
  width: 84%;
  margin: 34px auto 0;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}
.cal { margin-top: 44px; }
.cal-month {
  margin-bottom: 16px;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--accent);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  max-width: 320px;
  margin: 0 auto;
  font-size: 13.5px;
  color: var(--ink-2);
}
.cal-grid b { padding-bottom: 6px; font-family: var(--font); color: var(--ink); }
.cal-grid span, .cal-grid b { display: flex; align-items: center; justify-content: center; height: 34px; }
.cal-grid .sun { color: var(--accent); }
.cal-grid .is-day {
  width: 34px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-strong);
}

.ribbon {
  position: relative;
  z-index: 1;
  margin: 26px -20px 0;
  padding: 9px 0;
  background: var(--accent);
  color: #fff;
  overflow: hidden;
  transform: rotate(-3deg);
  white-space: nowrap;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(224, 87, 127, 0.25);
}
.ribbon-track { display: flex; width: max-content; animation: marquee 22s linear infinite; }
.ribbon-track span { padding: 0 22px; }

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- venue (돌잔치 안내 안) ---------- */
.venue-addr { margin-top: 2px; font-size: 14px; color: var(--muted); }
.venue-map-wrap {
  position: relative;
  height: 200px;
  margin-top: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f5;
}
.venue-map { width: 100%; height: 100%; }
.venue-map-link { position: absolute; inset: 0; z-index: 1; }
.chip {
  margin-top: 10px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
}
.map-naver {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 260px;
  margin: 16px auto 0;
  padding: 11px 0;
  border-radius: 12px;
  background: #03c75a;
  color: #fff;
  font-size: 14.5px;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(3, 199, 90, 0.22);
}
.map-naver-logo {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #fff;
  color: #03c75a;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}
.notes {
  margin: 18px 0 0;
  padding: 18px 20px;
  border-radius: 14px;
  background: #fafafa;
  list-style: none;
  text-align: left;
  font-size: 13.5px;
  color: var(--ink-2);
}
.notes li { position: relative; padding-left: 14px; }
.notes li + li { margin-top: 6px; }
.notes li::before { content: '·'; position: absolute; left: 0; color: var(--accent); }

/* ---------- timeline ---------- */
.tl { position: relative; margin: 0; padding: 10px 0 0; list-style: none; }
.tl::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
}
.tl-item {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
}
.tl-item + .tl-item { margin-top: 26px; }
.tl-photo { grid-column: 1; grid-row: 1; aspect-ratio: 1; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); }
.tl-dot { grid-column: 2; grid-row: 1; justify-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px #fff; }
.tl-text { grid-column: 3; grid-row: 1; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.tl-text time { display: block; margin-top: 6px; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); }
.tl-item.is-flip .tl-photo { grid-column: 3; }
.tl-item.is-flip .tl-text { grid-column: 1; }

/* ---------- family ---------- */
/* 첫 카드(주인공)는 한 줄 전체, 나머지는 두 장씩 나란히 */
.fam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fam-card {
  border-radius: 16px;
  background: var(--accent-soft);
}
.fam-card.is-main {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 18px;
  text-align: left;
}
.fam-card.is-half { padding: 18px 10px 20px; text-align: center; }
.fam-who { text-align: center; }
.is-main .fam-who { flex: 0 0 92px; }
.fam-who .photo { width: 84px; margin: 0 auto 6px; border: 3px solid #fff; }
.is-main .fam-who .photo { width: 92px; }
.fam-who p { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.fam-desc { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.is-half .fam-desc { margin-top: 10px; font-size: 12.5px; line-height: 1.75; }

/* ---------- gallery ---------- */
.gallery { padding-left: 0; padding-right: 0; }
.gallery-hint { margin: -14px 0 10px; font-size: 12.5px; color: var(--muted); }
.explore {
  position: relative;
  height: 400px;
  overflow: hidden;
  touch-action: pan-y; /* 세로로 밀면 페이지 스크롤, 가로·대각선은 사진 이동 */
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}
.explore.is-dragging { cursor: grabbing; }
.explore-layer { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.bubble {
  position: absolute;
  left: -60px;
  top: -60px;
  width: 120px; /* main.js 의 SIZE 와 같게 */
  height: 120px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  will-change: transform;
}
.bubble .photo {
  width: 100%;
  height: 100%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.8s ease, filter 0.8s ease;
}
.explore.is-in .bubble .photo, html:not(.js) .bubble .photo { opacity: 1; filter: none; }
.bubble img { pointer-events: none; -webkit-user-drag: none; }

/* ---------- together ---------- */
.together { padding-top: 40px; }
.together-label { font-size: 14.5px; color: var(--ink-2); }
.together-count { margin-top: 6px; font-family: var(--font-strong); font-size: 17px; color: var(--accent); }

/* ---------- ending ---------- */
.ending { padding: 36px 24px 0; text-align: center; }
.ending-text { font-family: var(--font-strong); font-size: 17px; line-height: 1.8; color: var(--ink); }
.ending-img { display: block; }
.ending-img img { width: 62%; max-width: 260px; margin: 18px auto 0; }
.foot {
  padding: 34px 0 96px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: #b4b4b8;
}

/* ---------- floating buttons ---------- */
.fab {
  position: fixed;
  right: max(14px, calc(50% - var(--w) / 2 + 14px));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
}
.fab svg { width: 20px; height: 20px; fill: none; stroke: #888; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.fab { opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.fab.is-shown { opacity: 1; visibility: visible; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
.lb-close, .lb-nav {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  line-height: 1;
}
.lb-close { top: 10px; right: 12px; width: 44px; height: 44px; font-size: 32px; }
.lb-nav {
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  font-size: 28px;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-count { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, 0.7); font-size: 13px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 60;
  padding: 9px 18px;
  border-radius: 99px;
  background: rgba(30, 30, 30, 0.85);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.toast.is-shown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---------- petals ---------- */
#petals { position: fixed; inset: 0; z-index: 20; width: 100%; height: 100%; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { transform: none; transition: opacity 0.4s; }
  .ribbon-track { animation: none; }
  .writable .ch { clip-path: none; }
}
