:root {
  color-scheme: light;
  --ink: #301c32;
  --paper: #fffaf3;
  --rose: #d83d66;
  --coral: #f06d64;
  --gold: #f2b84b;
  --teal: #0f766e;
  --violet: #432052;
  --shadow: 0 24px 80px rgba(33, 20, 38, .28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    linear-gradient(110deg, rgba(43, 23, 52, .82), rgba(15, 72, 78, .52) 46%, rgba(201, 70, 91, .46)),
    url("assets/love-bg.png") center / cover no-repeat,
    #301c32;
}

body.answer-body {
  overflow: auto;
  background:
    linear-gradient(110deg, rgba(43, 23, 52, .82), rgba(15, 72, 78, .52) 46%, rgba(201, 70, 91, .46)),
    url("assets/love-bg.png") center / cover fixed no-repeat,
    #301c32;
}

button,
input,
textarea {
  font: inherit;
}

.scene-glow {
  position: fixed;
  inset: auto -12vw -18vh -10vw;
  height: 42vh;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(242, 184, 75, .36), rgba(242, 184, 75, 0) 68%);
  filter: blur(12px);
}

.floating-hearts {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.floating-hearts span,
.burst-heart {
  position: absolute;
  width: 16px;
  aspect-ratio: 1;
  background: rgba(255, 250, 243, .88);
  transform: rotate(45deg);
  box-shadow: 0 0 18px rgba(255, 255, 255, .48);
}

.floating-hearts span::before,
.floating-hearts span::after,
.burst-heart::before,
.burst-heart::after {
  position: absolute;
  width: 100%;
  height: 100%;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.floating-hearts span::before,
.burst-heart::before {
  left: -50%;
}

.floating-hearts span::after,
.burst-heart::after {
  top: -50%;
}

.floating-hearts span {
  left: var(--x);
  bottom: -10vh;
  opacity: .36;
  scale: var(--s);
  animation: float-heart var(--d) linear infinite;
  animation-delay: var(--delay);
}

.proposal-screen {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  padding: clamp(28px, 5vw, 72px);
  place-items: center;
}

.proposal-copy {
  width: min(780px, 100%);
  text-align: center;
  text-shadow: 0 2px 24px rgba(32, 13, 38, .42);
}

.eyebrow {
  margin: 0 0 18px;
  color: #ffe7b5;
  font-size: clamp(.86rem, 2vw, 1rem);
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: .98;
}

h1 {
  max-width: 12ch;
  margin-inline: auto;
  font-size: clamp(3.15rem, 12vw, 8.8rem);
}

h2 {
  color: var(--ink);
  font-size: clamp(2.45rem, 8vw, 5.8rem);
}

.love-note {
  width: min(620px, 100%);
  margin: clamp(22px, 4vw, 34px) auto 0;
  color: rgba(255, 250, 243, .92);
  font-size: clamp(1.05rem, 2.7vw, 1.38rem);
  line-height: 1.65;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  min-height: 74px;
  margin-top: clamp(30px, 5vw, 48px);
}

.answer-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 116px;
  min-height: 58px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0;
  outline-offset: 5px;
  transform-origin: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.yes-button {
  color: #221525;
  background: linear-gradient(135deg, #ffe8a2, #f5b84b 48%, #f06d64);
  box-shadow: 0 18px 44px rgba(46, 20, 34, .34);
  transition: transform .22s ease, box-shadow .22s ease;
}

.yes-button:is(:hover, :focus-visible) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 22px 56px rgba(46, 20, 34, .42);
}

.no-button {
  color: var(--paper);
  border: 1px solid rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 14px 36px rgba(26, 14, 33, .2);
  backdrop-filter: blur(12px);
  transition: transform .2s ease, background .2s ease;
}

.no-button:is(:hover, :focus-visible) {
  background: rgba(255, 255, 255, .18);
}

.no-button.is-free {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  transition: transform .42s cubic-bezier(.16, 1, .3, 1), background .2s ease;
  will-change: transform;
}

.no-button.is-teasing {
  animation: tease .42s ease;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  color: var(--ink);
  background: rgba(255, 250, 243, .88);
  backdrop-filter: blur(18px);
}

.celebration[hidden] {
  display: none;
}

.celebration-inner {
  width: min(680px, 100%);
  text-align: center;
}

.celebration .eyebrow {
  color: var(--teal);
}

.celebration p {
  margin: 22px auto 0;
  color: #634464;
  font-size: clamp(1.06rem, 2.7vw, 1.35rem);
  line-height: 1.6;
}

.quiz-card {
  width: min(760px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, .66);
  border-radius: 8px;
  background: rgba(255, 250, 243, .94);
  box-shadow: var(--shadow);
  text-align: left;
}

.quiz-card h2,
.quiz-card h3 {
  color: var(--ink);
}

.quiz-card h2 {
  text-align: center;
}

.quiz-card h3 {
  margin: 10px 0 24px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.quiz-card .eyebrow {
  text-align: center;
}

.quiz-card .answer-button {
  margin-top: 28px;
}

.quiz-step {
  display: none;
  animation: step-in .34s ease both;
}

.quiz-step.is-active {
  display: block;
}

.quiz-progress {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  min-height: 62px;
  padding: 15px 18px;
  border: 1px solid rgba(48, 28, 50, .16);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(48, 28, 50, .08);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.quiz-option:is(:hover, :focus-visible) {
  border-color: rgba(216, 61, 102, .55);
  box-shadow: 0 16px 34px rgba(48, 28, 50, .13);
  transform: translateY(-2px);
}

.quiz-option.is-selected {
  border-color: transparent;
  color: #231220;
  background: linear-gradient(135deg, #ffe8a2, #f5b84b 48%, #f06d64);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #4e3350;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(48, 28, 50, .18);
  border-radius: 8px;
  padding: 14px 15px;
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(48, 28, 50, .05);
  font-weight: 650;
  outline-offset: 4px;
}

textarea {
  resize: vertical;
}

.final-step {
  text-align: center;
}

.answer-page {
  display: grid;
  min-height: 100svh;
  padding: clamp(24px, 5vw, 72px);
  place-items: center;
}

.answer-panel {
  width: min(860px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 243, .95);
  box-shadow: var(--shadow);
}

.answer-panel h1 {
  max-width: none;
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(2.6rem, 7vw, 5.2rem);
}

.answer-panel .eyebrow {
  color: var(--teal);
}

.saved-answer dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.saved-answer dl > div {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(48, 28, 50, .12);
}

.saved-answer dt {
  color: #765775;
  font-weight: 850;
}

.saved-answer dd {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.answer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.answer-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: #221525;
  background: #ffe2a3;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.danger-link {
  color: #fff;
  background: #7b2942;
}

.burst-heart {
  left: 50%;
  top: 52%;
  z-index: 30;
  background: hsl(var(--hue), 86%, 64%);
  opacity: 0;
  pointer-events: none;
  animation: burst 1.5s ease-out forwards;
}

body.accepted .proposal-copy {
  animation: soften-out .46s ease forwards;
}

@keyframes float-heart {
  0% {
    translate: -10px 0;
    rotate: 0deg;
    opacity: 0;
  }

  15% {
    opacity: .36;
  }

  100% {
    translate: 34px -118vh;
    rotate: 90deg;
    opacity: 0;
  }
}

@keyframes tease {
  0%,
  100% {
    scale: 1;
  }

  42% {
    scale: .88;
  }

  70% {
    scale: 1.08;
  }
}

@keyframes soften-out {
  to {
    opacity: 0;
    scale: .96;
    filter: blur(8px);
  }
}

@keyframes burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg) scale(.5);
  }

  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      rotate(calc(45deg + var(--spin)))
      scale(var(--scale));
  }
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  body {
    overflow: hidden;
    background-position: 54% center;
  }

  .proposal-screen {
    align-items: center;
    padding: 24px 18px;
  }

  .proposal-copy {
    text-align: left;
  }

  .eyebrow,
  .proposal-copy h1,
  .love-note {
    margin-inline: 0;
  }

  h1 {
    max-width: 9ch;
  }

  .proposal-actions {
    justify-content: flex-start;
    min-height: 144px;
  }

  .answer-button {
    min-width: min(100%, 260px);
  }

  .celebration {
    align-items: start;
  }

  .quiz-card {
    padding: 22px;
  }

  .form-grid,
  .saved-answer dl > div {
    grid-template-columns: 1fr;
  }

  .answer-actions,
  .answer-link {
    width: 100%;
  }
}

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