/* ============================================================
   Moussa & Hanin — night-funfair engagement invitation
   Palette: grape night sky + candy (coral, gold, mint, sky, cream)
   Type: Shrikhand (display) + Nunito (body)
   ============================================================ */

:root {
  --night:   #33175B;
  --night-2: #5B2A86;
  --ink:     #1F0F3D;
  --coral:   #FF5D73;
  --gold:    #FFC94D;
  --mint:    #4DDBB0;
  --sky:     #5AA9FF;
  --cream:   #FFF4E4;
  --cream-2: #FFE9C7;
  --shadow:  0 10px 0 rgba(31, 15, 61, .35);
  --radius:  22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: radial-gradient(120% 90% at 50% 0%, var(--night-2) 0%, var(--night) 55%, #241040 100%) fixed;
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

h1, h2, .ticket-names { font-family: "Shrikhand", "Nunito", cursive; font-weight: 400; }

/* ---------- confetti canvas ---------- */
#confettiCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ============================================================
   INTRO — the ring box
   ============================================================ */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2.2rem;
  background: radial-gradient(120% 90% at 50% 20%, var(--night-2) 0%, var(--night) 60%, #1c0c35 100%);
  transition: opacity .6s ease, visibility .6s;
}
.intro.closed { opacity: 0; visibility: hidden; }

.intro-stars {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff9  50%, transparent 51%),
    radial-gradient(2px 2px at 78% 14%, #fff7  50%, transparent 51%),
    radial-gradient(3px 3px at 32% 74%, #ffc94d88 50%, transparent 51%),
    radial-gradient(2px 2px at 64% 62%, #fff6  50%, transparent 51%),
    radial-gradient(2px 2px at 88% 78%, #ff5d7388 50%, transparent 51%),
    radial-gradient(2px 2px at 22% 48%, #5aa9ff88 50%, transparent 51%),
    radial-gradient(3px 3px at 51% 31%, #fff5 50%, transparent 51%);
  animation: twinkle 3.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .5; } to { opacity: 1; } }

.intro-eyebrow {
  font-size: 1rem; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}

.intro-hint {
  font-size: 1.05rem; font-style: italic; color: #ffffffb3;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* the box itself */
.ringbox {
  position: relative;
  width: 190px; height: 190px;
  background: none; border: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: boxwiggle 3s ease-in-out infinite;
}
.ringbox:focus-visible { outline: 4px dashed var(--gold); outline-offset: 12px; border-radius: 20px; }
@keyframes boxwiggle {
  0%, 84%, 100% { transform: rotate(0); }
  88% { transform: rotate(-3deg) scale(1.02); }
  92% { transform: rotate(3deg)  scale(1.02); }
  96% { transform: rotate(-2deg); }
}

.ringbox-glow {
  position: absolute; inset: -45px;
  background: radial-gradient(circle, #ffc94d40 0%, transparent 65%);
  border-radius: 50%;
  animation: twinkle 2s ease-in-out infinite alternate;
}

.ringbox-base {
  position: absolute; left: 15px; right: 15px; bottom: 6px; height: 105px;
  background: linear-gradient(180deg, var(--coral), #e04360);
  border-radius: 14px 14px 18px 18px;
  box-shadow: var(--shadow);
}
.ringbox-ribbon-h {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 26px; transform: translateX(-50%);
  background: var(--gold);
}
.ringbox-lid {
  position: absolute; left: 4px; right: 4px; top: 46px; height: 44px;
  background: linear-gradient(180deg, #ff7288, var(--coral));
  border-radius: 12px;
  box-shadow: 0 6px 0 rgba(31, 15, 61, .25);
  transform-origin: 8% 90%;
  transition: transform .55s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 2;
}
.ringbox-ribbon-v {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 26px; transform: translateX(-50%);
  background: var(--gold); border-radius: 4px;
}
.ringbox-ribbon-v::before {
  content: "🎀"; position: absolute; top: -26px; left: 50%;
  transform: translateX(-50%); font-size: 34px;
}

.ringbox-ring {
  position: absolute; left: 50%; bottom: 60px;
  transform: translateX(-50%) translateY(20px) scale(.3);
  font-size: 74px; opacity: 0; z-index: 1;
  transition: transform .65s cubic-bezier(.34, 1.8, .64, 1), opacity .3s ease .1s;
  filter: drop-shadow(0 0 18px #ffc94daa);
}

.ringbox.open { animation: none; }
.ringbox.open .ringbox-lid { transform: rotate(-112deg) translateY(-12px); }
.ringbox.open .ringbox-ring {
  transform: translateX(-50%) translateY(-58px) scale(1) rotate(-8deg);
  opacity: 1;
}

.sparkle {
  position: absolute; font-size: 24px; opacity: 0; pointer-events: none;
}
.s1 { top: -14px; left: -6px; }
.s2 { top: 6px; right: -18px; font-size: 30px; }
.s3 { top: -34px; left: 55%; font-size: 20px; }
.ringbox.open .sparkle { animation: sparklepop .9s ease forwards; }
.ringbox.open .s2 { animation-delay: .12s; }
.ringbox.open .s3 { animation-delay: .24s; }
@keyframes sparklepop {
  0% { opacity: 0; transform: scale(.2) rotate(0); }
  40% { opacity: 1; transform: scale(1.3) rotate(20deg); }
  100% { opacity: 0; transform: scale(.6) rotate(45deg) translateY(-18px); }
}

/* ============================================================
   FESTOON LIGHTS
   ============================================================ */
.festoon {
  display: block; width: 100%; height: 84px;
  overflow: visible;
  transform-origin: top center;
  animation: sway 6s ease-in-out infinite alternate;
}
@keyframes sway { from { transform: rotate(-.7deg); } to { transform: rotate(.7deg); } }
.festoon .bulb { animation: glowpulse 2.4s ease-in-out infinite; }
.festoon .bulb:nth-child(3n)   { animation-delay: .5s; }
.festoon .bulb:nth-child(3n+1) { animation-delay: 1.1s; }
@keyframes glowpulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ============================================================
   LAYOUT & SECTIONS
   ============================================================ */
.party > section, .party > header {
  max-width: 880px;
  margin: 0 auto;
  padding: 3.2rem 1.4rem;
}

.section-title {
  font-size: clamp(1.6rem, 4.5vw, 2.3rem);
  text-align: center;
  margin-bottom: 2rem;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--ink);
}

.eyebrow {
  font-size: .85rem; font-weight: 800; letter-spacing: .22em;
  text-transform: uppercase; color: var(--mint);
  margin-bottom: 1rem;
}

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 1.5rem; }

.hero-title {
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 1.08;
  text-shadow: 4px 4px 0 var(--ink);
}
.hero-title .line { display: block; }
.hero-title .line-1 { color: var(--cream); }
.hero-title .line-2 { color: var(--coral); }
.hero-title em {
  font-style: normal; color: var(--gold);
  display: inline-block;
  animation: yesbounce 2.2s ease-in-out infinite;
}
@keyframes yesbounce {
  0%, 60%, 100% { transform: rotate(0) scale(1); }
  70% { transform: rotate(-4deg) scale(1.12); }
  80% { transform: rotate(3deg) scale(1.06); }
}

.party[data-revealed] .line-1 { animation: swingin .7s cubic-bezier(.34,1.56,.64,1) both .15s; }
.party[data-revealed] .line-2 { animation: swingin .7s cubic-bezier(.34,1.56,.64,1) both .35s; }
@keyframes swingin {
  from { opacity: 0; transform: translateY(30px) rotate(-3deg); }
  to   { opacity: 1; transform: translateY(0) rotate(0); }
}

.hero-sub {
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  max-width: 34em; margin: 1.4rem auto 2rem;
  color: #fff;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font-family: inherit; font-weight: 900; font-size: 1.1rem;
  padding: .95em 1.8em;
  border-radius: 999px; border: 3px solid var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-gold {
  background: var(--gold); color: var(--ink);
  box-shadow: 0 6px 0 var(--ink);
}
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--ink); }
.btn-gold:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--ink); }
.btn-ghost {
  background: transparent; color: var(--cream);
  border-color: #ffffff55; box-shadow: none;
  font-size: .95rem;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   TICKET
   ============================================================ */
.ticket {
  display: flex;
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: rotate(-1.5deg);
  position: relative;
  transition: transform .25s ease;
}
.ticket:hover { transform: rotate(0deg) scale(1.01); }

.ticket-main { flex: 1; padding: 2rem 2.2rem; min-width: 0; }

.ticket-label {
  font-size: .8rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: var(--coral);
}
.ticket-names {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  color: var(--night);
  margin: .2rem 0 1.2rem;
}
.ticket-names .amp { color: var(--coral); }

.ticket-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.6rem; }
.ticket-facts dt {
  font-size: .72rem; font-weight: 900; letter-spacing: .16em;
  text-transform: uppercase; color: #8a7bab;
}
.ticket-facts dd { font-weight: 800; font-size: 1.02rem; }
.venue-link { color: var(--coral); text-decoration: underline; text-underline-offset: 2px; }
.venue-link:hover { color: var(--night); }

.ticket-stub {
  flex: 0 0 128px;
  border-left: 3px dashed #cbb9a3;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem .6rem;
  background: var(--cream-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  writing-mode: vertical-rl;
  font-weight: 900; letter-spacing: .3em; color: var(--coral);
}
.ticket-stub .stub-small { font-size: .62rem; letter-spacing: .12em; color: var(--night); font-weight: 800; }
.ticket-stub .stub-no { font-size: .68rem; letter-spacing: .2em; color: #8a7bab; }

/* punched holes on the perforation */
.ticket::before, .ticket::after {
  content: ""; position: absolute; right: 115px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--night);
}
.ticket::before { top: -13px; }
.ticket::after  { bottom: -13px; }

/* ---------- countdown ---------- */
.countdown { margin-top: 2.4rem; text-align: center; }
.countdown-label {
  font-size: .85rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: var(--mint); margin-bottom: 1rem;
}
.countdown-tiles { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.tile {
  background: var(--ink);
  border: 3px solid var(--night-2);
  border-radius: 16px;
  min-width: 84px; padding: .8rem .6rem;
  display: flex; flex-direction: column; align-items: center;
}
.tile span { font-size: 2rem; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }
.tile small { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: #b7a8d6; }

/* ============================================================
   STORY STRIP
   ============================================================ */
.story-strip {
  list-style: none;
  display: flex; align-items: stretch; justify-content: center;
  gap: 1rem; flex-wrap: wrap;
}
.story-card {
  flex: 1 1 160px; max-width: 220px;
  text-align: center;
  padding: 1.5rem 1rem 1.3rem;
  border-radius: var(--radius);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800; color: var(--ink);
  transition: transform .2s ease;
}
.story-card:hover { transform: translateY(-6px) rotate(-1deg); }
.sc-1 { background: var(--sky); }
.sc-2 { background: var(--coral); color: var(--cream); }
.sc-3 { background: var(--gold); }
.story-emoji { display: block; font-size: 2.6rem; margin-bottom: .5rem; }
.story-card small { display: block; font-weight: 700; font-size: .78rem; opacity: .8; }
.story-arrow {
  align-self: center; font-size: 1.6rem; font-weight: 900; color: var(--mint);
}

/* ============================================================
   RSVP
   ============================================================ */
.rsvp { text-align: center; }

.rsvp-count {
  display: inline-block;
  margin: -0.8rem auto 1.8rem;
  padding: .45em 1.2em;
  background: #ffffff14;
  border: 2px solid var(--mint);
  border-radius: 999px;
  color: var(--mint); font-weight: 800; font-size: .95rem;
}

.name-label { display: block; font-weight: 800; font-size: 1.15rem; margin-bottom: .8rem; }

.name-input {
  width: min(420px, 100%);
  font-family: inherit; font-size: 1.15rem; font-weight: 800;
  text-align: center;
  color: var(--ink); background: var(--cream);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: .8em 1.2em;
  box-shadow: 0 5px 0 var(--ink);
  transition: box-shadow .15s ease, transform .15s ease;
}
.name-input::placeholder { color: #9c8fb8; font-weight: 700; }
.name-input:focus { outline: none; transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink), 0 0 0 4px #ffc94d55; }

.name-hint { min-height: 1.4em; margin-top: .6rem; font-weight: 700; color: var(--gold); }

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  max-width: 640px;
  margin: 1.6rem auto 0;
}

.choice {
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: 1.5rem 1rem 1.2rem;
  border-radius: var(--radius);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--ink);
  transition: transform .16s ease, box-shadow .16s ease, filter .2s ease;
}
.choice:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 14px 0 rgba(31,15,61,.35); }
.choice:active { transform: translateY(2px); box-shadow: 0 4px 0 rgba(31,15,61,.35); }
.choice:focus-visible { outline: 4px dashed var(--cream); outline-offset: 4px; }

.ch-yes   { background: var(--gold); }
.ch-plus  { background: var(--coral); color: var(--cream); }
.ch-maybe { background: var(--sky); }
.ch-no    { background: var(--cream-2); }

.choice-emoji { font-size: 2.7rem; line-height: 1.2; }
.choice-title { font-weight: 900; font-size: 1.12rem; }
.choice-sub   { font-weight: 700; font-size: .82rem; opacity: .75; }

.choices.locked .choice { filter: saturate(.35) brightness(.75); cursor: not-allowed; }
.choices.locked .choice:hover { transform: none; box-shadow: var(--shadow); }

.choices.shake { animation: shake .4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

.choice.sending { animation: pulse .8s ease infinite; }
@keyframes pulse { 50% { transform: scale(.96); } }

/* done state */
.rsvp-done { margin-top: 1rem; }
.done-emoji { font-size: 4rem; animation: yesbounce 2s ease-in-out infinite; }
.done-msg {
  font-size: clamp(1.3rem, 3.5vw, 1.7rem);
  font-weight: 900; margin: .6rem 0 1.6rem;
  color: var(--cream);
}

.rsvp-error {
  margin-top: 1.2rem; font-weight: 800; color: var(--coral);
  background: #ffffff10; border: 2px solid var(--coral);
  border-radius: 14px; padding: .8em 1.2em;
  display: inline-block;
}

/* ============================================================
   PHOTO ALBUM
   ============================================================ */
.photos { text-align: center; }
.photos-card {
  max-width: 560px; margin: 0 auto;
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.4rem 1.8rem 2.6rem;
}
.photos-emoji { font-size: 2.4rem; letter-spacing: .2em; margin-bottom: .8rem; }
.photos-lead { font-weight: 800; font-size: 1.12rem; margin-bottom: 1.6rem; }
.photos-note { margin-top: 1.3rem; font-weight: 700; font-size: .85rem; color: #6b5e88; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 3rem 1.4rem 2.4rem;
  color: #b7a8d6; font-weight: 700; font-size: .92rem;
}
.footer-domain { margin-top: .4rem; letter-spacing: .12em; color: #8a7bab; font-size: .8rem; }

/* ============================================================
   GUESTS (secret page)
   ============================================================ */
.guests-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.4rem 4rem; }
.guests-title { text-align: center; font-size: clamp(1.8rem, 5vw, 2.6rem); color: var(--gold); text-shadow: 3px 3px 0 var(--ink); margin-bottom: .4rem; }
.guests-sub { text-align: center; color: #b7a8d6; font-weight: 700; margin-bottom: 2rem; }

.totals { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; margin-bottom: 2rem; }
.total-chip {
  display: flex; flex-direction: column; align-items: center;
  min-width: 96px; padding: .8rem 1rem;
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 rgba(31,15,61,.35);
  font-weight: 800; font-size: .8rem;
}
.total-chip b { font-size: 1.6rem; font-weight: 900; }
.total-chip.headcount { background: var(--gold); }

.guest-table { width: 100%; border-collapse: collapse; background: var(--cream); color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.guest-table th {
  background: var(--ink); color: var(--gold);
  font-size: .75rem; letter-spacing: .16em; text-transform: uppercase;
  padding: .9rem 1rem; text-align: left;
}
.guest-table td { padding: .8rem 1rem; border-top: 2px solid #eadfcb; font-weight: 700; }
.guest-table td.status { white-space: nowrap; }

.guests-msg { text-align: center; font-weight: 800; font-size: 1.15rem; margin-top: 3rem; color: var(--cream); }

/* ============================================================
   RESPONSIVE & MOTION
   ============================================================ */
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr; }
  .ticket { flex-direction: column; transform: rotate(0); }
  .ticket-stub {
    writing-mode: horizontal-tb;
    border-left: none; border-top: 3px dashed #cbb9a3;
    border-radius: 0 0 var(--radius) var(--radius);
    flex-basis: auto; letter-spacing: .2em;
  }
  .ticket::before, .ticket::after {
    right: auto; top: auto; bottom: 74px;
  }
  .ticket::before { left: -13px; }
  .ticket::after  { right: -13px; }
  .story-arrow { display: none; }
}

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