:root {
  color-scheme: light;
  --ink: #403b3b;
  --muted: #7d7474;
  --rose: #c8868a;
  --rose-deep: #a96269;
  --cream: #fbf7f3;
  --paper: rgba(255, 252, 249, 0.88);
  --sage: #aab8aa;
  --line: rgba(93, 72, 75, 0.14);
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(232, 199, 193, 0.5), transparent 30%),
    radial-gradient(circle at 90% 82%, rgba(193, 207, 190, 0.55), transparent 31%),
    linear-gradient(145deg, #f7efea, #eef1e9);
}

.entrance,
.experience {
  min-height: 100vh;
}

.entrance[hidden],
.experience[hidden] {
  display: none;
}

.entrance {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  transition: opacity 360ms ease, transform 360ms ease;
}

.entrance--leaving {
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
}

.entrance__card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  padding: clamp(46px, 8vw, 76px) clamp(24px, 7vw, 64px);
  text-align: center;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 36px;
  box-shadow: 0 28px 80px rgba(78, 57, 61, 0.12);
  backdrop-filter: blur(22px);
}

.entrance__card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  border-radius: 27px;
  pointer-events: none;
}

.entrance__card .eyebrow {
  position: relative;
  z-index: 1;
  margin-bottom: 16px;
}

.entrance__card h1 {
  position: relative;
  z-index: 1;
  margin: 0 auto 16px;
}

.entrance__card p {
  position: relative;
  z-index: 1;
  margin: 0 0 32px;
  color: var(--muted);
  line-height: 1.6;
}

.envelope {
  position: relative;
  z-index: 1;
  width: min(250px, 75vw);
  aspect-ratio: 1.5;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  filter: drop-shadow(0 18px 24px rgba(101, 72, 76, 0.16));
}

.envelope__back,
.envelope__front,
.envelope__paper {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 10px;
}

.envelope__back {
  bottom: 0;
  height: 78%;
  overflow: hidden;
  background: #dfb9b8;
}

.envelope__back::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ecd0cc;
  clip-path: polygon(0 0, 100% 0, 50% 62%);
}

.envelope__paper {
  z-index: 1;
  top: 18%;
  left: 9%;
  width: 82%;
  height: 67%;
  display: grid;
  place-items: start center;
  padding-top: 17px;
  color: var(--rose-deep);
  background: #fffaf6;
  border: 1px solid rgba(126, 92, 95, 0.09);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: transform 260ms ease;
}

.envelope__front {
  z-index: 2;
  bottom: 0;
  height: 78%;
  background: linear-gradient(145deg, #eacac6, #dcb2b2);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
}

.envelope__seal {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 31%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  transform: translate(-50%, 50%);
  color: #fff8f4;
  background: var(--rose-deep);
  border-radius: 50%;
  box-shadow: 0 5px 12px rgba(107, 69, 73, 0.18);
  transition: transform 220ms ease;
}

.envelope:hover .envelope__paper,
.envelope:focus-visible .envelope__paper {
  transform: translateY(-14px);
}

.envelope:hover .envelope__seal,
.envelope:focus-visible .envelope__seal {
  transform: translate(-50%, 50%) scale(1.08);
}

.envelope:focus-visible {
  outline: 3px solid rgba(169, 98, 105, 0.3);
  outline-offset: 10px;
  border-radius: 14px;
}

button {
  font: inherit;
}

.experience {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
}

.ambient {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  filter: blur(1px);
  pointer-events: none;
}

.ambient--one {
  width: 360px;
  height: 360px;
  top: -180px;
  right: -90px;
}

.ambient--two {
  width: 260px;
  height: 260px;
  bottom: -140px;
  left: 8%;
}

.story {
  position: relative;
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 30px 36px 26px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 32px;
  box-shadow: 0 28px 80px rgba(78, 57, 61, 0.12);
  backdrop-filter: blur(22px);
}

.story::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  border-radius: 23px;
  pointer-events: none;
}

.story__header,
.story__footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--rose-deep);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.progress {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.13em;
}

.progress__track {
  width: 104px;
  height: 2px;
  overflow: hidden;
  background: rgba(76, 62, 65, 0.12);
}

.progress__track span {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--rose-deep);
  transition: width 350ms ease;
}

.slide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(330px, 0.78fr);
  align-items: center;
  gap: clamp(44px, 7vw, 96px);
  padding: 42px clamp(22px, 5vw, 74px);
}

.slide--enter-forward .slide__copy,
.slide--enter-forward .slide__art {
  animation: enter-forward 560ms cubic-bezier(.2, .78, .25, 1) both;
}

.slide--enter-back .slide__copy,
.slide--enter-back .slide__art {
  animation: enter-back 560ms cubic-bezier(.2, .78, .25, 1) both;
}

.slide__art {
  animation-delay: 80ms !important;
}

@keyframes enter-forward {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes enter-back {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.eyebrow,
.dialog__eyebrow {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--rose-deep);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 {
  max-width: 600px;
  margin: 0 0 24px;
  font-size: clamp(44px, 5vw, 68px);
  hyphens: none;
  line-height: 0.94;
  overflow-wrap: normal;
  word-break: normal;
}

.slide__text {
  max-width: 590px;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.75;
}

.slide__text p {
  margin: 0 0 12px;
}

.slide__art {
  margin: 0;
}

.slide__art-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  padding: 16px;
  background: rgba(255, 255, 255, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 46% 46% 22px 22px;
  box-shadow: 0 24px 55px rgba(86, 67, 68, 0.11);
}

.slide__art-frame::after {
  content: "";
  position: absolute;
  inset: 25px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 44% 44% 16px 16px;
  pointer-events: none;
}

.slide__art-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 44% 44% 14px 14px;
}

.slide__art-image.slide__art-image--contain {
  object-fit: contain;
  padding: clamp(12px, 2vw, 24px);
  background: linear-gradient(160deg, #f4e7e2 0%, #eee9dd 100%);
}

.slide__art-image--sticker {
  object-fit: contain;
  padding: clamp(4px, 0.8vw, 10px);
  background: transparent;
}

.slide__art-overlay {
  position: absolute;
  z-index: 2;
  right: clamp(8px, 1.4vw, 16px);
  bottom: clamp(8px, 1.4vw, 16px);
  width: min(52%, 190px);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 14px rgba(51, 39, 38, 0.16));
}

.slide__sticker-caption {
  position: absolute;
  z-index: 3;
  right: clamp(8px, 1.4vw, 16px);
  bottom: 50%;
  max-width: calc(100% - 32px);
  padding: 5px 10px;
  color: #25201f;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(66, 50, 50, 0.1);
  font-family: Inter, Arial, sans-serif;
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.slide__sticker-caption--solo {
  top: 18%;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.slide__art-caption {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-align: center;
}

.story__footer {
  min-height: 48px;
}

.nav-button,
.answer-button,
.choice-button {
  border: 0;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 13px;
}

.nav-button[hidden] {
  display: none;
}

.nav-button--quiet {
  color: var(--ink);
  background: transparent;
}

.nav-button:hover:not(:disabled),
.answer-button:hover:not(:disabled),
.choice-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.nav-button:focus-visible,
.answer-button:focus-visible,
.choice-button:focus-visible,
.dialog__close:focus-visible {
  outline: 3px solid rgba(169, 98, 105, 0.3);
  outline-offset: 3px;
}

.nav-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

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

.answer-button,
.choice-button {
  padding: 14px 21px;
  border-radius: 999px;
  font-size: 13px;
}

.answer-button--schedule {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

.answer-button--no,
.choice-button--quiet {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.answer-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.answer-status--success {
  color: #687d69;
}

.answer-status--error {
  color: #a05259;
}

.dialog {
  width: min(620px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.dialog::backdrop {
  background: rgba(61, 52, 53, 0.35);
  backdrop-filter: blur(7px);
}

.dialog__card {
  position: relative;
  padding: 52px;
  background: #fffaf6;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(56, 43, 45, 0.2);
  max-height: min(920px, calc(100vh - 32px));
  overflow-y: auto;
}

.dialog__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
}

.dialog h2 {
  margin: 0 0 14px;
  font-size: clamp(36px, 7vw, 50px);
  line-height: 1;
}

.dialog p {
  color: var(--muted);
  line-height: 1.7;
}

.dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.schedule-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 26px 0 20px;
}

.schedule-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.schedule-field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 14px;
  font: 500 14px "Trebuchet MS", system-ui, sans-serif;
  text-transform: none;
}

.schedule-field select:focus-visible {
  border-color: var(--rose-deep);
  outline: 3px solid rgba(169, 98, 105, 0.14);
}

.schedule-field--time {
  width: min(240px, 100%);
}

.time-picker {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.time-picker b {
  color: var(--ink);
  font-size: 20px;
}

.calendar {
  padding: 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 18px;
  text-transform: none;
}

.calendar__header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}

.calendar__header strong {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: capitalize;
}

.calendar__nav,
.calendar__day {
  display: grid;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: 500 13px "Trebuchet MS", system-ui, sans-serif;
}

.calendar__nav {
  width: 36px;
  height: 36px;
}

.calendar__nav:hover:not(:disabled),
.calendar__day:hover:not(:disabled) {
  background: rgba(169, 98, 105, 0.1);
}

.calendar__nav:disabled,
.calendar__day:disabled {
  opacity: 0.25;
  cursor: default;
}

.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.calendar__weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
}

.calendar__weekdays span,
.calendar__day,
.calendar__empty {
  aspect-ratio: 1;
}

.calendar__weekdays span {
  display: grid;
  place-items: center;
}

.calendar__day--today {
  box-shadow: inset 0 0 0 1px rgba(169, 98, 105, 0.4);
}

.calendar__day--selected {
  color: #fff;
  background: var(--rose-deep);
  box-shadow: none;
}

.calendar__day--selected:hover:not(:disabled) {
  background: var(--rose-deep);
}

.choice-button {
  color: #fff;
  background: var(--ink);
}

.dialog__answer .choice-button {
  margin-top: 14px;
}

.login-dialog {
  width: min(480px, calc(100% - 32px));
}

.login-card {
  padding-bottom: 42px;
}

.login-fields {
  display: grid;
  gap: 16px;
  margin: 26px 0 22px;
}

.login-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 14px;
  font: 500 16px "Trebuchet MS", system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.login-field input:focus-visible {
  border-color: var(--rose-deep);
  outline: 3px solid rgba(169, 98, 105, 0.14);
}

.login-card .choice-button {
  width: 100%;
}

.choice-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (min-width: 821px) and (max-width: 1050px) {
  .story { padding-inline: 24px; }
  .slide {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
    gap: 28px;
    padding: 36px 20px;
  }
  h1 { font-size: clamp(36px, 4.4vw, 46px); }
}

@media (max-width: 820px) {
  .experience { padding: 14px; }
  .story { min-height: calc(100vh - 28px); padding: 22px 22px 18px; border-radius: 24px; }
  .slide { grid-template-columns: 1fr; gap: 28px; padding: 34px 12px 24px; }
  .slide__copy { order: 2; }
  .slide__art { order: 1; width: min(250px, 72vw); justify-self: center; }
  .slide__art-frame { aspect-ratio: 16 / 10; border-radius: 120px 120px 18px 18px; }
  .slide__art-frame::after,
  .slide__art-image { border-radius: 105px 105px 12px 12px; }
  .slide__art-overlay { width: 35%; right: 8px; bottom: 6px; }
  .slide__sticker-caption { right: 8px; bottom: 65%; }
  .slide__art-frame--sticker { aspect-ratio: 4 / 5; }
  .slide__sticker-caption--solo { top: 18%; right: auto; bottom: auto; left: 50%; }
  h1 { font-size: clamp(34px, 10vw, 54px); }
  .eyebrow { margin-bottom: 14px; }
  .hint { display: none; }
}

@media (max-width: 520px) {
  .entrance { padding: 14px; }
  .entrance__card { padding-inline: 22px; border-radius: 26px; }
  .entrance__card::before { border-radius: 19px; }
  .entrance__card p { margin-bottom: 24px; }
  .story__mark { width: 36px; height: 36px; }
  .progress { min-width: auto; }
  .progress__track { width: 72px; }
  .slide__art { width: min(220px, 75vw); }
  .slide__text { line-height: 1.65; }
  .story__footer { padding-top: 8px; }
  .nav-button { padding: 12px 15px; }
  .dialog__card { padding: 44px 24px 30px; }
  .dialog__actions { flex-direction: column; }
  .calendar { padding: 10px; }
  .calendar__weekdays,
  .calendar__grid { gap: 3px; }
  h1 { font-size: clamp(32px, 9vw, 42px); }
}

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