:root {
  --ink: #33212b;
  --muted: #725a66;
  --rose: #b84670;
  --rose-deep: #7f2348;
  --champagne: #fff4df;
  --pearl: rgba(255, 253, 248, 0.84);
  --gold: #d8ad58;
  --shadow: rgba(61, 25, 44, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 229, 209, 0.98), transparent 32rem),
    radial-gradient(circle at 86% 16%, rgba(239, 184, 206, 0.62), transparent 28rem),
    linear-gradient(145deg, #fffaf1 0%, #ffe4ec 45%, #e7d9ff 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

#effects {
  position: fixed;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient,
.fireflies {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  width: min(46vw, 34rem);
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(3.5rem);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite alternate;
}

.glow-a {
  left: -8rem;
  top: 10%;
  background: rgba(255, 186, 164, 0.7);
}

.glow-b {
  right: -9rem;
  top: 4%;
  background: rgba(180, 159, 255, 0.55);
  animation-delay: -4s;
}

.glow-c {
  bottom: -14rem;
  left: 30%;
  background: rgba(255, 219, 151, 0.68);
  animation-delay: -9s;
}

.firefly {
  position: absolute;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 246, 0.95);
  box-shadow: 0 0 1rem rgba(255, 232, 168, 0.95);
  animation: float var(--duration) linear infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(1rem, 2vw, 2rem);
  transition: transform 900ms ease, filter 900ms ease;
}

.page.celebrating {
  filter: saturate(1.08);
  transform: scale(1.025);
}

.proposal {
  width: min(45rem, 100%);
  padding: clamp(1.6rem, 5vw, 3.6rem) clamp(1.2rem, 5vw, 4rem);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.4rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 247, 239, 0.54));
  box-shadow: 0 1.5rem 4rem var(--shadow);
  backdrop-filter: blur(1.2rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--rose-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  line-height: 0.98;
}

h1 {
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  text-wrap: balance;
}

.subtitle,
.final-subtitle {
  max-width: 36rem;
  margin: 1.2rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.answer-row {
  position: relative;
  display: flex;
  min-height: 5.5rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: clamp(1.5rem, 4vw, 2.3rem);
}

.answer,
.again {
  position: relative;
  min-width: 8.75rem;
  min-height: 3.5rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    background 220ms ease,
    opacity 220ms ease;
  touch-action: manipulation;
}

.answer:focus-visible,
.again:focus-visible {
  outline: 3px solid rgba(127, 35, 72, 0.85);
  outline-offset: 4px;
}

.yes {
  z-index: 2;
  color: white;
  background: linear-gradient(135deg, #c84d75, #84254c);
  box-shadow: 0 1rem 2rem rgba(152, 42, 82, 0.32);
  transform: scale(var(--yes-scale, 1));
}

.yes:hover {
  box-shadow: 0 1.2rem 2.4rem rgba(152, 42, 82, 0.42);
  transform: scale(calc(var(--yes-scale, 1) * 1.04));
}

.no {
  z-index: 4;
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(127, 35, 72, 0.22), 0 0.7rem 1.5rem rgba(61, 25, 44, 0.12);
  transform: scale(var(--no-scale, 1));
}

.no:hover {
  background: rgba(255, 250, 244, 0.92);
  transform: scale(calc(var(--no-scale, 1) * 0.98));
}

.status {
  min-height: 2.6rem;
  margin-top: 1.3rem;
  color: var(--muted);
}

.status p {
  margin: 0.25rem 0;
}

#tease {
  color: var(--rose-deep);
  font-weight: 800;
}

.finale {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  overflow-y: auto;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.9), transparent 26rem),
    linear-gradient(145deg, #3c1430, #8d3259 48%, #2a2354);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
  transition:
    opacity 700ms ease,
    transform 900ms ease;
}

.finale.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.finale-content {
  position: relative;
  z-index: 2;
  width: min(38rem, 100%);
  text-align: center;
  color: white;
  animation: finaleIn 900ms ease both;
}

.heart-line {
  width: clamp(5.5rem, 16vw, 8rem);
  margin-bottom: 0.5rem;
  overflow: visible;
  fill: rgba(255, 255, 255, 0.08);
  stroke: #ffd7df;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1rem rgba(255, 214, 224, 0.72));
}

.heart-line path {
  stroke-dasharray: 330;
  stroke-dashoffset: 330;
}

.is-visible .heart-line path {
  animation: drawHeart 1.6s ease 280ms forwards;
}

h2 {
  font-size: clamp(3.2rem, 10vw, 6.6rem);
  text-shadow: 0 0.9rem 2.5rem rgba(0, 0, 0, 0.18);
}

.final-subtitle {
  color: rgba(255, 249, 238, 0.86);
}

.photo-frame {
  position: relative;
  width: min(31rem, 100%);
  margin: clamp(1.5rem, 4vw, 2.4rem) auto 0;
  padding: clamp(0.65rem, 2vw, 0.9rem);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 235, 204, 0.9));
  box-shadow:
    0 1.2rem 4rem rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(216, 173, 88, 0.4);
}

.photo-frame::before {
  content: "Tu wstaw public/us.jpg";
  position: absolute;
  inset: clamp(0.65rem, 2vw, 0.9rem) clamp(0.65rem, 2vw, 0.9rem) auto;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  border-radius: 0.85rem;
  color: rgba(255, 255, 255, 0.86);
  background:
    linear-gradient(135deg, rgba(95, 38, 70, 0.56), rgba(200, 79, 116, 0.4)),
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.22), transparent 18rem);
  font-weight: 800;
}

.photo-frame.has-photo::before {
  display: none;
}

.photo-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.85rem;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.16);
}

.photo-frame:not(.has-photo) img {
  opacity: 0;
}

.photo-frame figcaption {
  position: relative;
  z-index: 1;
  margin: 0.95rem 0 0.2rem;
  color: #5b263f;
  font-weight: 900;
  font-size: clamp(1rem, 2.6vw, 1.24rem);
  line-height: 1.45;
}

.again {
  min-width: 10rem;
  margin-top: 1.2rem;
  color: #5b263f;
  background: var(--champagne);
}

.again:hover {
  transform: translateY(-2px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}

.beam {
  position: absolute;
  left: 50%;
  bottom: -15vh;
  width: 14vw;
  min-width: 5rem;
  height: 135vh;
  border-radius: 999px;
  background: linear-gradient(to top, transparent, rgba(255, 244, 183, 0.34), transparent);
  filter: blur(0.45rem);
  opacity: 0;
  transform-origin: bottom;
}

.is-visible .beam {
  animation: sweep 3.5s ease-in-out infinite;
}

.beam-one {
  transform: translateX(-50%) rotate(-23deg);
}

.beam-two {
  transform: translateX(-50%) rotate(8deg);
  animation-delay: -1.1s;
}

.beam-three {
  transform: translateX(-50%) rotate(31deg);
  animation-delay: -2s;
}

@keyframes drift {
  to {
    transform: translate3d(4rem, -2rem, 0) scale(1.1);
  }
}

@keyframes float {
  0% {
    opacity: 0;
    transform: translate3d(0, 8vh, 0) scale(0.7);
  }
  12%,
  85% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--shift), -108vh, 0) scale(1);
  }
}

@keyframes finaleIn {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.96);
  }
}

@keyframes drawHeart {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes sweep {
  0%,
  100% {
    opacity: 0;
  }
  22%,
  70% {
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) rotate(28deg) scaleX(1.18);
  }
}

@media (max-width: 640px) {
  .proposal {
    min-height: min(43rem, calc(100svh - 2rem));
    display: grid;
    align-content: center;
    border-radius: 1rem;
  }

  .answer-row {
    min-height: 8rem;
    flex-direction: column;
  }

  .answer {
    min-width: min(12rem, 72vw);
  }

  .status {
    min-height: 5.4rem;
  }
}

@media (max-height: 760px) and (min-width: 700px) {
  .heart-line {
    width: 5rem;
    margin-bottom: 0.1rem;
  }

  h2 {
    font-size: 4.8rem;
  }

  .final-subtitle {
    margin-top: 0.5rem;
  }

  .photo-frame {
    width: min(24rem, 100%);
    margin-top: 1rem;
  }

  .again {
    margin-top: 0.75rem;
  }
}

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