/* ============================================================
   Rami & Yasmeen — wedding RSVP
   Palette: parchment cream + brown ink + watercolor green
============================================================ */
@font-face {
  font-family: "Fontspring";
  src: url("Fontspring-DEMO-braisetto-regular.otf") format("opentype");
}
@font-face {
  font-family: "Sunshiny";
  src: url("Sunshiney-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Cinzel";
  src: url("Cinzel-VariableFont_wght.ttf") format("truetype");
}

:root {
  --parchment: #f6efdc;
  --parchment-deep: #efe6cf;
  --ink: #3b2417;
  --ink-soft: #6b5a3e;
  --ink-softest: #9b8a6e;
  --green: #8aab4f;
  --green-deep: #5f7d39;
  --rose: #c65b5b;
  --line: rgba(59, 36, 23, 0.25);
  --maxw: 680px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "EB Garamond", Georgia, serif;
  color: var(--ink);
  background-color: var(--parchment);
  line-height: 1.6;
  overflow-x: hidden;
}
.parchment-container {
  background-image: url("../images/white-parchment-paper-texture.jpg");
  background-size: 20%;
  background-position: center;
  background-repeat: repeat;
  max-width: 1000px;
  margin: 0 auto;
  box-shadow: 0 0 10px 0 rgba(111, 111, 111, 0.1);
  position: relative;
}
.parchment-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.5);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

strong {
  font-weight: 600;
}

/* ----------------------------- Typography ----------------------------- */
.script-title {
  font-family: "Fontspring";
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  color: var(--ink);
  text-align: center;
  line-height: 0.5;
  margin: 0;
}
.script-title.small {
  font-size: clamp(2rem, 6vw, 2.6rem);
}

.sub-title {
  font-family: "Fontspring";
  font-weight: 400;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  line-height: 1.1;
  text-align: center;
  margin: 0.2em 0;
}

.eyebrow {
  text-align: center;
  font-family: "Cinzel";
  color: var(--ink-softest);
  font-size: 1.2rem;
  line-height: 1.1;
  margin: 0 0 0.6rem;
}

/* ----------------------- Invitation cover --------------------------- */
/* Lock scrolling while the cover is up. */
.cover-locked {
  overflow: hidden;
  height: 100vh;
}
.cover {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
}
/* The two halves that split open like doors */
.cover__half {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  /* opaque base so the invitation behind never shows through */
  background-color: var(--parchment);
  transition: transform 1.2s cubic-bezier(0.76, 0, 0.24, 1);
  will-change: transform;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.12);
}
.cover__half--left {
  left: 0;
}
.cover__half--right {
  right: 0;
}
/* A full-viewport background inside each half so the image stays seamless
   across the seam and keeps its aspect (each half is just a window). */
.cover__bg {
  position: absolute;
  top: 0;
  width: 100vw;
  height: 100%;
  background-image: url("../images/garden-bg.png");
  background-size: cover;
  background-position: center;
  opacity: 0.1;
}
.cover__half--left .cover__bg {
  left: 0;
}
.cover__half--right .cover__bg {
  right: 0;
}

/* The thin string the seal hangs from */
.cover__string {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: calc(50% - clamp(60px, 11vw, 90px));
  background: linear-gradient(rgba(59, 36, 23, 0), rgba(59, 36, 23, 0.45));
  z-index: 3;
}

/* The wax seal (image) */
.cover__seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(120px, 22vw, 180px);
  height: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 4;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.3));
  transition:
    transform 0.6s ease,
    opacity 0.6s ease;
  animation: seal-bob 3.6s ease-in-out infinite;
}
.cover__seal img {
  width: 100%;
  height: auto;
}
.cover__seal:hover {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(1.05);
}
.cover__seal:active {
  transform: translate(-50%, -50%) scale(0.97);
}

/* tap-to-open cue */
.cover__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(2rem, 8vh, 5rem);
  transform: translateX(-50%);
  margin: 0;
  font-family: "Cinzel";
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  z-index: 4;
  animation: cue-pulse 2.4s ease-in-out infinite;
}

/* Opened state — halves slide apart, seal & cue fade out */
.cover.is-open .cover__half--left {
  transform: translateX(-100%);
}
.cover.is-open .cover__half--right {
  transform: translateX(100%);
}
.cover.is-open .cover__seal,
.cover.is-open .cover__cue,
.cover.is-open .cover__string {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  animation: none;
  pointer-events: none;
}
.cover.is-open .cover__cue {
  transform: translateX(-50%) scale(0.8);
}
.cover.is-open {
  pointer-events: none;
}

@keyframes seal-bob {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(-50%, calc(-50% - 6px));
  }
}
@keyframes cue-pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

/* --------------------------- Music toggle --------------------------- */
.music-toggle {
  position: fixed;
  right: clamp(0.8rem, 2vw, 1.4rem);
  bottom: clamp(0.8rem, 2vw, 1.4rem);
  z-index: 900; /* below the cover (1000) so it appears once opened */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--green-deep);
  background: var(--green);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(95, 125, 57, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}
.music-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(95, 125, 57, 0.4);
}
.music-toggle__icon {
  font-size: 1.25rem;
  line-height: 1;
}
/* a slash through the note when muted/paused */
.music-toggle.is-paused::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 130%;
  background: #fff;
  border-radius: 2px;
  transform: rotate(45deg);
}

/* --------------------------- Sunshine rays --------------------------- */
/* Soft light rays fanning down from the top of the page (god-rays look).
   The individual .ray elements are injected by js/script.js. */
.light-rays {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: min(85vh, 820px);
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
/* warm halo behind the rays */
.light-rays::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  width: 120%;
  height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(
    60% 55% at 50% 0%,
    rgba(255, 227, 150, 0.4),
    rgba(255, 227, 150, 0) 70%
  );
}
.light-rays .ray {
  position: absolute;
  top: -12%;
  left: 50%;
  width: clamp(40px, 8vw, 120px);
  height: 125%;
  transform-origin: top center;
  transform: translateX(-50%) rotate(var(--a, 0deg));
  background: linear-gradient(
    to bottom,
    rgba(255, 222, 138, 0.7),
    rgba(255, 222, 138, 0) 72%
  );
  opacity: var(--o, 0.5);
  filter: blur(22px);
  animation: ray-sway var(--dur, 9s) ease-in-out infinite;
}

/* ------------------------------- Hero -------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 7vh 0 0;
  text-align: center;
  position: relative;
  z-index: 2; /* keep hero content above the light rays */
}

.monogram {
  width: clamp(120px, 26vw, 190px);
  margin: 0.3rem auto 0.6rem;
  animation: floaty 7s ease-in-out infinite;
}

.names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 5vw, 5rem);
  margin: 2rem 0 1rem;
  font-family: "Fontspring";
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.6rem);
  line-height: 1;
  color: var(--ink);
}
.names small {
  display: block;
  font-size: 0.62em;
  margin-top: -0.15em;
}
.names .amp {
  font-family: "Sunshiny";
  font-size: 0.5em;
  /* color: var(--green-deep); */
}

.details {
  font-family: "Cinzel";
  font-size: 1rem;
  line-height: 1.1;
  color: var(--ink-softest);
  margin: 0.4rem 0 1.4rem;
}

.hero-art {
  width: 100%;
  margin-top: auto;
}
.hero-art img {
  width: 100%;
}

.scroll-cue {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  color: var(--green-deep);
  animation: bob 2.2s ease-in-out infinite;
}

/* ----------------------------- Sections ----------------------------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 6rem) 1.4rem;
  position: relative;
}

.section-art {
  margin: 0 auto 1rem;
}
.venue {
  width: min(320px, 70vw);
}
.envelope {
  width: min(200px, 60vw);
  animation: floaty 6s ease-in-out infinite;
}

.kindly,
.song-note,
.gift-note {
  font-family: "Cinzel";
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.1;
  margin: 0.5rem 0 1.6rem;
}

/* ------------------------------ RSVP ------------------------------- */
.rsvp-lookup {
  text-align: center;
}
.lookup-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}
#code-input,
.song-input {
  font-family: "Cinzel";
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  min-width: 220px;
}
.song-input {
  display: block;
  margin: 0 auto 1.5rem;
  width: min(420px, 90%);
  text-align: center;
}

.rsvp-form {
  animation: fadeup 0.7s ease both;
}
.greeting {
  font-family: "Cinzel";
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.1;
  margin-bottom: 1.4rem;
  color: var(--ink-softest);
}

.members {
  border-top: 1px solid var(--line);
  margin-bottom: 3rem;
}
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.3rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  font-family: "Cinzel";
}
.member-name {
  font-size: 1rem;
}
.choices {
  display: flex;
  gap: 1rem;
}
.choices label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink-soft);
  user-select: none;
}
.choices input {
  accent-color: var(--green-deep);
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
  margin: 0;
}
.choices label:has(input:checked) {
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------ Buttons ----------------------------- */
.btn {
  font-family: "Fontspring";
  font-size: 2rem;
  letter-spacing: 0.02em;
  padding: 0.6rem 1.6rem;
  border: 1px solid var(--green-deep);
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  box-shadow: 0 3px 0 rgba(95, 125, 57, 0.5);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(95, 125, 57, 0.35);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(95, 125, 57, 0.5);
}
.btn--confirm {
  display: block;
  margin: 0 auto;
  padding: 0.7rem 2.6rem;
}
.btn--ghost {
  background: transparent;
  color: var(--green-deep);
  box-shadow: none;
}

.form-note,
.song-hint {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-top: 1rem;
}
.error {
  color: var(--rose);
  font-weight: 600;
}

.rsvp-thanks {
  text-align: center;
  animation: fadeup 0.6s ease both;
  font-family: "Cinzel";
}
.rsvp-thanks .script-title {
  font-family: "Cinzel";
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--ink-softest);
}
#thanks-summary {
  white-space: pre-line;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

/* ----------------------------- Location ----------------------------- */
.section--location {
  text-align: center;
}
.map {
  width: 100%;
  margin: 2rem auto 1rem;
  border-radius: 10px;
}
.map-link {
  display: inline-block;
  font-family: "Cinzel";
  font-size: 0.8rem;
  line-height: 1.1;
  color: var(--green-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--green-deep);
  padding-bottom: 1px;
}
.map-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ------------------------------- Songs ------------------------------ */
.section--songs {
  text-align: center;
}

/* -------------------------------- Gift ------------------------------ */
.section--gift {
  text-align: center;
}
.sharing-title {
  line-height: 0.7;
  margin-bottom: 1.2rem;
}
.cake {
  width: min(220px, 55vw);
  margin: 0 auto 1.2rem;
}
.gift-card-container {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  flex-direction: row;
  flex-wrap: wrap;
}
.gift-card {
  max-width: 460px;
  margin: 1.4rem auto 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  text-align: center;
  font-family: "Cinzel";
  flex: 1;
  /* center the contents vertically so equal-height cards stay balanced */
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.gift-card p {
  margin: 0.35rem 0;
  font-size: 1.2rem;
  color: var(--ink-soft);
}
.gift-card span {
  display: block;
  color: var(--ink-softest);
  font-size: 0.8rem;
  line-height: 1;
}
.monogram-group {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
}
.monogram-group p {
  font-size: 0.8rem;
  font-family: "Cinzel";
  color: var(--ink);
  margin: 0;
  text-align: center;
}
/* ------------------------------ Footer ------------------------------ */
.footer {
  text-align: center;
  margin-top: 3rem;
  position: relative;
}
.hedge {
  width: 100%;
  display: block;
}
.footer p {
  font-family: "Parisienne", cursive;
  font-size: 1.4rem;
  color: var(--green-deep);
  background: var(--green);
  color: #fff;
  margin: 0;
  padding: 1.2rem;
}

/* --------------------------- Floating cats -------------------------- */
.critters-group {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0;
}
.critter {
  z-index: 5;
  pointer-events: none;
  width: 25%;
  opacity: 0.95;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.12));
  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}
/* The two cats start pushed apart... */
.critter--bowtie {
  transform: translateX(-65%);
}
.critter--winged {
  transform: translateX(65%);
}
/* ...and drift together for a little kiss once the footer is in view */
.critters-group.together .critter--bowtie {
  transform: translateX(10%);
}
.critters-group.together .critter--winged {
  transform: translateX(-10%);
}

/* ----------------------------- Animations --------------------------- */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}
@keyframes bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(8px);
  }
}
@keyframes ray-sway {
  0%,
  100% {
    transform: translateX(-50%) rotate(calc(var(--a, 0deg) - 4deg));
    opacity: var(--o, 0.5);
  }
  50% {
    transform: translateX(-50%) rotate(calc(var(--a, 0deg) + 4deg));
    opacity: calc(var(--o, 0.5) * 0.45);
  }
}
@keyframes fadeup {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fly-across {
  0% {
    transform: translate(0, 0) rotate(-4deg);
  }
  50% {
    transform: translate(55vw, -40px) rotate(3deg);
  }
  100% {
    transform: translate(115vw, 20px) rotate(-4deg);
  }
}
@keyframes trot-across {
  0% {
    transform: translate(0, 0) scaleX(1);
  }
  49% {
    transform: translate(112vw, 0) scaleX(1);
  }
  50% {
    transform: translate(112vw, 0) scaleX(-1);
  }
  99% {
    transform: translate(0, 0) scaleX(-1);
  }
  100% {
    transform: translate(0, 0) scaleX(1);
  }
}

/* Falling petals (created in JS) */
.petal {
  position: fixed;
  top: -30px;
  z-index: 4;
  pointer-events: none;
  width: 14px;
  height: 14px;
  border-radius: 60% 0 60% 0;
  background: radial-gradient(circle at 30% 30%, #f2b8c6, #d98aa0);
  opacity: 0.8;
  animation: fall linear forwards;
}
@keyframes fall {
  to {
    transform: translateY(105vh) rotate(540deg);
    opacity: 0;
  }
}

/* --------------------------- Scroll reveal -------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.9s ease,
    transform 0.9s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
.hero.reveal {
  opacity: 1;
  transform: none;
} /* hero visible immediately */

/* --------------------- Mobile tuning (phones only) ------------------ */
/* Desktop is untouched — these only apply at phone widths. */
@media (max-width: 600px) {
  .hero {
    /* full-height opening screen */
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 4vh;
  }
  .eyebrow {
    /* auto top margin + the artwork's auto top margin together center
       the text block in the space above the illustration */
    margin-top: auto;
    /* smaller than the names, and kept off the screen edges */
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 0 1.6rem;
  }
  .names {
    padding: 0 0.4rem;
    font-size: 3.5rem;
  }
  .details {
    font-size: 0.92rem;
    padding: 0 1.4rem;
  }
  .member-name {
    font-size: 1rem;
  }
  .gift-card-container {
    flex-direction: column;
  }
  .gift-card {
    text-align: center;
    /* equal, full width when stacked (overrides the auto side margins) */
    width: 100%;
  }
  .gift-card p {
    font-size: 0.88rem;
  }
  .gift-card span {
    display: block;
    width: auto;
  }
  /* Show the whole garden scene (incl. the pond) on phones instead of a
     heavily zoomed-in crop. */
  .cover__bg {
    background-size: 150%;
    background-position: bottom;
    background-repeat: no-repeat;
  }
}

/* ----------------------- Reduced-motion respect --------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  .critter,
  .monogram,
  .envelope {
    animation: none !important;
  }
  .critter {
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  html {
    scroll-behavior: auto;
  }
}
