:root {
  --cream: #f5ecdf;
  --cream-2: #efe3d2;
  --ink: #4a3226;
  --ink-soft: #7a5c4a;
  --accent: #a0785c;
  --gold: #c9a26b;
  --script: 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Quicksand', system-ui, sans-serif;
  --caps: 'Aboreto', 'Cormorant Garamond', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #f1e7d7;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* The invitation is a phone page; on desktop it sits in a phone-width column. */
body > section { max-width: 480px; margin-inline: auto; }

.script { font-family: var(--script); font-weight: 400; margin: 0; }

/* Event sections: the painting stays pinned while the invitation card slides up over it. */
html, body { overflow-x: clip; }
.event { position: relative; display: flow-root; }
.bg { position: sticky; top: 0; height: 100svh; min-height: 600px; overflow: hidden; background: #c79a72 linear-gradient(#d8a98a, #b8865f); }
.bg img, .bg svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.bg svg { opacity: 0; transition: opacity .8s ease; }
.bg.animated svg { opacity: 1; }
.scene { transform-box: view-box; transform-origin: 50% 45%; animation: push 18s ease-in-out infinite alternate; }
html.scrolling .scene { animation-play-state: paused; }
@keyframes push { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Each event is two screens over the pinned painting: first the place, then the card. */
.bg + .screen { margin-top: -100svh; }
.screen { position: relative; height: 100svh; min-height: 600px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.intro { justify-content: space-between; padding: max(7svh, 44px) 0 calc(128px + env(safe-area-inset-bottom)); }
.next { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: rgba(74, 50, 38, .85); color: var(--cream); animation: nudge 2.4s ease-in-out infinite; }
.next svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.title {
  position: relative;
  color: #fff;
  font-size: clamp(36px, 10.5vw, 56px);
  padding: 0 16px;
  text-shadow: 0 2px 4px rgba(60, 30, 15, .55), 0 0 24px rgba(60, 30, 15, .55);
  text-align: center;
  line-height: 1.1;
}

/* Arch card, like a printed invitation laid over the painting */
.card {
  position: relative;
  isolation: isolate;
  margin-bottom: 96px;
  width: min(92%, 400px);
  min-height: min(68svh, 540px);
  padding: 64px 26px 34px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(241, 231, 215, .98);
  border-radius: 15em 15em 1.2em 1.2em;
  text-align: center;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink);
  box-shadow: 0 12px 34px rgba(40, 20, 10, .28);
}
/* thin inner line, like a letterpress border */
.card::after {
  content: ''; position: absolute; inset: 9px; z-index: -1;
  border: 1px solid rgba(160, 120, 92, .45);
  border-radius: 14.4em 14.4em .8em .8em;
  pointer-events: none;
}
/* the couple's monogram, faint behind the text */
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: url(img/logo.png) center 58% / 260px auto no-repeat;
  opacity: .1;
}
.card p { margin: 0; }
.label { font-family: var(--caps); font-size: 22px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink); }
.hebrew { font-family: var(--serif); font-size: clamp(13px, 3.9vw, 17px); white-space: nowrap; color: var(--ink-soft); margin: 6px 0 4px !important; }
.orn { display: block; width: 120px; height: 12px; margin: 12px auto; background:
  radial-gradient(circle, var(--accent) 2.2px, transparent 2.6px) center / 12px 12px no-repeat,
  linear-gradient(var(--accent), var(--accent)) left center / 48px 1px no-repeat,
  linear-gradient(var(--accent), var(--accent)) right center / 48px 1px no-repeat; opacity: .7; }
.names { font-family: var(--caps); font-size: 25px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink); margin-bottom: 2px !important; }
.names.big { font-size: 28px; margin: 10px 0 !important; }
.when { font-weight: 600; font-size: 19px; }
.when.small { font-weight: 500; font-size: 17px; }
.where { font-family: var(--caps); font-size: 18px; letter-spacing: 2px; text-transform: uppercase; margin-top: 12px !important; }
.parents { display: flex; justify-content: space-between; gap: 14px; width: 100%; font-size: 16px; line-height: 1.3; margin: 12px 0 8px !important; }
.dress { font-size: 15px; margin-top: 8px !important; color: var(--ink-soft); }
.todo { background: #ffe7a8; border-radius: 4px; padding: 0 4px; font-style: italic; }

/* Invite variants: Shabbat Kala only on the ?invite=kala link */
html:not(.kala) .kala-only { display: none !important; }

/* Opening */
.opening { height: 100svh; min-height: 600px; display: flex; flex-direction: column; align-items: center; }
.opening .bg { position: absolute; inset: 0; height: auto; min-height: 0; }
.opening-text {
  position: relative;
  margin-top: max(9svh, 54px);
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 14px rgba(60, 30, 15, .5);
  padding: 0 16px;
}
.logo { width: 118px; height: auto; margin: 0 auto 10px; display: block; filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(60, 30, 15, .45)); }
.footer-logo { width: 140px; margin: 44px auto 0; display: block; opacity: .9; }
.kicker { font-family: var(--serif); font-size: 18px; letter-spacing: 3px; text-transform: uppercase; margin: 0 0 6px; }
.opening h1 { font-size: clamp(52px, 16vw, 72px); line-height: 1.05; }
.opening h1 span { font-size: .7em; }
.dates { font-family: var(--serif); font-size: 21px; letter-spacing: 2px; margin: 8px 0 18px; }
.countdown { display: flex; justify-content: center; gap: 14px; margin-bottom: 22px; }
.countdown div { min-width: 58px; }
.countdown b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.countdown small { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }

.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 13px 28px;
  background: var(--ink);
  color: var(--cream);
  font: 600 15px var(--sans);
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(40, 20, 10, .3);
}
.btn.small { padding: 9px 22px; font-size: 14px; margin-top: 12px; }
.btn:active { transform: translateY(1px); }

.lang {
  position: absolute; top: 14px; right: 14px;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .15);
  color: #fff; border-radius: 999px;
  padding: 6px 12px; font: 600 13px var(--sans);
  backdrop-filter: blur(4px);
}

/* RSVP */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rsvp {
  background: var(--cream);
  padding: 56px 20px calc(120px + env(safe-area-inset-bottom));
  text-align: center;
}
.rsvp h2 { font-size: 56px; color: var(--ink); }
.lead { font-family: var(--serif); font-size: 18px; margin: 4px 0 26px; color: var(--ink-soft); }
form { text-align: left; display: grid; gap: 16px; }
form > label, .count { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
input, textarea {
  font: 500 16px var(--sans);
  color: var(--ink);
  background: #fffaf3;
  border: 1px solid #dccbb5;
  border-radius: 12px;
  padding: 12px 14px;
  width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
fieldset { border: 1px solid #e2d3bf; border-radius: 16px; padding: 16px 14px 14px; margin: 0; min-width: 0; background: var(--cream-2); }
/* legend floated so it sits inside the box instead of on its border */
legend { float: left; width: 100%; padding: 0; margin: 0 0 12px; font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--ink); }
legend + * { clear: both; }
.choice { display: flex; gap: 10px; margin-bottom: 10px; }
.choice label { flex: 1; }
.choice input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.choice span {
  display: block; text-align: center; padding: 10px; border-radius: 999px;
  border: 1px solid #d5c1a8; background: #fffaf3; font-weight: 600; font-size: 14px;
}
.choice input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); }
fieldset.no .count { display: none; }
.count input { width: 90px; }
form .btn { justify-self: center; margin-top: 6px; }
.form-msg { text-align: center; min-height: 1.2em; font-weight: 600; margin: 0; }
.footer { margin-top: 40px; font-family: var(--serif); color: var(--ink-soft); }

/* Bottom dock: icons share the bar equally; the music button floats above its right end. */
.dock {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 10;
  width: min(100vw, 480px);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(245, 236, 223, .95);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(160, 120, 92, .25);
}
.dock a { display: grid; place-items: center; height: 54px; }
.dock img { height: 40px; width: auto; max-width: 58px; object-fit: contain; }
.dock a[href="#rsvp"] img { height: 30px; }
.dock a:active img { transform: scale(.94); }
/* Small round play button sitting on the bar's top edge, in the middle gap. */
.dock .music {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--cream); color: var(--ink);
  border: 1px solid rgba(160, 120, 92, .45);
  box-shadow: 0 3px 10px rgba(40, 20, 10, .18);
}
.dock .gap { display: block; }
.dock a[href="#top"] img { height: 30px; }
html.kala .std-only { display: none !important; }
.music svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.music .play { fill: currentColor; stroke: none; display: none; }
.music.off .play { display: block; }
.music.off .pause { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scene { animation: none; }
}

