:root {
  --emerald: #0B5D4A;
  --emerald-deep: #07402F;
  --pink: #D88FA4;
  --pink-soft: #F3D9E0;
  --yellow: #D6B04C;
  --gold: #B88A2A;
  --ivory: #F7F3EA;
  --blush: #F9F0F3;
  --ink: #24302C;
  --muted: #6A756F;
  --line: rgba(184, 138, 42, .35);

  --serif-en: "Cormorant Garamond", "Times New Roman", serif;
  --serif-zh: "Noto Serif TC", "Songti TC", serif;
  --sans: "Noto Sans TC", -apple-system, "PingFang TC", sans-serif;

  --radius: 18px;
  --shadow: 0 1px 2px rgba(36, 48, 44, .04), 0 12px 32px -12px rgba(11, 93, 74, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.7;
  letter-spacing: .02em;
  /* faint paper grain */
  background-image: radial-gradient(rgba(184, 138, 42, .06) 1px, transparent 1px);
  background-size: 4px 4px;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.6em;
  border-radius: 999px; border: 1px solid transparent;
  font: 500 1rem/1 var(--sans); letter-spacing: .08em;
  text-decoration: none; cursor: pointer;
  transition: transform .15s, background .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn small { font: italic 500 .95rem var(--serif-en); letter-spacing: .05em; opacity: .8; }
.btn-primary { background: var(--emerald); color: var(--ivory); box-shadow: 0 8px 20px -8px rgba(11, 93, 74, .6); }
.btn-primary:hover { background: var(--emerald-deep); }
.btn-ghost { background: transparent; color: var(--emerald); border-color: var(--line); }
.btn-ghost:hover { background: rgba(11, 93, 74, .05); }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: max(48px, env(safe-area-inset-top)) 24px 40px;
  max-width: 560px; margin: 0 auto;
}
.eyebrow, .sign {
  font: 600 .78rem var(--serif-en); text-transform: uppercase; letter-spacing: .32em;
  color: var(--gold); margin: 0;
}
.mark { width: 104px; margin: 18px auto 8px; }
.names { margin: 0; font-weight: normal; }
.names .zh {
  display: block; font: 700 clamp(2rem, 9vw, 2.75rem)/1.3 var(--serif-zh);
  color: var(--emerald); letter-spacing: .12em;
}
.names .zh i { font: italic 500 .8em var(--serif-en); color: var(--gold); padding: 0 .1em; }
.names .en {
  display: block; margin-top: 6px;
  font: 500 1rem var(--serif-en); text-transform: uppercase; letter-spacing: .4em; color: var(--muted);
}
.tagline { margin: 14px 0 28px; font: italic 500 1.45rem var(--serif-en); color: var(--pink); }

.arch {
  margin: 0; position: relative;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden; aspect-ratio: 3 / 4.2;
  background: #e9e7e3;
  box-shadow: var(--shadow);
}
.arch img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(1.02); }
/* thin gold inner frame */
.arch::after {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: inherit; pointer-events: none;
}
.hero-photo { width: min(78%, 340px); margin: 0 auto; outline: 1px solid var(--line); outline-offset: 8px; }

.date-row {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 36px 0 4px; font-family: var(--serif-en); color: var(--emerald);
}
.date-row span { font-size: .9rem; letter-spacing: .3em; color: var(--gold); }
.date-row b { font-size: 2.1rem; font-weight: 600; letter-spacing: .08em; padding: 0 18px; border-inline: 1px solid var(--line); }
.countdown { margin: 4px 0 26px; color: var(--muted); font-size: .9rem; }
.countdown b { color: var(--emerald); font: 600 1.2rem var(--serif-en); }

/* ---------- the road ---------- */
.road { position: relative; max-width: 560px; margin: 0 auto; padding: 0 20px 24px; }
.road::before {
  /* Yellow Brick Road: dotted golden path running through the page */
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 0;
  border-left: 3px dotted var(--yellow); opacity: .55; transform: translateX(-50%);
}
.stop { position: relative; padding: 56px 0 8px; text-align: center; }
.stop::before {
  /* road marker gem */
  content: ""; display: block; width: 14px; height: 14px; margin: 0 auto 18px;
  background: var(--emerald); border: 2px solid var(--yellow); transform: rotate(45deg);
  box-shadow: 0 0 0 6px var(--ivory);
}
.stop h2 { margin: 4px 0 10px; font: 700 1.6rem var(--serif-zh); color: var(--emerald); letter-spacing: .15em; }
.lede { margin: 0 auto 24px; max-width: 26em; color: var(--muted); font-size: .95rem; background: var(--ivory); }
.lede b { color: var(--emerald); }

.card {
  position: relative; text-align: left;
  background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 20px; box-shadow: var(--shadow);
}

/* info */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; }
.info-grid .full { grid-column: 1 / -1; padding-top: 18px; border-top: 1px dashed var(--line); }
.info-grid h3 { margin: 0 0 2px; font: 600 .75rem var(--sans); letter-spacing: .25em; color: var(--gold); }
.info-grid p { margin: 0; font-size: 1rem; }
.map-links { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.map-links .btn { min-height: 40px; padding: 0 1.1em; font-size: .9rem; }

/* gallery */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 18px;
  margin: 0 -20px; padding-inline: 20px; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .arch { scroll-snap-align: center; }

/* ---------- RSVP form ---------- */
.rsvp { padding-top: 20px; }
.progress { display: flex; justify-content: space-between; align-items: center; list-style: none; margin: 0 4px 22px; padding: 0; position: relative; }
.progress::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; border-top: 2px dotted var(--line); }
.progress li {
  position: relative; width: 12px; height: 12px; transform: rotate(45deg);
  background: #fffdf8; border: 2px solid var(--line); transition: all .25s;
}
.progress li.on { background: var(--yellow); border-color: var(--gold); }
.progress li.now { background: var(--emerald); border-color: var(--yellow); width: 16px; height: 16px; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step legend { font: 700 1.2rem var(--serif-zh); color: var(--emerald); margin-bottom: 18px; padding: 0; letter-spacing: .08em; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: .85rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; letter-spacing: .1em; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; font-size: .8rem; }
.field small { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); }
input:not([type=radio]), textarea {
  width: 100%; font: 400 16px/1.5 var(--sans); color: var(--ink);
  padding: 12px 14px; border: 1px solid rgba(36, 48, 44, .16); border-radius: 12px;
  background: #fff; transition: border-color .2s, box-shadow .2s; appearance: none;
}
input:focus, textarea:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(11, 93, 74, .12); }
textarea { resize: vertical; }
::placeholder { color: #a8afab; }
.invalid input, .invalid .choice { border-color: #c0566b; }

.choice { display: grid; gap: 10px; }
.choice.two { grid-template-columns: 1fr 1fr; }
.choice.wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.pill > span, .chip > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; padding: 10px 12px; border-radius: 14px; cursor: pointer;
  border: 1px solid rgba(36, 48, 44, .16); background: #fff; transition: all .18s; font-weight: 500;
}
.pill small { font: italic 500 .9rem var(--serif-en); color: var(--muted); font-weight: 500; }
.pill.big > span { min-height: 76px; font-size: 1.05rem; }
.chip > span { min-height: 40px; padding: 6px 18px; border-radius: 999px; }
.choice input:checked + span { border-color: var(--emerald); background: rgba(11, 93, 74, .06); color: var(--emerald); box-shadow: inset 0 0 0 1px var(--emerald); }
.pill.pink input:checked + span { border-color: var(--pink); background: var(--blush); color: #9b4d63; box-shadow: inset 0 0 0 1px var(--pink); }
.pill.muted input:checked + span { border-color: var(--muted); background: #f1f1ee; color: var(--ink); box-shadow: inset 0 0 0 1px var(--muted); }
.choice input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }

.counters { border: 1px solid rgba(36, 48, 44, .1); border-radius: 14px; margin-bottom: 18px; background: #fff; }
.counter { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.counter + .counter { border-top: 1px solid rgba(36, 48, 44, .07); }
.counter > span { font-weight: 500; }
.counter small { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: #fffdf8; color: var(--emerald); font-size: 1.1rem; cursor: pointer;
}
.stepper button:active { background: var(--emerald); color: var(--ivory); }
.stepper input { width: 40px; text-align: center; border: 0; padding: 0; font: 600 1.15rem var(--serif-en); background: transparent; }

.form-error { color: #b0475f; font-size: .88rem; margin: 0 0 12px; }
.nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 8px; }
.nav .btn-primary { flex: 1; }

.done { text-align: center; padding: 36px 24px; animation: rise .4s ease; }
.done img { margin: 0 auto 12px; }
.done h3 { font: 700 1.3rem var(--serif-zh); color: var(--emerald); margin: 0 0 8px; }
.done p { color: var(--muted); margin: 0 0 20px; }

.lookup { margin: 22px auto 0; max-width: 420px; text-align: left; background: var(--ivory); }
.lookup summary { cursor: pointer; text-align: center; color: var(--emerald); font-size: .9rem; list-style: none; text-decoration: underline dotted var(--gold); text-underline-offset: 5px; }
.lookup summary::-webkit-details-marker { display: none; }
.lookup-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 10px; margin-top: 16px; align-items: end; }
.lookup-body .btn, .lookup-body .form-error { grid-column: 1 / -1; }
.lookup-body .form-error { margin: 10px 0 0; text-align: center; }

/* ---------- footer ---------- */
.footer {
  margin-top: 56px; padding: 56px 28px max(40px, env(safe-area-inset-bottom));
  background: var(--emerald); color: var(--ivory); text-align: center;
  border-radius: 40px 40px 0 0;
}
.footer img { margin: 0 auto 18px; filter: brightness(1.6); }
.footer blockquote { margin: 0 auto; max-width: 22em; font: italic 500 1.25rem/1.5 var(--serif-en); }
.footer cite { display: block; margin-top: 10px; font-size: .95rem; color: var(--yellow); font-style: normal; letter-spacing: .1em; }
.footer .small { margin: 28px 0 0; font: 500 .8rem var(--serif-en); letter-spacing: .3em; opacity: .6; text-transform: uppercase; }

/* ---------- larger screens ---------- */
@media (min-width: 900px) {
  .hero { max-width: 1040px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; align-items: center; text-align: left; padding-top: 72px; }
  .hero > * { grid-column: 1; }
  .hero .hero-photo { grid-column: 2; grid-row: 1 / span 8; width: 100%; max-width: 380px; justify-self: center; }
  .hero .mark { margin-left: 0; }
  .date-row { justify-content: flex-start; }
  .date-row span:first-child { display: none; }
  .date-row b { padding-left: 0; border-left: 0; }
  .hero .btn { justify-self: start; }
  .road, .lookup { max-width: 640px; }
  .gallery { grid-auto-columns: 38%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* keep headings legible over the road line; use lining figures (Cormorant defaults to old-style) */
.stop .sign, .stop h2 { display: table; margin-inline: auto; padding-inline: 14px; background: var(--ivory); }
body { font-variant-numeric: lining-nums; }

/* Chinese breaks anywhere; keep phrases whole and even out line lengths */
.nb { white-space: nowrap; }
h1, h2, h3, legend, .lede, .form-error, blockquote, .done p { text-wrap: balance; }
p, small { text-wrap: pretty; }
