/* Sample wedding: an invitation suite. Emerald linen table, ivory stationery, champagne gold. */
:root {
  --ivory: #fbf7ef; --ivory-2: #efe7d8; --champagne: #c8ab78; --champagne-light: #e2cfa6;
  --emerald: #1f3b2d; --emerald-deep: #12241b; --ink: #1b1d1a; --muted: #5e5f58;
  --serif: 'Bodoni Moda', 'Didot', Georgia, serif; --sans: 'Jost', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; overflow-x: clip; color: var(--ink); font: 300 1.05rem/1.75 var(--sans); letter-spacing: .02em; -webkit-font-smoothing: antialiased;
  /* emerald linen */
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 1px, transparent 1px 3px), radial-gradient(80% 60% at 50% 0%, #24453a, var(--emerald-deep)) var(--emerald-deep); }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.sample-banner { position: relative; z-index: 5; background: rgba(0, 0, 0, .35); color: var(--champagne-light); text-align: center; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; padding: 10px 12px; white-space: nowrap; }
.sample-banner a { color: var(--ivory); margin-left: 12px; text-underline-offset: 3px; }

/* ---------- arrival: envelope ---------- */
.arrival { min-height: calc(100svh - 38px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 18px 50px; text-align: center; color: var(--champagne-light); }
.arrival__kicker { font-size: .7rem; letter-spacing: .34em; text-transform: uppercase; margin-bottom: clamp(150px, 42vw, 220px); }
.envelope { position: relative; width: min(360px, 86vw); aspect-ratio: 1.45; }
.env-back { position: absolute; inset: 0; border-radius: 4px; background: linear-gradient(#d9cdb5, #cbbd9f); box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .7); }
.env-card { position: absolute; left: 6%; right: 6%; top: 6%; height: 92%; z-index: 2; background: var(--ivory); padding: 22px 16px; border: 1px solid var(--champagne); outline: 1px solid var(--champagne); outline-offset: -6px;
  transform: translateY(0); animation: rise 1.3s cubic-bezier(.16, 1, .3, 1) 1.15s both; }
.env-card .kicker { font-size: .56rem; }
.env-names { font: 400 clamp(1.7rem, 8vw, 2.2rem)/1.1 var(--serif); color: var(--emerald-deep); margin-top: 8px; }
.env-names em { color: var(--champagne); font-size: .7em; }
.env-date { font-size: .7rem; letter-spacing: .3em; color: var(--muted); margin-top: 6px; }
@keyframes rise { to { transform: translateY(-62%); } }
.env-front { position: absolute; inset: 0; z-index: 3; border-radius: 4px; background: linear-gradient(170deg, #ece2cf, #dccfb4); clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%); }
.env-front::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.6%, rgba(0, 0, 0, .06) 50%, transparent 50.4%), linear-gradient(to top left, transparent 49.6%, rgba(0, 0, 0, .06) 50%, transparent 50.4%); }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 4; transform-origin: 50% 0; background: linear-gradient(#e3d8c2, #d2c4a8); clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: open .9s cubic-bezier(.6, 0, .3, 1) .35s both; }
@keyframes open { 0% { transform: rotateX(0); z-index: 4; } 60% { z-index: 4; } 61% { z-index: 1; } 100% { transform: rotateX(180deg); z-index: 1; } }
.seal { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; color: var(--champagne-light); font: 400 1.05rem var(--serif);
  background: radial-gradient(circle at 35% 30%, #3b6b55, var(--emerald) 55%, #0d1d15); box-shadow: 0 3px 6px rgba(0, 0, 0, .35), inset 0 0 0 4px rgba(0, 0, 0, .15); }
.seal i { font-size: .8em; margin: 0 1px; }
.env-flap .seal { position: absolute; left: 50%; bottom: -2px; transform: translate(-50%, 0); }
.arrival__hint { margin-top: 46px; font: italic 400 1.1rem var(--serif); color: var(--champagne-light); animation: nudge 2.2s ease-in-out 2.6s infinite both; }
@keyframes nudge { 50% { transform: translateY(6px); } }

/* ---------- the suite ---------- */
.suite { position: relative; max-width: 640px; margin: 0 auto; padding: 20px 16px 120px; }
.sheet { position: relative; background: var(--ivory); color: var(--ink); text-align: center; padding: 48px 24px 44px; margin-bottom: 28px;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .65), 0 2px 0 rgba(255, 255, 255, .4) inset; border-radius: 2px; transform: rotate(calc((var(--i) - 1.5) * .9deg)); }
@media (min-width: 900px) and (min-height: 820px) {
  .sheet:not(.sheet--reply) { position: sticky; top: calc(40px + var(--i) * 22px); }
  .suite { padding-bottom: 160px; }
}
.sheet--invite { padding: 56px 28px 50px; outline: 1px solid var(--champagne); outline-offset: -12px; }
.sheet--invite::after { content: ''; position: absolute; inset: 18px; border: 1px solid rgba(200, 171, 120, .5); pointer-events: none; }
.sheet--details { background: #f6f0e3; }
.sheet--evening { background: var(--emerald); color: var(--ivory); }
.sheet--reply { max-width: 520px; margin: 40px auto 0; border: 1px solid var(--champagne); outline: 1px solid var(--champagne); outline-offset: -9px; }
.kicker { font-size: .66rem; letter-spacing: .32em; text-transform: uppercase; color: var(--muted); }
.laurel { display: block; width: 120px; height: 60px; margin: 0 auto 14px; color: var(--champagne); }
.names { margin: 14px 0; font: 400 clamp(2.8rem, 13vw, 4.6rem)/1 var(--serif); color: var(--emerald-deep); }
.names span { display: block; }
.names em { display: block; font-size: .4em; color: var(--champagne); margin: 8px 0; }
.invite { font: italic 400 1.05rem var(--serif); color: var(--muted); }
.date { font: 400 1.3rem var(--serif); color: var(--emerald); margin-top: 22px; }
.year { font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.countdown { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.countdown div { width: 74px; padding: 10px 0; border-top: 1px solid var(--champagne); border-bottom: 1px solid var(--champagne); }
.countdown b { display: block; font: 400 1.6rem/1 var(--serif); color: var(--emerald); }
.countdown span { font-size: .56rem; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

.sheet__title { font: 400 clamp(1.9rem, 7vw, 2.5rem)/1.1 var(--serif); font-style: italic; color: var(--emerald-deep); margin-bottom: 26px; }
.sheet__title::after { content: ''; display: block; width: 40px; height: 1px; background: var(--champagne); margin: 16px auto 0; }
.sheet__title--light { color: var(--ivory); }
.split { display: grid; gap: 28px; }
@media (min-width: 600px) { .split { grid-template-columns: 1fr 1px 1fr; gap: 26px; } }
.split__rule { height: 1px; width: 60px; margin: 0 auto; background: var(--champagne); }
@media (min-width: 600px) { .split__rule { width: 1px; height: auto; } }
.label { font-size: .64rem; letter-spacing: .3em; text-transform: uppercase; color: var(--champagne); margin-bottom: 10px; }
.split h3 { font: 400 1.4rem/1.25 var(--serif); color: var(--emerald-deep); margin-bottom: 8px; }
.time { font: italic 400 1rem var(--serif); color: var(--muted); }
.addr { color: var(--muted); font-size: .92rem; margin: 2px 0 14px; }
.map { font-size: .66rem; letter-spacing: .26em; text-transform: uppercase; color: var(--emerald); text-decoration: none; border-bottom: 1px solid var(--champagne); padding-bottom: 3px; }

.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 360px; text-align: left; }
.timeline li { display: grid; grid-template-columns: 64px 1fr; gap: 18px; padding: 10px 0; border-bottom: 1px solid rgba(200, 171, 120, .25); }
.timeline time { font: italic 400 1.15rem var(--serif); color: var(--champagne-light); text-align: right; }
.attire { margin-top: 30px; }
.attire__code { font: 400 1.8rem var(--serif); color: var(--ivory); }
.swatches { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.swatches span { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--champagne); }

/* reply card */
.rsvp__intro { font: italic 400 1rem var(--serif); color: var(--muted); margin: -10px 0 26px; }
.form, .more { display: grid; gap: 20px; text-align: left; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
label, legend { display: block; padding: 0; margin-bottom: 6px; font-size: .64rem; letter-spacing: .24em; text-transform: uppercase; color: var(--emerald); }
.field--m { display: flex; align-items: flex-end; gap: 6px; }
.field--m label { margin: 0; }
.field--m .m { font: italic 400 2.2rem/1 var(--serif); text-transform: none; letter-spacing: 0; color: var(--emerald-deep); }
.field--m input { flex: 1; }
.field--m .rsvp-field-error { flex-basis: 100%; }
.field--m { flex-wrap: wrap; }
input[type=text], select, textarea { width: 100%; font: italic 400 1.15rem var(--serif); font-size: max(16px, 1.15rem); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid #b9ab8f; padding: 8px 2px; min-height: 46px; border-radius: 0; }
input::placeholder { color: #b5ab98; }
textarea { resize: vertical; }
select { appearance: none; max-width: 140px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--emerald); }
.choices { display: grid; gap: 4px; }
.choice { position: relative; margin: 0; text-transform: none; letter-spacing: .01em; color: var(--ink); cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; gap: 14px; min-height: 46px; font: italic 400 1.15rem var(--serif); }
.choice span::before { content: ''; width: 22px; height: 22px; border: 1px solid var(--emerald); flex: none; }
.choice input:checked + span::before { background: linear-gradient(45deg, transparent 45%, var(--emerald) 45%, var(--emerald) 55%, transparent 55%), linear-gradient(-45deg, transparent 45%, var(--emerald) 45%, var(--emerald) 55%, transparent 55%); }
.choice input:focus-visible + span { outline: 2px solid var(--emerald); outline-offset: 2px; }
.has-error input, .has-error select, .has-error textarea { border-color: #9b3b2f; }
.has-error .choice span::before { border-color: #9b3b2f; }
.rsvp-field-error { color: #9b3b2f; font-size: .9rem; margin-top: 4px; font-style: italic; text-transform: none; letter-spacing: 0; }
.hp { position: absolute; left: -9999px; }
.btn { width: 100%; min-height: 54px; background: var(--emerald-deep); color: var(--ivory); border: 0; font: 400 .72rem var(--sans); letter-spacing: .32em; text-transform: uppercase; cursor: pointer; transition: background .3s; }
.btn:hover { background: var(--emerald); }
.btn:disabled { opacity: .6; }
.link { background: none; border: 0; font: italic 400 1rem var(--serif); color: var(--emerald); text-decoration: underline; cursor: pointer; }
.msg { text-align: center; }
.msg h3 { font: 400 2rem var(--serif); font-style: italic; color: var(--emerald-deep); margin-bottom: 10px; }
.msg p { color: var(--muted); margin-bottom: 14px; }
.demo-note { font-size: .85rem; font-style: italic; }

.foot { text-align: center; padding: 30px 20px calc(70px + env(safe-area-inset-bottom)); color: var(--champagne-light); }
.seal--foot { width: 70px; height: 70px; font-size: 1.3rem; margin-bottom: 14px; }
.foot p { letter-spacing: .3em; font-size: .74rem; text-transform: uppercase; }

/* ---------- effects ---------- */
/* gold dust rising around the envelope */
.arrival { position: relative; overflow: hidden; }
.dust { position: absolute; inset: 0; pointer-events: none; }
.dust i { position: absolute; bottom: -10px; width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #fff6d8, #c8ab78 60%, transparent 70%);
  box-shadow: 0 0 6px rgba(226, 207, 166, .8); opacity: 0; animation: dust var(--dur) linear var(--delay) infinite; }
@keyframes dust { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .9; } 80% { opacity: .6; } 100% { transform: translate(var(--sway), -105vh); opacity: 0; } }
.arrival > *:not(.dust) { position: relative; }

/* gold-foil shine sweeping across the names */
.foil { background: linear-gradient(110deg, var(--emerald-deep) 0 42%, #b9965c 46%, #fff3d0 50%, #b9965c 54%, var(--emerald-deep) 58% 100%); background-size: 300% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: foil 7s ease-in-out 2.4s infinite; }
@keyframes foil { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }

/* rolling countdown digits */
.countdown b { overflow: hidden; }
.roll { animation: roll .55s cubic-bezier(.2, .8, .2, 1); }
@keyframes roll { from { transform: translateY(-60%); opacity: 0; filter: blur(2px); } to { transform: none; opacity: 1; filter: none; } }

/* cards: settle in as they arrive, tilt toward the pointer, soft light follows it */
.sheet { transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(calc((var(--i) - 1.5) * .9deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1), opacity .9s ease; }
.sheet::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; background: radial-gradient(400px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, .5), transparent 60%); mix-blend-mode: soft-light; }
.sheet:hover::before { opacity: 1; }
.js .sheet:not(.in) { opacity: 0; transform: perspective(1400px) translateY(60px) rotate(calc((var(--i) - 1.5) * 4deg)); }

/* map links: gold underline draws on hover */
.map { border-bottom: 0; background: linear-gradient(var(--champagne), var(--champagne)) 0 100% / 100% 1px no-repeat; transition: background-size .5s; }
.map:hover { background-size: 0 1px; background-position: 100% 100%; }

/* reply sent: the wax seal stamps down */
.seal--stamp { width: 74px; height: 74px; font-size: 1.3rem; margin-bottom: 14px; animation: stamp .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp { from { transform: scale(2.6) rotate(-25deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .sheet:not(.in) { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
}
