:root {
  --bg: #ffffff;
  --bg2: #f6f4f1;
  --ink: #161616;
  --muted: #6f6a64;
  --line: rgba(22, 22, 22, 0.1);
  --accent: #5c2a33;
  --sand: #cbb9a8;
  --font: Outfit, system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-weight: 300;
  -webkit-tap-highlight-color: transparent;
}

.top {
  position: fixed;
  inset: 14px 14px auto 14px;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.top button {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}
.music-wrap .music {
  pointer-events: auto;
  padding: 1rem 1.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  background: #fff;
  border: 2px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 10px 28px rgba(22, 22, 22, 0.18);
}
.music[aria-pressed="true"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.music-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: none;
}
.music-hint {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.35rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--accent);
  backdrop-filter: blur(10px);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
  animation: hintPulse 1.8s ease-in-out infinite;
  user-select: none;
  box-shadow: 0 10px 28px rgba(22, 22, 22, 0.18);
}
.music-hint-arrow {
  display: inline-block;
  font-size: 1.45rem;
  line-height: 1;
  animation: hintNudge 1.2s ease-in-out infinite;
}
.music-hint.is-gone {
  opacity: 0;
  transform: translateX(-6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  animation: none;
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(22, 22, 22, 0.1), 0 0 0 0 rgba(92, 42, 51, 0.0); }
  50% { box-shadow: 0 6px 18px rgba(22, 22, 22, 0.12), 0 0 0 8px rgba(92, 42, 51, 0.12); }
}
@keyframes hintNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(300px, 88vw);
  background: #fff;
  z-index: 50;
  padding: 4.2rem 1.4rem 2rem;
  display: grid;
  gap: 0.9rem;
  box-shadow: 12px 0 48px rgba(0, 0, 0, 0.12);
}
.drawer[hidden] { display: none !important; }
.drawer a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.45rem;
}
.drawer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}

.cover {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.cover-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 5rem 1.5rem 3.5rem;
  gap: 1.1rem;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.cover-copy::before {
  content: "&";
  position: absolute;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(12rem, 28vw, 22rem);
  color: rgba(22, 22, 22, 0.035);
  line-height: 1;
  pointer-events: none;
}
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
}
.names {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: grid;
  gap: 0.05rem;
  position: relative;
}
.amp {
  font-style: italic;
  text-transform: none;
  color: var(--accent);
  font-size: 0.55em;
  letter-spacing: 0;
  margin: 0.15rem 0;
}
.cover-date {
  margin-top: 1.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--muted);
  position: relative;
}
.cover-date span {
  color: rgba(22, 22, 22, 0.22);
  margin: 0 0.4rem;
}
.cover-photo {
  position: relative;
  min-height: 320px;
  background: linear-gradient(145deg, #2a2420, #111 60%, #3a2a2e);
  overflow: hidden;
}
.cover-photo .photo-img,
.shot .photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-photo .photo-img { position: absolute; inset: 0; }
.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  color: rgba(255, 255, 255, 0.78);
  letter-spacing: 0.18em;
  background:
    radial-gradient(circle at 30% 20%, rgba(203, 185, 168, 0.25), transparent 45%),
    linear-gradient(160deg, #2a2420, #111 55%, #3a2a2e);
}

.block {
  padding: 4.5rem 1.4rem;
  max-width: 720px;
  margin: 0 auto;
}
.block.soft {
  background: var(--bg2);
  max-width: none;
}
.block.soft > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.block.center { text-align: center; }
.block h2,
.story-copy h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 2.7rem);
  margin-bottom: 1.15rem;
  letter-spacing: 0.02em;
}
.block p + p { margin-top: 0.85rem; }
.muted { color: var(--muted); }
.big-date {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  font-weight: 500;
}
.place-name {
  font-size: 1.25rem;
  font-weight: 500;
}
.map {
  display: inline-block;
  margin-top: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.story {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  align-items: stretch;
  background: var(--bg2);
}
.story-copy {
  padding: 4.5rem 8vw 4.5rem 1.5rem;
  max-width: 560px;
  margin-left: auto;
}
.story-copy p + p { margin-top: 0.9rem; }
.story-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-rows: 1.2fr 0.8fr;
  gap: 0.55rem;
  padding: 1.2rem 1.2rem 1.2rem 0.4rem;
  min-height: 520px;
}
.story-grid .tall {
  grid-row: 1 / span 2;
}

.shot {
  position: relative;
  overflow: hidden;
  background: #1c1c1c;
  min-height: 160px;
}
.shot .photo-fallback { font-size: clamp(1.4rem, 3vw, 2.2rem); }
.gallery {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0.55rem;
  padding: 0.55rem;
}
.gallery .wide { min-height: 320px; }
.gallery .shot { min-height: 320px; }

.program, .notes {
  list-style: none;
  display: grid;
  gap: 0.85rem;
}
.program li, .notes li {
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--line);
}
.program li b {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-right: 0.25rem;
}
.notes { counter-reset: n; }
.notes li { counter-increment: n; }
.notes li::before {
  content: counter(n, decimal-leading-zero);
  display: block;
  font-family: var(--display);
  color: var(--accent);
  margin-bottom: 0.3rem;
  font-size: 1.1rem;
}

.palette {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.35rem;
}
.palette span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

form { display: grid; gap: 1rem; }
label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.94rem;
}
input[type="text"], textarea {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.btn {
  border: 0;
  padding: 0.95rem 1.3rem;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}
.btn:hover { background: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { border-color: var(--ink); background: transparent; }

#attend { text-align: center; }
#attend .btn { min-width: 200px; }

.scene-evening {
  min-height: 100svh;
  padding: 1.25rem 1.25rem 4rem;
  max-width: 980px;
  margin: 0 auto;
}
.eve-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 1.75rem;
}
.eve-header p {
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-align: center;
}
.back {
  justify-self: start;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  font-size: 0.9rem;
}
.eve-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}
.panel {
  background: var(--bg2);
  border: 1px solid var(--line);
  padding: 1.25rem;
}
.panel h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.45rem;
  margin-bottom: 0.45rem;
}
.panel-lead {
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: var(--muted);
}
#sky {
  width: 100%;
  height: auto;
  display: block;
  background: #111;
}
.star-caption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.panel form { display: grid; gap: 0.85rem; }
.panel label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent);
}
.candelabra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.candle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(92, 42, 51, 0.45);
  animation: pulse 1.6s ease-in-out infinite;
}
.wishes {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.wish-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem;
  font-size: 0.95rem;
}
.wish-card b {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
  font-weight: 500;
}
.eve-foot {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.modal[hidden], .scene-evening[hidden], #scene-invite[hidden] {
  display: none !important;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 22, 22, 0.45);
}
.ticket-wrap { position: relative; z-index: 1; width: min(560px, 100%); }
.ticket {
  display: flex;
  width: 100%;
  min-height: 200px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  border: 1px solid var(--line);
}
.ticket.for-pdf {
  position: fixed !important;
  left: -10000px !important;
  top: 0 !important;
  z-index: 1;
  width: 720px !important;
  max-width: none !important;
  min-height: 280px !important;
  height: auto !important;
  display: flex !important;
  flex-direction: row !important;
  border-radius: 0;
  opacity: 1 !important;
  overflow: visible !important;
  box-shadow: none;
  border: 1px solid #e5e5e5;
}
.ticket.for-pdf .stub {
  width: 140px !important;
  min-width: 140px !important;
  min-height: 280px !important;
  flex: 0 0 140px !important;
  flex-direction: column !important;
}
.ticket.for-pdf .ticket-body {
  flex: 1 1 auto !important;
  min-width: 0;
  padding: 28px 32px !important;
  overflow: visible !important;
}
.ticket.for-pdf .tk {
  letter-spacing: 0.18em;
  white-space: nowrap;
}
.stub {
  width: 128px;
  background: var(--ink);
  color: #fff;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.stub-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 600;
}
.stub-mono {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 500;
}
.serial { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; }
.barcode {
  width: 80%;
  height: 28px;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 2px,
    transparent 2px 4px,
    #fff 4px 5px,
    transparent 5px 8px
  );
}
.ticket-body { padding: 1.35rem 1.5rem; flex: 1; }
.tk {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket-body h3 {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0.2rem 0 0.35rem;
}
.tk-name {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0.2rem 0 0.75rem;
}
.ticket-body ul {
  list-style: none;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.tk-guest {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--accent);
  font-family: var(--display);
  font-style: italic;
}
.ticket-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1rem;
  width: 100%;
}
.ticket-actions .btn {
  min-width: 200px;
  width: auto;
}

@keyframes pulse {
  50% { transform: scale(0.75); opacity: 0.6; }
}

.timer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-top: 1.3rem;
}
.timer div {
  background: #fff;
  border: 1px solid var(--line);
  padding: 1rem 0.4rem;
}
.timer b {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 500;
}
.timer span {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toast {
  margin-top: 1.7rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--muted);
}

.foot {
  text-align: center;
  padding: 3.2rem 1.25rem 4.2rem;
  border-top: 1px solid var(--line);
}

.credit {
  margin-top: 1.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
    color: rgba(22, 22, 22, 0.22);
  font-weight: 300;
  user-select: none;
}
.eve-foot .credit {
  margin-top: 0.85rem;
  width: 100%;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .cover { grid-template-columns: 1fr; min-height: auto; }
  .cover-photo { order: -1; min-height: 52svh; }
  .cover-copy { min-height: 48svh; padding-top: 3.5rem; }
  .story { grid-template-columns: 1fr; }
  .story-copy {
    padding: 3.5rem 1.4rem;
    max-width: none;
    margin: 0;
  }
  .story-grid {
    padding: 0 1rem 1.2rem;
    min-height: 420px;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .gallery .wide,
  .gallery .shot {
    min-height: 260px;
  }
  .eve-grid { grid-template-columns: 1fr; }
  .ticket { flex-direction: column; }
  .stub {
    width: 100%;
    flex-direction: row;
    min-height: 72px;
    gap: 0.75rem;
  }
  .modal {
    align-items: end;
    padding: 0.75rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .ticket-actions {
    width: 100%;
    align-items: center;
  }
  .ticket-actions .btn {
    flex: 0 0 auto;
    min-width: 200px;
    width: auto;
  }
}
