:root {
  --stone: #DCD3C8;
  --paper: #FBF8F2;
  --gold: #B08D57;
  --gold-light: #DCC392;
  --bronze: #85673F;
  --ink: #45372A;
  --ink-soft: #6E5E4C;

  --sans: "Assistant", "Segoe UI", system-ui, sans-serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;

  --step--1: clamp(0.86rem, 0.84rem + 0.12vw, 0.93rem);
  --step-0: clamp(1rem, 0.97rem + 0.18vw, 1.1rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.35rem);
  --step-2: clamp(1.55rem, 1.2rem + 1.6vw, 2.4rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--stone);
  /* Stone texture, like the surface the invitation sits on. */
  background-image:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 252, 246, 0.55), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .36 0 0 0 0 .29 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bsd {
  position: absolute;
  top: 0.6rem;
  right: 1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

main {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
  padding-block: clamp(1.25rem, 3vh, 2rem) 2.5rem;
}

h1, h2, p, ol, blockquote { margin: 0; }

/* ---------- Header: seal beside names ---------- */

.intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
}

.seal {
  position: relative;
  flex: none;
  width: 68px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 47% 53% 50% 50% / 53% 47% 54% 46%;
  background:
    radial-gradient(circle at 34% 28%, #EEDCB4 0%, #C9A66E 32%, #A9864F 62%, #7F5F33 100%);
  box-shadow:
    inset 0 -4px 8px rgba(80, 55, 22, 0.35),
    inset 0 3px 6px rgba(255, 240, 205, 0.35),
    0 6px 12px rgba(92, 70, 40, 0.26),
    0 1px 2px rgba(92, 70, 40, 0.25);
  animation: press 900ms cubic-bezier(.2, .8, .2, 1) both;
}

.seal::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1.25px solid rgba(110, 80, 40, 0.38);
  box-shadow: 0 1px 0 rgba(255, 238, 200, 0.45);
}

.seal span {
  font-family: var(--script);
  font-size: 29px;
  line-height: 1;
  padding: 0 3px 2px 0;
  color: #8E6B3B;
  text-shadow:
    0 1px 0 rgba(255, 238, 200, 0.6),
    0 -1px 0 rgba(70, 45, 15, 0.45);
}

@keyframes press {
  from { transform: scale(1.35) rotate(-8deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; }
}

.names {
  font-size: var(--step-2);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--bronze);
}

.names .amp {
  font-weight: 300;
  color: var(--gold);
}

.details {
  margin-top: 0.3rem;
  font-weight: 600;
}

.names .nw { white-space: nowrap; }

.details-he {
  text-align: left;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.sep {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 0.65em;
  border-radius: 50%;
  background: var(--gold);
  vertical-align: middle;
}

/* ---------- Lace card holding the stream ---------- */

.lace {
  --r: 5px;
  position: relative;
  isolation: isolate;
  /* Size the video so the whole card fits on screen under the header. */
  width: max(min(100%, 32rem), min(100%, calc((100svh - 14rem) * 16 / 9 + 2.5rem)));
  margin: clamp(1rem, 2.5vh, 1.5rem) auto 0;
  padding: clamp(12px, 1.8vw, 20px);
  filter: drop-shadow(0 12px 22px rgba(92, 70, 40, 0.16)) drop-shadow(0 1px 2px rgba(92, 70, 40, 0.18));
}

/* Paper with a scalloped edge. */
.lace::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: var(--r);
  background: var(--paper);
  -webkit-mask:
    radial-gradient(circle closest-side, #000 97%, #0000) 0 0 / calc(var(--r) * 2) calc(var(--r) * 2) round,
    linear-gradient(#000 0 0) content-box;
  mask:
    radial-gradient(circle closest-side, #000 97%, #0000) 0 0 / calc(var(--r) * 2) calc(var(--r) * 2) round,
    linear-gradient(#000 0 0) content-box;
}

/* Stitched lace line just inside the edge. */
.lace::after {
  content: "";
  position: absolute;
  inset: calc(var(--r) * 1.8);
  z-index: -1;
  border: 1px dotted rgba(176, 141, 87, 0.75);
  pointer-events: none;
}

.screen {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #EFE8DD;
  box-shadow: inset 0 0 0 1px rgba(133, 103, 63, 0.18);
}

.screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #1c1712;
}

.placard {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  text-align: center;
}

.placard h2 {
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--bronze);
  line-height: 1.2;
}

.placard p {
  max-width: 40ch;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.placard .countdown {
  max-width: none;
  margin-top: 0.3rem;
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.status:empty { display: none; }

.status {
  margin-top: 0.6rem;
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.status .live {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 800;
  color: #9B3D2E;
  margin-right: 0.5em;
}

.status .live::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(155, 61, 46, 0.45); }
  50% { box-shadow: 0 0 0 0.45em rgba(155, 61, 46, 0); }
}

/* ---------- Schedule: one row under the video ---------- */

.schedule {
  margin-top: 1.25rem;
  text-align: center;
}

.schedule ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2.25rem;
}

.schedule li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  column-gap: 0.5rem;
}

.schedule time {
  font-weight: 800;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.schedule .what { font-weight: 600; }

.schedule .local {
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.schedule .local:empty { display: none; }

.tz-note {
  margin-top: 0.2rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* ---------- Verse ---------- */

.verse {
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent) top center / 8rem 1px no-repeat;
}

.verse blockquote p[lang="he"] {
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.6;
  color: var(--bronze);
}

.verse .translation,
.verse .cite {
  margin-top: 0.4rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.verse .cite { font-weight: 600; }

/* ---------- Small screens: stack the header ---------- */

@media (max-width: 40rem) {
  main { width: min(100% - 1.25rem, 64rem); }
  .intro { flex-direction: column; gap: 0.6rem; text-align: center; }
  .details-he { text-align: center; }
  .seal { width: 54px; }
  .seal::before { inset: 7px; }
  .seal span { font-size: 23px; }
  .details .sep { display: block; height: 0; margin: 0; background: none; }
  .verse br { display: none; }
  .placard p { font-size: 0.82rem; }
}

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
