:root {
  --ink: #1f2a22;
  --muted: #5b6a5f;
  --paper: #f7f4ee;
  --card: #ffffff;
  --leaf: #1f4323;
  --leaf-soft: #e4ebe2;
  --line: #d9d4c8;
  --vermilion: #a8332a;
  --gold: #c9a227;
  --imperial-yellow: #f2c94c;
  --white: #ffffff;
  --serif: "Bodoni Moda", "Noto Serif SC", "Songti SC", Georgia, serif;
  --script: "Mrs Saint Delafield", "Bodoni Moda", cursive;
  --sans: "Open Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
:lang(zh) body, body:lang(zh) { letter-spacing: 0.02em; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  color: var(--white);
  background: #22301f var(--hero, none) center 70% / cover no-repeat;
  padding: 16px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 20, 10, 0.55) 0%, rgba(10, 20, 10, 0.15) 45%, rgba(10, 20, 10, 0.35) 100%);
}
.hero > * { position: relative; }
.hero-text { margin-top: clamp(64px, 12vh, 140px); }
.names {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  font-size: clamp(14px, 2.4vw, 22px);
  margin: 0 0 12px;
  padding-left: 0.5em;
}
.date {
  font-family: var(--serif);
  font-size: clamp(38px, 9vw, 104px);
  line-height: 1.05;
  overflow-wrap: anywhere;
  margin: 0;
  font-weight: 400;
}
.date sup { font-size: 0.45em; }
.place {
  font-family: var(--serif);
  font-size: clamp(22px, 4vw, 40px);
  margin: 8px 0 0;
}
.script {
  font-family: var(--script);
  font-size: clamp(56px, 11vw, 120px);
  line-height: 0.9;
  margin: 24px 0 0;
  font-weight: 400;
}
:lang(zh) .script { font-family: var(--serif); font-size: clamp(32px, 6vw, 56px); letter-spacing: 0.3em; padding-left: 0.3em; }

/* ---------- Language chooser (landing) ---------- */
.lang-choice {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}
.lang-choice a {
  min-width: 140px;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 18px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(4px);
  transition: background 0.2s, color 0.2s;
}
.lang-choice a:hover, .lang-choice a:focus-visible { background: var(--white); color: var(--leaf); outline: none; }
.lang-prompt { font-size: 14px; letter-spacing: 0.15em; margin: 0; opacity: 0.9; }

/* ---------- Top bar on language pages ---------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 14px 16px;
  font-size: 14px;
  z-index: 2;
}
.topbar nav { display: flex; gap: 12px; flex-wrap: wrap; }
.topbar .langs { margin-left: auto; }
.topbar a { text-decoration: none; opacity: 0.9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar .langs a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.scroll-cue {
  margin-top: auto;
  margin-bottom: 24px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
}

/* ---------- Sections ---------- */
section { padding: 72px 16px; }
.wrap { max-width: 720px; margin: 0 auto; }
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 44px);
  text-align: center;
  margin: 0 0 8px;
  color: var(--leaf);
}
.lead { text-align: center; color: var(--muted); margin: 0 auto 36px; max-width: 560px; }

.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.detail {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 18px;
  text-align: center;
}
.detail .label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.detail .value { font-family: var(--serif); font-size: 22px; margin-top: 6px; }

.countdown { display: flex; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.countdown div { text-align: center; min-width: 72px; }
.countdown strong { display: block; font-family: var(--serif); font-size: 34px; font-weight: 400; color: var(--leaf); }
.countdown span { font-size: 12px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

.photo { padding: 0 16px 72px; }
.photo img { width: 100%; max-width: 420px; margin: 0 auto; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }

/* ---------- RSVP form ---------- */
#rsvp { background: var(--leaf-soft); }
form.rsvp {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 20px;
  border: 1px solid var(--line);
  display: grid;
  gap: 16px;
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
label.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--leaf); outline-offset: 1px; border-color: transparent; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 14px; color: var(--muted); margin-bottom: 8px; padding: 0; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 15px;
}
.options input { accent-color: var(--leaf); margin: 0; }
.options label:has(input:checked) { border-color: var(--leaf); background: var(--leaf-soft); }
button[type="submit"], .rsvp-button {
  justify-self: center;
  font: inherit;
  font-family: var(--serif);
  font-size: 18px;
  padding: 12px 40px;
  border: 0;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  cursor: pointer;
}
button[type="submit"]:hover, .rsvp-button:hover { filter: brightness(1.15); }
button[disabled] { opacity: 0.6; cursor: wait; }
.form-msg { text-align: center; padding: 28px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.form-msg h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--leaf); margin: 0 0 6px; }
.form-msg.error { border-color: #b4483c; color: #b4483c; }

footer { text-align: center; padding: 32px 16px 48px; color: var(--muted); font-size: 14px; }
footer .monogram { font-family: var(--script); font-size: 44px; color: var(--leaf); line-height: 1; }

/* Landscape screens: crop the photo so the title sits over the trees, not the faces. */
@media (min-aspect-ratio: 1/1) {
  .hero { background-position: center 30%; }
  .hero-text { margin-top: clamp(56px, 8vh, 96px); }
  .script { font-size: clamp(48px, 7vw, 96px); margin-top: 12px; }
}

/* ---------- Our story ---------- */
#story { background: var(--paper); }
/* The card grows with the screen: full width on phones, up to ~1100px on large screens */
#story .wrap { max-width: min(1100px, 100%); }
.story-card {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 64px clamp(20px, 6vw, 80px) 48px;
  background: #fbf3dc;
  border: 3px double var(--gold);
  outline: 1px solid var(--vermilion);
  outline-offset: 8px;
  border-radius: 4px;
  box-shadow: 0 18px 40px rgba(60, 30, 10, 0.12);
}
/* Vermilion corner brackets, a nod to palace window lattices */
.story-card::before, .story-card::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid var(--vermilion);
}
.story-card::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.story-card::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.seal {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--vermilion);
  color: var(--imperial-yellow);
  font-family: var(--serif);
  font-size: 32px;
  border: 3px solid var(--imperial-yellow);
  box-shadow: 0 6px 16px rgba(120, 30, 20, 0.3);
}
.story-card h2 { color: var(--vermilion); margin-bottom: 20px; }
.story p { max-width: 820px; margin: 0 auto 18px; text-align: center; color: #3b2f22; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.75; }
.story p:last-child { margin-bottom: 0; }


label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
label.check input { accent-color: var(--leaf); margin-top: 5px; }
select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6a5f' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }

/* ---------- Travel guide ---------- */
.wrap.wide { max-width: min(1000px, 100%); }
.guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.guide-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 22px;
}
.guide-group h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  color: var(--leaf);
  margin: 0 0 12px;
}
.guide-group ul { list-style: none; margin: 0; padding: 0; }
.guide-group li { padding: 10px 0; border-top: 1px solid var(--line); }
.guide-group li:first-child { border-top: 0; padding-top: 0; }
.guide-group a { display: block; font-weight: 600; color: var(--leaf); text-decoration: none; }
.guide-group a::after { content: " ↗"; font-weight: 400; }
.guide-group a:hover { text-decoration: underline; }
.guide-group li span { display: block; font-size: 14px; color: var(--muted); }
.tip {
  margin: 20px auto 0;
  max-width: 760px;
  padding: 14px 18px;
  border-left: 3px solid var(--vermilion);
  background: #fbf3dc;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
}

/* ---------- Ask the "AI agent" ---------- */
#ask { background: var(--leaf); }
.ask-card { text-align: center; color: #fff; }
.ask-card h2 { color: #fff; }
.ask-sub { font-family: var(--serif); font-size: 24px; color: var(--imperial-yellow); margin: 0 0 16px; letter-spacing: 0.04em; }
.ask-card p { max-width: 560px; margin-left: auto; margin-right: auto; }
.contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }
.contact-btn {
  display: grid;
  gap: 2px;
  flex: 0 1 300px;
  padding: 14px 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: background 0.2s;
}
.contact-btn:hover { background: rgba(255, 255, 255, 0.2); }
.contact-label { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.8; }
.contact-value { font-size: 16px; overflow-wrap: anywhere; }
button.contact-btn { font: inherit; color: inherit; cursor: pointer; text-align: center; }

/* ---------- Venue ---------- */
.venue {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 22px;
  text-align: center;
}
.venue h3 { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--leaf); margin: 0 0 6px; }
.venue p { margin: 0 auto 10px; max-width: 560px; }
.venue-name { font-family: var(--serif); font-size: 20px; color: var(--vermilion); }
.venue-address { font-weight: 600; }
.venue-taxi { display: inline-grid; gap: 2px; padding: 10px 16px; background: #fbf3dc; border-radius: 8px; }
.venue-taxi span { font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.venue-taxi strong { font-size: 18px; font-weight: 600; }
.venue-metro { font-size: 15px; color: var(--muted); }
.map-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 8px; }
.map-links a {
  padding: 9px 16px;
  border: 1px solid var(--leaf);
  border-radius: 999px;
  color: var(--leaf);
  text-decoration: none;
  font-size: 15px;
}
.map-links a:hover { background: var(--leaf); color: #fff; }
.maps-note { font-size: 13px; color: var(--muted); }

.airport {
  display: block;
  max-width: 560px;
  margin: 12px auto;
  padding: 12px 16px;
  border: 1px dashed var(--vermilion);
  border-radius: 10px;
  background: #fbf3dc;
  text-align: center;
}
.airport strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--vermilion); }
#travel .airport { margin-bottom: 24px; }

/* ---------- Password gate ---------- */
.gate {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--leaf);
}
.gate form {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 32px 24px;
  background: var(--paper);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
.gate .monogram { font-family: var(--script); font-size: 56px; color: var(--leaf); line-height: 1; }
.gate label { font-size: 14px; color: var(--muted); }
.gate input { width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
.gate button {
  font: inherit;
  font-family: var(--serif);
  font-size: 18px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--leaf);
  color: #fff;
  cursor: pointer;
}
.gate-error { margin: 0; color: var(--vermilion); font-size: 14px; }

.rsvp-action { margin: 32px 0; }
.rsvp-button { display: inline-block; text-decoration: none; }
