:root {
  --ink: #201815;
  --muted: #6f625d;
  --paper: #f7efe5;
  --rose: #e34f6f;
  --wine: #732d3d;
  --mint: #4f9f87;
  --lime: #d7e36f;
  --blue: #305f85;
  --shadow: 0 22px 70px rgba(72, 43, 32, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(227, 79, 111, 0.2), transparent 32rem),
    radial-gradient(circle at 86% 8%, rgba(215, 227, 111, 0.32), transparent 29rem),
    linear-gradient(135deg, #f8efe6 0%, #f4d8c4 42%, #e7efe1 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(32, 24, 21, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 24, 21, 0.055) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  opacity: 0.23;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 280 280' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

main {
  width: min(1160px, calc(100% - 28px));
  margin: 0 auto;
}

.panel {
  min-height: 92vh;
  display: grid;
  align-content: center;
  padding: clamp(54px, 8vw, 110px) 0;
}

.hero {
  position: relative;
  min-height: 96vh;
  isolation: isolate;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--wine);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.94;
}

h1 {
  max-width: 850px;
  font-size: clamp(4.2rem, 13vw, 10.5rem);
}

h1 span {
  display: block;
  font-style: italic;
}

h2 {
  font-size: clamp(3rem, 8vw, 7.2rem);
  max-width: 920px;
}

.lede {
  max-width: 530px;
  margin: 28px 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.primary-cta,
.back-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  background: var(--ink);
  border: 1px solid rgba(32, 24, 21, 0.12);
  border-radius: 999px;
  padding: 14px 18px 14px 22px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, background 220ms ease;
}

.primary-cta:hover,
.back-link:hover {
  transform: translateY(-3px);
  background: var(--wine);
}

.primary-cta svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: bob 1.2s ease-in-out infinite;
}

.hero-art {
  position: absolute;
  inset: 8% 0 auto auto;
  width: min(44vw, 480px);
  aspect-ratio: 1;
  z-index: -1;
}

.sun,
.plate,
.orbit {
  position: absolute;
  border-radius: 50%;
}

.sun {
  inset: 12%;
  background:
    radial-gradient(circle at 40% 38%, #fff8e7 0 13%, transparent 14%),
    conic-gradient(from 120deg, var(--rose), #f6b55f, var(--lime), var(--mint), var(--blue), var(--rose));
  box-shadow: var(--shadow);
  animation: float 7s ease-in-out infinite;
}

.plate {
  left: 18%;
  bottom: 4%;
  width: 54%;
  aspect-ratio: 1;
  background: rgba(255, 251, 244, 0.84);
  border: 1px solid rgba(32, 24, 21, 0.14);
  display: grid;
  place-items: center;
  box-shadow: 0 24px 60px rgba(32, 24, 21, 0.18);
}

.plate span {
  position: absolute;
  border-radius: 999px;
  background: var(--ink);
}

.plate span:nth-child(1) {
  width: 42%;
  height: 8px;
  transform: rotate(22deg);
}

.plate span:nth-child(2) {
  width: 10px;
  height: 58%;
  transform: rotate(22deg) translateX(32px);
  background: var(--rose);
}

.plate span:nth-child(3) {
  width: 42%;
  height: 8px;
  transform: rotate(-22deg) translateY(34px);
  background: var(--mint);
}

.orbit {
  inset: 3%;
  border: 1px dashed rgba(32, 24, 21, 0.32);
  animation: spin 26s linear infinite;
}

.orbit-two {
  inset: 20%;
  animation-duration: 18s;
  animation-direction: reverse;
}

.ticker {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  border-block: 1px solid rgba(32, 24, 21, 0.18);
  background: rgba(255, 250, 241, 0.42);
}

.ticker div {
  display: flex;
  width: max-content;
  gap: 34px;
  padding: 18px 0;
  animation: marquee 25s linear infinite;
}

.ticker span {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.8rem, 4vw, 3.8rem);
  white-space: nowrap;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 7vw, 90px);
  align-items: end;
}

.split p,
.invite-copy p,
.finale p,
.lab-copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.receipt {
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(28px, 7vw, 86px);
  align-items: center;
}

.receipt-list {
  display: grid;
  gap: 10px;
  counter-reset: receipt;
}

.receipt-list button {
  cursor: pointer;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 86px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 251, 244, 0.58);
  border: 1px solid rgba(32, 24, 21, 0.16);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(72, 43, 32, 0.1);
  transition: transform 180ms ease, background 180ms ease;
}

.receipt-list button:hover {
  transform: translateX(6px);
  background: rgba(255, 251, 244, 0.86);
}

.receipt-list span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fffaf1;
  background: var(--wine);
  border-radius: 50%;
  font-weight: 900;
}

.receipt-list strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 3rem);
  font-weight: 400;
  line-height: 1;
}

.cards {
  min-height: auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.joke-card {
  min-height: 300px;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 251, 244, 0.58);
  border: 1px solid rgba(32, 24, 21, 0.16);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(72, 43, 32, 0.12);
  backdrop-filter: blur(18px);
  transform-style: preserve-3d;
  transition: transform 180ms ease, background 180ms ease;
}

.joke-card:hover {
  background: rgba(255, 251, 244, 0.78);
}

.joke-card span,
.joke-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.joke-card strong {
  display: block;
  margin: 80px 0 14px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  font-weight: 400;
  line-height: 0.92;
}

.lab {
  grid-template-columns: 0.9fr minmax(290px, 440px);
  gap: clamp(30px, 7vw, 90px);
  align-items: center;
}

.lab-copy p {
  max-width: 520px;
  margin-top: 24px;
}

.meter {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 8px;
  color: #fffaf1;
  background:
    linear-gradient(135deg, rgba(115, 45, 61, 0.95), rgba(32, 24, 21, 0.96)),
    var(--ink);
  box-shadow: var(--shadow);
}

.face {
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  background: #fff1ca;
  box-shadow: inset 0 -16px 0 rgba(32, 24, 21, 0.08);
}

.eye {
  position: absolute;
  top: 64px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
}

.eye.left {
  left: 52px;
}

.eye.right {
  right: 52px;
}

.mouth {
  position: absolute;
  left: 50%;
  bottom: 50px;
  width: 54px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
  transform: translateX(-50%);
  transition: height 160ms ease, border-radius 160ms ease, bottom 160ms ease;
}

.meter label {
  font-weight: 900;
}

.meter input {
  accent-color: var(--lime);
  width: 100%;
}

.meter output {
  min-height: 28px;
  color: rgba(255, 250, 241, 0.78);
  font-weight: 800;
}

.loyalty-btn {
  min-height: 50px;
  cursor: pointer;
  border: 1px solid rgba(255, 250, 241, 0.35);
  border-radius: 999px;
  color: #fffaf1;
  background: transparent;
  font: inherit;
  font-weight: 900;
  transition: transform 180ms ease, background 180ms ease;
}

.loyalty-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 250, 241, 0.1);
}

.invite {
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: clamp(28px, 7vw, 88px);
  align-items: center;
}

.ticket {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 251, 244, 0.78);
  border: 1px solid rgba(32, 24, 21, 0.18);
  box-shadow: var(--shadow);
}

.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  top: 42%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1d9ca;
  border: 1px solid rgba(32, 24, 21, 0.14);
}

.ticket::before {
  left: -18px;
}

.ticket::after {
  right: -18px;
}

.ticket-top,
.ticket-main {
  padding: 22px;
}

.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px dashed rgba(32, 24, 21, 0.24);
}

.ticket-main p {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 800;
}

.ticket-main h3 {
  margin: 0;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 400;
  line-height: 0.95;
}

.rsvp {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffaf1;
  box-shadow: var(--shadow);
}

.rsvp button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.rsvp button:hover {
  transform: translateY(-2px);
}

.yes-btn {
  color: var(--ink);
  background: var(--lime);
}

.maybe-btn {
  color: #fffaf1;
  background: transparent;
  border: 1px solid rgba(255, 250, 241, 0.35) !important;
}

.rsvp-note {
  margin: 8px 4px 0;
  color: rgba(255, 250, 241, 0.72);
  line-height: 1.5;
}

.countdown {
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
}

.count-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.count-grid div {
  min-height: 156px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 8px;
  border: 1px solid rgba(32, 24, 21, 0.14);
  background: rgba(255, 251, 244, 0.58);
}

.count-grid strong {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 5.7rem);
  font-weight: 400;
  line-height: 1;
}

.count-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.finale {
  min-height: 76vh;
  text-align: center;
  justify-items: center;
}

.finale p {
  margin-bottom: 18px;
}

.back-link {
  margin-top: 32px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  width: min(520px, calc(100% - 28px));
  padding: 16px 18px;
  color: #fffaf1;
  background: rgba(32, 24, 21, 0.92);
  border: 1px solid rgba(255, 250, 241, 0.16);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 25;
}

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes bob {
  50% {
    transform: translateY(4px);
  }
}

@keyframes float {
  50% {
    transform: translate3d(0, -18px, 0) rotate(4deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@media (max-width: 760px) {
  main {
    width: min(100% - 22px, 620px);
  }

  .panel {
    min-height: auto;
    padding: 64px 0;
  }

  .hero {
    min-height: 94vh;
    padding-top: 34vh;
  }

  .hero-art {
    inset: 6% 50% auto auto;
    width: min(82vw, 390px);
    transform: translateX(50%);
  }

  h1 {
    font-size: clamp(4.1rem, 20vw, 6.8rem);
  }

  .split,
  .invite,
  .lab,
  .receipt,
  .countdown,
  .cards {
    grid-template-columns: 1fr;
  }

  .cards {
    gap: 12px;
  }

  .joke-card {
    min-height: 220px;
  }

  .joke-card strong {
    margin-top: 48px;
  }

  .count-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
