:root {
  --bg: #fbfcf8;
  --bg2: #eef5e8;
  --ink: #1f241c;
  --muted: #6a7463;
  --line: rgba(95, 125, 79, 0.16);
  --accent: #5f7d4f;
  --blush: #d49aa0;
  --sage: #9bb988;
  --leaf: #6e8f5d;
  --font: Outfit, system-ui, sans-serif;
  --display: "Cormorant Infant", "Cormorant Garamond", Georgia, serif;
  --content: 680px;
}

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

.petal {
  position: fixed;
  width: 12px;
  height: 16px;
  border-radius: 70% 10% 60% 20%;
  background: rgba(220, 120, 140, 0.55);
  top: -40px;
  left: 14%;
  z-index: 25;
  pointer-events: none;
  animation: fall 15s linear infinite;
}
.petal.p2 { left: 42%; width: 10px; height: 13px; animation-duration: 19s; animation-delay: -4s; background: rgba(155, 185, 136, 0.5); }
.petal.p3 { left: 68%; width: 13px; height: 17px; animation-duration: 17s; animation-delay: -9s; background: rgba(230, 140, 155, 0.45); }
.petal.p4 { left: 28%; width: 9px; height: 12px; animation-duration: 22s; animation-delay: -12s; background: rgba(230, 150, 160, 0.4); }
.petal.p5 { left: 84%; width: 11px; height: 14px; animation-duration: 18s; animation-delay: -2s; background: rgba(143, 168, 134, 0.45); }
@keyframes fall {
  0% { transform: translateY(0) rotate(0deg) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(110vh) rotate(320deg) translateX(40px); opacity: 0.2; }
}

.top {
  position: fixed;
  inset: 14px 14px auto 14px;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
body.evening-on .menu-btn {
  visibility: hidden;
  pointer-events: none;
}
body.evening-on .music-hint {
  display: none !important;
}
.top button {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  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 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  pointer-events: none;
}
.music-wrap .music {
  pointer-events: auto;
  width: 3.1rem;
  height: 3.1rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 10px 28px rgba(47, 53, 44, 0.14);
}
.music[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}
.music-hint {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  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(47, 53, 44, 0.14);
}
.music-hint-arrow {
  display: inline-block;
  font-size: 1.25rem;
  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 10px 28px rgba(47, 53, 44, 0.1), 0 0 0 0 rgba(95, 115, 86, 0); }
  50% { box-shadow: 0 10px 28px rgba(47, 53, 44, 0.14), 0 0 0 8px rgba(95, 115, 86, 0.14); }
}
@keyframes hintNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.drawer[hidden] { display: none !important; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.97);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
  padding: 2rem;
}
.drawer a {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 0.04em;
}
.drawer-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  width: 2.6rem;
  height: 2.6rem;
  cursor: pointer;
  font-size: 1rem;
}

.cover {
  padding: 0;
  background: #ffffff;
  min-height: 0;
}
.cover-card {
  position: relative;
  width: 100%;
  min-height: min(100svh, 920px);
  margin: 0;
  overflow: hidden;
  background: #f4f7ef;
}
.cover-illu {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  display: block;
}
.cover-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(140px, 32%, 320px);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.55) 48%,
    #ffffff 100%
  );
  pointer-events: none;
  z-index: 1;
}
.cover-copy {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: min(88%, 540px);
  text-align: center;
  pointer-events: none;
}
.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.02;
  color: #1a1a1a;
}
.name-a, .name-b {
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  letter-spacing: 0.01em;
}
.name-and {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.45rem, 4.2vw, 2rem);
  color: #1a1a1a;
  line-height: 1;
  margin: 0.12rem 0 0.18rem;
}
.cover-date {
  margin-top: 0.85rem;
  font-family: var(--display);
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.08em;
  color: #2a3226;
}

.block {
  max-width: var(--content);
  margin: 0 auto;
  padding: 3.8rem 1.4rem;
  background: #fff;
}
.block.soft {
  background: linear-gradient(180deg, #f3f8ee 0%, #ffffff 100%);
  max-width: none;
  width: 100%;
  padding-left: max(1.4rem, calc(50% - (var(--content) / 2)));
  padding-right: max(1.4rem, calc(50% - (var(--content) / 2)));
}
.block.center { text-align: center; }
.block.center .btn { margin-left: auto; margin-right: auto; }
.block.center .program,
.block.center .notes {
  text-align: left;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
}
.block.center .palette {
  justify-content: center;
}
.attend-lead {
  max-width: 28rem;
  margin: 0 auto 1.5rem;
}
.block h2, .story-copy h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 1.2rem;
  letter-spacing: 0.02em;
}
.block p + p { margin-top: 0.9rem; }
.muted { color: var(--muted); }
.big-date {
  font-family: var(--display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  margin: 0.4rem 0 0.5rem;
}
.place-name {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.map {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(95, 125, 79, 0.35);
}

.story {
  display: grid;
  gap: 2rem;
  max-width: 980px;
  margin: 0 auto;
  padding: 2rem 1.4rem 3.5rem;
  background: #fff;
}
@media (min-width: 900px) {
  .story {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 2.5rem;
    padding: 3.5rem 1.5rem;
  }
}
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.55rem;
  max-height: 360px;
  height: min(360px, 50vw);
}
.shot {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: var(--bg2);
  min-height: 0;
}
.shot.tall { grid-row: 1 / span 2; }
.shot img,
.shot video,
.photo-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-fallback {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.6rem;
  color: rgba(95, 125, 79, 0.4);
  background: linear-gradient(160deg, #eef5e8, #f3ebe8);
}

.gallery {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0.5rem 1.4rem 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  align-items: stretch;
  background: #fff;
}
.gallery .shot {
  aspect-ratio: 3 / 4;
  max-height: 260px;
  width: 100%;
}
.gallery .shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery .video-shot {
  grid-column: 1 / -1;
  aspect-ratio: 9 / 16;
  width: min(100%, 340px);
  max-height: min(72vh, 560px);
  height: auto;
  justify-self: center;
  background: #1a1f18;
}
.gallery .video-shot video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.program, .notes {
  list-style: none;
  display: grid;
  gap: 0.95rem;
}
.program li, .notes li {
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}
.program b { color: var(--accent); font-weight: 500; }
.notes li {
  counter-increment: note;
  position: relative;
  padding-left: 3rem;
}
.notes { counter-reset: note; }
.notes li::before {
  content: counter(note, decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 0.95rem;
  font-family: var(--display);
  color: var(--sage);
  font-size: 1.05rem;
}

.palette {
  display: flex;
  gap: 0.55rem;
  margin-top: 1.3rem;
  flex-wrap: wrap;
}
.palette span {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(63, 78, 58, 0.12);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.btn {
  appearance: none;
  border: none;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 1rem 1.8rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(95, 125, 79, 0.28);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn:disabled { opacity: 0.55; cursor: wait; }

.timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1.4rem;
}
.timer div {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 0.4rem;
}
.timer b {
  display: block;
  font-family: var(--display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 500;
}
.timer span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.toast {
  margin-top: 1.8rem;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.55rem;
  color: var(--leaf);
}

.foot, .eve-foot {
  text-align: center;
  padding: 3rem 1.4rem 4rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.credit {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  opacity: 0.24;
  letter-spacing: 0.02em;
}

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

.scene-evening {
  position: relative;
  z-index: 35;
  min-height: 100svh;
  background:
    radial-gradient(900px 520px at 50% 0%, rgba(155, 185, 136, 0.22), transparent 55%),
    #fbfcf8;
  color: var(--ink);
  padding: 0 0 2.5rem;
}
.scene-evening[hidden] { display: none !important; }
.eve-header {
  position: relative;
  z-index: 36;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
}
.back {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.eve-grid {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1.2rem 0.5rem;
  display: grid;
  gap: 0.85rem;
}
@media (min-width: 900px) {
  .eve-grid { grid-template-columns: 1.1fr 0.9fr; }
}
.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem;
}
.panel h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.55rem;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.panel-lead {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}
#sky {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  background: #e7efe0;
  border: 1px solid var(--line);
}
.star-caption {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}
#wish-form {
  display: grid;
  gap: 0.85rem;
}
#wish-form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
#wish-form input,
#wish-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  resize: vertical;
}
.form-hint {
  font-size: 0.82rem;
  color: var(--muted);
}
.candelabra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}
.candle {
  width: 0.55rem;
  height: 1.6rem;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, #f4e7c8, #c9a86a);
  box-shadow: 0 -4px 10px rgba(201, 168, 106, 0.28);
}
.wishes {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 1.2rem 2rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.wish-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem 1rem;
  font-size: 0.95rem;
  color: var(--ink);
}
.wish-card b {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-weight: 500;
}
.eve-foot {
  text-align: center;
  padding: 1.5rem 1.4rem 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 24, 0.62);
  backdrop-filter: blur(6px);
}
.ticket-wrap {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
}
.ticket {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.ticket.for-pdf {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 720px;
  grid-template-columns: 160px 1fr;
}
.stub {
  background: linear-gradient(180deg, #6e8564, #4f6348);
  color: #f7f4ee;
  padding: 1.2rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
}
.stub-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.75;
}
.stub-mono {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 500;
}
.serial {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.barcode {
  height: 34px;
  background: repeating-linear-gradient(
    90deg,
    #f7f4ee 0 2px,
    transparent 2px 5px,
    #f7f4ee 5px 7px,
    transparent 7px 9px
  );
  opacity: 0.85;
}
.ticket-body {
  padding: 1.25rem 1.35rem;
}
.tk {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.ticket-body h3 {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 500;
  margin: 0.2rem 0 0.45rem;
}
.tk-name {
  font-size: 1.15rem;
  margin-bottom: 0.8rem;
}
.ticket-body ul {
  list-style: none;
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}
.tk-guest {
  font-family: var(--script);
  font-size: 1.5rem;
  color: var(--leaf);
}
.ticket-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .ticket { grid-template-columns: 1fr; }
  .stub { flex-direction: row; align-items: center; }
  .barcode { width: 90px; height: 28px; }
  .music-hint { padding: 0.7rem 0.95rem; font-size: 0.82rem; }
}
