/* ─────────────────────────────────────────────
   하늘과 숲 — 위에서부터 하늘 → 나무 꼭대기 → 숲 → 월넛 흙길
   색을 바꾸려면 :root 값만 고치면 됩니다.
   ───────────────────────────────────────────── */
:root {
  --sky: #AACDE3;
  --sky-2: #D6E7F1;
  --mist: #F3F6F5;
  --forest: #2E4630;
  --forest-2: #3E5A3D;
  --walnut: #45301F;
  --walnut-2: #6B4A33;
  --ink: #1F3326;
  --ink-2: #566A5C;
  --on-forest: #EAF0E8;
  --on-forest-2: rgb(234 240 232 / 0.72);
  --line: rgb(31 51 38 / 0.14);
  --heart: #D25A6E;
  --font: 'Gowun Dodum', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --col: 430px;
  --gutter: 28px;
  --acorn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M10 1v3' stroke='%233E2A1D' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M2.5 9.5C2.5 6 6 4 10 4s7.5 2 7.5 5.5c0 .8-.6 1.3-1.3 1.3H3.8c-.7 0-1.3-.5-1.3-1.3z' fill='%235B3F2C'/%3E%3Cpath d='M4 11h12c0 6-2.8 11-6 11s-6-5-6-11z' fill='%23B07E52'/%3E%3C/svg%3E");
  --leaf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 19C5 10 11 4 20 4c0 9-6 15-15 15z' fill='%235F8A55'/%3E%3Cpath d='M5 19L14 10' stroke='%23DDEBD6' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; background: #C9D9E2; color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.8; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.page { position: relative; max-width: var(--col); margin: 0 auto; overflow: hidden; background: var(--mist); }

/* ── 하늘 ─────────────────────────────── */
.hero { position: relative; padding-top: 150px; background: linear-gradient(180deg, var(--sky) 0, var(--sky) 60%, var(--sky-2) 100%); }
.hero-text { position: absolute; inset: 52px 0 auto; z-index: 1; text-align: center; }
.hero-date { font-size: 15px; letter-spacing: 0.12em; color: var(--ink-2); }
.hero h1 { margin: 10px 0 0; font-size: 46px; font-weight: 400; line-height: 1.2; letter-spacing: 0.02em; }
.hero h1 small { display: block; margin-top: 8px; font-size: 18px; letter-spacing: 0.3em; padding-left: 0.3em; }
.hero-photo { position: relative; }
.hero-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 110px); mask-image: linear-gradient(to bottom, transparent 0, #000 110px); }
.hero-when { padding: 34px var(--gutter) 0; text-align: center; font-size: 15px; color: var(--ink-2); background: var(--sky-2); }
.fade { height: 90px; background: linear-gradient(var(--sky-2), var(--mist)); }

/* 강아지 이스터 에그 */
.dog-spot { position: absolute; left: 59%; top: 81%; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); cursor: pointer; }
.dog-bubble {
  position: absolute;
  left: 59%;
  top: calc(81% - 44px);
  max-width: 230px;
  padding: 10px 14px;
  border-radius: 16px;
  background: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 6px 18px rgb(31 51 38 / 0.18);
  transform: translate(-60%, -100%);
  animation: pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.dog-bubble::after { content: ''; position: absolute; left: 60%; bottom: -7px; width: 14px; height: 14px; background: #fff; transform: rotate(45deg); }
@keyframes pop { from { opacity: 0; transform: translate(-60%, -90%) scale(0.85); } }

/* ── 공통 ─────────────────────────────── */
.sec { padding: 72px var(--gutter); text-align: center; }
.sec-tight { padding-top: 24px; }
h2 { margin: 0 0 28px; font-size: 22px; font-weight: 400; letter-spacing: 0.06em; }
.lead { margin-bottom: 24px; font-size: 15px; color: var(--ink-2); }
.note { margin-top: 16px; font-size: 14px; color: var(--ink-2); }
.hint { margin: -14px 0 20px; font-size: 14px; color: var(--on-forest-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 24px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-fill { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn-soft { border-color: var(--line); background: #fff; }
.btn-block { width: 100%; }
.more { margin-top: 20px; }
.forest .more { margin-top: 24px; }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.text-btn { padding: 6px 4px; border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── 초대 ─────────────────────────────── */
.greeting { white-space: pre-line; font-size: 17px; line-height: 2.1; }
.parents { display: grid; gap: 6px; margin: 44px 0 32px; }
.parents small { margin: 0 6px 0 2px; font-size: 14px; color: var(--ink-2); }
.late { margin-right: 3px; font-size: 13px; color: var(--ink-2); }

/* ── 나무 꼭대기 → 숲 ─────────────────── */
.treeline { position: relative; }
.treeline svg { display: block; width: 100%; height: 64px; margin-bottom: -1px; }
.forest { background: var(--forest); color: var(--on-forest); }
.forest h2 { color: #fff; }
.when-big { font-size: 24px; color: #fff; }
.when-sub { margin-bottom: 26px; color: var(--on-forest-2); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); max-width: 320px; margin: 0 auto; padding: 16px 0; border-block: 1px solid rgb(255 255 255 / 0.16); font-size: 15px; }
.cal > span { display: grid; place-items: center; height: 42px; }
.cal .wd { height: 30px; font-size: 13px; color: var(--on-forest-2); }
.cal .sun { color: #F2B8AE; }
.cal .sat { color: #B9DAF0; }
.cal .wedding { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--sky); color: var(--forest); font-weight: 400; }
.dday { margin-top: 22px; font-size: 15px; color: var(--on-forest-2); }

/* 사진 */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.g-item { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--forest-2); aspect-ratio: 1; cursor: zoom-in; }
.g-item:first-child { grid-column: span 2; grid-row: span 2; }
.g-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-badge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px; background: rgb(20 30 22 / 0.55); color: #fff; font-size: 12px; line-height: 1.6; }
.g-badge.mine { background: var(--heart); }

/* ── 오시는 길 ────────────────────────── */
.venue-name { font-size: 21px; }
.venue-hall { font-size: 15px; color: var(--ink-2); }
.venue-addr { margin-top: 8px; font-size: 15px; }
.venue-tel { font-size: 14px; color: var(--ink-2); }
.venue-tel a { color: inherit; }
.map { margin: 24px 0 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #FAFBFA; }
.map svg { display: block; width: 100%; height: auto; font-family: var(--font); }
.m-road { font-size: 10px; fill: #8A968C; }
.m-line { font-size: 10px; fill: #fff; }
.m-label { font-size: 10.5px; fill: #55625A; }
.m-exit { font-size: 10px; font-weight: 700; text-anchor: middle; }
.m-venue { font-size: 14px; fill: #45301F; }
.m-dot { fill: #AAB5AD; }
.nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.nav .btn { padding: 0 6px; border-color: var(--line); background: #fff; font-size: 14px; }
.transport { display: grid; gap: 22px; margin: 36px 0 0; text-align: left; }
.transport dt { margin-bottom: 4px; font-size: 15px; }
.transport dd { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.transport dd + dd { margin-top: 4px; }

/* ── 계좌 ─────────────────────────────── */
.acc { display: grid; gap: 10px; text-align: left; }
.acc details { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.acc summary { display: flex; align-items: center; padding: 16px 20px; list-style: none; cursor: pointer; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '열기'; margin-left: auto; font-size: 13px; color: var(--ink-2); }
.acc details[open] summary::after { content: '닫기'; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); }
.acc-who { font-size: 13px; color: var(--ink-2); }
.acc-num { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ── 좋아요 ───────────────────────────── */
.like { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.like svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.like[aria-pressed='true'] { color: var(--heart); }
.like[aria-pressed='true'] svg { fill: currentColor; }
.like.bump svg { animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

/* ── 축하 메시지 ──────────────────────── */
.gb-list { margin: 28px 0 0; padding: 0; list-style: none; text-align: left; border-top: 1px solid var(--line); }
.gb-item { padding: 16px 2px 10px; border-bottom: 1px solid var(--line); }
.gb-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; font-size: 13px; color: var(--ink-2); }
.gb-meta b { font-weight: 400; color: var(--ink); font-size: 15px; }
.gb-msg { white-space: pre-line; font-size: 15px; line-height: 1.8; }
.gb-acts { display: flex; justify-content: space-between; align-items: center; margin: 4px -8px 0; }
.gb-empty { padding: 28px 0; font-size: 14px; color: var(--ink-2); text-align: center; }

/* ── 축하 보내기 ──────────────────────── */
.cheer { padding-bottom: 88px; }
.cheer-btn {
  display: inline-grid;
  place-items: center;
  gap: 2px;
  width: 116px;
  height: 116px;
  border: 0;
  border-radius: 50%;
  background: var(--forest);
  color: #8FBF7F;
  font-size: 15px;
  box-shadow: 0 0 0 8px rgb(46 70 48 / 0.08), 0 10px 22px rgb(46 70 48 / 0.25);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.cheer-btn span { color: #fff; }
.cheer-btn:active { transform: scale(0.95); }
.cheer-count { margin-top: 22px; min-height: 1.8em; font-size: 15px; color: var(--ink-2); }
.leaf { position: fixed; z-index: 90; width: 22px; height: 22px; background: var(--leaf) center / contain no-repeat; pointer-events: none; animation: leaf-fly var(--t, 1.4s) cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes leaf-fly {
  0% { opacity: 0; transform: translate(0, 0) rotate(0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}

/* ── 월넛 흙길 ────────────────────────── */
.ground { position: relative; padding: 72px var(--gutter) 96px; text-align: center; color: #E9DCCB; background: var(--walnut) repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0 2px, transparent 2px 9px); }
.btn-ground { margin-top: 18px; border-color: rgb(233 220 203 / 0.6); color: #E9DCCB; }
.acorn-hint { margin-top: 36px; font-size: 13px; color: rgb(233 220 203 / 0.55); }
.acorn-hint button { color: inherit; }

/* 도토리 이스터 에그 */
.acorn { position: absolute; z-index: 2; width: 20px; height: 24px; padding: 0; border: 0; background: var(--acorn) center / contain no-repeat; cursor: pointer; opacity: 0.92; }
.acorn::before { content: ''; position: absolute; inset: -12px; }
.cal .acorn { position: relative; justify-self: center; align-self: center; width: 16px; height: 19px; opacity: 0.75; }
.acorn.found { animation: acorn-found 0.6s ease forwards; pointer-events: none; }
@keyframes acorn-found { 40% { transform: translateY(-14px) scale(1.4); opacity: 1; } 100% { transform: translateY(-30px) scale(0.4); opacity: 0; } }
.acorn-reward { text-align: center; }
.acorn-rank { margin: 4px 0 10px; font-size: 14px; color: var(--walnut-2); }
.acorn-msg { white-space: pre-line; font-size: 16px; line-height: 1.9; }
.acorn-reward img { width: 100%; margin-top: 20px; border-radius: 14px; }

/* ── 바텀시트 ─────────────────────────── */
dialog { color: var(--ink); }
.sheet { width: 100%; max-width: var(--col); max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--mist); overflow: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgb(20 32 24 / 0.5); }
.sheet[open] { animation: sheet-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(32px); opacity: 0; } }
.sheet-body { padding: 0 24px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 6px; background: var(--mist); }
.sheet-head h3 { margin: 0; font-size: 18px; font-weight: 400; }
.x { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -12px; border: 0; background: none; color: var(--ink-2); cursor: pointer; }

.seg { margin: 20px 0 0; padding: 0; border: 0; min-width: 0; }
.seg legend { margin-bottom: 8px; padding: 0; font-size: 13px; color: var(--ink-2); }
.seg-opts { display: flex; gap: 8px; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 46px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 15px; }
.seg input:checked + span { border-color: var(--forest); background: var(--forest); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 2px; }
.field { display: block; margin-top: 20px; text-align: left; }
.field > span { display: block; margin-bottom: 8px; font-size: 13px; color: var(--ink-2); }
.field input, .field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 16px; }
.field textarea { resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--forest); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { min-height: 1.5em; margin: 14px 0 8px; font-size: 13px; color: #B5473C; }

.ct-group + .ct-group { margin-top: 16px; }
.ct-group h4 { margin: 12px 0 2px; font-size: 15px; font-weight: 400; color: var(--ink-2); }
.ct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ct-row small { margin-right: 8px; font-size: 13px; color: var(--ink-2); }
.ct-acts { display: flex; gap: 6px; }

/* ── 사진 크게 보기 ───────────────────── */
.lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(16 24 18); color: #fff; overscroll-behavior: contain; }
.lightbox::backdrop { background: rgb(16 24 18); }
.lb-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 56px 0 76px; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb-bar { position: absolute; inset: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: calc(6px + env(safe-area-inset-top)) 18px 6px 20px; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb-bar .x { color: #fff; }
.lb-nav { position: absolute; top: 50%; display: grid; place-items: center; width: 52px; height: 72px; border: 0; background: none; color: #fff; opacity: 0.75; transform: translateY(-50%); cursor: pointer; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-foot { position: absolute; inset: auto 0 0; display: flex; justify-content: center; padding: 12px 0 calc(16px + env(safe-area-inset-bottom)); }
.like-lg { min-height: 44px; padding: 0 18px; background: rgb(255 255 255 / 0.12); color: #fff; font-size: 15px; }
.like-lg svg { width: 20px; height: 20px; }
.like-lg[aria-pressed='true'] { color: #fff; background: var(--heart); }

/* ── 알림 ─────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 100; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .sheet[open], .dog-bubble, .like.bump svg { animation: none; }
  .leaf { display: none; }
}
