:root {
  --peach: #ffdcb7;
  --blush: #e2b99a;
  --terra: #cb7f4f;
  --terra-deep: #a8623a;
  --sun: #f8d482;
  --sand: #ebdec0;
  --olive: #c6c09c;
  --sage-deep: #768e78;
  --sage: #9caf88;
  --ink: #3d4a3e;
  --ink-soft: #6a7568;
  --paper: #fbf7ef;
  --card: #fffdf8;
  --line: #e4dccb;
  --serif: "Fraunces", "Noto Serif Thai", Georgia, serif;
  --sans: "Jost", "Noto Sans Thai", system-ui, sans-serif;
}
html[lang="th"] {
  --serif: "Noto Serif Thai", "Fraunces", serif;
  --sans: "Noto Sans Thai", "Jost", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 300 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 300; margin: 0; line-height: 1.15; }
h2 { font-size: clamp(2.1rem, 5vw, 3.2rem); color: var(--sage-deep); }
html[lang="th"] h2 { line-height: 1.4; }
p { margin: 0; }
a { color: var(--terra-deep); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(640px, 100% - 32px); }
.eyebrow {
  font: 400 .8rem/1.4 var(--sans);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--terra); margin-bottom: .6rem;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 10px 24px;
  transition: background .3s, box-shadow .3s;
}
.topbar.solid { background: rgba(251, 247, 239, .94); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line); }
.topbar-mark { opacity: 0; transition: opacity .3s; pointer-events: none; }
.topbar.solid .topbar-mark { opacity: 1; pointer-events: auto; }
.topbar-mark img { height: 40px; width: auto; }
.topnav { display: flex; gap: 1.6rem; margin-left: auto; }
.topnav a, .lang button {
  font: 400 .85rem var(--sans); letter-spacing: .08em; text-transform: uppercase;
  color: #fff; text-decoration: none;
}
.topbar.solid .topnav a, .topbar.solid .lang button { color: var(--ink); }
.lang { display: flex; border: 1px solid rgba(255,255,255,.6); border-radius: 99px; overflow: hidden; }
.topbar.solid .lang { border-color: var(--line); }
.lang button { background: none; border: 0; padding: 5px 12px; cursor: pointer; text-transform: none; }
.lang button[aria-pressed="true"] { background: rgba(255,255,255,.25); }
.topbar.solid .lang button[aria-pressed="true"] { background: var(--sand); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; background: #2f3a2c; }
.hero picture, .hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo { object-fit: cover; object-position: 50% 62%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,30,18,.35) 0%, rgba(20,30,18,0) 30%, rgba(20,30,18,0) 55%, rgba(20,30,18,.5) 100%); }
.hero-content {
  position: relative; text-align: center; color: #fff;
  align-self: stretch; display: flex; flex-direction: column; align-items: center;
  padding: 14vh 16px 7vh;
}
.hero h1 .logo-on-paper { display: none; }
.hero h1 img { width: clamp(190px, 28vw, 320px); height: auto; filter: drop-shadow(0 2px 14px rgba(0,0,0,.25)); }
.hero-date { margin-top: auto; font: 300 clamp(2rem, 5vw, 3rem)/1 "Fraunces", serif; letter-spacing: .02em; }
.hero-venue { margin-top: auto; font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; }
.hero-tag { margin-top: .3rem; font-size: .95rem; opacity: .9; }

/* Invitation */
.invite {
  display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; align-items: center; gap: 24px;
  padding: 96px 0 72px; text-align: center;
}
.invite-flower { width: 100%; max-width: 170px; justify-self: start; }
.invite-flower.mirror { justify-self: end; transform: scaleX(-1); }
.parents { color: var(--ink-soft); font-size: 1rem; }
.invite-line { margin: 1.4rem 0 1.2rem; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--ink-soft); }
html[lang="th"] .invite-line { font-style: normal; }
.couple-names { display: flex; flex-direction: column; gap: .2rem; font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--sage-deep); }
.couple-names .amp { font-size: .8em; color: #e8b84a; }
.invite-date { margin-top: 1.4rem; letter-spacing: .12em; text-transform: uppercase; font-size: .9rem; font-weight: 400; color: var(--sage-deep); }

/* Day */
.day { background: var(--sand); padding: 88px 0; }
.day h2 { margin-bottom: 2.4rem; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--olive); }
.timeline li { position: relative; display: grid; grid-template-columns: 84px 1fr; gap: 1rem; padding: 0 0 2rem 1.6rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .45rem; width: 13px; height: 13px; border-radius: 50%;
  background: var(--sand); border: 2px solid var(--terra);
}
.timeline time { font: 300 1.7rem/1 "Fraunces", serif; color: var(--terra); }
.timeline h3 { font-size: 1.35rem; color: var(--ink); }
.timeline p { color: var(--ink-soft); margin-top: .2rem; }

/* Venue */
.venue { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 32px; padding: 88px 0; }
.venue-card { max-width: 560px; }
.theme { margin-top: 2.4rem; }
.swatches { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.swatches li { width: 34px; height: 34px; border-radius: 50%; background: var(--c); }
.venue-th { margin: .3rem 0 1.6rem; font-family: "Noto Serif Thai", serif; font-size: 1.3rem; color: var(--ink-soft); }
.venue-flower { width: 150px; }

/* Buttons + forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 400 .9rem var(--sans); letter-spacing: .1em; text-transform: uppercase;
  padding: 13px 26px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--terra); color: var(--terra-deep); background: transparent; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--terra); color: #fff; }
.btn-solid { background: var(--terra); color: #fff; }
.btn-solid:hover { background: var(--terra-deep); border-color: var(--terra-deep); }
.btn:disabled { opacity: .6; cursor: progress; }
.link-btn { background: none; border: 0; color: var(--terra-deep); text-decoration: underline; cursor: pointer; font: inherit; }

input, select, textarea {
  width: 100%; font: 300 1rem var(--sans); color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sage); outline-offset: 1px; border-color: var(--sage); }
label { display: block; font-size: .95rem; font-weight: 400; margin-bottom: .35rem; }
.opt { color: var(--ink-soft); font-weight: 300; }

.guest { padding: 88px 0; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guest h2 { margin-bottom: 1.8rem; }
.gate p { color: var(--ink-soft); }
.gate-row { display: flex; gap: 10px; margin-top: 1rem; }
.gate-row input { flex: 1; }
.form-msg { margin-top: .8rem; font-size: .95rem; min-height: 1.4em; }
.form-msg.err { color: #b0452b; }
.form-msg.ok { color: var(--sage-deep); }

.rsvp-form { display: grid; gap: 1.2rem; }
.choice { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice legend { font-weight: 400; font-size: .95rem; margin-bottom: .5rem; padding: 0; }
.choice label {
  display: flex; align-items: center; gap: .6rem; margin: 0; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper);
}
.choice label:has(input:checked) { border-color: var(--terra); background: #fff4ea; }
.choice input, .check input { width: auto; accent-color: var(--terra); }
.if-yes { display: grid; gap: 1.2rem; }
.rsvp-form.declining .if-yes { display: none; }
.field-row { display: grid; gap: 1rem; }
.check { display: flex; gap: .6rem; align-items: center; font-weight: 300; cursor: pointer; margin: 0; }
.rsvp-form .btn-solid { justify-self: start; }

.done { text-align: center; padding: 1rem 0; }
.done img { width: 90px; margin: 0 auto 1rem; }
.done-title { font: 300 2rem var(--serif); color: var(--terra); }
.done p { margin-bottom: .6rem; }

/* Photos */
.photos { padding: 88px 0 96px; }
.photos .lede { color: var(--ink-soft); margin: .8rem 0 2rem; max-width: 560px; }
.locked-note { padding: 28px; border: 1px dashed var(--olive); border-radius: 16px; color: var(--ink-soft); text-align: center; }
.upload { display: grid; gap: 12px; margin-bottom: 2rem; max-width: 640px; }
.drop {
  position: relative; display: grid; place-items: center; text-align: center; gap: .2rem; margin: 0;
  padding: 34px 20px; border: 1.5px dashed var(--sage); border-radius: 16px; background: #f4f5ec; cursor: pointer;
  transition: background .2s;
}
.drop:hover, .drop.over { background: #e9eddd; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-title { font: 400 1.3rem var(--serif); color: var(--sage-deep); }
.drop-sub { font-size: .9rem; color: var(--ink-soft); }
.progress { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--terra); transition: width .2s; }

.gallery { columns: 4 220px; column-gap: 12px; }
.gallery button {
  display: block; width: 100%; margin: 0 0 12px; padding: 0; border: 0; background: var(--sand);
  border-radius: 10px; overflow: hidden; cursor: zoom-in; break-inside: avoid;
}
.gallery img { width: 100%; height: auto; transition: transform .4s; }
.gallery button:hover img { transform: scale(1.03); }
.gallery-empty { color: var(--ink-soft); }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(25, 30, 22, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; }
.lb-caption { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #eee; font-size: .95rem; }
.lightbox button { position: fixed; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; padding: 10px 18px; line-height: 1; }
.lb-close { top: 8px; right: 8px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

/* Footer */
.footer { text-align: center; padding: 64px 16px 72px; background: var(--sand); color: var(--ink-soft); }
.footer img { width: 140px; margin: 0 auto 1.2rem; }
.footer-tag { color: var(--terra); margin-top: .3rem; }

@media (max-width: 760px) {
  .topbar { padding: 8px 16px; gap: .8rem; }
  .topnav { display: none; }
  .lang { margin-left: auto; }
  .invite { grid-template-columns: 1fr; padding: 64px 0 48px; }
  .invite-flower { max-width: 100px; justify-self: center; }
  .invite-flower:not(.mirror) { display: none; }
  .day, .venue, .guest, .photos { padding-block: 64px; }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .venue { grid-template-columns: 1fr; }
  .venue-flower { width: 90px; justify-self: center; }
  .choice { grid-template-columns: 1fr; }
  .gallery { columns: 2; column-gap: 8px; }
  .gallery button { margin-bottom: 8px; }
}
/* Desktop hero: photo beside the logotype, like the poster */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .hero { grid-template-columns: minmax(0, 46%) 1fr; place-items: stretch; background: var(--sand); }
  .hero picture { position: relative; grid-column: 1; grid-row: 1; height: 100svh; }
  .hero-photo { object-position: 50% 55%; }
  .hero-shade { display: none; }
  .hero-content { grid-column: 2; grid-row: 1; color: var(--ink); justify-content: center; padding: 80px 48px; }
  .hero h1 img { filter: none; width: clamp(240px, 26vw, 380px); }
  .hero h1 .logo-on-photo { display: none; }
  .hero h1 .logo-on-paper { display: block; }
  .hero-venue { margin-top: 2.4rem; }
  .hero-venue { color: var(--ink-soft); }
  .hero-tag { color: var(--terra); }
  .topbar:not(.solid) .topnav a, .topbar:not(.solid) .lang button { color: var(--ink); }
  .topbar:not(.solid) .lang { border-color: var(--olive); }
  .topbar:not(.solid) .lang button[aria-pressed="true"] { background: rgba(255,255,255,.6); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
