@font-face {
  font-family: "Parisienne";
  src: url("assets/parisienne-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f7f1e7;
  --paper-deep: #eee2d2;
  --ink: #3e2d2a;
  --muted: #8a746c;
  --wine: #730625;
  --wine-dark: #510015;
  --line: rgba(80, 44, 38, 0.18);
  --shadow: 0 18px 50px rgba(71, 35, 25, 0.13);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: #e9dfd3;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.6), transparent 50%),
    #e9dfd3;
  font-family: Georgia, "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.experience {
  position: relative;
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)),
    var(--paper);
  box-shadow: 0 0 70px rgba(52, 26, 21, 0.12);
}

.screen {
  position: relative;
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  isolation: isolate;
}

.screen--active {
  animation: screen-in 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(100deg, transparent 0 5px, rgba(111, 79, 57, 0.025) 6px 7px),
    repeating-linear-gradient(15deg, transparent 0 8px, rgba(255, 255, 255, 0.22) 9px 10px);
}

.opening {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.envelope-button {
  position: relative;
  width: min(88vw, 390px);
  margin: 18px 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 24px 25px rgba(74, 42, 29, 0.16));
  transform-origin: center 70%;
  will-change: transform;
  animation: float 3.2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.envelope-button img {
  display: block;
  width: 100%;
  height: auto;
}

.envelope-name {
  position: absolute;
  top: 31%;
  left: 50%;
  color: rgba(115, 6, 37, 0.82);
  font-family: "Parisienne", "Snell Roundhand", cursive;
  font-size: clamp(2rem, 8vw, 2.7rem);
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
}

.envelope-button:active {
  transform: scale(0.97);
}

.envelope-button:focus-visible,
.button:focus-visible,
.text-button:focus-visible,
.option:focus-within,
textarea:focus-visible {
  outline: 3px solid rgba(115, 6, 37, 0.28);
  outline-offset: 4px;
}

.opening-title {
  margin: 10px 0 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.opening-note,
.aside,
.lead,
.venue,
.tease {
  color: var(--muted);
}

.opening-note {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-style: italic;
}

.content {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.content--centered {
  display: flex;
  min-height: calc(100svh - 56px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.display-title {
  margin: 0;
  color: var(--wine);
  font-size: clamp(2.4rem, 11vw, 4.25rem);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

.display-title--small {
  font-size: clamp(2.35rem, 10vw, 3.4rem);
}

.aside {
  max-width: 330px;
  margin: 22px auto 0;
  font-size: 0.93rem;
  font-style: italic;
  line-height: 1.55;
}

.choice-stage {
  position: relative;
  width: 100%;
  height: 190px;
  margin-top: 30px;
}

.button {
  min-height: 50px;
  border: 1px solid var(--wine);
  border-radius: 2px;
  padding: 14px 22px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
  cursor: pointer;
}

.button--primary {
  color: #fffaf4;
  background: var(--wine);
  box-shadow: 0 12px 28px rgba(115, 6, 37, 0.18);
}

.button--primary:active:not(:disabled) {
  transform: translateY(2px);
  background: var(--wine-dark);
}

.button--ghost {
  color: var(--wine);
  background: rgba(255, 255, 255, 0.26);
}

.button--wide {
  width: 100%;
}

.button:disabled {
  border-color: #b99f9d;
  color: rgba(255, 255, 255, 0.85);
  background: #b99f9d;
  box-shadow: none;
  cursor: not-allowed;
}

#yes-button {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

#yes-button:active {
  transform: translateX(-50%) translateY(2px);
}

.no-button {
  position: absolute;
  top: 96px;
  left: 50%;
  max-width: 190px;
  padding-inline: 17px;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: top 320ms cubic-bezier(0.2, 0.8, 0.2, 1), left 320ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 180ms ease;
}

.tease {
  min-height: 44px;
  max-width: 330px;
  margin: 0 auto;
  font-size: 0.88rem;
  font-style: italic;
  line-height: 1.5;
}

.planner-content {
  padding: 28px 0 10px;
}

.section-heading {
  text-align: center;
}

.lead {
  max-width: 380px;
  margin: 18px auto 0;
  font-size: 1rem;
  line-height: 1.55;
}

.venue {
  margin: 9px auto 0;
  font-size: 0.78rem;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

form {
  margin-top: 34px;
}

fieldset {
  margin: 0 0 30px;
  padding: 0;
  border: 0;
}

legend,
.message-field label,
.other-field label {
  display: block;
  margin-bottom: 13px;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.option-grid--activity {
  gap: 9px;
}

.fieldset-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.45;
}

.picker-wrap {
  display: flex;
  width: 100%;
  justify-content: center;
}

.picker {
  display: block;
  width: min(100%, 280px);
  min-height: 64px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 18px;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.32);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  text-align: center;
  color-scheme: light;
}

.picker:focus-visible {
  outline: 3px solid rgba(115, 6, 37, 0.28);
  outline-offset: 4px;
  border-color: var(--wine);
}

.picker::-webkit-calendar-picker-indicator {
  opacity: 0.68;
  cursor: pointer;
}

.picker::-webkit-date-and-time-value {
  min-height: 1.6em;
  text-align: center;
}

.option {
  position: relative;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option span {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.27);
  font-size: 0.92rem;
  text-align: center;
  transition: 180ms ease;
  cursor: pointer;
}

.option input:checked + span {
  border-color: var(--wine);
  color: #fffaf4;
  background: var(--wine);
  box-shadow: 0 9px 20px rgba(115, 6, 37, 0.14);
}

.other-field {
  margin-top: 14px;
}

.other-field label {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.66rem;
}

.other-field input {
  display: block;
  width: 100%;
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-style: italic;
}

.other-field input::placeholder {
  color: #ab958d;
}

.message-field {
  position: relative;
  margin-bottom: 26px;
}

.message-field label span {
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 42px 12px 0;
  color: var(--ink);
  background: transparent;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.5;
}

textarea::placeholder {
  color: #ab958d;
}

.counter {
  position: absolute;
  right: 0;
  bottom: 12px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
}

.summary-content {
  display: flex;
  min-height: calc(100svh - 56px);
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.summary-rose {
  display: block;
  width: 74px;
  height: 112px;
  margin: 0 auto 20px;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(115, 6, 37, 0.16));
}

.summary-card {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0;
}

.summary-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
  text-align: left;
}

.summary-row + .summary-row {
  border-top: 1px solid rgba(80, 44, 38, 0.1);
}

.summary-row span {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.summary-row strong {
  color: var(--wine);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.35;
}

.summary-row--stacked {
  grid-template-columns: 110px 1fr;
}

.summary-row--stacked small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

blockquote {
  margin: 8px 0;
  border-top: 1px solid rgba(80, 44, 38, 0.1);
  padding: 20px 10px 12px;
  color: var(--ink);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.55;
}

.signature {
  margin: 25px 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.65;
}

.signature strong {
  color: var(--wine);
  font-size: 1.35rem;
  font-weight: 500;
}

.summary-actions {
  display: grid;
  gap: 10px;
}

.text-button {
  min-height: 46px;
  border: 0;
  color: var(--wine);
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
  cursor: pointer;
}

.save-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 5px, 0) rotate(-1.1deg); }
  50% { transform: translate3d(0, -28px, 0) rotate(1.1deg); }
}

@media (min-width: 560px) {
  body {
    padding: 24px 0;
  }

  .experience,
  .screen {
    min-height: calc(100vh - 48px);
  }

  .experience {
    border-radius: 5px;
  }

  .content--centered,
  .summary-content {
    min-height: calc(100vh - 104px);
  }
}

@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;
  }
}
