/* =========================================================
   Noon & Ole — Wedding
   Ivory · Champagne gold · Espresso
   ========================================================= */

:root {
  --ivory: #fbf8f3;
  --cream: #f5efe6;
  --sand: #ece2d4;
  --blush: #ead7cc;
  --gold: #b48f57;
  --gold-soft: #d6bf94;
  --gold-pale: #ebdcc0;
  --ink: #2c2420;
  --ink-soft: #5a4c44;
  --muted: #8a7a6f;
  --line: rgba(180, 143, 87, 0.35);

  --serif: "Cormorant Garamond", "Noto Serif Thai", serif;
  --script: "Pinyon Script", cursive;
  --sans: "Jost", "Noto Serif Thai", sans-serif;
  --thai: "Noto Serif Thai", serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--thai);
  font-weight: 400;
  line-height: 1.7;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

/* fine paper grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video { display: block; max-width: 100%; }
.nw { display: inline-block; white-space: nowrap; }
video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--gold-pale); color: var(--ink); }

/* ---------- shared type ---------- */
.label {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}
.label.light { color: var(--gold-soft); }

.section-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.section-title em,
.section-title i {
  font-family: var(--script);
  font-style: normal;
  font-size: 0.8em;
  color: var(--gold);
  padding: 0 0.08em;
}

.section-sub {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
}

.script-title {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 4.6rem);
  line-height: 1.1;
  color: var(--ink);
}

.ornament {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
  font-size: 0.7rem;
}
.ornament i {
  display: block;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.ornament i:last-child { transform: scaleX(-1); }

/* ---------- buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), color 0.4s ease, background 0.4s ease;
}
.btn svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn::before { /* gold shine sweep */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: scale(0.96); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.5);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--ink); box-shadow: 0 10px 30px -12px rgba(140, 105, 60, 0.4); }

.btn-solid {
  color: #fff;
  background: linear-gradient(135deg, #c7a46b, #a67f48);
  box-shadow: 0 12px 30px -12px rgba(140, 100, 50, 0.6);
}
.btn-solid:hover { box-shadow: 0 16px 36px -12px rgba(140, 100, 50, 0.75); }

.ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(214, 191, 148, 0.45);
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.8s var(--ease) forwards;
}
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* =========================================================
   ENTRY / ENVELOPE
   ========================================================= */
.entry {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #fffdf9 0%, #f8f1e7 45%, #eee1cf 100%);
  transition: opacity 1.2s var(--ease), visibility 1.2s;
}
.entry.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

.entry-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.entry-frame {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(180, 143, 87, 0.35);
  pointer-events: none;
}
.entry-frame::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(180, 143, 87, 0.16);
}

.entry-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px;
}

.entry-kicker {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold);
  animation: fade-up 1.2s var(--ease) 0.2s both;
}

.entry-names {
  margin: 4px 0 2px;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 13vw, 5.4rem);
  line-height: 1.15;
  color: var(--ink);
  animation: fade-up 1.4s var(--ease) 0.35s both;
}
.entry-names em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.55em;
  color: var(--gold);
  margin: 0 0.1em;
}
.entry-inner > .ornament { margin-bottom: 26px; animation: fade-up 1.2s var(--ease) 0.5s both; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

.entry-kicker, .entry-names, .entry-inner > .ornament, .entry-date, .entry-hint {
  transition: opacity 0.7s ease, transform 0.9s var(--ease), filter 0.7s ease;
}

/* envelope */
.envelope {
  position: relative;
  display: block;
  width: min(400px, 82vw);
  aspect-ratio: 1.5;
  perspective: 1400px;
  animation: fade-up 1.4s var(--ease) 0.6s both, env-float 5s ease-in-out 2s infinite;
  transition: transform 1.1s var(--ease);
}
.envelope:focus-visible { outline: 1px solid var(--gold); outline-offset: 10px; }

@keyframes env-float {
  0%, 100% { transform: translateY(0) rotate(-0.4deg); }
  50%      { transform: translateY(-7px) rotate(0.4deg); }
}

.envelope > span { position: absolute; display: block; }

.env-back {
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #e8dccb, #dccdb7);
  box-shadow: 0 40px 60px -30px rgba(90, 65, 35, 0.45), 0 8px 20px rgba(90, 65, 35, 0.1);
}

.env-card {
  left: 6%; right: 6%; top: 5%; height: 92%;
  z-index: 2;
  padding: 7px 7px 0;
  display: flex !important;
  flex-direction: column;
  background: #fffdf9;
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(80, 60, 40, 0.12);
  transition: transform 1.3s var(--ease) 0.6s;
}
.env-card img {
  width: 100%;
  flex: 1;
  min-height: 0;
  object-fit: cover;
  object-position: center 28%;
}
.env-card-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 0 9px;
  font-family: var(--serif);
  color: var(--ink);
}
.env-card-copy .save { font-size: 0.85rem; font-weight: 500; letter-spacing: 0.34em; text-transform: uppercase; }
.env-card-copy .date { font-size: 0.8rem; letter-spacing: 0.26em; color: var(--gold); }

.env-pocket { inset: 0; z-index: 3; pointer-events: none; overflow: hidden; border-radius: 4px; }
.env-pocket::before,
.env-pocket::after { content: ""; position: absolute; inset: 0; }
.env-pocket::before {
  background: linear-gradient(180deg, #f3ebdf, #e9dfcf);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}
.env-pocket::after {
  background: linear-gradient(180deg, #f7f1e7, #ece2d2);
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  filter: drop-shadow(0 -2px 3px rgba(90, 65, 35, 0.12));
}

.env-flap {
  inset: 0 0 auto 0;
  height: 60%;
  z-index: 4;
  transform-origin: top center;
  filter: drop-shadow(0 4px 5px rgba(90, 65, 35, 0.16));
  transition: transform 1s var(--ease-io) 0.2s, z-index 0s linear 0.7s;
}
.env-flap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f6efe4, #e6d9c5);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* thin gold edge on the flap */
.env-flap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0 96%, rgba(180, 143, 87, 0.5) 96%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  opacity: 0.6;
}

.env-seal {
  left: 50%; top: 60%;
  z-index: 5;
  width: 84px; height: 84px;
  display: grid !important;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 34% 28%, #ffffff 0%, #f8f3ea 45%, #eadfcc 85%, #dccdb4 100%);
  box-shadow:
    0 0 0 2px #fffdf8,
    0 0 0 3px rgba(196, 154, 90, 0.75),
    0 10px 22px rgba(90, 60, 20, 0.32),
    inset 0 -4px 8px rgba(120, 90, 40, 0.18),
    inset 0 3px 6px rgba(255, 255, 255, 0.9);
  transition: transform 0.6s var(--ease), opacity 0.5s ease;
}
.env-seal::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(196, 154, 90, 0.45);
}
.env-seal::after { /* pulse halo */
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(180, 143, 87, 0.55);
  animation: seal-pulse 2.4s ease-out infinite;
}
@keyframes seal-pulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.55); opacity: 0; }
}
.env-seal img {
  position: relative;
  height: 52px;
  width: auto;
  max-width: none;
  filter: drop-shadow(0 1px 1px rgba(120, 80, 20, 0.25));
}
.env-seal span {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  color: #fff6e6;
  text-shadow: 0 1px 1px rgba(70, 45, 15, 0.5);
}
.env-seal i { font-style: italic; font-weight: 300; margin: 0 1px; }
.envelope:hover .env-seal { transform: translate(-50%, -50%) scale(1.06) rotate(-4deg); }

.entry-date {
  margin: 30px 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: fade-up 1.2s var(--ease) 0.8s both;
}

.entry-hint {
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  animation: fade-up 1.2s var(--ease) 1s both;
}
.hint-th { font-family: var(--thai); font-size: 0.85rem; color: var(--ink-soft); }
.hint-en {
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }

/* opening sequence */
.entry.is-opening .entry-kicker,
.entry.is-opening .entry-names,
.entry.is-opening .entry-inner > .ornament { opacity: 0; transform: translateY(-20px); filter: blur(4px); }
.entry.is-opening .entry-date,
.entry.is-opening .entry-hint { opacity: 0; transform: translateY(20px); filter: blur(4px); }
.entry.is-opening .envelope { animation: none; transform: translateY(20%); }
.entry.is-opening .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(25deg); }
.entry.is-opening .env-seal::after { animation: none; opacity: 0; }
.entry.is-opening .env-flap { transform: rotateX(180deg); z-index: 1; }
.entry.is-opening .env-card { transform: translateY(-72%) scale(1.06); }

@media (max-height: 640px) {
  .entry-inner > .ornament { margin-bottom: 14px; }
  .entry-date { margin-top: 18px; }
  .envelope { width: min(330px, 80vw); }
}

/* =========================================================
   FLOATING UI
   ========================================================= */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold-pale), var(--gold), var(--gold-pale));
}

/* music */
.music {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: rgba(251, 248, 243, 0.82);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px -14px rgba(80, 55, 25, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease), box-shadow 0.4s ease;
}
body.opened .music { opacity: 1; transform: none; pointer-events: auto; }
.music:active { transform: scale(0.94); }

.music-disc {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fbf8f3 0 16%, transparent 17%),
    repeating-radial-gradient(circle, #2c2420 0 1px, #3a302a 1px 3px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  animation: spin 4s linear infinite;
  animation-play-state: paused;
}
.music-disc span {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: radial-gradient(circle, #fbf8f3 0 22%, var(--gold) 24%);
}
.music.is-playing .music-disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }

.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.music-bars i {
  width: 2px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: height 0.3s ease;
}
.music.is-playing .music-bars i { animation: eq 1s ease-in-out infinite; }
.music.is-playing .music-bars i:nth-child(2) { animation-delay: -0.3s; }
.music.is-playing .music-bars i:nth-child(3) { animation-delay: -0.6s; }
.music.is-playing .music-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 14px; } }

.music-label {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* top nav */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px clamp(18px, 4vw, 44px);
  padding-top: max(16px, env(safe-area-inset-top));
  color: #fff;
  transition: background 0.5s ease, color 0.5s ease, padding 0.5s var(--ease), box-shadow 0.5s ease, opacity 0.6s ease, transform 0.6s var(--ease);
  opacity: 0;
  transform: translateY(-100%);
}
body.opened .topnav { opacity: 1; transform: none; }
.topnav.is-solid {
  color: var(--ink);
  background: rgba(251, 248, 243, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: 10px;
}

.monogram {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}
.monogram img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.25));
  transition: height 0.5s var(--ease), filter 0.5s ease;
}
.topnav.is-solid .monogram img { height: 34px; filter: none; }
.monogram em { font-style: italic; font-weight: 300; color: var(--gold-soft); margin: 0 2px; }
.topnav.is-solid .monogram em { color: var(--gold); }

.topnav-links { display: flex; gap: clamp(18px, 3vw, 40px); }
.topnav-links a {
  position: relative;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding: 6px 0;
}
.topnav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.topnav-links a:hover::after,
.topnav-links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.menu-btn {
  display: none;
  position: relative;
  width: 38px; height: 38px;
  z-index: 2;
}
.menu-btn span {
  position: absolute;
  left: 9px; right: 9px;
  height: 1px;
  background: currentColor;
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.menu-btn span:first-child { top: 15px; }
.menu-btn span:last-child { top: 22px; }
body.menu-open .topnav { color: var(--ink); }
body.menu-open .topnav .monogram em { color: var(--gold); }
body.menu-open .menu-btn span:first-child { top: 19px; transform: rotate(45deg); }
body.menu-open .menu-btn span:last-child { top: 19px; transform: rotate(-45deg); }

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--ivory);
  clip-path: circle(0% at calc(100% - 40px) 36px);
  transition: clip-path 0.9s var(--ease-io);
  visibility: hidden;
}
body.menu-open .menu-overlay { clip-path: circle(150% at calc(100% - 40px) 36px); visibility: visible; }
.menu-overlay nav { display: flex; flex-direction: column; gap: 14px; text-align: center; }
.menu-overlay a {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--ink);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.8s var(--ease), color 0.3s;
}
.menu-overlay a small {
  display: block;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--gold);
}
.menu-overlay a:hover { color: var(--gold); }
body.menu-open .menu-overlay a { opacity: 1; transform: none; }
body.menu-open .menu-overlay a:nth-child(1) { transition-delay: 0.25s; }
body.menu-open .menu-overlay a:nth-child(2) { transition-delay: 0.31s; }
body.menu-open .menu-overlay a:nth-child(3) { transition-delay: 0.37s; }
body.menu-open .menu-overlay a:nth-child(4) { transition-delay: 0.43s; }
body.menu-open .menu-overlay a:nth-child(5) { transition-delay: 0.49s; }
body.menu-open .menu-overlay a:nth-child(6) { transition-delay: 0.55s; }
.menu-foot {
  position: absolute;
  bottom: 40px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 90;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(44, 36, 32, 0.9);
  color: #fbf8f3;
  font-family: var(--thai);
  font-size: 0.85rem;
  white-space: nowrap;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.6s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* particles (sparkles / hearts / petals) */
.fx {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-spark {
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  background: radial-gradient(circle, #fff7e3 0%, #e2c58d 45%, transparent 70%);
  border-radius: 50%;
}
.fx-star {
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  background: #d9b977;
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
}
.fx-heart {
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d3a08f' d='M12 21s-8-4.9-8-11a4.6 4.6 0 0 1 8-2.9A4.6 4.6 0 0 1 20 10c0 6.1-8 11-8 11z'/%3E%3C/svg%3E");
}
.fx-petal {
  width: 12px; height: 9px;
  margin: -5px 0 0 -6px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #f5dcd2, #dfae9d);
}

/* =========================================================
   PAGE
   ========================================================= */
.page { opacity: 0; transition: opacity 1.2s ease; }
body.opened .page { opacity: 1; }

section { position: relative; }

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease), transform 1.2s var(--ease), filter 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- HERO ---------- */
.hero {
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: #2c2420;
}
.hero-media { position: absolute; inset: -6% 0; will-change: transform; }
.hero-video {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(1.05) brightness(0.92) sepia(0.08);
  transform: scale(1.12);
  transition: transform 6s var(--ease);
}
body.opened .hero-video { transform: scale(1.02); }
.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(25, 18, 14, 0.45) 0%, rgba(25, 18, 14, 0.15) 35%, rgba(25, 18, 14, 0.25) 60%, rgba(25, 18, 14, 0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 24px;
}
.hero-kicker {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.hero-names {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(4.4rem, 17vw, 9rem);
  line-height: 1.05;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  column-gap: 0.18em;
}
.hero-amp {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 0.5em;
  color: var(--gold-pale);
  opacity: 0;
  transform: scale(0.6) rotate(-10deg);
  transition: opacity 1.4s var(--ease) 1.2s, transform 1.4s var(--ease) 1.2s;
}
body.opened .hero-amp { opacity: 1; transform: none; }

.split .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em) rotate(6deg);
  filter: blur(8px);
  transition: opacity 1.2s var(--ease), transform 1.4s var(--ease), filter 1.2s var(--ease);
}
body.opened .split .ch { opacity: 1; transform: none; filter: none; }

.hero-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--serif);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1.2s var(--ease) 1.6s, transform 1.2s var(--ease) 1.6s;
}
.hero-date span {
  font-size: 0.85rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  min-width: 70px;
}
.hero-date b { font-weight: 300; font-size: 3.2rem; line-height: 1; }
.hero-year {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.82);
  opacity: 0;
  transition: opacity 1.2s ease 2s;
}
.hero-kicker { opacity: 0; transition: opacity 1.2s ease 0.4s; }
body.opened .hero-date { opacity: 1; transform: none; }
body.opened .hero-year,
body.opened .hero-kicker { opacity: 1; }

.scroll-cue {
  position: absolute;
  bottom: max(28px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.scroll-cue i {
  position: relative;
  width: 1px; height: 46px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 0; top: -50%;
  width: 1px; height: 50%;
  background: #fff;
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue { to { top: 100%; } }

/* ---------- COUNTDOWN ---------- */
.countdown-sec {
  padding: clamp(80px, 12vw, 130px) 20px;
  text-align: center;
  background: var(--ivory);
}
.countdown {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(6px, 2.4vw, 24px);
  margin: 34px auto 40px;
}
.cd-unit { width: clamp(62px, 18vw, 110px); }
.cd-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.btn { white-space: nowrap; }
.cd-num {
  position: relative;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  height: 1.05em;
  overflow: hidden;
}
.cd-num .roll { display: block; animation: roll 0.7s var(--ease); }
@keyframes roll {
  from { transform: translateY(-70%); opacity: 0; filter: blur(3px); }
  to   { transform: none; opacity: 1; filter: none; }
}
.cd-unit small {
  display: block;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.cd-sep {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.2;
  color: var(--gold-soft);
  animation: blink 2s ease-in-out infinite;
}

/* ---------- INVITATION ---------- */
.invite {
  padding: 30px clamp(14px, 4vw, 40px) clamp(80px, 10vw, 120px);
  background: linear-gradient(180deg, var(--ivory), var(--cream));
}
.paper {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(52px, 8vw, 90px) clamp(22px, 6vw, 80px);
  text-align: center;
  background: #fffdf9;
  box-shadow: 0 40px 80px -50px rgba(90, 65, 35, 0.35), 0 0 0 1px rgba(180, 143, 87, 0.12);
}
.paper::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  pointer-events: none;
}
.corner {
  position: absolute;
  width: 34px; height: 34px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
}
.corner.tl { top: 20px; left: 20px; border-top-width: 1px; border-left-width: 1px; }
.corner.tr { top: 20px; right: 20px; border-top-width: 1px; border-right-width: 1px; }
.corner.bl { bottom: 20px; left: 20px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 20px; right: 20px; border-bottom-width: 1px; border-right-width: 1px; }

.paper-logo {
  width: clamp(96px, 22vw, 130px);
  margin: -6px auto 22px;
  filter: drop-shadow(0 14px 18px rgba(90, 65, 35, 0.12));
}
.families {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(16px, 4vw, 40px);
  margin: 26px 0 40px;
}
.family h4 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.family p { margin: 2px 0; font-size: 0.95rem; color: var(--ink-soft); font-weight: 300; }
.family-divider { width: 1px; height: 70px; background: linear-gradient(transparent, var(--gold), transparent); }

.invite-th {
  margin: 0 auto 10px;
  font-size: clamp(0.92rem, 2.6vw, 1.05rem);
  font-weight: 300;
  line-height: 1.9;
  color: var(--ink);
}
.invite-line {
  margin: 0 auto 40px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.couple {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(10px, 3vw, 30px);
}
.role {
  display: inline-block;
  margin-bottom: 4px;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.person-name {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 9vw, 5rem);
  line-height: 1.2;
  color: var(--ink);
}
.person-en {
  margin: 4px 0 2px;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.person-th { margin: 0; font-size: 0.9rem; font-weight: 300; color: var(--ink-soft); }

.amp-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(70px, 14vw, 100px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: transform 0.6s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.amp-btn::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1px dashed rgba(180, 143, 87, 0.3);
  animation: spin 30s linear infinite;
}
.amp-btn span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  line-height: 1;
  color: var(--gold);
}
.amp-btn small {
  position: absolute;
  bottom: -22px;
  font-family: var(--sans);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
}
.amp-btn:hover { border-color: var(--gold); box-shadow: 0 0 0 8px rgba(214, 191, 148, 0.15); }
.amp-btn.pop { animation: pop 0.6s var(--ease); }
@keyframes pop { 40% { transform: scale(1.18); } }

/* ---------- SCHEDULE ---------- */
.schedule {
  padding: clamp(80px, 12vw, 130px) 20px;
  text-align: center;
  background: var(--cream);
}
.celebration {
  position: relative;
  max-width: 460px;
  margin: 50px auto 0;
  padding: 50px 24px 44px;
  background: #fffdf9;
  border: 1px solid rgba(180, 143, 87, 0.2);
  box-shadow: 0 40px 70px -50px rgba(90, 65, 35, 0.45);
  transition: transform 0.7s var(--ease), box-shadow 0.7s var(--ease);
}
.celebration:hover { transform: translateY(-6px); box-shadow: 0 50px 80px -50px rgba(90, 65, 35, 0.55); }
.celebration .corner { width: 24px; height: 24px; }
.celebration .corner.tl, .celebration .corner.tr { top: 12px; }
.celebration .corner.bl, .celebration .corner.br { bottom: 12px; }
.celebration .corner.tl, .celebration .corner.bl { left: 12px; }
.celebration .corner.tr, .celebration .corner.br { right: 12px; }
.cheers {
  width: 46px; height: 46px;
  margin: 0 auto 14px;
  fill: none; stroke: var(--gold); stroke-width: 1.2;
  stroke-linecap: round; stroke-linejoin: round;
  transform-origin: 50% 90%;
}
.celebration.in .cheers { animation: clink 1.2s var(--ease) 0.6s; }
@keyframes clink {
  30% { transform: rotate(-8deg) scale(1.08); }
  60% { transform: rotate(5deg); }
}
.celebration-time {
  display: block;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.5rem, 12vw, 4.4rem);
  line-height: 1;
  color: var(--gold);
}
.celebration-time i { font-style: normal; margin: 0 0.12em; color: var(--gold-soft); }
.celebration-unit { margin: 6px 0 0; font-size: 0.85rem; font-weight: 300; color: var(--muted); }
.celebration-th {
  margin: 18px auto 2px;
  padding-top: 18px;
  max-width: 220px;
  border-top: 1px solid var(--line);
  font-size: clamp(1.3rem, 4.5vw, 1.6rem);
  color: var(--ink);
}
.celebration-en { margin: 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--muted); }

/* ---------- MOMENTS ---------- */
.moments {
  padding: clamp(80px, 12vw, 130px) clamp(14px, 4vw, 40px);
  text-align: center;
  background: var(--ivory);
}
.quote {
  max-width: 640px;
  margin: 18px auto 46px;
  font-size: 1rem;
  font-weight: 300;
  color: var(--ink-soft);
}
.gallery {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: clamp(180px, 26vw, 330px);
  gap: clamp(8px, 1.4vw, 16px);
}
.g-item {
  position: relative;
  display: block;
  margin: 0;
  overflow: hidden;
  background: var(--sand);
}
.g-video { grid-column: span 2; grid-row: span 2; }
.g-item img,
.g-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.4s var(--ease), filter 0.8s ease;
}
.g-item img { filter: saturate(0.9); }
.g-item::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.6s ease, transform 0.8s var(--ease);
  pointer-events: none;
}
.g-item:hover img { transform: scale(1.07); filter: saturate(1.05); }
.g-item:hover::after { opacity: 1; transform: none; }
.gallery-hint {
  margin: 22px 0 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(24, 19, 16, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-stage { margin: 0; padding: 60px 16px; max-width: 100%; max-height: 100%; }
.lb-stage img {
  max-width: min(92vw, 900px);
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.7s var(--ease), opacity 0.5s ease;
}
.lightbox.open .lb-stage img.ready { transform: none; opacity: 1; }
.lb-close, .lb-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.8rem;
  line-height: 1;
  transition: background 0.3s, border-color 0.3s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--gold-soft); }
.lb-close { top: max(18px, env(safe-area-inset-top)); right: 18px; }
.lb-nav.prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-nav.next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  margin: 0;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.7);
}

/* ---------- LOCATION ---------- */
.location {
  padding: clamp(80px, 12vw, 130px) 20px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream), var(--ivory));
  transition: background-color 1s ease;
}
.location::before { /* tint wash when a swatch is tapped */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 25%, var(--tint, transparent), transparent 65%);
  opacity: 0.55;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.location > * { position: relative; }

.swatches {
  display: grid;
  grid-template-columns: repeat(8, auto);
  justify-content: center;
  gap: clamp(14px, 3vw, 28px) clamp(14px, 3vw, 30px);
  margin: 40px auto 30px;
}
.swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.swatch span {
  position: relative;
  width: clamp(54px, 14vw, 70px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.65), transparent 45%),
    var(--c);
  box-shadow: 0 14px 26px -14px rgba(90, 65, 35, 0.5), inset 0 -4px 10px rgba(0, 0, 0, 0.06);
  transition: transform 0.6s var(--ease);
}
.swatch span::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.5s, transform 0.6s var(--ease);
}
.swatch:hover span { transform: translateY(-6px); }
.swatch.active span { transform: translateY(-6px) scale(1.06); }
.swatch.active span::after { opacity: 1; transform: none; }
.swatch small {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.dress-note {
  margin: 0 auto 56px;
  max-width: 560px;
  font-size: 0.98rem;
  font-weight: 300;
  color: var(--ink-soft);
}

.venue-card {
  max-width: 560px;
  margin: 0 auto;
  padding: 44px 24px 40px;
  background: #fffdf9;
  border: 1px solid rgba(180, 143, 87, 0.2);
  box-shadow: 0 40px 70px -50px rgba(90, 65, 35, 0.45);
}
.venue-icon {
  width: 30px; height: 30px;
  margin: 0 auto 14px;
  fill: none; stroke: var(--gold); stroke-width: 1.2;
  animation: bob 2.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-5px); } }
.venue {
  margin: 0;
  font-family: var(--thai);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 400;
  color: var(--ink);
}
.venue {
  font-family: var(--serif) !important;
  font-weight: 400 !important;
  font-size: clamp(1.7rem, 5vw, 2.3rem) !important;
  line-height: 1.15;
}
.venue-jp {
  margin: 6px 0 14px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.venue-addr {
  margin: 0 auto 26px;
  max-width: 400px;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.8;
  color: var(--ink-soft);
}
.venue-addr span { color: var(--gold); }
.venue-when {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(16px, 5vw, 34px);
  margin: 0 auto 30px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  max-width: 400px;
}
.venue-when > div { display: flex; flex-direction: column; align-items: center; }
.venue-when i { width: 1px; background: var(--line); }
.venue-when small { white-space: nowrap; font-size: 0.78rem; font-weight: 300; color: var(--muted); }
.venue-when b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.45rem, 6vw, 2.2rem);
  line-height: 1.2;
  white-space: nowrap;
  color: var(--gold);
}
.venue-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* ---------- RSVP ---------- */
.rsvp {
  padding: clamp(80px, 12vw, 130px) 16px;
  text-align: center;
  background: linear-gradient(180deg, var(--ivory) 0%, #f6eee5 100%);
}
.rsvp-intro {
  margin: 14px auto 40px;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--ink-soft);
}
.rsvp-card {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 56px) clamp(20px, 6vw, 48px) clamp(36px, 7vw, 48px);
  text-align: left;
  background: #fffdf9;
  border: 1px solid rgba(180, 143, 87, 0.2);
  box-shadow: 0 50px 90px -60px rgba(90, 65, 35, 0.5);
}
.rsvp-card .corner { width: 22px; height: 22px; }
.rsvp-card .corner.tl, .rsvp-card .corner.tr { top: 12px; }
.rsvp-card .corner.bl, .rsvp-card .corner.br { bottom: 12px; }
.rsvp-card .corner.tl, .rsvp-card .corner.bl { left: 12px; }
.rsvp-card .corner.tr, .rsvp-card .corner.br { right: 12px; }

.rsvp-form { display: flex; flex-direction: column; gap: 22px; }

/* floating-label fields */
.field { position: relative; }
.field input,
.field textarea {
  width: 100%;
  padding: 22px 2px 8px;
  border: 0;
  border-bottom: 1px solid rgba(180, 143, 87, 0.4);
  border-radius: 0;
  background: transparent;
  font-family: var(--thai);
  font-size: 16px; /* 16px stops iPhone from zooming in */
  font-weight: 400;
  color: var(--ink);
  outline: none;
  resize: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.4s;
}
.field label {
  position: absolute;
  left: 2px;
  top: 20px;
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.45s var(--ease), color 0.4s;
}
.field label small { font-size: 0.78em; opacity: 0.8; }
.field::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.6s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-17px) scale(0.78);
  color: var(--gold);
}
.field.invalid input { border-bottom-color: #c0846f; }
.field.invalid::after { background: #c0846f; transform: scaleX(1); }

.group { margin: 0; padding: 0; border: 0; min-width: 0; }
.group legend,
.group .legend {
  margin: 0 0 12px;
  padding: 0;
  font-size: 0.92rem;
  color: var(--ink);
}
.group .legend small { font-size: 0.8em; font-weight: 300; color: var(--muted); }

.attend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attend-card { position: relative; cursor: pointer; }
.attend-card input,
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.attend-card > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 18px 10px 16px;
  text-align: center;
  border: 1px solid rgba(180, 143, 87, 0.28);
  background: #fff;
  transition: border-color 0.4s, background 0.4s, transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.attend-card svg {
  width: 34px; height: 34px;
  margin-bottom: 4px;
  fill: none; stroke: var(--gold); stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.6s var(--ease);
}
.attend-card b { font-weight: 500; font-size: 1rem; color: var(--ink); }
.attend-card small { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--muted); }
.attend-card:hover > span { border-color: var(--gold-soft); }
.attend-card input:checked + span {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fffaf0, #fbf1e1);
  box-shadow: 0 16px 30px -18px rgba(140, 100, 50, 0.55), inset 0 0 0 1px var(--gold);
  transform: translateY(-3px);
}
.attend-card input:checked + span svg { transform: scale(1.12) rotate(-6deg); }
.attend-card input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 3px; }

.if-yes {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.7s var(--ease), opacity 0.5s ease;
}
.if-yes > * { overflow: hidden; }
.if-yes.show { grid-template-rows: 1fr; opacity: 1; }
.if-yes-inner { min-height: 0; display: flex; flex-direction: column; gap: 22px; padding-top: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip span {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(180, 143, 87, 0.3);
  background: #fff;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: all 0.4s var(--ease);
}
.chip input:checked + span {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
  box-shadow: 0 8px 18px -10px rgba(140, 100, 50, 0.7);
}
.chip input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: 2px; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(180, 143, 87, 0.35);
  border-radius: 999px;
  background: #fff;
}
.stepper button {
  width: 48px; height: 48px;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold);
  transition: background 0.3s, transform 0.2s;
}
.stepper button:hover { background: rgba(214, 191, 148, 0.18); }
.stepper button:active { transform: scale(0.88); }
.stepper button:disabled { opacity: 0.3; pointer-events: none; }
.stepper output {
  min-width: 46px;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.7rem;
  color: var(--ink);
}
.stepper output.bump { animation: pop 0.4s var(--ease); }
.total-line { margin: 10px 0 0; font-size: 0.85rem; font-weight: 300; color: var(--muted); }
.total-line b { font-family: var(--serif); font-size: 1.15rem; font-weight: 500; color: var(--gold); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error { margin: -6px 0 0; min-height: 1.2em; font-size: 0.85rem; color: #b5664f; text-align: center; }
.form-error:empty { display: none; }

.rsvp-submit { width: 100%; padding: 17px 26px; font-size: 0.95rem; letter-spacing: 0.08em; }
.rsvp-submit .spin {
  display: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.rsvp-submit.loading { pointer-events: none; }
.rsvp-submit.loading .txt { opacity: 0.7; }
.rsvp-submit.loading .spin { display: inline-block; }

.rsvp-done { text-align: center; padding: 10px 0; }
.rsvp-done[hidden] { display: none; }
.done-seal svg {
  width: 74px; height: 74px;
  margin: 0 auto 18px;
  fill: none; stroke: var(--gold); stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.done-seal circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 1s var(--ease) forwards; }
.done-seal path { stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw 0.6s var(--ease) 0.7s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.rsvp-done h4 {
  margin: 0;
  font-family: var(--thai);
  font-weight: 400;
  font-size: clamp(1.4rem, 5vw, 1.7rem);
  color: var(--ink);
}
.rsvp-done p { margin: 10px auto 24px; max-width: 360px; font-size: 0.95rem; font-weight: 300; line-height: 1.85; color: var(--ink-soft); }
.rsvp-done p b { font-weight: 500; color: var(--ink); }
.rsvp-done.enter { animation: fade-up 0.9s var(--ease) both; }
.rsvp-form.leave { animation: form-out 0.45s ease forwards; }
@keyframes form-out { to { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }

/* ---------- GIFT ---------- */
.gift {
  padding: clamp(70px, 10vw, 110px) 20px clamp(80px, 12vw, 120px);
  text-align: center;
  background: var(--ivory);
}
.gift-card {
  max-width: 420px;
  margin: 0 auto;
  padding: 44px 24px 38px;
  background: #fffdf9;
  border: 1px solid rgba(180, 143, 87, 0.2);
  box-shadow: 0 40px 70px -50px rgba(90, 65, 35, 0.45);
}
.gift-title {
  margin: 0;
  font-family: var(--thai);
  font-weight: 400;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  color: var(--ink);
}
.gift-sub { margin: 4px 0 24px; font-size: 0.85rem; font-weight: 300; color: var(--muted); }
.qr-frame {
  position: relative;
  display: block;
  width: min(220px, 64vw);
  margin: 0 auto 26px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  transition: transform 0.6s var(--ease), box-shadow 0.6s var(--ease);
  cursor: zoom-in;
}
.qr-frame::before, .qr-frame::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid var(--gold);
}
.qr-frame::before { top: -6px; left: -6px; border-right: 0; border-bottom: 0; }
.qr-frame::after { bottom: -6px; right: -6px; border-left: 0; border-top: 0; }
.qr-frame img { width: 100%; image-rendering: pixelated; }
.qr-frame.zoom {
  transform: scale(1.45);
  z-index: 5;
  box-shadow: 0 30px 60px -20px rgba(60, 40, 20, 0.45);
  cursor: zoom-out;
}

/* ---------- THANK YOU ---------- */
.thanks {
  padding: clamp(110px, 16vw, 170px) 22px;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background: #2c2420;
}
.thanks-bg {
  position: absolute;
  inset: -10% 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.42) saturate(0.7) sepia(0.15);
  will-change: transform;
}
.thanks::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 22, 18, 0.35), rgba(30, 22, 18, 0.55) 60%, rgba(30, 22, 18, 0.75));
}
.thanks-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.thanks-title {
  margin: 0;
  font-family: var(--thai);
  font-weight: 300;
  font-size: clamp(1.55rem, 7vw, 2.8rem);
  line-height: 1.4;
}
.thanks-message {
  margin: 22px auto 34px;
  font-weight: 300;
  font-size: 0.98rem;
  line-height: 1.95;
  color: rgba(255, 255, 255, 0.85);
}

.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--thai);
  font-size: 0.88rem;
  transition: background 0.4s, border-color 0.4s, transform 0.4s var(--ease);
}
.heart-btn svg {
  width: 26px; height: 26px;
  fill: rgba(232, 180, 165, 0.25);
  stroke: #f0c7b8;
  stroke-width: 1.2;
  transition: fill 0.3s, transform 0.4s var(--ease);
}
.heart-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--gold-soft); }
.heart-btn:active { transform: scale(0.95); }
.heart-btn.beat svg { animation: beat 0.5s var(--ease); fill: #e8b4a5; }
@keyframes beat { 30% { transform: scale(1.35); } 60% { transform: scale(0.95); } }
.heart-btn b { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }

.apology {
  margin: 40px 0 4px;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.apology.th {
  margin-top: 0;
  font-family: var(--thai);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.82);
}
.signature {
  margin: 34px 0 0;
  font-family: var(--script);
  font-size: clamp(1.9rem, 8vw, 3rem);
  line-height: 1.3;
  color: var(--gold-pale);
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px calc(90px + env(safe-area-inset-bottom));
  background: var(--ivory);
}
.footer-logo { width: 110px; margin-bottom: 6px; }
.footer .footer-tag {
  font-family: var(--script);
  font-size: 1.5rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gold);
}
.monogram.small em { color: var(--gold); }
.footer p {
  margin: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
  .topnav-links { display: none; }
  .entry-date { font-size: 0.9rem; letter-spacing: 0.16em; }
  .swatches { grid-template-columns: repeat(4, auto); }
  .invite-th br { display: none; }
  .thanks-message br, .dress-note br { display: none; }
  .thanks-message, .dress-note { max-width: 340px; }
  .music {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 5px;
    gap: 0;
  }
  .music-label, .music-bars { display: none; }
  .music-disc { width: 36px; height: 36px; }
  .music.is-playing::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    animation: seal-pulse 2s ease-out infinite;
  }
  .music { border-radius: 50%; }

  .hero-kicker { font-size: 0.58rem; letter-spacing: 0.3em; }
  .hero-date { gap: 12px; }
  .hero-date span { min-width: 58px; font-size: 0.75rem; letter-spacing: 0.24em; }
  .hero-date b { font-size: 2.7rem; }

  .countdown-sec .btn { padding: 13px 20px; font-size: 0.85rem; }
  .venue-when { gap: 14px; }
  .label { letter-spacing: 0.34em; }
  .menu-btn { display: block; }

  .families { grid-template-columns: 1fr; gap: 22px; }
  .family-divider { width: 70px; height: 1px; margin: 0 auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

  .couple { grid-template-columns: 1fr; gap: 26px; }
  .amp-btn { margin: 0 auto 14px; }


  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 58vw; }
  .g-video { grid-column: span 2; grid-row: span 2; }

  .lb-nav { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; }
  .lb-nav.prev { left: 22px; }
  .lb-nav.next { right: 22px; }
  .lb-count { bottom: max(30px, env(safe-area-inset-bottom)); }

  .corner { width: 22px; height: 22px; }
}

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

@media (max-width: 360px) {
  .cd-actions { flex-direction: column; align-items: center; }
  .attend { gap: 8px; }
  .attend-card > span { padding: 16px 6px 14px; }
  .chip span { padding: 8px 14px; }
  .section-title { font-size: 2.05rem; }
}

.if-yes:not(.show) { margin-top: -22px; }
.rsvp-form[hidden] { display: none; }
