/* ===== Elegant gold & cream ===== */
:root {
  --cream: #fbf7ef;
  --cream-2: #f4ecdd;
  --paper: #fffdf8;
  --gold: #b8925a;
  --gold-light: #d9bf8c;
  --gold-dark: #8c6a3a;
  --ink: #3b2f24;
  --muted: #7a6a58;
  --seal: #8e2b2b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(90, 64, 30, 0.10);
  --serif: "Cormorant Garamond", "Kantumruy Pro", Georgia, serif;
  --script: "Great Vibes", cursive;
  --km-body: "Kantumruy Pro", sans-serif;
  --km-title: "Moul", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
body.lang-km { font-family: var(--km-body); font-size: 16px; line-height: 2; }
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

.container { width: min(1080px, 92vw); margin: 0 auto; }
.container.narrow { width: min(680px, 92vw); }
.narrow-text { max-width: 620px; margin-left: auto; margin-right: auto; }

/* ---------- Type ---------- */
.kicker {
  letter-spacing: .3em; text-transform: uppercase; font-size: .8rem;
  color: var(--gold-dark); font-weight: 500;
}
.lang-km .kicker { letter-spacing: .05em; font-family: var(--km-title); font-size: .95rem; font-weight: 400; }
.kicker.light { color: var(--gold-light); }

.title {
  text-align: center; font-weight: 500; color: var(--gold-dark);
  font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.3; margin-bottom: .4em;
}
.lang-en .title { font-family: var(--script); font-weight: 400; font-size: clamp(2.4rem, 6vw, 3.4rem); }
.lang-km .title { font-family: var(--km-title); font-size: clamp(1.3rem, 4vw, 1.8rem); line-height: 1.9; }
.title::after {
  content: ""; display: block; width: 140px; height: 20px; margin: 10px auto 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='20' viewBox='0 0 140 20'%3E%3Cpath d='M0 10h56M84 10h56' stroke='%23b8925a' stroke-width='1'/%3E%3Cpath d='M70 2l8 8-8 8-8-8z' fill='none' stroke='%23b8925a'/%3E%3Ccircle cx='70' cy='10' r='2.2' fill='%23b8925a'/%3E%3Ccircle cx='56' cy='10' r='1.5' fill='%23b8925a'/%3E%3Ccircle cx='84' cy='10' r='1.5' fill='%23b8925a'/%3E%3C/svg%3E") center/contain no-repeat;
}
.sub { text-align: center; color: var(--muted); margin-bottom: 2rem; }
.label { color: var(--gold-dark); font-size: .85rem; letter-spacing: .15em; text-transform: uppercase; }
.lang-km .label { letter-spacing: 0; text-transform: none; font-weight: 500; font-size: .95rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; border: 1px solid var(--gold); background: var(--gold);
  color: #fff; padding: .7em 2em; border-radius: 999px; text-decoration: none;
  letter-spacing: .08em; transition: all .3s; font-size: .95rem;
}
.btn:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn.outline { background: transparent; color: var(--gold-dark); }
.btn.outline:hover { background: var(--gold); color: #fff; }
.btn.small { padding: .35em 1.2em; font-size: .85rem; }
.btn:disabled { opacity: .6; cursor: wait; }

/* ---------- Image placeholders ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.55), transparent 60%),
    linear-gradient(135deg, #e8d9bd, #cfb487);
}
.ph::before {
  content: "♡"; position: absolute; inset: 0; display: grid; place-items: center;
  color: rgba(255,255,255,.7); font-size: 2.4rem;
}
.ph img { position: relative; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Cover / Envelope ---------- */
.cover {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  text-align: center; padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, #fff 0%, transparent 60%),
    repeating-linear-gradient(45deg, rgba(184,146,90,.05) 0 2px, transparent 2px 14px),
    var(--cream);
  transition: opacity .9s ease, visibility .9s;
}
.cover.hide { opacity: 0; visibility: hidden; }
.cover-inner { max-width: 420px; }
.cover-names { font-family: var(--script); font-weight: 400; color: var(--gold-dark); font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1.2; margin: .3em 0; }
.lang-km .cover-names { font-family: var(--km-title); font-size: clamp(1.3rem, 5.5vw, 1.8rem); line-height: 2; }
.cover-names span, .footer-names span { display: block; }
.cover-names .amp, .footer-names .amp { font-size: .6em; color: var(--gold); line-height: 1.4; }
.cover-guest {
  position: relative; margin: 1.4rem auto 1.6rem; padding: 1rem 1.6rem 1.1rem; max-width: 340px;
  border: 1px solid var(--gold-light); border-radius: 12px; background: rgba(255,253,248,.85);
  box-shadow: var(--shadow);
}
.cover-guest::before, .cover-guest::after {
  content: "❦"; position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--gold); font-size: 1.1rem; background: var(--cream); padding: 0 4px;
}
.cover-guest::before { left: -12px; }
.cover-guest::after { right: -12px; transform: translateY(-50%) scaleX(-1); }
.cg-label { color: var(--muted); font-size: .9rem; }
.cg-name {
  font-family: var(--script); color: var(--gold-dark); font-size: 2.3rem; line-height: 1.3;
  overflow-wrap: anywhere;
}
.lang-km .cg-name { font-family: var(--km-title); font-size: 1.35rem; line-height: 2; }
.cg-note { color: var(--muted); font-size: .8rem; letter-spacing: .05em; }

.envelope {
  position: relative; width: min(78vw, 320px); aspect-ratio: 3 / 2;
  margin: 60px auto 10px; cursor: pointer; perspective: 900px;
  filter: drop-shadow(0 14px 24px rgba(90,64,30,.18));
}
.env-back { position: absolute; inset: 0; background: #e3d0ae; border-radius: 8px; }
.env-letter {
  position: absolute; left: 7%; right: 7%; top: 6%; bottom: 8%; z-index: 1;
  background: var(--paper); border-radius: 4px; border: 1px solid var(--gold-light);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8%;
  font-family: var(--script); color: var(--gold-dark); font-size: 1.5rem; line-height: 1.3; text-align: center;
  transition: transform .9s cubic-bezier(.2,.8,.2,1) .45s;
}
.env-letter b { font-family: var(--km-body); font-weight: 600; font-size: .95rem; color: var(--ink); margin-top: .3em; padding: 0 8px; }
.lang-km .env-letter { font-family: var(--km-title); font-size: .95rem; line-height: 2; }
.env-front {
  position: absolute; inset: 0; z-index: 2; border-radius: 8px;
  background: linear-gradient(180deg, #efe2c8, #e8d7b6);
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
}
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%; z-index: 3;
  background: linear-gradient(180deg, #e9d8b8, #dcc49b);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top; transition: transform .6s ease, z-index 0s .3s;
}
.env-seal {
  position: absolute; left: 50%; top: 60%; z-index: 4; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b94a4a, var(--seal) 70%);
  box-shadow: 0 3px 8px rgba(0,0,0,.25), inset 0 0 0 3px rgba(255,255,255,.12);
  color: #f6e3bd; display: grid; place-items: center; font-family: var(--script); font-size: 1.05rem;
  transition: opacity .3s, transform .3s;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.07); } }
.envelope.open .env-seal { opacity: 0; animation: none; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 0; }
.envelope.open .env-letter { transform: translateY(-48%); }

/* ---------- Floating controls ---------- */
.lang-toggle, .music-toggle {
  position: fixed; z-index: 150; border: 1px solid var(--gold-light);
  background: rgba(255,253,248,.92); color: var(--gold-dark);
  backdrop-filter: blur(6px); box-shadow: var(--shadow);
}
.lang-toggle { top: 16px; right: 16px; border-radius: 999px; padding: .3em .9em; font-size: .9rem; font-family: var(--km-body); }
.lang-toggle span { opacity: .45; transition: opacity .2s; }
.lang-toggle .sep { margin: 0 .4em; }
.lang-km .lang-toggle [data-l="km"], .lang-en .lang-toggle [data-l="en"] { opacity: 1; font-weight: 600; }
.music-toggle {
  bottom: 18px; right: 18px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
}
.music-toggle.playing svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 10vw, 110px) 0; }
.section:nth-of-type(even) { background: var(--cream-2); }
.card { background: var(--paper); border: 1px solid rgba(184,146,90,.25); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Hero */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden; }
.hero-photo { position: absolute; inset: 0; }
.hero-photo img { transform: scale(1.08); animation: slowzoom 18s ease-out forwards; }
@keyframes slowzoom { to { transform: scale(1); } }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(40,28,15,.35), rgba(40,28,15,.55)); }
.hero-content { position: relative; padding: 24px; }
.names { font-family: var(--script); font-weight: 400; font-size: clamp(3rem, 12vw, 6rem); line-height: 1.15; margin: .2em 0; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.names span { display: block; }
.names .amp { font-size: .55em; color: var(--gold-light); }
.lang-km .names { font-family: var(--km-title); font-size: clamp(1.7rem, 7vw, 3rem); line-height: 2; }
.hero-date { font-size: 1.15rem; letter-spacing: .12em; border-top: 1px solid rgba(255,255,255,.5); border-bottom: 1px solid rgba(255,255,255,.5); display: inline-block; padding: .3em 1.4em; }
.lang-km .hero-date { letter-spacing: 0; }
.scroll-hint { display: block; margin-top: 3rem; color: #fff; text-decoration: none; font-size: .85rem; opacity: .85; }
.scroll-hint i { display: block; width: 1px; height: 40px; margin: 8px auto 0; background: #fff; animation: drop 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes drop { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Invitation */
.invite { text-align: center; }
.parents { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0 2rem; }
.parents p:not(.label) { font-size: 1.05rem; }
.invite-text { color: var(--muted); max-width: 560px; margin: 0 auto 2.2rem; }
.couple-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }
.couple-name { font-family: var(--script); font-size: clamp(1.9rem, 6vw, 2.6rem); color: var(--gold-dark); line-height: 1.3; }
.lang-km .couple-name { font-family: var(--km-title); font-size: clamp(1.05rem, 4vw, 1.4rem); line-height: 2; }
.heart { color: var(--gold); font-size: 1.4rem; }

/* Countdown */
.countdown { text-align: center; }
.timer { display: flex; justify-content: center; gap: clamp(10px, 3vw, 24px); margin-bottom: 2rem; }
.timer div {
  width: clamp(70px, 19vw, 110px); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--gold-light); background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.timer b { font-size: clamp(1.5rem, 5vw, 2.3rem); font-weight: 500; color: var(--gold-dark); line-height: 1.1; }
.timer span { font-size: .8rem; color: var(--muted); }
.married { font-size: 1.3rem; color: var(--gold-dark); margin-bottom: 1.5rem; }

/* Story timeline */
.timeline { position: relative; margin-top: 2rem; }
.timeline::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--gold-light); }
.t-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; margin-bottom: 3.5rem; }
.t-item::before { content: ""; position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: var(--gold); transform: translate(-50%, -50%); box-shadow: 0 0 0 5px var(--cream); }
.t-item:nth-child(even) .t-photo { order: 2; }
.t-photo { aspect-ratio: 4 / 3; border-radius: var(--radius); box-shadow: var(--shadow); }
.t-year { font-family: var(--script); font-size: 2.2rem; color: var(--gold); line-height: 1; }
.lang-km .t-year { font-family: var(--km-body); font-size: 1.5rem; font-weight: 600; }
.t-text h3 { font-weight: 600; font-size: 1.3rem; margin: .3em 0; }
.lang-km .t-text h3 { font-size: 1.1rem; }
.t-text p { color: var(--muted); }

/* Schedule */
.day { padding: 1.8rem; margin-bottom: 1.5rem; }
.day-date { text-align: center; color: var(--gold-dark); font-weight: 600; font-size: 1.15rem; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px dashed var(--gold-light); }
.event { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; padding: .7rem 0; align-items: baseline; }
.lang-km .event { grid-template-columns: 150px 1fr; }
.event + .event { border-top: 1px solid rgba(184,146,90,.15); }
.event-time { color: var(--gold-dark); font-weight: 600; }
.event-title { font-weight: 500; }

/* Venue */
.venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.venues.single { max-width: 760px; margin-left: auto; margin-right: auto; grid-template-columns: 1fr; }
.venue-card { overflow: hidden; text-align: center; }
.venue-card .info { padding: 1.6rem 1.4rem; }
.venue-card h3 { font-size: 1.35rem; font-weight: 600; margin: .3em 0; }
.lang-km .venue-card h3 { font-family: var(--km-title); font-weight: 400; font-size: 1.15rem; }
.venue-card .addr { color: var(--muted); margin-bottom: 1.2rem; }
.venue-card iframe { width: 100%; height: 300px; border: 0; display: block; filter: sepia(.25); }

/* Gallery */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 2rem; }
.grid .g-item { aspect-ratio: 1; border-radius: 10px; cursor: zoom-in; border: 0; padding: 0; }
.grid .g-item img { transition: transform .6s; }
.grid .g-item:hover img { transform: scale(1.06); }
.grid .g-item:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }

/* Forms */
.form { padding: 2rem; display: grid; gap: 1.2rem; }
.form label, .form fieldset { display: grid; gap: .35rem; border: 0; font-size: .95rem; color: var(--muted); }
.form legend { margin-bottom: .4rem; }
.form .choice { display: flex; align-items: center; gap: .6rem; color: var(--ink); cursor: pointer; }
.form input:not([type=radio]), .form select, .form textarea {
  font: inherit; color: var(--ink); padding: .65em .9em; border-radius: 10px;
  border: 1px solid rgba(184,146,90,.4); background: #fff; width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--gold-light); border-color: var(--gold); }
.form input[type=radio] { accent-color: var(--gold); width: 18px; height: 18px; }
.form .btn { justify-self: center; min-width: 180px; }
.status { text-align: center; min-height: 1.4em; color: var(--gold-dark); }
.status.error { color: var(--seal); }

/* Wishes */
.wish-list { margin-top: 2rem; display: grid; gap: 1rem; max-height: 560px; overflow-y: auto; padding: 4px; }
.wish { padding: 1.2rem 1.4rem; animation: fadeUp .5s ease; }
.wish-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: .3rem; }
.wish-name { font-weight: 600; color: var(--gold-dark); }
.wish-time { font-size: .8rem; color: var(--muted); }
.wish p { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { text-align: center; color: var(--muted); }

/* Gifts */
.gift-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; }
.gift { width: min(320px, 100%); padding: 1.6rem; text-align: center; }
.gift .owner { color: var(--gold-dark); font-weight: 600; }
.gift .qr { width: 190px; aspect-ratio: 1; margin: 1rem auto; border-radius: 10px; background-color: #fff; }
.gift .qr img { object-fit: contain; background: #fff; }
.gift .bank { font-weight: 600; }
.gift .acc { font-size: 1.25rem; letter-spacing: .08em; color: var(--ink); margin: .2rem 0 .8rem; font-family: ui-monospace, Menlo, monospace; }
.gift .acc-name { color: var(--muted); font-size: .95rem; }

/* Footer */
.footer {
  text-align: center; padding: 90px 20px 110px; color: #f5ead6;
  background: linear-gradient(180deg, #4a3a29, #2f241a);
}
.footer-names { font-family: var(--script); font-size: clamp(2.4rem, 8vw, 3.6rem); color: var(--gold-light); line-height: 1.3; margin: .3em 0; }
.lang-km .footer-names { font-family: var(--km-title); font-size: clamp(1.2rem, 5vw, 1.7rem); line-height: 2; }
.footer-text { max-width: 520px; margin: 0 auto; opacity: .85; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20,14,8,.92); display: grid; place-items: center; padding: 40px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-height: 86vh; max-width: 100%; border-radius: 6px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; line-height: 1; padding: 10px 14px; opacity: .8; }
.lightbox button:hover { opacity: 1; }
.lb-close { top: 10px; right: 14px; }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .timeline::before { left: 8px; }
  .t-item { grid-template-columns: 1fr; gap: 1rem; padding-left: 32px; }
  .t-item::before { left: 8px; top: 0; transform: translate(-50%, 0); }
  .t-item:nth-child(even) .t-photo { order: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .event, .lang-km .event { grid-template-columns: 1fr; gap: 0; }
  .parents { grid-template-columns: 1fr; }
  .form { padding: 1.4rem; }
  .day { padding: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
