/* Tinggalduduk invitation base layout + motion. Themes set the variables below (+ small flourishes). */
:root {
  --bg: #f7f2ea; --surface: #fffdf9; --ink: #2b2420; --muted: #7a6e64;
  --accent: #a8834f; --accent-ink: #ffffff; --line: rgba(0, 0, 0, .1);
  --outer: #e9e1d4;
  --font-display: Georgia, serif; --font-body: system-ui, sans-serif;
  --radius: 14px;
  --c1: #f25f5c; --c2: #ffe066; --c3: #247ba0; --c4: #70c1b3;
  /* Gate (opening) */
  --gate-bg: var(--bg); --gate-line: var(--accent);
  --curtain-1: #b3262d; --curtain-2: #8f1d23;
  /* Particle colours */
  --p1: #e8b4b8; --p2: #f3d1c8; --p3: #d9a5a0; --p4: #f7e1d7;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--outer); color: var(--ink);
  font: 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.is-open { overflow: auto; }
#app { max-width: 480px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; box-shadow: 0 0 40px rgba(0,0,0,.08); overflow-x: clip; }
.display { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; }
.big { font-size: 2.6rem; }
.eyebrow { letter-spacing: .25em; text-transform: uppercase; font-size: .75rem; color: var(--muted); margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.ornament { color: var(--accent); width: 180px; margin: 1rem auto; }
.ornament svg { display: block; width: 100%; height: auto; }

/* ---------- Cover / gate ---------- */
.cover {
  position: fixed; inset: 0; z-index: 10; display: grid; place-items: center;
  max-width: 480px; margin: 0 auto; text-align: center; padding: 24px;
  perspective: 1400px; overflow: hidden;
}
.cover.opened { pointer-events: none; }
.cover[hidden] { display: none; }
.panel {
  position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--gate-bg);
  transition: transform 1.4s cubic-bezier(.65, 0, .2, 1), opacity 1.2s ease .2s; will-change: transform; backface-visibility: hidden;
}
.panel-l { left: 0; transform-origin: left center; }
.panel-r { right: 0; transform-origin: right center; }
.gate-door .panel { box-shadow: inset 0 0 0 12px var(--gate-bg), inset 0 0 0 13px var(--gate-line); }
.gate-door .panel::after { content: ""; position: absolute; top: 78%; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.gate-door .panel-l::after { right: 18px; }
.gate-door .panel-r::after { left: 18px; }
.gate-door.opened .panel-l { transform: rotateY(-100deg); opacity: 0; }
.gate-door.opened .panel-r { transform: rotateY(100deg); opacity: 0; }
.gate-curtain .panel {
  background: repeating-linear-gradient(90deg, var(--curtain-1) 0 22px, var(--curtain-2) 22px 30px, var(--curtain-1) 30px 44px);
  box-shadow: inset 0 -40px 60px rgba(0,0,0,.25);
}
.gate-curtain .panel-l { border-radius: 0 0 60% 0 / 0 0 12% 0; }
.gate-curtain .panel-r { border-radius: 0 0 0 60% / 0 0 0 12%; }
.gate-curtain.opened .panel-l { transform: translateX(-85%) scaleX(.3) skewY(4deg); }
.gate-curtain.opened .panel-r { transform: translateX(85%) scaleX(.3) skewY(-4deg); }
.cover-inner { position: relative; z-index: 2; transition: opacity .5s, transform .7s var(--ease); }
.cover.opened .cover-inner { opacity: 0; transform: scale(.92); }
.cover-inner > * { opacity: 0; transform: translateY(14px); transition: opacity .8s, transform .9s var(--ease); }
.cover.ready .cover-inner > * { opacity: 1; transform: none; }
.cover-inner > :nth-child(2) { transition-delay: .15s; }
.cover-inner > :nth-child(3) { transition-delay: .3s; }
.cover-inner > :nth-child(4) { transition-delay: .9s; }
.cover-inner > :nth-child(5) { transition-delay: 1.05s; }
.cover-inner > :nth-child(6) { transition-delay: 1.25s; }
.cover h1 { font-size: 2.8rem; }
.cover-date { letter-spacing: .2em; margin: .75rem 0 2rem; }
.guest { margin-bottom: 1.75rem; }
.guest p { margin: 0; }
.guest-name { font-size: 1.25rem; font-weight: 600; margin-top: .4rem !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 1px solid var(--accent); border-radius: 999px; padding: .7rem 1.4rem;
  font: 600 .9rem var(--font-body); cursor: pointer; text-decoration: none;
  transition: transform .15s, background .2s, color .2s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--accent-ink); }
.btn-small { padding: .5rem 1rem; font-size: .8rem; background: var(--accent); color: var(--accent-ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pulse { animation: pulse 2.2s ease-out 2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 16px transparent; }
}

/* ---------- Progress + particles ---------- */
.progress { position: fixed; top: 0; left: 50%; width: min(100%, 480px); margin-left: calc(min(100%, 480px) / -2); height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 6; }
.particles { position: fixed; top: 0; left: 50%; width: min(100%, 480px); height: 100%; transform: translateX(-50%); pointer-events: none; z-index: 4; }

/* ---------- Scroll scene (camera moves through the arch) ---------- */
main section.scene { height: 190vh; padding: 0; position: relative; }
.scene-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.is-open .scene-sticky { animation: enter 1.6s var(--ease) both; }
@keyframes enter { from { transform: scale(1.15); filter: blur(6px); opacity: 0; } }
.layer { position: absolute; inset: 0; display: grid; place-items: center; will-change: transform, opacity; }
.l-back svg { width: 150%; max-width: none; color: var(--accent); opacity: .16; animation: spin 90s linear infinite; }
.l-mid svg { width: 80%; height: 76%; color: var(--accent); opacity: .5; margin-top: 10vh; }
.l-front { padding: 0 28px; text-align: center; align-content: center; }
.scroll-hint { margin-top: 1.5rem; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.scroll-hint span { width: 1px; height: 32px; background: linear-gradient(var(--accent), transparent); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal system ---------- */
.reveal { opacity: 0; transition: opacity .9s ease, transform 1.1s var(--ease); transition-delay: var(--d, 0ms); }
.reveal[data-reveal="up"] { transform: translateY(40px); }
.reveal[data-reveal="left"] { transform: translateX(-56px); }
.reveal[data-reveal="right"] { transform: translateX(56px); }
.reveal[data-reveal="zoom"] { transform: scale(.85); }
.reveal.in { opacity: 1; transform: none; }

.split .w { display: inline-block; white-space: nowrap; }
.split .w span { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(8deg); transition: opacity .6s, transform .9s var(--ease); transition-delay: calc(var(--i) * 45ms + 150ms); }
.split.in .w span, .in .split .w span, .ready .split .w span { opacity: 1; transform: none; }

.draw svg [stroke], .draw svg g[stroke] * { stroke-dasharray: 420; stroke-dashoffset: 420; transition: stroke-dashoffset 2.4s ease .2s; }
.draw.in svg [stroke], .draw.in svg g[stroke] * { stroke-dashoffset: 0; }

/* ---------- Sections ---------- */
main section { padding: 64px 24px; position: relative; }
.tinted { background: var(--surface); }
.section-title { text-align: center; font-size: 1.9rem; margin-bottom: 1.5rem; }
.quote { text-align: center; background: var(--surface); }
.quote-text { font-family: var(--font-display); font-size: 1.15rem; font-style: italic; margin: 0 0 .75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.tinted .card { background: var(--bg); }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 1rem; }

.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 1.5rem; }
.countdown div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 4px; perspective: 300px; }
.countdown b { display: block; font: 600 1.6rem var(--font-display); color: var(--accent); }
.countdown b.flip { animation: flip .55s var(--ease); }
@keyframes flip { from { transform: rotateX(-90deg); opacity: 0; } }
.countdown span { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.hosts { display: grid; gap: 8px; }
.host { text-align: center; }
.avatar {
  position: relative; width: 112px; height: 112px; margin: 0 auto 1.2rem; border-radius: 50%;
  display: grid; place-items: center; font: 600 2.6rem var(--font-display);
  background: var(--surface); color: var(--accent); border: 2px solid var(--accent);
}
.avatar::before { content: ""; position: absolute; inset: -10px; border-radius: inherit; border: 1px dashed var(--accent); opacity: .6; animation: spin 24s linear infinite; }
.host.in .avatar span { animation: pop .8s var(--ease) .3s both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.08); } }
.host-name { font-size: 1.8rem; }
.host-sub { margin: .25rem 0; font-weight: 600; }
.joiner { text-align: center; font-size: 2.4rem; color: var(--accent); margin: .5rem 0; }

.event { text-align: center; }
.event h3 { font-size: 1.5rem; margin-bottom: .5rem; }
.event-date { font-weight: 600; margin: 0; }
.event-time { margin: 0 0 .75rem; color: var(--accent); font-weight: 600; }
.event-place { margin: 0; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  margin: 0; aspect-ratio: 3/4; border-radius: 10px; display: grid; place-items: end start; padding: 8px; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--h) 45% 82%), hsl(calc(var(--h) + 30) 40% 62%));
  background-size: 160% 160%; background-position: 0 0;
  color: rgba(255,255,255,.9); font-size: .7rem; font-weight: 600;
}
.tile.in { animation: drift 9s ease-in-out infinite alternate; }
@keyframes drift { to { background-position: 100% 100%; } }
.tile:nth-child(1), .tile:nth-child(6) { grid-column: span 2; aspect-ratio: auto; }

.gift { text-align: center; }
.bank { font-weight: 700; letter-spacing: .1em; margin: 0; }
.acc { font: 600 1.4rem var(--font-display); margin: .25rem 0; letter-spacing: .05em; }
.gift .btn { margin-top: .75rem; }

.rsvp { display: grid; gap: 12px; }
.rsvp label { display: grid; gap: 4px; font-weight: 600; font-size: .85rem; }
.rsvp input, .rsvp select, .rsvp textarea {
  font: 1rem var(--font-body); padding: .65rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.wishes { display: grid; gap: 10px; margin-top: 16px; max-height: 360px; overflow: auto; }
.wish { background: var(--surface); border-radius: 10px; padding: 12px 14px; border: 1px solid var(--line); }
.wish.fresh { animation: pop .6s var(--ease); }
.wish p { margin: 0; }
.pill { font-size: .7rem; padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); vertical-align: middle; }

.closing { text-align: center; }
.credit { text-align: center; padding: 28px 24px 40px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.credit a { color: inherit; }
.credit p { margin: 0 0 .75rem; }

/* ---------- Reduced motion (engine adds .reduce to <html>): everything visible, nothing moves ---------- */
.reduce *, .reduce *::before, .reduce *::after { animation: none !important; transition: none !important; }
.reduce .reveal, .reduce .split .w span, .reduce .cover-inner > * { opacity: 1 !important; transform: none !important; }
.reduce .draw svg * { stroke-dashoffset: 0 !important; }
.reduce main section.scene { height: auto; }
.reduce .scene-sticky { position: relative; height: auto; min-height: 100vh; }
