:root {
  --milk: #f7f4fd;
  --c1: #d9ccf5;
  --c2: #f3d6ec;
  --c3: #c9dcf7;
  --acc: #6b4ea3;
  --ink: #3b2f55;
  --glass: color-mix(in srgb, var(--milk) 50%, transparent);
  --glass-line: color-mix(in srgb, #ffffff 70%, transparent);
  --shade: color-mix(in srgb, var(--ink) 16%, transparent);
  --fh: "Marck Script", cursive;
  --hs: 1.02;
  --fb: "Cormorant Garamond", serif;
  --bs: 1.1;
  --fk: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fl-size: 6.6;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --u: min(1vw, .462vh);
  --u: min(1vw, .462dvh);
  --fm: 1;
  --runway: 0px;
  --bleed-top: 0px;
  --bleed-bottom: 0px;
  color-scheme: light;
}
@media (orientation: landscape) {
  :root {
    --u: min(.42vw, .672vh);
    --u: min(.42vw, .672dvh);
    --fm: 1.5;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--milk); }
/* iOS 26 Safari paints its own bars with a flat tint while the page sits at scrollY 0 or behind a fixed layer.
   A scroll runway plus bleeding backgrounds lets it composite the real page behind both bars. */
html.runway { --runway: 62px; --bleed-top: 62px; --bleed-bottom: 136px; height: auto; overflow-x: hidden; overflow-y: scroll; }
html.runway body { height: auto; min-height: calc(100dvh + var(--runway)); overflow: visible; }
html.runway .app { position: relative; margin-top: var(--runway); overflow: visible; touch-action: none; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button { font: inherit; color: inherit; }

.app {
  position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100dvh;
  overflow: hidden; isolation: isolate; overscroll-behavior: none;
  touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none;
  color: var(--ink); font-family: var(--fb); font-weight: 500;
}
.stage { position: absolute; inset: 0; z-index: 1; }
.scr { position: absolute; inset: 0; display: none; }
.scr.on { display: block; }
.selectable { user-select: text; -webkit-user-select: text; }

.flora { position: absolute; inset: calc(-1 * var(--bleed-top)) 0 calc(-1 * var(--bleed-bottom)); z-index: 0; pointer-events: none; overflow: hidden; opacity: .4; }
.flower { position: absolute; top: 0; height: 100%; width: calc(var(--fs) * var(--u) * var(--fm)); animation: ffall linear infinite; will-change: transform; }
.flower svg { display: block; width: 100%; height: auto; overflow: visible; transform: translateY(-120%); animation: fsway ease-in-out infinite alternate; }
.flower.far { opacity: .5; }
@media not all and (hover: hover) and (pointer: fine) { .flower:nth-child(n + 10) { display: none; } }
@keyframes ffall { from { transform: translateY(0); } to { transform: translateY(115%); } }
@keyframes fsway {
  from { transform: translateY(-120%) translateX(calc(-3 * var(--u))) rotate(-14deg); }
  to { transform: translateY(-120%) translateX(calc(3 * var(--u))) rotate(14deg); }
}

.hero {
  position: absolute; left: 0; right: 0; top: calc(-1 * var(--bleed-top)); height: calc(60% + var(--bleed-top)); z-index: 1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 48%, transparent 98%); mask-image: linear-gradient(180deg, #000 48%, transparent 98%);
}
.scr[data-s="1"] .hero { height: calc(42% + var(--bleed-top)); }
.scr[data-s="5"] .hero, .scr[data-s="7"] .hero { height: calc(52% + var(--bleed-top)); }
.art {
  position: absolute; inset: -20%;
  background:
    radial-gradient(38% 30% at 30% 30%, var(--c1), transparent 70%),
    radial-gradient(34% 28% at 72% 50%, var(--c2), transparent 70%),
    radial-gradient(44% 34% at 40% 80%, var(--c3), transparent 70%);
  filter: blur(14px); animation: drift 12s ease-in-out infinite alternate; will-change: transform;
}
@keyframes drift { to { transform: translate(5%, -4%) rotate(10deg) scale(1.1); } }
.bigword {
  position: absolute; left: -2%; top: 8%; font-family: var(--fh); color: var(--acc);
  font-size: calc(36 * var(--u)); line-height: .82; opacity: .22; white-space: nowrap;
}
.ph {
  position: absolute; inset: 0; background-image: var(--photo); background-size: cover; background-position: center;
}
.ph::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: soft-light;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 34%, transparent), color-mix(in srgb, var(--c3) 22%, transparent));
}
.scr[data-s="0"] .hero { height: calc(100% + var(--bleed-top) + var(--bleed-bottom)); -webkit-mask-image: none; mask-image: none; }

.content {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; gap: calc(3.4 * var(--u));
  padding: calc(10 * var(--u) + var(--sat)) calc(8 * var(--u) + var(--sar)) calc(30 * var(--u) + var(--sab)) calc(8 * var(--u) + var(--sal));
}
.scr[data-s="5"] .content, .scr[data-s="8"] .content { padding-bottom: calc(12 * var(--u) + var(--sab)); }
.scr[data-s="6b"] .content { padding-bottom: calc(14 * var(--u) + var(--sab)); }
.bar {
  position: absolute; z-index: 3; display: flex; justify-content: flex-start; align-items: center;
  left: calc(8 * var(--u) + var(--sal)); right: calc(8 * var(--u) + var(--sar)); bottom: calc(9 * var(--u) + var(--sab));
}

.kicker { font-family: var(--fk); font-weight: 400; font-size: calc(3.2 * var(--u)); letter-spacing: .32em; text-transform: uppercase; color: var(--acc); opacity: .8; margin: 0; }
.kicker.pre { font-family: var(--fh); text-transform: none; letter-spacing: 0; font-size: calc(6.6 * var(--u) * var(--hs)); opacity: .7; }
.title { font-family: var(--fh); font-weight: 400; color: var(--acc); font-size: calc(12 * var(--u) * var(--hs)); line-height: 1.02; margin: 0; }
.title.huge { font-size: calc(20 * var(--u) * var(--hs)); }
.title.mid { font-size: calc(11 * var(--u) * var(--hs)); }
.title.small { font-size: calc(10 * var(--u) * var(--hs)); }
.text { font-family: var(--fb); font-weight: 500; font-size: calc(5.2 * var(--u) * var(--bs)); line-height: 1.38; margin: 0; }
.addr { margin: 0; font-family: var(--fb); font-size: calc(4.4 * var(--u) * var(--bs)); opacity: .75; }
.words span { display: inline-block; }

.lines { display: grid; gap: calc(1.4 * var(--u)); }
.lines p { margin: 0; font-family: var(--fb); font-style: italic; font-weight: 500; font-size: calc(var(--fl-size) * var(--u)); line-height: 1.22; }
.lines p:last-child { color: var(--acc); font-size: calc(var(--fl-size) * 1.4 * var(--u)); margin-top: calc(2.4 * var(--u)); }

.smiley { width: calc(24 * var(--u)); overflow: visible; }
.smile { stroke: var(--acc); }
.smiley .eye { fill: var(--acc); transform-box: fill-box; transform-origin: center; }
.play .smile { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw 1.2s .9s ease forwards; }
.play .smiley .eye { animation: pop .5s .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.play .smiley .e2 { animation: pop .5s .85s cubic-bezier(.3, 1.6, .5, 1) both, wink 4s 2.6s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes wink { 0%, 88%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.12); } }

.play .rise { opacity: 0; animation: rise 1s cubic-bezier(.2, .7, .2, 1) var(--d, 0s) forwards; }
.play .lines p { opacity: 0; animation: rise 1.1s cubic-bezier(.2, .7, .2, 1) forwards; }
.play .lines p:nth-child(1) { animation-delay: .2s; }
.play .lines p:nth-child(2) { animation-delay: 1s; }
.play .lines p:nth-child(3) { animation-delay: 1.8s; }
.play .lines p:nth-child(4) { animation-delay: 2.5s; }
.play .lines p:nth-child(5) { animation-delay: 3.2s; }
.play .lines p:nth-child(6) { animation-delay: 4.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(calc(3 * var(--u))); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.nx {
  border: none; background: none; cursor: pointer; color: var(--acc); display: inline-flex; align-items: center; gap: calc(3 * var(--u)); padding: 0;
  font-family: var(--fh); font-size: calc(7 * var(--u) * var(--hs)); white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.nx.long { font-size: calc(5.6 * var(--u) * var(--hs)); }
.nx[disabled] { opacity: .3; cursor: default; }
.nx .arr { position: relative; flex: none; width: calc(16 * var(--u)); height: 1px; }
.nx .arr::before { content: ""; position: absolute; inset: 0; background: var(--acc); transform-origin: left center; animation: reach-line 2.6s ease-in-out infinite; }
.nx .arr::after {
  content: ""; position: absolute; right: 0; top: 50%; width: calc(2.4 * var(--u)); height: calc(2.4 * var(--u));
  border-top: 1px solid var(--acc); border-right: 1px solid var(--acc); transform: translateY(-50%) rotate(45deg);
  animation: reach-head 2.6s ease-in-out infinite;
}
@keyframes reach-line { 50% { transform: scaleX(1.375); } }
@keyframes reach-head {
  0%, 100% { transform: translateY(-50%) rotate(45deg); }
  50% { transform: translateX(calc(6 * var(--u))) translateY(-50%) rotate(45deg); }
}
.nx:focus-visible, .ans:focus-visible, .date:focus-visible { outline: 1px solid var(--acc); outline-offset: calc(1.5 * var(--u)); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: calc(3 * var(--u)); margin-top: calc(3 * var(--u)); width: 100%; max-width: calc(88 * var(--u)); }
.ans {
  aspect-ratio: 1; border-radius: calc(6 * var(--u)); background: var(--glass); border: 1px solid var(--glass-line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 calc(2 * var(--u)) calc(8 * var(--u)) var(--shade);
  display: grid; align-content: space-between; justify-items: start; padding: calc(5 * var(--u)); cursor: pointer;
  font-family: var(--fh); font-size: calc(6 * var(--u) * var(--hs)); text-align: left; line-height: 1.1; color: var(--ink);
  transition: transform .3s; -webkit-tap-highlight-color: transparent;
}
.ans i { font-style: normal; color: var(--acc); font-size: calc(7 * var(--u)); }
.ans:active { transform: scale(.96); }
.ans.was { color: var(--acc); }

.dates { display: grid; grid-template-columns: repeat(5, 1fr); gap: calc(2 * var(--u)); margin-top: calc(2 * var(--u)); }
.date {
  border: none; background: none; cursor: pointer; color: var(--ink); font-family: var(--fb); display: grid; justify-items: center;
  gap: calc(1 * var(--u)); padding: calc(2.5 * var(--u)) 0; -webkit-tap-highlight-color: transparent;
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1), color .3s;
}
.date small { font-size: calc(3 * var(--u)); text-transform: uppercase; letter-spacing: .14em; opacity: .7; }
.date b { font-family: var(--fh); font-weight: 400; font-size: calc(11 * var(--u) * var(--hs)); line-height: 1; }
.date::after {
  content: ""; width: calc(1.6 * var(--u)); height: calc(1.6 * var(--u)); border-radius: 50%; background: var(--acc);
  transform: scale(0); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.date.sel { color: var(--acc); transform: translateY(calc(-1.5 * var(--u))); }
.date.sel::after { transform: scale(1); }

.scr[data-s="8"] .hero {
  left: 12%; right: 12%; top: calc(6% + var(--sat)); height: 46%; background: #fff; border-radius: calc(1.6 * var(--u));
  transform: rotate(-3deg); box-shadow: 0 calc(3 * var(--u)) calc(10 * var(--u)) var(--shade); -webkit-mask-image: none; mask-image: none;
}
.scr[data-s="8"] .ph { inset: calc(3 * var(--u)) calc(3 * var(--u)) calc(13 * var(--u)); }
.scr[data-s="8"] .caption {
  position: absolute; left: 0; right: 0; bottom: calc(3.4 * var(--u)); text-align: center;
  font-family: var(--fh); color: var(--ink); font-size: calc(6 * var(--u) * var(--hs)); line-height: 1.2;
}
.play[data-s="8"] .hero { animation: snap-in 1.1s cubic-bezier(.3, 1.3, .5, 1) both; }
@keyframes snap-in {
  from { transform: translateY(calc(-10 * var(--u))) rotate(-12deg); opacity: 0; }
  to { transform: rotate(-3deg); opacity: 1; }
}
.invite { display: grid; gap: calc(2.4 * var(--u)); }
.invite .kicker, .invite .row span:first-child {
  font-family: var(--fh); font-weight: 400; text-transform: none; letter-spacing: 0;
  font-size: calc(4.8 * var(--u) * var(--hs)); color: var(--acc); opacity: .75;
}
.invite .row {
  display: flex; justify-content: space-between; gap: calc(3 * var(--u)); padding-top: calc(2.2 * var(--u));
  border-top: 1px solid color-mix(in srgb, var(--acc) 28%, transparent); font-family: var(--fb); font-size: calc(4 * var(--u) * var(--bs));
}
.invite .row span:first-child { padding-top: calc(.6 * var(--u)); }
.invite .row span:last-child { text-align: right; }

.entry {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  gap: calc(3 * var(--u)); padding: 0 calc(8 * var(--u) + var(--sar)) 16% calc(8 * var(--u) + var(--sal));
}
.entry .big { font-family: var(--fh); font-weight: 400; color: var(--acc); font-size: calc(16 * var(--u) * var(--hs)); line-height: .95; margin: 0; }
.fog { position: absolute; inset: calc(-1 * var(--bleed-top)) 0 calc(-1 * var(--bleed-bottom)); width: 100%; height: calc(100% + var(--bleed-top) + var(--bleed-bottom)); z-index: 4; touch-action: none; cursor: crosshair; opacity: 0; }

.burst { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.burst span { position: absolute; bottom: -8%; line-height: 1; }

@media (orientation: landscape) {
  .hero, .scr[data-s] .hero {
    top: calc(-1 * var(--bleed-top)); bottom: calc(-1 * var(--bleed-bottom)); height: auto; right: auto; width: 58%;
    -webkit-mask-image: linear-gradient(90deg, #000 55%, transparent 99%); mask-image: linear-gradient(90deg, #000 55%, transparent 99%);
  }
  .scr[data-s="0"] .hero { width: 100%; -webkit-mask-image: none; mask-image: none; }
  .scr[data-s="8"] .hero { left: calc(9% + var(--sal)); right: auto; top: 13%; bottom: auto; width: 38%; height: 70%; -webkit-mask-image: none; mask-image: none; }
  .scr[data-s="8"] .ph { inset: calc(2.4 * var(--u)) calc(2.4 * var(--u)) calc(11 * var(--u)); }
  .scr[data-s="8"] .caption { bottom: calc(2.6 * var(--u)); font-size: calc(5 * var(--u) * var(--hs)); }
  .bigword { top: 20%; font-size: calc(70 * var(--u)); }
  .content, .scr[data-s] .content {
    left: 52%; justify-content: center;
    padding: calc(10 * var(--u) + var(--sat)) calc(17 * var(--u) + var(--sar)) calc(28 * var(--u) + var(--sab)) calc(9.5 * var(--u));
  }
  .scr[data-s="5"] .content, .scr[data-s="8"] .content, .scr[data-s="6b"] .content { padding-bottom: calc(14 * var(--u) + var(--sab)); }
  .bar { left: 56%; right: calc(7% + var(--sar)); bottom: calc(10% + var(--sab)); }
  .smiley { width: calc(18 * var(--u)); }
  .entry { padding-bottom: 12%; }
}

@media (prefers-reduced-motion: reduce) {
  .art, .flower, .flower svg, .nx .arr::before, .nx .arr::after { animation: none; }
  .flower { transform: translateY(var(--y)); }
  .play .rise, .play .lines p, .play[data-s="8"] .hero { animation-name: fadein; }
  .play .smile { animation: none; stroke-dashoffset: 0; }
  .play .smiley .eye, .play .smiley .e2 { animation: fadein .5s .3s both; }
  .date, .date::after, .ans { transition: color .3s; }
  .date.sel { transform: none; }
  .ans:active { transform: none; }
}

.flower .p { fill: color-mix(in srgb, var(--acc) 16%, transparent); stroke: color-mix(in srgb, var(--acc) 62%, transparent); }
.flower .c { fill: color-mix(in srgb, var(--acc) 50%, transparent); }
.flower .s { fill: none; stroke: color-mix(in srgb, var(--acc) 62%, transparent); }
.scr[data-s="0"] .entry { opacity: 0; }
.scr[data-s="0"].fog-ready .entry { opacity: 1; }
