:root {
  --pearl: #F3F1F0;
  --ink: #1F3440;
  --ink-soft: #4B5F67;
  --blush: #E6CDC9;
  --silver: #B9B4BA;
  --line: rgba(185, 180, 186, .6);
  --field: rgba(31, 52, 64, .22);
  --error: #8A3B3B;
  --display: "Noto Serif Display", "Times New Roman", serif;
  --text: "Be Vietnam Pro", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; scrollbar-color: var(--silver) var(--pearl); }
body {
  margin: 0;
  background: var(--pearl);
  color: var(--ink);
  font: 300 1.0625rem/1.75 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* A faint wash of real nacre behind the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(243, 241, 240, .84), rgba(243, 241, 240, .84)),
    url(/assets/pearl-nacre.jpg) center / cover;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: 1px; }
::selection { background: var(--blush); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 300; text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }

/* ---------- Opening: the shell ---------- */
.gate { display: none; }
.js .gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vh, 26px);
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--pearl);
  transition: opacity 1.1s var(--ease-out), transform 1.5s var(--ease-out), filter 1.1s var(--ease-out);
}
.js .gate[hidden] { display: none; }
.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(243, 241, 240, .78), rgba(243, 241, 240, .78)),
    url(/assets/pearl-nacre.jpg) center / cover;
}
.gate-names { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.6rem, 6.6vw, 2.2rem); letter-spacing: .01em; }
.gate-box {
  position: relative;
  width: min(90vw, 62svh, 520px);
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 32px;
  -webkit-tap-highlight-color: transparent;
}
.gate-box img, .gate-box video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 52%, #000 60%, transparent 99%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 52%, #000 60%, transparent 99%);
  transition: opacity .9s var(--ease-out), transform 1.8s var(--ease-out);
}
.gate-box .open, .gate-box .film { opacity: 0; }
.gate-box .film { transition: none; }
@media (hover: hover) {
  .gate-box:hover .closed { transform: scale(1.015); }
}
.gate-box.is-playing .film { opacity: 1; }
.gate-box.is-crossfade .closed { opacity: 0; }
.gate-box.is-crossfade .open { opacity: 1; }

/* The little dancing couple, mapped onto the shell's card by site.js (matrix3d).
   The clip itself stays a hair visible: iOS pauses muted video it considers hidden. The canvas shows the processed frames. */
.gate-box .dance, .gate-box .dance-canvas, .gate-box .dance-still {
  position: absolute;
  inset: 0 auto auto 0;
  width: 360px;
  height: 360px;
  transform-origin: 0 0;
  -webkit-mask-image: none;
          mask-image: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s var(--ease-out);
}
.gate-box .dance { opacity: .02; transition: none; }
.gate-box.is-dancing .dance-canvas, .gate-box.show-dip .dance-still { opacity: 1; }
.gate-box { transform-origin: 51.5% 38.9%; transition: transform 3.4s var(--ease-out); }
.gate-box.is-dancing, .gate-box.show-dip { transform: scale(1.7); }
@media (prefers-reduced-motion: reduce) {
  .gate-box.is-dancing, .gate-box.show-dip { transform: none; }
}
.gate-names, .gate-hint { position: relative; z-index: 2; }
.for-skip { display: none; }
.is-dancing .for-open { display: none; }
.is-dancing .for-skip { display: inline; }
.bloom {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 62%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 64%);
  opacity: 0;
  pointer-events: none;
}
.is-revealing .bloom { animation: bloom 1.4s var(--ease-out) both; }
@keyframes bloom {
  0% { opacity: 0; transform: scale(.5); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.7); }
}
.gate-hint { margin: 0; font-size: .92rem; letter-spacing: .03em; color: var(--ink-soft); opacity: 0; animation: fade-in 1s 1s var(--ease-out) forwards; }
.hint-click { display: none; }
@media (hover: hover) and (pointer: fine) {
  .hint-tap { display: none; }
  .hint-click { display: inline; }
}
@keyframes fade-in { to { opacity: 1; } }
.is-opening .gate-hint { animation: none; opacity: 0; transition: opacity .3s; }
.is-dancing .gate-hint { opacity: 1; transition: opacity .8s .9s; }
.is-open .gate { opacity: 0; transform: scale(1.07); filter: blur(6px); pointer-events: none; }
body.is-sealed { overflow: hidden; }

/* ---------- Top bar ---------- */
.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px 16px;
  background: rgba(243, 241, 240, .94);
  border-bottom: 1px solid rgba(185, 180, 186, .45);
}
.mono { font-family: var(--display); font-size: 1.2rem; text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.mono i { font-weight: 300; color: var(--ink-soft); }
.tools { display: flex; align-items: center; gap: 6px; }
.lang { display: flex; }
.lang button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  background: none;
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--ink-soft);
  cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: .35em; }
.music {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.music:hover { background: rgba(31, 52, 64, .07); }
.music .slash { opacity: 1; }
.music[aria-pressed="true"] .slash { opacity: 0; }
.bar-rsvp {
  margin-left: 4px;
  font-size: .85rem;
  font-weight: 400;
  letter-spacing: .04em;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}
.bar-rsvp:hover { background: var(--ink); color: var(--pearl); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 92px 16px 72px;
}
.garland { width: min(1000px, 100%); margin: 0 auto 4px; mix-blend-mode: multiply; }
.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: .1em 0 .3em;
  font-size: clamp(3.6rem, 17vw, 6rem);
  line-height: .95;
  letter-spacing: -.012em;
}
.names .amp { font-style: italic; font-size: .5em; line-height: 1.35; color: var(--ink-soft); }
.names:focus { outline: none; }
@media (min-width: 760px) {
  .names { flex-direction: row; align-items: baseline; gap: .28em; }
}
.when { margin: .3em 0 .2em; font-family: var(--display); font-weight: 400; font-size: clamp(1.3rem, 5.2vw, 1.65rem); }
.where { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.count { min-height: 1.75em; margin: 1.3em 0 1.7em; font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--ink-soft); }
.count b { font-weight: 400; color: var(--ink); font-variant-numeric: lining-nums; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--pearl);
  font: 400 .95rem/1 var(--text);
  letter-spacing: .05em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(31, 52, 64, .55);
  transition: background-color .3s, transform .3s var(--ease-out);
}
.btn:hover { background: #2B4655; transform: translateY(-1px); }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.by { margin: .9em 0 0; font-size: .86rem; color: var(--ink-soft); }

.js .hero > * { opacity: 0; transform: translateY(18px); }
.is-open .hero > * {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s var(--ease-out), transform 1.5s var(--ease-out);
  transition-delay: calc(.35s + var(--i, 0) * .11s);
}

/* ---------- Shared section rhythm ---------- */
.section { padding: clamp(56px, 9vw, 112px) 24px; }
.wrap { max-width: 1100px; margin: 0 auto; }
.section h2 { margin: 0 0 .55em; font-size: clamp(2.2rem, 8.4vw, 3.1rem); line-height: 1.05; letter-spacing: -.01em; }
.pearls { display: flex; justify-content: center; gap: 10px; margin: 0 auto 28px; }
.pearls i, .strand li::before {
  display: block;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 12%, #F7F2F4 30%, #E4DAE1 64%, #CBBFCB 100%);
  box-shadow: 0 2px 4px rgba(31, 52, 64, .2);
}
.pearls i:nth-child(2) { width: 17px; height: 17px; margin-top: -2px; }

/* Letter */
.letter { max-width: 36rem; margin: 0 auto; text-align: center; }
.letter p { margin: 0 0 1em; font-family: var(--display); font-size: clamp(1.28rem, 4.8vw, 1.55rem); line-height: 1.55; }
.letter .sign { margin-top: 1.5em; font-style: italic; }

/* Story */
.story { display: grid; gap: 44px; align-items: center; }
@media (min-width: 880px) { .story { grid-template-columns: 5fr 6fr; gap: 80px; } }
.arch {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 20px 20px;
  overflow: hidden;
  box-shadow: 0 34px 60px -34px rgba(31, 52, 64, .45);
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 78%; }
.arch::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px 999px 12px 12px;
  pointer-events: none;
}
.arch, .painting { width: 100%; max-width: 560px; margin-inline: auto; }
.story p { margin: 0 0 1em; max-width: 36rem; }
.story h3 { margin: 1.7em 0 .35em; font-style: italic; font-size: 1.5rem; }

/* Schedule: a strand of pearls */
.day { display: grid; gap: 48px; align-items: center; }
@media (min-width: 880px) { .day { grid-template-columns: 6fr 5fr; gap: 80px; } }
.painting { margin: 0 auto; border-radius: 6px; overflow: hidden; box-shadow: 0 34px 60px -34px rgba(31, 52, 64, .4); }
.day h3 { margin: 1.4em 0 .7em; font-size: 1.45rem; font-weight: 400; }
.day h2 + h3 { margin-top: 0; }
.strand { position: relative; list-style: none; margin: 0; padding: 0 0 0 34px; }
.strand li { position: relative; padding-bottom: 24px; }
.strand li::before { content: ""; position: absolute; left: -34px; top: .42em; }
.strand li:not(:last-child)::after { content: ""; position: absolute; left: -28px; top: calc(.42em + 13px); bottom: -.42em; width: 1px; background: var(--silver); }
.strand time { display: block; font-size: .88rem; font-weight: 400; letter-spacing: .02em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.strand strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.32rem; line-height: 1.3; }
.strand span { display: block; color: var(--ink-soft); font-size: .98rem; }
.map { margin: .4em 0 0; font-size: .95rem; }

/* Dress code */
.dress-head { text-align: center; max-width: 34rem; margin: 0 auto 48px; }
.dress-head p { margin: 0; color: var(--ink-soft); }
.dress-grid { display: grid; gap: 64px; }
@media (min-width: 760px) { .dress-grid { grid-template-columns: 1fr 1fr; gap: 56px; } }
.board { margin: 0 0 22px; aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; box-shadow: 0 30px 56px -34px rgba(31, 52, 64, .45); }
.board img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.dress-grid h3 { margin: 0; font-size: 1.8rem; }
.dress-grid .code { margin: .1em 0 .7em; font-family: var(--display); font-style: italic; font-size: 1.2rem; color: var(--ink-soft); }
.dress-grid p { margin: 0 0 .8em; }
.dress-grid .aside { color: var(--ink-soft); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px 16px; list-style: none; margin: 14px 0 0; padding: 0; font-size: .86rem; color: var(--ink-soft); }
.swatches li { display: flex; align-items: center; gap: 7px; }
.swatches li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(31, 52, 64, .16); }

/* ---------- RSVP ---------- */
.rsvp-card { max-width: 38rem; margin: 0 auto; }
.rsvp-card > h2, .rsvp-card > .lede, .rsvp-card > .note { text-align: center; }
.rsvp .lede { margin: 0 0 .4em; font-family: var(--display); font-size: 1.2rem; }
.rsvp .note { margin: 0 auto 2.2em; max-width: 30rem; color: var(--ink-soft); font-size: .95rem; }
.field { margin: 0 0 22px; }
fieldset.field { border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; padding: 0; margin: 0 0 8px; font-size: .95rem; font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  font: 400 1rem/1.4 var(--text);
  color: var(--ink);
  background: rgba(255, 255, 255, .66);
  border: 1px solid var(--field);
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 104px; resize: vertical; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 52%, calc(100% - 16px) 52%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(31, 52, 64, .14); }
.field [aria-invalid="true"] { border-color: var(--error); }
.choices { display: grid; gap: 10px; }
@media (min-width: 560px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--field);
  border-radius: 14px;
  background: rgba(255, 255, 255, .5);
  transition: border-color .2s, background-color .2s;
}
.choice span::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(31, 52, 64, .4);
  background: #fff;
}
.choice input[type="checkbox"] + span::before { border-radius: 5px; }
/* A chosen answer gets a pearl */
.choice input:checked + span { border-color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink); }
.choice input:checked + span::before {
  border-color: transparent;
  background: radial-gradient(circle at 34% 30%, #fff 0 12%, #F7F2F4 30%, #E4DAE1 64%, #CBBFCB 100%);
  box-shadow: 0 1px 3px rgba(31, 52, 64, .35);
}
.choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.invalid .choice span { border-color: var(--error); }
.err { margin: 6px 0 0; color: var(--error); font-size: .88rem; }
.form-alert { margin: 0 0 20px; padding: 12px 16px; border-radius: 12px; background: rgba(138, 59, 59, .08); color: var(--error); font-size: .95rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.submit { width: 100%; margin-top: 8px; }
@media (min-width: 560px) { .submit { width: auto; } }
.thanks { text-align: center; padding: 8px 0; }
.thanks:focus { outline: none; }
.thanks h3 { margin: 0 0 .3em; font-size: 2rem; }
.thanks p { margin: 0 auto .8em; max-width: 28rem; }
.thanks .small { color: var(--ink-soft); font-size: .92rem; }
.thanks.is-yes .thanks-no, .thanks.is-no .thanks-yes { display: none; }
.link-btn { padding: 8px 4px; border: 0; background: none; font-size: .95rem; text-decoration: underline; text-underline-offset: .22em; cursor: pointer; }

/* ---------- Plan your trip ---------- */
.plan details { border-bottom: 1px solid var(--line); }
.plan h2 + details { border-top: 1px solid var(--line); }
.plan summary { position: relative; display: block; padding: 22px 44px 22px 0; cursor: pointer; list-style: none; }
.plan summary::-webkit-details-marker { display: none; }
.plan summary span { display: block; font-family: var(--display); font-size: 1.5rem; line-height: 1.3; }
.plan summary small { display: block; color: var(--ink-soft); font-size: .95rem; }
.plan summary::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .3s var(--ease-out);
}
.plan details[open] summary::after { transform: translateY(-20%) rotate(-135deg); }
.detail { max-width: 46rem; padding: 0 0 32px; }
.detail h3 { margin: 1.5em 0 .3em; font-weight: 400; font-size: 1.25rem; }
.detail > :first-child { margin-top: 0; }
.detail p { margin: 0 0 .9em; }
.detail ul { margin: 0 0 1em; padding-left: 1.2em; }
.detail li { margin-bottom: .4em; }
.detail .stays { list-style: none; padding: 0; }
.detail .stays li { margin-bottom: 1em; }
.detail .stays strong { display: block; font-weight: 500; }
.detail .go { display: block; width: fit-content; padding: 6px 0 2px; }
.detail .links { display: flex; flex-wrap: wrap; column-gap: 22px; margin: 0 0 .9em; }
.detail .stays .links { margin: 0; }
.detail .links a { display: inline-block; padding: 6px 0 2px; }
.detail dl { margin: 0; }
.detail dt { margin-top: 1.2em; font-weight: 500; }
.detail dt:first-child { margin-top: 0; }
.detail dd { margin: .2em 0 0; }

footer { padding: 48px 24px 64px; text-align: center; color: var(--ink-soft); font-size: .9rem; }
footer .mono { display: block; margin-bottom: 6px; font-size: 1.5rem; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}
