/* ==========================================================================
   PAGE — background, layout around the envelope, buttons under it.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--noise), radial-gradient(110% 80% at 50% 25%, var(--linen), var(--linen-2));
  background-color: var(--linen);
  color: var(--green);
  font-family: var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow-x: hidden;
}

.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 24px 40px;
}
.wrap { padding-top: calc(var(--env-h) * 1.02); padding-bottom: calc(var(--env-h) * .3); }

.hint {
  margin: 6px 0 0;
  font-family: var(--caps);
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--green);
  opacity: .7;
  transition: opacity .6s;
}
.started .hint, .stage:not(.ready) .hint { opacity: 0; }

.after {
  display: grid;
  justify-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s;
}
.done .after { opacity: 1; pointer-events: auto; }

.rsvp {
  font-family: var(--caps);
  font-size: 17px;
  letter-spacing: .2em;
  padding: 10px 64px;
  border: 2px solid var(--green);
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(40,50,30,.5);
  transition: background .3s, color .3s;
}
.done .rsvp { animation: pulse-gentle 2s ease-in-out infinite; }
.rsvp:hover { background: var(--green); color: var(--paper); }
.deadline { font-size: 15px; font-style: italic; }

.replay {
  margin-top: 6px;
  background: none; border: 0;
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: .25em;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.rsvp:focus-visible, .replay:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* top bar: the language links sit at its end from the start; the section
   links and the paper background appear once the card has settled
   (body.settled, set by details.js) */
.topbar {
  position: fixed;
  z-index: 5;
  top: 0; left: 0; right: 0;
  min-height: calc(48px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  pointer-events: none;
  transition: background .5s, border-color .5s, box-shadow .5s;
}
.topbar > * { pointer-events: auto; }
.settled .topbar {
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  border-bottom-color: color-mix(in srgb, var(--gold) 35%, transparent);
  box-shadow: 0 6px 18px -14px rgba(40,50,30,.5);
}
.bar-links {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s, visibility 0s .5s;
}
.bar-links::-webkit-scrollbar { display: none; }
.settled .bar-links { opacity: 1; visibility: visible; transition: opacity .5s .2s; }
.bar-links a {
  padding: 12px 7px;
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--green);
  text-decoration: none;
}
.bar-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar-links a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* language links, end of the top bar */
.lang-switch {
  margin-inline-start: auto;
  flex: none;
  display: flex;
  gap: 0;
  font-family: var(--caps-he);   /* has both Latin and Hebrew letters */
  font-size: 13px;
}
.lang-switch a {
  padding: 8px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: .08em;
}
.lang-switch a[aria-current] { color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.lang-switch a:hover { color: var(--green); }
.lang-switch a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* "The day before: Welcome to Tel Aviv →" — only for guests invited to it */
.also {
  display: inline-flex; align-items: baseline; flex-wrap: wrap; justify-content: center; gap: 2px 8px;
  min-height: 36px;
  padding-block: 6px;
  color: var(--green);
  text-decoration: none;
}
.also[hidden] { display: none; }
.also-when {
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.also-what {
  font-size: 18px;
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent);
  text-underline-offset: 4px;
}
.also-what::after { content: " →"; display: inline-block; margin-inline-start: 4px; color: var(--gold); text-decoration: none; }
[dir="rtl"] .also-what::after { content: " ←"; }
.also:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* "Details" cue under the RSVP button */
.more {
  margin-top: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  font-family: var(--caps);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}
.more::before { content: "↓"; font-family: var(--body); font-size: 16px; letter-spacing: 0; }
.done .more::before { animation: nudge 2.4s ease-in-out 1s infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

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

@keyframes pulse-gentle { 50% { transform: scale(1.05); } }
.no-anim, .no-anim * { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { .done .rsvp { animation: none; } }

/* wax seals: "&" in M&E like the "&" between Moli & Edi on the invitation (card.css .names em) */
.mono { white-space: nowrap; }
.mono-amp { font-family: var(--body); font-style: normal; font-size: .6em; vertical-align: .2em; margin: 0 .16em; }

/* "Add to calendar" under the RSVP button */
#cal-slot { display: grid; justify-items: center; width: min(320px, 86vw); }
#cal-slot:empty { display: none; }
.cal-top { gap: 8px; }
.cal-top summary { list-style: none; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--gold) 60%, transparent); text-underline-offset: 5px; color: var(--green); }
.cal-top summary::-webkit-details-marker { display: none; }
.cal-top[open] summary { background: none; color: var(--green); }

/* brunch card above the RSVP button (brunch guests only): a smaller second card, slightly tilted */
.brunch-card {
  width: min(86vw, 380px); box-sizing: border-box;
  margin: 4px 0 22px; padding: 40px 34px 34px;
  /* straight (Moli, 20 Nov: the tilt looked crooked) */
  text-align: center; color: var(--green); font-family: var(--body);
  background:
    url("ivory/corner-tl.webp") left top / 70px auto no-repeat,
    url("ivory/corner-tr.webp") right top / 70px auto no-repeat,
    url("ivory/corner-bl.webp") left bottom / 70px auto no-repeat,
    url("ivory/corner-br.webp") right bottom / 70px auto no-repeat,
    var(--card);
  border-radius: 2px;
  box-shadow: 0 14px 30px -14px rgba(40,50,30,.45);
}
.brunch-card[hidden] { display: none; }
.brunch-card .bc-eyebrow { font-family: var(--caps); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-soft); }
.brunch-card .bc-lede { font-style: italic; font-size: 17px; margin: 10px 0 4px; }
.brunch-card .bc-title { font-family: var(--caps); font-size: 22px; letter-spacing: .14em; margin: 6px 0 2px; }
.brunch-card .bc-date { font-family: var(--caps); font-size: 14px; letter-spacing: .08em; }
.brunch-card .bc-place { font-size: 20px; margin-top: 4px; }
.brunch-card .bc-closing { font-style: italic; font-size: 16px; margin: 12px 0 0; color: var(--ink-soft); }
:lang(he) .brunch-card .bc-eyebrow { font-size: 14px; letter-spacing: .08em; }
:lang(he) .brunch-card .bc-date { font-size: 16px; letter-spacing: 0; }
.more[hidden] { display: none; }
