:root {
  --ink: #3d6e8f;
  --ink-dark: #2d5877;
  --blue: #d9e9f4;
  --blue-deep: #bfd7e8;
  --paper: #fffefd;
  --gold: #d8b96e;
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Petit Formal Script", "Segoe Script", cursive;
  --caps: "Italiana", "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 0.82, 0.25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #f8fbfd;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.72) 46%, rgba(229, 242, 249, 0.7)),
    #f7fbfd;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: clamp(24px, 5vw, 64px) 20px 48px;
  overflow: hidden;
  isolation: isolate;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: min(52vw, 720px);
  aspect-ratio: 1;
  border: 1px solid rgba(83, 148, 185, 0.09);
  border-radius: 42% 58% 63% 37% / 54% 42% 58% 46%;
  background:
    radial-gradient(circle at 30% 32%, rgba(114, 190, 224, 0.17) 0 8%, transparent 9%),
    radial-gradient(circle at 54% 44%, rgba(198, 226, 239, 0.64), transparent 42%),
    radial-gradient(circle at 70% 73%, rgba(89, 174, 215, 0.13), transparent 38%);
  filter: blur(4px);
  opacity: 0.78;
  animation: drift 12s ease-in-out infinite alternate;
}

.ambient--one {
  top: -21vw;
  right: -12vw;
  transform: rotate(18deg);
}

.ambient--two {
  bottom: -27vw;
  left: -16vw;
  transform: rotate(-24deg);
  animation-delay: -6s;
}

.intro {
  position: absolute;
  top: clamp(26px, 5vh, 62px);
  z-index: 20;
  width: calc(100% - 40px);
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s var(--ease);
}

.intro__eyebrow,
.intro__hint {
  margin: 0;
  color: #718fa4;
  font-family: var(--serif);
  font-size: clamp(0.78rem, 1.4vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro h1 {
  margin: 7px 0 5px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.2;
}

.intro h1 span {
  display: inline-block;
  margin: 0 0.14em;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.7em;
  font-style: italic;
}

.intro__hint {
  font-size: clamp(0.68rem, 1.1vw, 0.8rem);
  letter-spacing: 0.1em;
  opacity: 0.75;
}

.application-info {
  position: absolute;
  top: 42%;
  left: 50%;
  z-index: 5;
  width: min(calc(100% - 40px), 620px);
  padding: 28px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(61, 110, 143, 0.2);
  border-radius: 20px;
  background: rgba(255, 254, 253, 0.92);
  color: var(--text);
  text-align: center;
  box-shadow: 0 12px 35px rgba(45, 36, 48, 0.08);
}

.application-info h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 400;
}

.application-info p { margin: 8px 0; }
.application-info__hint { color: var(--ink-dark); font-size: 0.92rem; }
body.has-event .application-info { display: none; }
body:not(.has-event) .event-content { display: none !important; }
body:not(.has-event) .intro { top: clamp(45px, 10vh, 110px); }
body:not(.has-event) .intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

body.wedding-day .intro {
  top: clamp(18px, 3vh, 34px);
}

body.wedding-day .intro__hint,
body.wedding-day .intro__reminder,
body.wedding-day .announcement,
body.wedding-day .countdown,
body.wedding-day .confirmation,
body.wedding-day .seal,
body.wedding-day .close-button,
body.wedding-day .info-card-wrap {
  display: none !important;
}

body.wedding-day .wedding-now__actions {
  display: none;
}

.wedding-now {
  width: min(calc(100% - 28px), 760px);
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid rgba(61, 110, 143, 0.2);
  border-radius: 20px;
  background: rgba(255, 254, 253, 0.95);
  box-shadow: 0 14px 32px rgba(45, 88, 119, 0.15);
  text-align: center;
}

.wedding-now__eyebrow {
  margin: 0;
  color: #7895a9;
  font-family: var(--caps);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wedding-now__status {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.25rem, 3.4vw, 1.9rem);
  line-height: 1.2;
}

.wedding-now__actions {
  display: grid;
  margin-top: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wedding-now__action {
  display: flex;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(61, 110, 143, 0.32);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: clamp(0.66rem, 1.6vw, 0.76rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  align-items: center;
  justify-content: center;
}

.wedding-now__action--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.wedding-now__action:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

body:not(.wedding-day) .wedding-now {
  display: none !important;
}

.invitation-scene {
  position: relative;
  width: min(84vw, 520px);
  height: min(84vw, 520px);
  margin-top: clamp(90px, 12vh, 130px);
}

body.wedding-day .invitation-scene {
  margin-top: clamp(70px, 10vh, 110px);
}

.scene {
  position: absolute;
  inset: 0;
}

.wallet {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  border: 1px solid rgba(65, 100, 123, 0.45);
  border-radius: 2px;
  background: #fcfefe;
  container-type: inline-size;
  filter: drop-shadow(0 22px 30px rgba(54, 91, 112, 0.2));
  transition: opacity 0.55s ease, transform 0.8s var(--ease);
}

.wallet__base,
.wallet__pockets {
  position: absolute;
  inset: 0;
}

.wallet__base {
  z-index: 1;
  background:
    radial-gradient(ellipse at 86% 52%, rgba(96, 185, 222, 0.4), transparent 25%),
    radial-gradient(ellipse at 66% 65%, rgba(190, 225, 240, 0.76), transparent 31%),
    radial-gradient(ellipse at 29% 84%, rgba(93, 181, 218, 0.29), transparent 28%),
    radial-gradient(ellipse at 78% 91%, rgba(163, 214, 235, 0.58), transparent 27%),
    linear-gradient(145deg, #ffffff 20%, #eef8fc 100%);
}

.wallet__base::after {
  position: absolute;
  right: -5%;
  bottom: -18%;
  width: 78%;
  height: 64%;
  border: 2px solid rgba(216, 185, 110, 0.35);
  border-radius: 48% 52% 55% 45%;
  content: "";
  filter: blur(1px);
  transform: rotate(-8deg);
}

.wallet__pockets {
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.wallet__upper {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(74, 105, 122, 0.43);
  stroke-width: 0.75;
}

.wallet__rear-pocket {
  fill: #d8e9f4;
  stroke: rgba(74, 105, 122, 0.48);
  stroke-width: 0.8;
}

.wallet__names {
  position: absolute;
  top: 4.2%;
  left: 5.2%;
  z-index: 4;
  max-width: 44%;
  margin: 0;
  color: var(--ink-dark);
  font-family: var(--display);
  font-size: clamp(1.1rem, 7.2cqw, 2.2rem);
  line-height: 1.22;
  overflow-wrap: break-word;
}

.seal {
  position: absolute;
  top: 39%;
  left: 72%;
  z-index: 14;
  display: grid;
  width: 28%;
  max-width: 145px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-dark);
  cursor: pointer;
  place-items: center;
  transform: translate(-50%, -50%);
  transition: opacity 0.35s ease, transform 0.45s var(--ease), filter 0.3s ease;
}

.seal:hover {
  filter: drop-shadow(0 8px 10px rgba(45, 88, 119, 0.18));
  transform: translate(-50%, -50%) scale(1.05);
}

.seal:focus-visible,
.close-button:focus-visible,
.card-wrap:focus-visible,
.info-card-wrap:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 5px;
}

.seal__ring {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(74, 105, 122, 0.42);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 12px rgba(50, 82, 101, 0.15);
  place-items: center;
}

.seal__ring img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.card-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: min(78vw, 430px);
  height: min(80svh, 760px);
  min-height: 590px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12%) scale(0.94);
  transition:
    opacity 0.3s ease,
    transform 1.1s var(--ease);
}

.info-card-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: min(70vw, 300px);
  height: 250px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 48%) rotate(2deg) scale(0.78);
  transition: opacity 0.35s ease, transform 0.55s var(--ease), height 0.35s var(--ease);
}

.info-card-wrap.has-visible-iban {
  height: 290px;
}

.info-card {
  position: relative;
  display: flex;
  height: 100%;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid rgba(80, 117, 139, 0.2);
  background:
    radial-gradient(circle at 86% 15%, rgba(153, 210, 234, 0.27), transparent 31%),
    radial-gradient(circle at 8% 94%, rgba(206, 233, 244, 0.7), transparent 37%),
    #fffefd;
  box-shadow: 0 14px 35px rgba(49, 89, 114, 0.2);
  color: var(--ink-dark);
  flex-direction: column;
  justify-content: center;
}

.info-card::after {
  position: absolute;
  right: -14%;
  bottom: -32%;
  width: 66%;
  aspect-ratio: 1;
  border: 1px solid rgba(216, 185, 110, 0.42);
  border-radius: 52% 48% 45% 55%;
  content: "";
  pointer-events: none;
  transform: rotate(-18deg);
}

.info-card__eyebrow {
  margin: 0 0 13px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.65rem;
}

.info-card__row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: start;
  gap: 12px;
}

.info-card__row p {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.35;
}

.info-card__row small {
  color: #7694a8;
  font-size: 0.78em;
}

.info-card__label {
  color: #7895a9;
  font-family: var(--caps) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
}

.info-card__gift-message {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  color: #5f8198;
  font-family: var(--serif);
  font-size: 0.83rem;
  font-style: italic;
  line-height: 1.4;
  text-align: center;
}

.info-card__gift-toggle {
  position: relative;
  z-index: 1;
  align-self: center;
  min-height: 34px;
  margin: 0 0 9px;
  padding: 6px 11px;
  border: 1px solid rgba(95, 129, 152, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #5f8198;
  cursor: pointer;
  font-family: var(--caps);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.info-card__bank-details {
  min-width: 0;
}

.info-card__iban {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.025em !important;
  line-height: 1.5 !important;
}

.info-card__account-holder {
  margin-top: 5px !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.02em !important;
}

.info-card__account-holder small {
  display: block;
  margin-bottom: 1px;
  font-family: var(--caps);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.info-card__copy {
  min-height: 34px;
  margin-top: 8px;
  padding: 6px 11px;
  border: 1px solid rgba(95, 129, 152, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #4d7189;
  cursor: pointer;
  font-family: var(--caps);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.info-card__copy-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.info-card__gift-toggle:focus-visible,
.info-card__copy:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.info-card__line {
  width: 100%;
  height: 1px;
  margin: 11px 0;
  background: linear-gradient(90deg, transparent, rgba(216, 185, 110, 0.72), transparent);
}

.info-card__row[hidden],
.info-card__line[hidden],
.info-card__gift-message[hidden],
.info-card__gift-toggle[hidden] {
  display: none;
}

.invitation-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(80, 117, 139, 0.13);
  background: var(--paper);
  box-shadow: 0 15px 42px rgba(49, 89, 114, 0.2);
}

.watercolor {
  position: absolute;
  pointer-events: none;
}

.watercolor--top {
  top: -8%;
  right: -18%;
  width: 78%;
  aspect-ratio: 1.1;
  border-radius: 34% 66% 40% 60% / 54% 34% 66% 46%;
  background:
    radial-gradient(circle at 32% 27%, transparent 0 17%, rgba(188, 224, 241, 0.5) 18% 26%, transparent 30%),
    radial-gradient(circle at 60% 50%, rgba(126, 195, 226, 0.33), transparent 37%),
    radial-gradient(circle at 43% 74%, rgba(205, 231, 243, 0.56), transparent 36%);
  filter: blur(2px);
}

.watercolor--top::after,
.watercolor--bottom::after {
  position: absolute;
  inset: 12%;
  border: 2px solid rgba(216, 185, 110, 0.38);
  border-radius: 48% 52% 63% 37%;
  content: "";
  filter: blur(1px);
}

.watercolor--bottom {
  bottom: -14%;
  left: -20%;
  width: 92%;
  aspect-ratio: 1.3;
  border-radius: 57% 43% 35% 65% / 47% 34% 66% 53%;
  background:
    radial-gradient(circle at 65% 32%, rgba(167, 215, 235, 0.28), transparent 29%),
    radial-gradient(circle at 34% 50%, rgba(108, 194, 225, 0.28), transparent 35%),
    radial-gradient(circle at 60% 74%, rgba(217, 239, 247, 0.7), transparent 40%);
  filter: blur(2px);
  transform: rotate(-9deg);
}

.card-content {
  position: relative;
  z-index: 2;
  display: flex;
  height: 100%;
  padding: clamp(36px, 7%, 58px) 7% 34px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.monogram-text {
  position: absolute;
  top: 5%;
  left: 50%;
  margin: 0;
  color: rgba(61, 110, 143, 0.07);
  font-family: var(--display);
  font-size: clamp(4.2rem, 12vw, 7rem);
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.monogram-text span {
  color: rgba(216, 185, 110, 0.16);
}

.couple {
  display: flex;
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.3rem, 5vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  flex-direction: column;
}

.ornament {
  display: flex;
  width: 42%;
  margin: clamp(10px, 2vh, 16px) 0;
  align-items: center;
  gap: 8px;
}

.ornament::before,
.ornament::after {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  content: "";
  flex: 1;
}

.ornament::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.ornament span {
  width: 5px;
  height: 5px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.announcement,
.detail__label,
.confirmation {
  margin: 0;
  color: #7895a9;
  font-family: var(--caps);
  font-size: clamp(0.7rem, 1.4vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.date {
  display: flex;
  margin: clamp(12px, 2vh, 18px) 0 clamp(14px, 2.3vh, 20px);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.2;
  flex-direction: column;
}

.date strong {
  font-family: var(--caps);
  font-size: 0.46em;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail {
  margin-bottom: clamp(12px, 2vh, 16px);
}

.detail__name {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.5vw, 2.1rem);
  line-height: 1.2;
}

.detail__address {
  margin: 0;
  color: #7895a9;
  font-family: var(--serif);
  font-size: clamp(0.67rem, 1.9vw, 0.9rem);
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.reception {
  margin-top: 2px;
}

.confirmation {
  margin-top: 14px;
  padding-top: 4px;
}

.invitation-quote {
  margin: 14px 0 0;
  color: #5f8198;
  font-family: var(--display);
  font-size: clamp(1.08rem, 2.5vw, 1.55rem);
  line-height: 1.28;
  text-align: center;
}

.countdown {
  width: 100%;
  margin-top: auto;
  color: var(--ink);
  text-align: center;
}

.countdown__label,
.countdown__complete,
.countdown__unavailable {
  margin: 0 0 8px;
  color: #7895a9;
  font-family: var(--caps);
  font-size: clamp(0.64rem, 1.8vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.countdown__grid {
  display: flex;
  width: min(100%, 320px);
  margin: 0 auto;
  justify-content: center;
  gap: clamp(8px, 3%, 16px);
  flex-wrap: wrap;
}

.countdown-ring {
  position: relative;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
}

.countdown-ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.countdown-ring__track {
  fill: none;
  stroke: rgba(61, 110, 143, 0.12);
  stroke-width: 5;
}

.countdown-ring__fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 201.06;
  stroke-dashoffset: 201.06;
  transition: stroke-dashoffset 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.countdown-ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.countdown-ring__text strong {
  display: block;
  color: var(--ink);
  font-family: var(--caps);
  font-size: clamp(0.82rem, 2.4vw, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}

.countdown-ring__text span {
  display: block;
  margin-top: 2px;
  color: #7895a9;
  font-family: var(--serif);
  font-size: clamp(0.42rem, 1.2vw, 0.52rem);
  letter-spacing: 0.04em;
  line-height: 1;
}

.countdown__complete {
  margin-bottom: 0;
  color: var(--ink);
}

.countdown__unavailable {
  margin-bottom: 0;
}

.memory-trigger {
  margin-top: 10px;
  padding: 8px 15px;
  border: 1px solid rgba(61, 110, 143, 0.42);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.memory-screen[hidden],
.countdown__label[hidden],
.countdown__grid[hidden],
.countdown__complete[hidden],
.countdown__unavailable[hidden],
.invitation-quote[hidden],
.memory-trigger[hidden],
.memory-preview[hidden] {
  display: none;
}

.memory-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 18px;
  place-items: center;
}

.memory-screen__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(232, 243, 249, 0.9);
  backdrop-filter: blur(10px);
}

.memory-screen__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 650px);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid rgba(77, 114, 136, 0.24);
  background:
    radial-gradient(circle at 94% 8%, rgba(136, 204, 232, 0.3), transparent 29%),
    radial-gradient(circle at 5% 95%, rgba(196, 228, 241, 0.72), transparent 34%),
    #fffefd;
  box-shadow: 0 24px 70px rgba(45, 88, 119, 0.2);
  color: var(--ink-dark);
  animation: memoryIn 0.45s var(--ease) both;
}

.memory-screen__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(61, 110, 143, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  place-items: center;
}

.memory-screen__eyebrow {
  margin: 0 0 6px;
  color: #7895a9;
  font-family: var(--caps);
  font-size: 0.75rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.memory-screen h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2.2rem, 7vw, 3.8rem);
  font-weight: 400;
  line-height: 1.2;
}

.memory-screen__intro {
  max-width: 510px;
  margin: 8px 0 26px;
  color: #66869b;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.45;
}

.memory-form {
  display: grid;
  gap: 17px;
}

.memory-form label {
  display: grid;
  gap: 7px;
  color: var(--ink-dark);
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.memory-form input[type="text"],
.memory-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(78, 116, 138, 0.28);
  border-radius: 2px;
  outline: 0;
  background: rgba(255, 255, 255, 0.76);
  color: #315f7e;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.memory-form textarea {
  resize: vertical;
}

.memory-form input[type="text"]:focus,
.memory-form textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(61, 110, 143, 0.1);
}

.memory-form__file {
  position: relative;
  justify-items: start;
}

.memory-form__file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.memory-form__file-action {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid rgba(61, 110, 143, 0.4);
  border-radius: 30px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.73rem;
}

.memory-form__file small {
  color: #7895a9;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

.memory-preview {
  display: grid;
  overflow-y: auto;
  max-height: 260px;
  padding: 4px;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 7px;
}

.memory-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  object-fit: cover;
}

.memory-form__status {
  min-height: 1.2em;
  margin: 0;
  color: #66869b;
  font-family: var(--serif);
  font-size: 0.9rem;
}

.memory-form__status.is-error {
  color: #9a4a4a;
}

.memory-form__submit {
  justify-self: start;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: 30px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.memory-form__submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

body.memory-open {
  overflow: hidden;
}

@keyframes memoryIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-button {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: auto;
  left: auto;
  z-index: 20;
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(61, 110, 143, 0.38);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  place-items: center;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.scene.is-open .seal {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -70%) scale(0.8);
}

.scene.is-open .card-wrap {
  z-index: 11;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-30%, -50%) scale(1);
  transition-delay: 0.38s, 0.38s;
}

body.wedding-day .scene.is-open .card-wrap {
  transform: translate(-50%, -50%) scale(1);
  transition-delay: 0s;
}

.scene.is-open .info-card-wrap {
  z-index: 10;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-150%, -4%) rotate(-2deg) scale(1);
  transition-delay: 0.58s, 0.58s;
}

.scene.is-open.info-on-top .card-wrap {
  z-index: 9;
}

.scene.is-open.info-on-top .info-card-wrap {
  z-index: 11;
}

.scene.is-open .card-wrap,
.scene.is-open .info-card-wrap {
  cursor: pointer;
  touch-action: manipulation;
}

.scene.is-open .wallet {
  opacity: 0.08;
  transform: translateY(34%) scale(0.92);
  transition-delay: 0.86s;
}

.scene.is-open + .close-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0.8s;
}

body.invitation-open .intro {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-15px);
}

body.wedding-day.invitation-open .intro {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@keyframes drift {
  from { translate: 0 0; rotate: 0deg; }
  to { translate: 2vw 1.5vh; rotate: 6deg; }
}

@media (min-width: 651px) and (max-height: 820px) {
  .intro {
    top: clamp(18px, 3vh, 28px);
  }

  .intro h1 {
    font-size: clamp(2.1rem, 4vw, 3.2rem);
  }

  .invitation-scene {
    width: min(72vw, 54svh, 520px);
    height: min(72vw, 54svh, 520px);
    margin-top: clamp(120px, 20vh, 140px);
  }
}

@media (min-width: 651px) {
  body.wedding-day .page-shell {
    display: flex;
    min-height: 100svh;
    padding: 150px 24px 48px;
    flex-direction: column;
    justify-content: flex-start;
    overflow: visible;
  }

  body.wedding-day .wedding-now {
    order: 1;
    width: min(100%, 760px);
    margin: 0 auto;
  }

  body.wedding-day .invitation-scene {
    order: 2;
    width: min(78vw, 430px);
    height: auto;
    margin: 24px auto 0;
  }

  body.wedding-day .scene {
    position: relative;
    height: auto;
  }

  body.wedding-day .card-wrap {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    height: clamp(450px, 58svh, 560px);
    min-height: 450px;
    margin: 0 auto;
  }

  body.wedding-day .scene.is-open .card-wrap {
    transform: none;
  }
}

@media (min-width: 901px) {
  body.wedding-day .wallet {
    display: none;
  }

  body.wedding-day .page-shell {
    display: grid;
    padding: clamp(150px, 16vh, 180px) 32px clamp(48px, 6vh, 72px);
    grid-template-columns: minmax(300px, 430px) minmax(420px, 760px);
    grid-template-rows: auto auto auto;
    align-content: center;
    justify-content: center;
    column-gap: clamp(36px, 5vw, 88px);
  }

  body.wedding-day .wedding-now {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
  }

  body.wedding-day .invitation-scene {
    width: 100%;
    margin: 0;
    grid-column: 1;
    grid-row: 1 / span 3;
    align-self: center;
  }

  body.wedding-day .card-wrap {
    height: clamp(470px, 58svh, 620px);
  }
}

@media (max-width: 900px) {
  .scene.is-open .card-wrap {
    transform: translate(-50%, -50%) scale(1);
  }

  .scene.is-open .info-card-wrap {
    transform: translate(-105%, 34%) rotate(-2deg) scale(1);
  }
}

@media (max-width: 650px) {
  .page-shell {
    min-height: 100svh;
    padding-inline: 12px;
  }

  .intro {
    top: 24px;
  }

  .intro h1 {
    display: flex;
    align-items: center;
    flex-direction: column;
    line-height: 0.92;
  }

  .intro h1 span {
    margin: 0;
    line-height: 0.8;
  }

  .wedding-now {
    margin-top: 12px;
    padding: 10px;
    border-radius: 16px;
  }

  .wedding-now__actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .invitation-scene {
    width: min(94vw, 520px);
    height: min(94vw, 520px);
    min-height: 0;
    margin-top: 120px;
  }

  .scene {
    height: 100%;
  }

  .card-wrap {
    width: min(90vw, 430px);
    height: min(80svh, 660px);
    height: clamp(560px, calc(100dvh - 136px), 1040px);
    min-height: 560px;
  }

  body.wedding-day .card-wrap {
    top: 46%;
    width: min(88vw, 410px);
    height: clamp(430px, calc(100dvh - 360px), 560px);
    min-height: 430px;
  }

  .info-card-wrap {
    top: auto;
    bottom: 14px;
    width: min(78vw, 300px);
    height: 250px;
    transform: translate(-50%, 45%) rotate(1deg) scale(0.8);
  }

  .info-card {
    padding: 16px 18px;
  }

  .info-card__eyebrow {
    margin-bottom: 8px;
    font-size: 1.35rem;
  }

  .info-card__line {
    margin-block: 7px;
  }

  .card-content {
    padding-top: 30px;
    padding-bottom: 26px;
  }

  .ornament {
    margin-block: 10px;
  }

  .date {
    margin-block: 12px 14px;
  }

  .detail {
    margin-bottom: 12px;
  }

  .scene.is-open .card-wrap {
    transform: translate(-50%, -50%) rotate(-0.6deg) scale(1);
    transition-delay: 0s;
    transition-duration: 0.3s, 0.5s;
  }

  body.wedding-day .scene.is-open .card-wrap {
    transform: translate(-50%, -56%) scale(0.98);
  }

  .scene.is-open .info-card-wrap {
    transform: translate(-43%, 7%) rotate(3deg) scale(0.96);
    transition-delay: 0s;
  }

  .scene.is-open.info-on-top .card-wrap {
    transform: translate(-53%, -51%) rotate(-1.6deg) scale(0.985);
  }

  .scene.is-open.info-on-top .info-card-wrap {
    transform: translate(-50%, 0) rotate(-1deg) scale(1);
  }

  .scene.is-open.is-shuffling:not(.info-on-top) .card-wrap {
    transform: translate(-62%, -50%) rotate(-3deg) scale(0.98);
  }

  .scene.is-open.is-shuffling.info-on-top .info-card-wrap {
    transform: translate(-36%, 4%) rotate(4deg) scale(0.97);
  }

  .close-button {
    top: 12px;
    right: 12px;
  }

  body.invitation-open .page-shell {
    min-height: 720px;
  }

  body.wedding-day .page-shell {
    display: flex;
    min-height: 100svh;
    padding: 150px 12px calc(32px + env(safe-area-inset-bottom));
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
  }

  body.wedding-day .wedding-now {
    order: 1;
    width: min(100%, 430px);
    margin: 0 auto;
    padding: 10px 14px;
  }

  body.wedding-day .wedding-now__actions {
    display: none;
  }

  body.wedding-day .invitation-scene {
    order: 3;
    width: 100%;
    height: auto;
    margin: 18px 0 0;
  }

  body.wedding-day .scene {
    position: relative;
    height: auto;
  }

  body.wedding-day .card-wrap {
    position: relative;
    top: auto;
    left: auto;
    margin: 0 auto;
  }

  body.wedding-day .scene.is-open .card-wrap {
    transform: none;
  }
}

@media (max-width: 390px) {
  .card-content {
    padding-inline: 5%;
  }

  .confirmation {
    font-size: 0.62rem;
  }
}

@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;
    transition-delay: 0ms !important;
  }
}
