/* ---------- tokens (Figma 473:7) ---------- */
:root {
  color-scheme: dark;   /* dark page: iOS/Android draw the keyboard accessory bar, scrollbars and pickers dark to match */
  --bg: #050505;
  --card: #141414;
  --line: #2c2b2b;
  --text: #fafafa;
  --muted: #737373;
  --row: #2c2b2b;
  --btn: #32221d;
  --btn-line: #412e28;
  --paper: #fafafa;
  --ink: #141414;
  --date: #b9b9b9;
  --tag: #e5e4ea;
  --placeholder: #c4c4c4;
  --input-line: #2c2c2c;
  --intro-bg: #f8f8f8;
  --intro-text: #222;
  --en: 'JetBrains Mono', 'Pretendard', monospace;          /* hero text, section titles */
  --en-host: 'Host Grotesk', 'Pretendard', sans-serif;       /* date, countdown, photo counter, copyright */
  --ko: 'Pretendard', -apple-system, sans-serif;
  --page: 402px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }  /* no double-tap zoom */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ko);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.05em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
/* modal open: the document must have nothing to scroll (iOS scrolls it to reveal a focused field even with
   overflow:hidden), so the page content is moved into a viewport-high scroll box; JS carries the scroll position over */
html.is-locked, html.is-locked body { height: 100%; overflow: hidden; }
html.is-locked .page { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
/* no grey flash on tap (mobile tap highlight) and no focus ring from taps/clicks; keyboard focus keeps its ring */
* { -webkit-tap-highlight-color: transparent; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
.en { font-family: var(--en); letter-spacing: -0.02em; }
.en--host { font-family: var(--en-host); letter-spacing: -0.01em; }
.ko { font-family: var(--ko); font-weight: 500; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.page { max-width: 480px; margin: 0 auto; overflow: hidden; }

/* ---------- icons (inline SVG sprite in index.html; color via currentColor) ---------- */
.icon { display: inline-block; width: 20px; height: 20px; flex-shrink: 0; fill: currentColor; vertical-align: middle; overflow: visible; }
.icon--sound   { width: 18px; height: 18px; }  /* sound-mute.svg frame; note glyph is 13.5×14.3 inside */
.icon--flower  { width: 12px; height: 12px; }
.icon--copy    { color: var(--muted); }
.icon--link    { width: 12px; height: 12px; }
.icon--link-sm { width: 10px; height: 10px; }
.icon--plus, .icon--minus { color: var(--muted); }
.icon--close   { width: 24px; height: 24px; }
.iconbtn { display: inline-flex; vertical-align: middle; line-height: 0; }

/* ---------- intro (294:9) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: 6vh;
  background: var(--intro-bg); color: var(--intro-text);
  text-align: center; cursor: pointer;
}
/* exit = "film develop": the intro exhales (names track out, fade) while the hero photo develops from an
   over-exposed, soft state to full contrast and the grain settles. html.is-intro holds the pre-developed state. */
.intro.is-leaving { opacity: 0; visibility: hidden; transition: opacity 1.1s .15s ease, visibility 0s 1.3s; }
.intro__names { display: flex; gap: 8px; align-items: center; font-size: 24px; letter-spacing: -0.05em; transition: letter-spacing 1.3s cubic-bezier(.2,0,.1,1); }
.intro.is-leaving .intro__names { letter-spacing: .3em; }
.intro.is-leaving .intro__enter { opacity: 0; transition: opacity .5s; }
.intro__name { font-weight: 500; }
.intro__amp { font-weight: 300; }
.intro__enter { margin-top: 5px; font-size: 15px; letter-spacing: -0.05em; }

/* ---------- hero ---------- */
.hero { position: relative; aspect-ratio: 402 / 675; overflow: hidden; }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 50%;
  transition: filter 1.9s cubic-bezier(.4,0,.2,1), transform 2.4s cubic-bezier(.22,1,.36,1); }
html.is-intro .hero__img { filter: brightness(1.9) contrast(.35) blur(3px) grayscale(.4); transform: scale(1.05); }
.hero__grain { position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: multiply; transition: opacity 1.6s .3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
html.is-intro .hero__grain { opacity: .14; transition: none; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 74%, rgba(0,0,0,.6) 100%); }
/* icon edge sits on the page's 20px margin; padding keeps a 34px tap target; safe-area for notched phones */
.sound { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; padding: 10px; line-height: 0; color: var(--text); }
/* one-time hint next to the note icon when the intro auto-advanced and the music is still waiting for a touch */
.sound__hint { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 48px; margin: 0;
  padding: 4px 10px; border-radius: 12px; background: rgba(20,20,20,.72); color: var(--text);
  font-size: 11px; line-height: 1.6; letter-spacing: -0.03em; white-space: nowrap;
  opacity: 0; transform: translateX(6px); transition: opacity .4s ease, transform .4s ease; pointer-events: none; }
.sound__hint.is-visible { opacity: 1; transform: none; }
.sound[aria-pressed="false"] .icon--sound-on { display: none; }   /* off: note with a slash, 60% like the Figma icon */
.sound[aria-pressed="false"] .icon--sound-off { opacity: .6; }
.sound[aria-pressed="true"] .icon--sound-off { display: none; }   /* on: plain note */
.hero__text { position: absolute; left: 0; right: 0; bottom: 30px; padding: 0 20px; text-transform: capitalize; font-weight: 400; }
.hero__row { display: flex; justify-content: space-between; font-size: 10px; line-height: 1.6; margin-bottom: 13px; }
.hero__row span:nth-child(2) { text-transform: uppercase; }
.hero__row span:nth-child(3) { text-transform: none; }
/* two equal columns as in Figma: About Us starts at the centre; text wraps naturally */
.hero__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.hero__label { font-size: 9px; line-height: 1.6; margin-bottom: 9px; }
.hero__body { font-size: 8px; line-height: 1.25; }

/* ---------- shared bits ---------- */
.eyebrow { font-size: 11px; line-height: 1.6; text-align: center; text-transform: capitalize; }
.section__title { font-size: 16px; line-height: 1.6; text-align: center; }
.section__desc { font-size: 12px; line-height: 1.8; text-align: center; color: var(--muted); margin-top: 21px; }
/* "⁺ ‧ ∗ ⸼ °" outlined from Figma (477:91): U+2E3C has no glyph on iOS. 12px tall inside the original 19px line box. */
.ornament { display: block; width: 39px; height: 12px; margin: 3px auto 4px; color: var(--text); fill: currentColor; }
.card {
  margin: 0 20px; padding: 49px 20px 0;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 2px 2px 0 0 #000;
}
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 50px;
  background: var(--btn); border: 1px solid var(--btn-line);
  font-size: 14px; font-weight: 500; letter-spacing: -0.03em; color: var(--text);
}

/* ---------- save the date ---------- */
.save { padding-top: 80px; text-align: center; }
.save__date { margin-top: 20px; font-size: 16px; line-height: 1.6; letter-spacing: -0.03em; text-transform: uppercase; }
.save__venue { font-size: 16px; line-height: 1.6; font-weight: 500; }
.save__photo { width: 306px; max-width: calc(100% - 40px); height: 278px; margin: 44px auto 0; overflow: hidden; }
.save__photo img { width: 100.16%; height: 138.08%; margin: -15.3% 0 0 -0.08%; object-fit: cover; }

/* ---------- greeting (504:43) ---------- */
.greeting { margin-top: 54px; height: 405px; }
.greeting__text { margin-top: 30px; font-size: 14px; line-height: 2; text-align: center; white-space: nowrap; }
.parents { display: grid; grid-template-columns: auto auto; column-gap: 34px; row-gap: 4px; justify-content: center; margin-top: 30px; font-size: 14px; line-height: 1.6; }
.parents__side { color: var(--muted); text-align: right; display: inline-flex; align-items: center; justify-content: flex-end; gap: 3px; }
.parents__name { font-weight: 500; text-align: left; }

/* ---------- calendar + countdown ---------- */
.calendar { padding-top: 91px; text-align: center; }
.calendar__month { font-size: 16px; line-height: 1.6; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 13px); column-gap: 20px; row-gap: 10px; justify-content: center; margin-top: 26px; font-size: 12px; line-height: 1.6; letter-spacing: -0.05em; }
.calendar__grid .dow { color: var(--muted); }
.calendar__grid .today { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.countdown__label { margin-top: 50px; font-size: 16px; line-height: 2; }
.countdown { font-size: 20px; line-height: 1.6; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.countdown .light { font-weight: 300; }

/* ---------- gallery (530:295) ---------- */
.gallery { margin-top: 134px; }
/* Figma: centered slide 256×359, neighbours 237.6×333 (scale .927) vertically centred, ~7px visual gap */
.gallery__track {
  display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 calc(50% - 128px); scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
@media (hover: hover) { .gallery__track { cursor: grab; } }
.gallery__item { flex: 0 0 256px; height: 359px; scroll-snap-align: center; overflow: hidden; transform: scale(.927); transition: transform .35s ease; }
.gallery__item img { pointer-events: none; -webkit-user-drag: none; user-select: none; }
.gallery__item.is-active { transform: none; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- location (511:208) ---------- */
.location { margin-top: 145px; padding: 71px 0 73px; text-align: center; box-shadow: none; }
.location__name { margin-top: 20px; font-size: 16px; line-height: 1.6; font-weight: 500; }
.location__addr { margin-top: 3px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.location__addr-line { display: inline-flex; align-items: center; gap: 0; font-size: inherit; line-height: inherit; color: inherit; }
.map { position: relative; width: calc(100% - 40px); height: 250px; margin: 21px 20px 0; background: #1a1a1a; overflow: hidden; }
.map__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; font-size: 12px; color: var(--muted); }
.map__links { display: flex; justify-content: space-between; width: 240px; margin: 12px auto 0; font-size: 12px; line-height: 1.8; opacity: .7; }
.map__links a { display: inline-flex; align-items: center; gap: 5px; }
.transit { margin-top: 53px; font-size: 14px; line-height: 1.8; }
.transit p + p { margin-top: 30px; }
.transit strong { font-weight: 600; }

/* ---------- accounts (536:373) ---------- */
.accounts { padding-top: 80px; text-align: center; }
.accounts .section__title { margin-top: 21px; }
.accordion { margin: 42px 20px 0; background: var(--card); text-align: left; }
.accordion__head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 50px; padding: 0 19px;
  border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; letter-spacing: -0.03em;
}
.accordion__group:last-child .accordion__head { border-bottom: 1px solid var(--line); }
.accordion__group.is-open + .accordion__group .accordion__head { border-top: 0; }
.accordion__body { display: none; }
.accordion__group.is-open .accordion__body { display: block; }
.account { position: relative; height: 76px; padding: 14px 19px 0; background: var(--row); }
.account + .account { height: 78px; padding-top: 16px; }
.account:not(:last-child) { border-bottom: 1px dashed var(--bg); }
.account__name { font-size: 14px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.6; }
.account__line { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; letter-spacing: -0.03em; line-height: 1.6; }
.account__sep { font-size: 13px; font-weight: 200; color: var(--muted); }
.account__line .iconbtn { margin-left: -5px; }  /* cancel the flex gap: Figma puts the 20px icon box right after the number */
.account__empty { font-size: 12px; color: var(--muted); }

/* ---------- interlude ---------- */
.interlude { margin-top: 80px; }
.interlude img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- guestbook (552:533) ---------- */
.guestbook { padding: 91px 20px 0; text-align: center; }
.guestbook .section__title { margin-top: 20px; }
.guestbook__list {
  height: 513px; margin-top: 29px; padding: 11px 28px 0; overflow-y: auto; overflow-x: hidden; text-align: left;
  scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 29%, #000 71%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 29%, #000 71%, transparent 100%);
}
.guestbook__list::-webkit-scrollbar { display: none; }
/* under 5 entries: no rolling, no fades, natural height */
.guestbook__list.is-static { height: auto; min-height: 120px; overflow: visible; padding-bottom: 12px; -webkit-mask-image: none; mask-image: none; }
.guestbook__empty { padding-top: 120px; text-align: center; color: var(--muted); font-size: 13px; }
.guestbook__loop { will-change: transform; }
.guestbook__set + .guestbook__set { margin-top: 20px; }
.entry + .entry { margin-top: 20px; }
.entry__name { font-size: 12px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.6; color: var(--tag); }
.entry__card {
  margin-top: 4px; padding: 11px 20px 10px;   /* not positioned: keeps its shadow under the next entry's name */
  background: var(--paper); color: var(--ink); border-radius: 5px;
  box-shadow: 0 24px 15.3px 0 #000;
}
.entry__msg { font-size: 13px; line-height: 1.6; letter-spacing: -0.03em; white-space: pre-wrap; word-break: break-word; }
.entry__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; font-size: 10px; line-height: 1.6; letter-spacing: -0.03em; color: var(--date); }
.entry__date { color: var(--date); }
.entry__actions { display: flex; gap: 10px; }
.entry__actions button { font-size: 10px; color: #8a8a8a; padding: 2px 0; }
.entry__actions button:hover { color: var(--ink); }
.guestbook .btn { width: calc(100% - 44px); margin: 42px auto 0; }

/* ---------- notice (564:176) ---------- */
.notice { margin-top: 80px; height: 233px; }
.notice__text { margin-top: 30px; font-size: 14px; line-height: 2; text-align: center; white-space: nowrap; }

/* ---------- closing ---------- */
.closing { position: relative; margin-top: 93px; aspect-ratio: 404 / 605; overflow: hidden; }
.closing img { width: 100%; height: 100%; object-fit: cover; }
.closing__shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 72%, rgba(0,0,0,.5) 100%); }
.copyright { position: absolute; left: 0; right: 0; bottom: 32px; font-size: 11px; line-height: 1.6; text-align: center; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(5,5,5,.88); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.dialog {
  position: relative; width: 362px; max-width: 100%; padding: 41px 20px 43px;
  background: var(--card); border: 1px solid var(--line); text-align: center;
}
.dialog--small { padding-bottom: 30px; }
.dialog__close { position: absolute; top: 19px; right: 21px; line-height: 0; }
.dialog__title { font-size: 16px; line-height: 1.6; }
.field {
  display: block; width: 100%; height: 50px; margin-top: 10px; padding: 13px 19px;
  background: var(--paper); border: 1px solid var(--input-line); border-radius: 5px;
  font: inherit; font-size: 14px; letter-spacing: -0.03em; color: var(--ink); outline: none;
}
.dialog__title + .field { margin-top: 38px; }
.field { text-align: left; }
/* guestbook PIN: a plain text field masked with dots, so browsers do not offer password suggestions or keychain saving */
.field--secret { -webkit-text-security: disc; }
.field::placeholder { color: var(--placeholder); }
.field:focus { border-color: #888; }
.field--area { height: 173px; resize: none; line-height: 1.6; }
.dialog__note { margin-top: 10px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.dialog .btn { margin-top: 25px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* phones: form modals become a full-screen sheet sized to the *visible* viewport (--vvh/--vvt come from the
   Visual Viewport API), so the keyboard never covers the fields; the submit button sticks to the sheet bottom */
@media (max-width: 767px) {
  /* the sheet's background extends one viewport above and below the screen: when iOS pans the page to reveal a
     focused field, only sheet colour comes into view, never the page behind. The content stays one viewport tall. */
  .modal--form {
    top: -100%; bottom: -100%;
    padding: 0; align-items: center; justify-content: stretch;
    background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .modal--form .dialog {
    width: 100%; max-width: none; height: calc(100% / 3); border: 0;
    display: flex; flex-direction: column;
    padding: calc(64px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto; overscroll-behavior: contain;
  }
  .modal--form .dialog > * { flex-shrink: 0; }     /* never squash the fields: overflow scrolls instead */
  /* while a field is focused give the sheet room below, so iOS can reveal the field by scrolling the sheet itself */
  .modal--form .dialog:focus-within { padding-bottom: 60vh; }
  .modal--form .dialog__close { top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; }
  .modal--form .dialog__title { font-size: 18px; }
}

/* lightbox (527:10) */
.lightbox { padding: 0; }
/* everything sits inside a page-width column so arrows and the close button stay next to the photo on desktop */
.lightbox__inner { position: relative; width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; }
.lightbox__close { position: absolute; top: -36px; right: 30px; z-index: 1; line-height: 0; }   /* 12px above the photo, flush with its right edge (Figma had 69px; too far on phones) */
.lightbox__stage { position: relative; width: 100%; }
.lightbox__nav { position: absolute; top: 50%; z-index: 1; width: 30px; height: 64px; display: flex; align-items: center; justify-content: center; transform: translateY(-50%); color: var(--text); }
.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }
.lightbox__nav[disabled] { opacity: .25; cursor: default; }
.icon--chevron { width: 24px; height: 24px; }
.icon--chevron-left { transform: rotate(-90deg); }
.icon--chevron-right { transform: rotate(90deg); }
.lightbox__track { display: flex; width: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox__track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
@media (hover: hover) { .lightbox__track { cursor: grab; } }
.lightbox__slide img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.lightbox__track::-webkit-scrollbar { display: none; }
.lightbox__slide { flex: 0 0 100%; display: flex; justify-content: center; scroll-snap-align: center; }
.lightbox__slide img { width: 342px; max-width: calc(100vw - 60px); height: 478px; max-height: 60vh; object-fit: cover; }
.lightbox__counter { display: flex; gap: 8px; margin-top: 12px; font-size: 11px; line-height: 2; }
/* desktop: bigger photo (same 342:478 frame ratio), arrows in wider gutters, close button pinned to the screen corner */
@media (min-width: 768px) {
  .lightbox { --lb-h: min(82vh, 783px); }               /* photo height; width follows the 342:478 frame */
  .lightbox__inner { max-width: 800px; }
  .lightbox__slide img { width: auto; height: var(--lb-h); max-width: none; max-height: none; aspect-ratio: 342 / 478; }
  .lightbox__nav { width: 110px; height: 120px; }
  /* close button 12px above the photo, flush with its right edge (right edge = centre + half the photo width) */
  .lightbox__close { position: absolute; top: -36px; right: calc(50% - var(--lb-h) * 342 / 478 / 2); }
  .lightbox__counter { margin-top: 18px; font-size: 13px; }
}

/* floating buttons: stuck to the page column's right margin (20px), above the safe area */
.fab {
  position: fixed; z-index: 30;
  right: max(20px, calc(50% - 240px + 20px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
.fab__btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20,20,20,.88); border: 1px solid var(--line); color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity .25s ease, transform .25s ease, background .15s ease;
}
.fab__btn:active { background: rgba(44,43,43,.95); }
.fab__btn--top { opacity: 0; transform: translateY(8px); pointer-events: none; }
.fab__btn--top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.icon--share { width: 18px; height: 18px; }
.icon--top { width: 20px; height: 20px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 40px; z-index: 60; transform: translateX(-50%); padding: 9px 16px; background: rgba(250,250,250,.92); color: var(--ink); border-radius: 20px; font-size: 12px; letter-spacing: -0.03em; white-space: nowrap; }

@media (max-width: 400px) {
  .greeting__text, .notice__text { white-space: normal; }
  .greeting { height: auto; padding-bottom: 42px; }
  .notice { height: auto; padding-bottom: 51px; }
}
