:root {
    --ink: #4d2031;
    --muted: #865267;
    --rose: #d9467d;
    --rose-dark: #a71f55;
    --pink: #f59cbd;
    --blush: #ffe8f0;
    --cream: #fffaf7;
    --pearl: #fffefe;
    --gold: #c99a55;
    --plum: #43142c;
    --night: #170814;
    --border: rgba(165, 54, 96, .14);
    --shadow: 0 24px 70px rgba(111, 33, 65, .14);
    --serif: Georgia, 'Times New Roman', serif;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --script: 'Segoe Script', 'Snell Roundhand', 'Bradley Hand', cursive;
    --safe-top: max(16px, env(safe-area-inset-top));
    --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--rose) #fff1f6;
    scrollbar-width: thin;
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background: var(--cream);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.is-intro-locked {
    overflow: hidden;
}

body.motion-paused *,
body.motion-paused *::before,
body.motion-paused *::after {
    animation-play-state: paused !important;
}

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

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(217, 70, 125, .45);
    outline-offset: 4px;
}

::selection {
    color: #fff;
    background: var(--rose);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fff1f6;
}

::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: linear-gradient(var(--pink), var(--rose));
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    z-index: 10000;
    top: 12px;
    left: 12px;
    padding: 10px 16px;
    border-radius: 999px;
    color: #fff;
    background: var(--plum);
    transform: translateY(-160%);
    transition: transform .2s ease;
}

.skip-link:focus {
    transform: none;
}

.ambient {
    position: fixed;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 197, 219, .45), transparent 28%),
        radial-gradient(circle at 85% 75%, rgba(244, 174, 202, .28), transparent 30%),
        linear-gradient(145deg, #fffaf8 0%, #fff1f6 52%, #fffaf8 100%);
}

.orb {
    position: absolute;
    width: 38vw;
    aspect-ratio: 1;
    border-radius: 50%;
    filter: blur(42px);
    opacity: .23;
    animation: orbFloat 15s ease-in-out infinite alternate;
}

.orb-one { top: -12%; left: -12%; background: #ff91bb; }
.orb-two { top: 35%; right: -22%; background: #ffd18e; animation-delay: -4s; }
.orb-three { bottom: -20%; left: 25%; background: #e881ab; animation-delay: -8s; }

.petal-field {
    position: absolute;
    inset: 0;
}

.petal {
    position: absolute;
    top: -8vh;
    width: 10px;
    height: 16px;
    border-radius: 80% 10% 80% 10%;
    background: linear-gradient(145deg, rgba(255, 255, 255, .85), rgba(224, 79, 133, .55));
    opacity: .52;
    animation: petalFall var(--fall-time, 14s) linear var(--fall-delay, 0s) infinite;
}

.intro {
    position: fixed;
    z-index: 9000;
    inset: 0;
    display: grid;
    place-items: center;
    min-height: 100svh;
    overflow: hidden;
    color: #fff9fc;
    background:
        radial-gradient(circle at 50% 48%, rgba(218, 57, 116, .2), transparent 21%),
        radial-gradient(circle at 30% 20%, rgba(156, 38, 92, .16), transparent 25%),
        #120710;
    transition: clip-path 1.15s cubic-bezier(.76, 0, .24, 1), opacity .65s ease;
    clip-path: circle(150% at 50% 50%);
}

.intro.is-leaving {
    clip-path: circle(0% at 50% 50%);
    opacity: .5;
    pointer-events: none;
}

.intro-stars,
.intro-stars::before,
.intro-stars::after {
    position: absolute;
    inset: 0;
    content: '';
    background-image:
        radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.5px),
        radial-gradient(circle, rgba(244,154,190,.7) 0 1px, transparent 1.5px);
    background-position: 10px 12px, 45px 58px;
    background-size: 74px 74px, 103px 103px;
    opacity: .18;
    animation: starDrift 24s linear infinite;
}

.intro-stars::before { transform: rotate(24deg) scale(1.2); opacity: .18; }
.intro-stars::after { transform: rotate(-18deg) scale(1.4); opacity: .12; }

.intro-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: min(55vw, 390px);
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(255, 179, 210, .13);
    border-radius: 50%;
    box-shadow: 0 0 100px rgba(222, 57, 121, .12), inset 0 0 90px rgba(222, 57, 121, .08);
    transform: translate(-50%, -50%);
    animation: introPulse 3.2s ease-in-out infinite;
}

.intro-heart {
    color: #e54e86;
    font-size: clamp(2rem, 5vw, 4rem);
    filter: drop-shadow(0 0 18px rgba(229,78,134,.6));
}

.intro-content {
    position: relative;
    z-index: 2;
    width: min(90vw, 800px);
    padding: 32px 20px;
    text-align: center;
}

.intro-kicker {
    margin: 0 0 20px;
    color: rgba(255, 229, 240, .55);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.intro-line {
    min-height: 2.8em;
    margin: 0 auto 28px;
    font-family: var(--serif);
    font-size: clamp(2.1rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.12;
    text-wrap: balance;
    transition: opacity .38s ease, transform .38s ease, filter .38s ease;
}

.intro-line.is-changing {
    opacity: 0;
    filter: blur(7px);
    transform: translateY(12px);
}

.intro-open {
    margin-inline: auto;
    animation: softEntrance .8s ease both;
}

.intro-skip {
    position: absolute;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom));
    color: rgba(255,255,255,.62) !important;
}

.floating-header {
    position: fixed;
    z-index: 1000;
    top: var(--safe-top);
    left: 50%;
    display: flex;
    width: min(calc(100% - 28px), 1160px);
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 999px;
    background: rgba(255, 250, 248, .64);
    box-shadow: 0 12px 40px rgba(91, 30, 56, .1);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transform: translateX(-50%) translateY(-140%);
    transition: transform .6s cubic-bezier(.22,1,.36,1);
}

body.story-started .floating-header {
    transform: translateX(-50%);
}

.mini-mark {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-inline: 8px;
    color: var(--plum);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}

.mini-mark i { color: var(--rose); font-size: .75rem; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.pill-control,
.round-control {
    min-height: 42px;
    border: 1px solid var(--border);
    color: var(--ink);
    background: rgba(255,255,255,.74);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.pill-control:hover,
.round-control:hover { transform: translateY(-2px); }

.pill-control {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.round-control {
    width: 42px;
    border-radius: 50%;
}

.music-bars {
    display: flex;
    height: 16px;
    align-items: flex-end;
    gap: 2px;
}

.music-bars i {
    display: block;
    width: 2px;
    height: 5px;
    border-radius: 3px;
    background: var(--rose);
}

.pill-control[aria-pressed="true"] .music-bars i {
    animation: musicBar .75s ease-in-out infinite alternate;
}

.pill-control[aria-pressed="true"] .music-bars i:nth-child(2) { animation-delay: -.25s; }
.pill-control[aria-pressed="true"] .music-bars i:nth-child(3) { animation-delay: -.5s; }

.story-progress {
    position: fixed;
    z-index: 999;
    inset: 0 0 auto;
    height: 3px;
    pointer-events: none;
}

.story-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--pink), var(--rose), var(--gold));
    box-shadow: 0 0 15px rgba(217,70,125,.35);
}

.scene {
    position: relative;
    width: 100%;
    min-height: 100svh;
    overflow: clip;
}

.section-shell {
    display: grid;
    align-content: center;
    width: min(100%, 1200px);
    margin-inline: auto;
    padding: clamp(100px, 12vw, 160px) clamp(20px, 5vw, 72px);
}

.section-heading {
    max-width: 720px;
    margin: 0 auto clamp(44px, 7vw, 82px);
    text-align: center;
}

.section-heading h2,
.choice-card h2,
.heartbeat-copy h2,
.gift-contents h2 {
    margin: 7px 0 12px;
    font-family: var(--serif);
    font-size: clamp(2.25rem, 5vw, 4.8rem);
    font-weight: 400;
    line-height: 1.06;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.section-heading > p:last-child,
.hero-message {
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.18rem);
}

.eyebrow {
    margin: 0;
    color: var(--rose-dark);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .85s ease, transform .85s cubic-bezier(.22,1,.36,1);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.hero-scene {
    display: grid;
    min-height: 100svh;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: clamp(30px, 6vw, 90px);
    padding: clamp(110px, 13vw, 170px) max(24px, calc((100vw - 1180px) / 2));
}

.hero-ribbon {
    position: absolute;
    top: 18%;
    left: -52px;
    padding: 9px 55px;
    color: rgba(91,37,60,.62);
    background: rgba(255,255,255,.44);
    border-block: 1px solid rgba(211,79,126,.12);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    transform: rotate(-7deg);
}

.hero-copy {
    position: relative;
    z-index: 2;
}

.hero-title-row {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.4vw, 30px);
    width: max-content;
    max-width: 100%;
}

.display-title {
    margin: 12px 0 18px;
    font-family: var(--serif);
    font-size: clamp(4.2rem, 9vw, 8.6rem);
    font-weight: 400;
    line-height: .86;
    letter-spacing: -.075em;
    color: var(--plum);
}

.display-title::first-letter { color: var(--rose); }

.title-heart {
    display: grid;
    width: clamp(56px, 7vw, 88px);
    aspect-ratio: 1;
    flex: 0 0 auto;
    place-items: center;
    margin-top: 3px;
    border: 1px solid rgba(217, 70, 125, .16);
    border-radius: 50%;
    color: var(--rose);
    background: rgba(255,255,255,.58);
    box-shadow: 0 18px 38px rgba(133,36,73,.12);
    font-family: var(--serif);
    font-size: clamp(1.55rem, 3vw, 2.5rem);
    animation: heartbeat 1.8s ease-in-out infinite;
}

.hero-message {
    max-width: 620px;
    margin: 0 0 26px;
    font-family: var(--serif);
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    font-style: italic;
    line-height: 1.45;
}

.signature {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    border: 0;
    color: var(--rose-dark);
    background: transparent;
    cursor: pointer;
}

.signature span {
    font-family: var(--script);
    font-size: clamp(2rem, 4vw, 3.4rem);
    transform: rotate(-4deg);
}

.signature small {
    margin: -2px 0 0 22px;
    color: var(--muted);
    font-size: .58rem;
    letter-spacing: .1em;
    opacity: .65;
}

.hero-heart-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: min(38vw, 460px);
    aspect-ratio: 1;
    margin-inline: auto;
}

.hero-heart {
    position: relative;
    display: grid;
    width: 82%;
    aspect-ratio: 1;
    place-items: center;
    color: #fff;
    filter: drop-shadow(0 35px 55px rgba(174,46,92,.28));
    animation: heroHeart 4s ease-in-out infinite;
}

.hero-heart svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-heart span {
    position: relative;
    z-index: 2;
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2.6rem);
    line-height: 1.05;
    text-align: center;
    transform: translateY(-3%);
}

.orbit {
    position: absolute;
    display: grid;
    width: 52px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid rgba(201,64,113,.17);
    border-radius: 50%;
    color: var(--rose);
    background: rgba(255,255,255,.7);
    box-shadow: 0 15px 35px rgba(117,34,68,.12);
    animation: orbitFloat 5s ease-in-out infinite;
}

.orbit-one { top: 4%; right: 8%; }
.orbit-two { right: -2%; bottom: 20%; animation-delay: -2s; }
.orbit-three { left: 2%; bottom: 8%; animation-delay: -3.4s; }

.scroll-invitation {
    position: absolute;
    bottom: max(30px, var(--safe-bottom));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 13px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-decoration: none;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.scroll-invitation i {
    display: block;
    width: 1px;
    height: 36px;
    background: var(--rose);
    animation: scrollHint 1.8s ease-in-out infinite;
}

.reasons-scene { width: 100%; max-width: none; background: rgba(255,255,255,.45); }
.reasons-scene > * { width: min(100%, 1120px); margin-inline: auto; }

.reason-orbit {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.reason-card {
    position: relative;
    display: flex;
    min-height: 230px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 22px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 28px;
    color: var(--ink);
    background: linear-gradient(145deg, rgba(255,255,255,.78), rgba(255,229,239,.62));
    box-shadow: 0 18px 44px rgba(121,35,70,.09);
    cursor: pointer;
    transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, background .35s ease;
}

.reason-card::before {
    position: absolute;
    width: 110px;
    aspect-ratio: 1;
    content: '';
    border-radius: 50%;
    background: radial-gradient(circle, rgba(246,117,166,.24), transparent 70%);
    transform: scale(0);
    transition: transform .5s ease;
}

.reason-card:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: var(--shadow); }
.reason-card[aria-expanded="true"] { color: #fff; background: linear-gradient(145deg, #e65b90, #ad2258); }
.reason-card[aria-expanded="true"]::before { transform: scale(3.5); }

.reason-icon,
.reason-title,
.reason-message,
.reason-tap { position: relative; z-index: 1; }

.reason-icon { color: var(--rose); font-family: var(--serif); font-size: 2rem; }
.reason-title { margin-top: 13px; font-family: var(--serif); font-size: 1.3rem; }
.reason-message { display: none; margin-top: 12px; font-size: .86rem; line-height: 1.55; }
.reason-tap { margin-top: 14px; color: var(--muted); font-size: .56rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.reason-card[aria-expanded="true"] .reason-icon { color: #ffe8f1; }
.reason-card[aria-expanded="true"] .reason-message { display: block; animation: softEntrance .45s ease both; }
.reason-card[aria-expanded="true"] .reason-tap { display: none; }

.tiny-status {
    margin-top: 28px !important;
    color: var(--muted);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.memory-scene { padding-inline: 20px; }

.memory-deck {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(18px, 3vw, 34px);
    align-items: start;
}

.polaroid {
    padding: 10px 10px 20px;
    border: 1px solid rgba(102,39,63,.08);
    background: #fffdfb;
    box-shadow: 0 20px 55px rgba(87, 28, 51, .15);
    transform: rotate(var(--tilt));
    transition: transform .35s ease, box-shadow .35s ease;
}

.polaroid:nth-child(even) { margin-top: 48px; }
.polaroid:hover { z-index: 2; transform: rotate(0) translateY(-8px) scale(1.02); box-shadow: 0 30px 70px rgba(87,28,51,.2); }

.memory-photo {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #f7dce6;
    cursor: zoom-in;
}

.memory-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.memory-photo:hover img { transform: scale(1.04); }

.photo-fallback {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background:
        linear-gradient(135deg, rgba(255,255,255,.4), transparent),
        repeating-linear-gradient(45deg, #ffe8f0, #ffe8f0 12px, #fff1f5 12px, #fff1f5 24px);
}

.memory-photo.is-missing .photo-fallback { display: flex; }
.memory-photo.is-missing img { display: none; }
.photo-fallback i { color: var(--rose); font-size: 2.7rem; font-style: normal; }
.photo-fallback b { margin-top: 8px; font-family: var(--serif); font-size: 1.15rem; }
.photo-fallback small { margin-top: 4px; font-size: .58rem; }

.memory-number {
    position: absolute;
    top: 10px;
    right: 10px;
    display: grid;
    width: 34px;
    aspect-ratio: 1;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(73,21,45,.48);
    font-size: .64rem;
    font-weight: 800;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.polaroid-copy { padding: 16px 8px 0; }
.polaroid-copy p { margin: 0; color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.polaroid-copy h3 { margin: 5px 0 10px; font-family: var(--serif); font-size: 1.25rem; line-height: 1.15; }
.polaroid-copy span { display: block; color: var(--rose-dark); font-family: var(--script); font-size: .8rem; transform: rotate(-2deg); }

.timeline-scene { max-width: 980px; }

.timeline {
    position: relative;
    width: min(100%, 780px);
    margin-inline: auto;
}

.timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    content: '';
    background: linear-gradient(transparent, var(--pink) 7%, var(--rose) 50%, var(--pink) 93%, transparent);
}

.timeline-item {
    position: relative;
    display: flex;
    width: 50%;
    padding: 0 48px 55px 0;
    justify-content: flex-end;
}

.timeline-item:nth-child(even) { margin-left: 50%; padding: 0 0 55px 48px; justify-content: flex-start; }

.timeline-dot {
    position: absolute;
    z-index: 2;
    top: 25px;
    right: -18px;
    display: grid;
    width: 36px;
    aspect-ratio: 1;
    place-items: center;
    border: 6px solid var(--cream);
    border-radius: 50%;
    color: #fff;
    background: var(--rose);
    box-shadow: 0 5px 18px rgba(198,43,100,.23);
    font-size: .55rem;
}

.timeline-item:nth-child(even) .timeline-dot { right: auto; left: -18px; }

.timeline-card {
    width: 100%;
    padding: 24px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 22px;
    background: rgba(255,255,255,.62);
    box-shadow: 0 13px 35px rgba(91,29,56,.08);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.timeline-card p { margin: 0 0 7px; color: var(--rose-dark); font-size: .62rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.timeline-card h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; }
.timeline-card span { color: var(--muted); font-size: .86rem; }

.choice-scene { width: 100%; max-width: none; place-items: center; background: linear-gradient(135deg, #fadbe8, #fff9f6 60%, #fce4ec); }

.choice-card {
    position: relative;
    width: min(100%, 780px);
    margin-inline: auto;
    padding: clamp(34px, 6vw, 76px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.92);
    border-radius: clamp(28px, 5vw, 54px);
    background: rgba(255,255,255,.7);
    box-shadow: 0 35px 100px rgba(104,33,61,.13);
    text-align: center;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.choice-decoration {
    position: absolute;
    top: -68px;
    right: -18px;
    color: rgba(217,70,125,.07);
    font-family: var(--serif);
    font-size: 16rem;
    line-height: 1;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.button {
    position: relative;
    display: inline-flex;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .84rem;
    font-weight: 850;
    letter-spacing: .03em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .24s ease, box-shadow .24s ease, background .24s ease;
}

.button:hover { transform: translateY(-3px); }
.button:active { transform: translateY(0) scale(.98); }
.button-primary { color: #fff; background: linear-gradient(135deg, #e8588e, #b9255d); box-shadow: 0 14px 35px rgba(185,37,93,.25); }
.button-soft { border-color: var(--border); color: var(--rose-dark); background: rgba(255,255,255,.8); }

.choice-reply {
    min-height: 1.8em;
    margin: 22px 0 0;
    color: var(--rose-dark);
    font-family: var(--serif);
    font-size: 1.05rem;
    font-style: italic;
}

.chat-scene { max-width: 970px; }

.phone-shell {
    width: min(100%, 430px);
    min-height: 650px;
    margin-inline: auto;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 48px;
    background: #39152a;
    box-shadow: 0 40px 90px rgba(51,11,31,.28), inset 0 0 0 2px rgba(255,255,255,.07);
}

.phone-top { display: flex; height: 22px; justify-content: center; }
.phone-top i { width: 92px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.22); }

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 30px 30px 14px 14px;
    color: #fff;
    background: rgba(255,255,255,.08);
}

.chat-avatar { display: grid; width: 42px; aspect-ratio: 1; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #f582ad, #ca2c67); font-family: var(--serif); font-weight: 700; }
.chat-header div { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.chat-header strong { font-family: var(--serif); font-size: .95rem; }
.chat-header small { color: rgba(255,255,255,.55); font-size: .62rem; }
.online-dot { width: 8px; aspect-ratio: 1; border-radius: 50%; background: #7ce4b1; box-shadow: 0 0 0 4px rgba(124,228,177,.12); }

.chat-messages {
    display: flex;
    min-height: 560px;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 22px 13px 28px;
    overflow: hidden;
    border-radius: 0 0 36px 36px;
    background:
        radial-gradient(circle at 20% 10%, rgba(242,110,162,.09), transparent 25%),
        #25101f;
}

.chat-bubble {
    display: flex;
    max-width: 82%;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 18px;
    animation: bubbleIn .45s cubic-bezier(.22,1,.36,1) both;
}

.chat-bubble.mine { align-self: flex-end; border-bottom-right-radius: 5px; color: #fff; background: linear-gradient(135deg, #dc4b84, #ac2358); }
.chat-bubble.hers { align-self: flex-start; border-bottom-left-radius: 5px; color: #492337; background: #fff1f6; }
.chat-bubble small { margin-bottom: 2px; font-size: .54rem; font-weight: 800; opacity: .62; }
.chat-bubble span { font-size: .92rem; }

.typing-bubble { display: flex; align-self: flex-start; gap: 4px; padding: 13px 17px; border-radius: 18px 18px 18px 5px; background: rgba(255,255,255,.13); }
.typing-bubble i { display: block; width: 6px; aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.62); animation: typing .8s ease-in-out infinite alternate; }
.typing-bubble i:nth-child(2) { animation-delay: -.25s; }
.typing-bubble i:nth-child(3) { animation-delay: -.5s; }

.heartbeat-scene {
    display: grid;
    min-height: 105svh;
    place-items: center;
    align-content: center;
    color: #fff2f7;
    background:
        radial-gradient(circle at 50% 45%, rgba(223,66,126,.15), transparent 24%),
        linear-gradient(160deg, #180912, #321020 60%, #170810);
}

.heartbeat-visual {
    position: relative;
    display: grid;
    width: 150px;
    aspect-ratio: 1;
    place-items: center;
    margin-bottom: 38px;
}

.heartbeat-visual span { color: #ea4e86; font-size: 5.3rem; filter: drop-shadow(0 0 24px rgba(234,78,134,.5)); animation: heartbeat 1.25s ease-in-out infinite; }
.heartbeat-visual i { position: absolute; width: 100%; aspect-ratio: 1; border: 1px solid rgba(238,85,142,.3); border-radius: 50%; animation: heartRing 1.25s ease-out infinite; }
.heartbeat-copy { width: min(90%, 720px); text-align: center; }
.heartbeat-copy > p { color: rgba(255,226,238,.68); font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.3rem); }
.heartbeat-copy h2 { margin: 10px 0; color: #fff; font-size: clamp(3.2rem, 8vw, 7rem); }

.letter-scene { max-width: 900px; justify-items: center; }

.envelope {
    position: relative;
    width: min(78vw, 430px);
    aspect-ratio: 1.5;
    padding: 0;
    border: 0;
    background: transparent;
    filter: drop-shadow(0 28px 34px rgba(97,28,56,.19));
    cursor: pointer;
    perspective: 900px;
}

.envelope-back,
.envelope-front,
.envelope-flap,
.envelope-paper-preview { position: absolute; inset: 0; }
.envelope-back { border-radius: 12px; background: #f2a8bf; }
.envelope-paper-preview { top: 11%; left: 9%; z-index: 1; display: grid; width: 82%; height: 74%; place-items: center; border-radius: 5px; color: var(--rose-dark); background: #fffdf8; font-family: var(--script); font-size: 1.6rem; transition: transform .75s cubic-bezier(.22,1,.36,1); }
.envelope-front { z-index: 2; clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%); border-radius: 11px; background: linear-gradient(145deg, #f7b7cc, #de789f); }
.envelope-flap { z-index: 3; clip-path: polygon(0 0, 100% 0, 50% 58%); border-radius: 11px; background: linear-gradient(160deg, #ffd4e1, #ef96b6); transform-origin: top; transition: transform .7s ease, z-index 0s .35s; }
.wax-seal { position: absolute; z-index: 4; top: 49%; left: 50%; display: grid; width: 48px; aspect-ratio: 1; place-items: center; border: 4px double rgba(255,255,255,.4); border-radius: 50%; color: #ffdce8; background: #b9235b; font-family: var(--serif); transform: translate(-50%, -50%); transition: opacity .25s ease; }
.envelope.is-open .envelope-flap { z-index: 0; transform: rotateX(180deg); }
.envelope.is-open .envelope-paper-preview { transform: translateY(-54%); }
.envelope.is-open .wax-seal { opacity: 0; }

.letter-paper {
    width: min(100%, 720px);
    margin-top: 72px;
    padding: clamp(30px, 6vw, 70px);
    border: 1px solid rgba(129,53,82,.1);
    background:
        linear-gradient(90deg, transparent 94%, rgba(218,77,127,.06) 94%),
        #fffdf8;
    background-size: 26px 100%;
    box-shadow: var(--shadow);
    animation: paperReveal .9s cubic-bezier(.22,1,.36,1) both;
}

.letter-paper h3 { margin: 0 0 28px; font-family: var(--script); color: var(--rose-dark); font-size: clamp(1.8rem, 4vw, 2.5rem); }
.letter-paper p { color: #614052; font-family: var(--serif); font-size: clamp(1.05rem, 1.8vw, 1.23rem); line-height: 1.8; }
.letter-signoff { margin-top: 35px; }
.letter-signoff span { color: var(--rose-dark); font-family: var(--script); font-size: 2rem; }
.letter-paper .button { margin-top: 18px; }

.proposal-scene {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: clamp(100px, 14vw, 160px) 20px;
    color: #fff;
    background: radial-gradient(circle at 50% 42%, #5b1737 0, #2a0b20 38%, #10060e 78%);
}

.proposal-atmosphere { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.proposal-glow { position: absolute; top: 50%; left: 50%; width: min(95vw, 850px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(233,70,130,.17), transparent 64%); transform: translate(-50%,-50%); animation: introPulse 3.5s ease-in-out infinite; }
.proposal-heart { position: absolute; top: 50%; left: 50%; color: rgba(232,67,129,.055); font-size: min(70vw, 700px); line-height: 1; transform: translate(-50%,-50%); }

.proposal-copy { position: relative; z-index: 2; width: min(100%, 940px); text-align: center; }
.proposal-lead { min-height: 150px; font-family: var(--serif); font-size: clamp(2.1rem, 6vw, 5.2rem); line-height: 1.12; text-wrap: balance; }
.proposal-lead span { display: block; animation: proposalLine 1s ease both; }
.proposal-question { animation: proposalQuestion 1.2s cubic-bezier(.22,1,.36,1) both; }
.proposal-question > p { margin: 0; color: #f1adc7; font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.proposal-question h2 { max-width: 900px; margin: 18px auto 10px; font-family: var(--serif); font-size: clamp(3.7rem, 10vw, 9rem); font-weight: 400; line-height: .92; letter-spacing: -.065em; text-shadow: 0 0 55px rgba(236,93,146,.2); text-wrap: balance; }
.proposal-question > span { display: block; color: #f1adc7; font-family: var(--script); font-size: 1.6rem; }
.proposal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px; margin-top: 42px; }
.button-yes { min-width: 185px; color: #8f1748; background: #fff5f8; box-shadow: 0 16px 50px rgba(255,189,214,.16); animation: yesGlow 1.8s ease-in-out infinite; }
.button-glass { border-color: rgba(255,255,255,.18); color: #ffeaf2; background: rgba(255,255,255,.08); }
.think-reply { min-height: 1.5em; margin: 24px 0 0; color: #f2b2ca; font-family: var(--serif); font-style: italic; }

.celebration-scene {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: clamp(90px, 12vw, 150px) 20px;
    overflow: hidden;
    color: var(--plum);
    background:
        radial-gradient(circle at 50% 35%, rgba(255,255,255,.92), transparent 30%),
        linear-gradient(135deg, #ffd8e7, #fff9f4 45%, #f5bfd3);
}

#confettiCanvas { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.celebration-card {
    position: relative;
    z-index: 2;
    width: min(100%, 880px);
    padding: clamp(40px, 7vw, 86px) clamp(24px, 6vw, 70px);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: clamp(30px, 5vw, 58px);
    background: rgba(255,255,255,.67);
    box-shadow: 0 40px 120px rgba(114,34,66,.18);
    text-align: center;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    animation: celebrationEntrance 1.2s cubic-bezier(.22,1,.36,1) both;
}

.celebration-crown { color: var(--gold); font-size: 1.4rem; letter-spacing: .45em; }
.celebration-card h2 { margin: 14px 0 6px; color: var(--rose-dark); font-family: var(--serif); font-size: clamp(3.2rem, 9vw, 7.8rem); font-weight: 400; line-height: .9; letter-spacing: -.055em; }
.celebration-card > p:not(.eyebrow):not(.screenshot-note) { color: var(--muted); font-family: var(--serif); font-size: 1.3rem; font-style: italic; }

.couple-lockup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    width: min(100%, 600px);
    margin: 32px auto;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(1.5rem, 4vw, 3rem);
}

.couple-lockup span:first-child { text-align: right; }
.couple-lockup span:last-of-type { text-align: left; }
.couple-lockup i { color: var(--rose); font-size: .85em; animation: heartbeat 1.2s ease-in-out infinite; }
.couple-lockup b { grid-column: 1/-1; color: var(--gold); font-size: 2rem; font-weight: 400; line-height: 1; }
.screenshot-note { color: var(--rose-dark); font-size: .88rem; }
.celebration-actions { margin-top: 28px; }
.button-glass-dark { border-color: var(--border); color: var(--rose-dark); background: rgba(255,255,255,.76); }

.gift-scene { max-width: 950px; place-items: center; text-align: center; }
.gift-box { width: 100%; }

.gift-present {
    position: relative;
    display: block;
    width: 230px;
    height: 230px;
    margin: 40px auto;
    border: 0;
    background: transparent;
    cursor: pointer;
    animation: giftFloat 3s ease-in-out infinite;
}

.gift-present b { position: absolute; right: 0; bottom: -15px; left: 0; color: var(--muted); font-size: .63rem; letter-spacing: .15em; text-transform: uppercase; }
.gift-lid { position: absolute; z-index: 2; top: 38px; left: 12px; width: 206px; height: 52px; border-radius: 8px; background: linear-gradient(145deg, #eb6597, #c12863); box-shadow: 0 12px 22px rgba(150,31,77,.18); transition: transform .8s cubic-bezier(.22,1,.36,1); }
.gift-body { position: absolute; bottom: 22px; left: 26px; width: 178px; height: 148px; border-radius: 6px 6px 18px 18px; background: linear-gradient(145deg, #f489b1, #d5477d); box-shadow: 0 28px 45px rgba(110,29,61,.2); }
.gift-lid::after,
.gift-body::after { position: absolute; top: 0; bottom: 0; left: 50%; width: 32px; content: ''; background: #f9d5a3; transform: translateX(-50%); }
.gift-lid i::before,
.gift-lid i::after { position: absolute; bottom: 46px; width: 80px; height: 52px; content: ''; border: 16px solid #efbd78; }
.gift-lid i::before { left: 25px; border-radius: 60% 15% 55% 15%; transform: rotate(25deg); }
.gift-lid i::after { right: 25px; border-radius: 15% 60% 15% 55%; transform: rotate(-25deg); }
.gift-present.is-open .gift-lid { transform: translate(-55px,-75px) rotate(-18deg); }
.gift-present.is-open { animation: none; }

.gift-contents { animation: softEntrance .9s ease both; }
.gift-message { max-width: 720px; margin: 20px auto 45px; color: var(--muted); font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.55rem); font-style: italic; }
.gift-media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.optional-media { min-width: 0; margin: 0; padding: 12px; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; background: rgba(255,255,255,.65); box-shadow: 0 18px 45px rgba(99,30,57,.1); }
.optional-media img,
.optional-media video { width: 100%; aspect-ratio: 4/5; border-radius: 16px; object-fit: cover; background: #f6dbe5; }
.optional-media figcaption,
.optional-media > span { display: block; padding: 10px 4px 4px; color: var(--rose-dark); font-family: var(--serif); font-size: 1rem; }
.media-player { display: flex; flex-direction: column; justify-content: center; }
.media-player audio { width: 100%; }
.optional-media.is-unavailable { display: none; }

.love-counter { display: flex; max-width: 650px; margin: 55px auto 18px; flex-direction: column; padding: 26px; border-block: 1px solid var(--border); }
.love-counter span { color: var(--rose-dark); font-family: var(--serif); font-size: 1.5rem; }
.love-counter small { margin: 5px 0 2px; color: var(--muted); text-transform: uppercase; letter-spacing: .13em; }
.love-counter strong { font-size: 1.05rem; }

.text-button {
    padding: 8px;
    border: 0;
    color: var(--rose-dark);
    background: transparent;
    font-size: .75rem;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: rgba(217,70,125,.3);
    text-underline-offset: 5px;
    cursor: pointer;
}

.restart-button { margin-top: 26px; }

.love-footer {
    padding: 70px 20px max(44px, var(--safe-bottom));
    color: var(--muted);
    background: rgba(255,255,255,.5);
    text-align: center;
}

.love-footer p { margin: 8px 0 2px; font-size: .82rem; }
.love-footer p span { color: var(--rose-dark); font-family: var(--script); font-size: 1rem; }
.love-footer small { font-size: .62rem; letter-spacing: .08em; }
.footer-heart { border: 0; color: var(--rose); background: transparent; font-size: 1.4rem; cursor: pointer; transition: transform .2s ease; }
.footer-heart:hover { transform: scale(1.25); }

.memory-dialog {
    width: min(calc(100% - 28px), 850px);
    max-height: calc(100svh - 30px);
    padding: 12px;
    overflow: auto;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 28px;
    color: var(--ink);
    background: rgba(255,250,248,.94);
    box-shadow: 0 40px 120px rgba(48,11,29,.4);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

.memory-dialog::backdrop { background: rgba(28,6,18,.72); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.memory-dialog[open] { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; animation: dialogIn .4s ease both; }
.memory-dialog img { width: 100%; height: 100%; min-height: 380px; border-radius: 18px; object-fit: cover; background: #f5dfe7; }
.memory-dialog > div { align-self: center; padding: 30px 24px 30px 0; }
.memory-dialog p:first-child { color: var(--rose-dark); font-size: .63rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.memory-dialog h2 { margin: 8px 0 14px; font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 400; line-height: 1; }
.memory-dialog p:last-child { color: var(--muted); }
.dialog-close { position: absolute; z-index: 2; top: 18px; right: 18px; display: grid; width: 42px; aspect-ratio: 1; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.85); font-size: 1.4rem; cursor: pointer; }

.toast {
    position: fixed;
    z-index: 10000;
    right: 18px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    max-width: min(360px, calc(100% - 36px));
    padding: 13px 18px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 16px;
    color: #fff;
    background: rgba(60,16,37,.92);
    box-shadow: 0 18px 40px rgba(46,9,27,.25);
    font-size: .84rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .25s ease, transform .25s ease;
}

.toast.is-visible { opacity: 1; transform: none; }

.touch-heart {
    position: fixed;
    z-index: 8000;
    color: var(--rose);
    pointer-events: none;
    animation: touchHeart .8s ease-out forwards;
}

.noscript {
    position: fixed;
    z-index: 11000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 30px;
    color: #fff;
    background: var(--night);
    text-align: center;
}

@keyframes orbFloat { to { transform: translate3d(8vw, 5vh, 0) scale(1.12); } }
@keyframes petalFall { to { transform: translate3d(var(--drift, 40px), 116vh, 0) rotate(600deg); } }
@keyframes starDrift { to { transform: translate3d(40px, 30px, 0); } }
@keyframes introPulse { 50% { opacity: .72; transform: translate(-50%,-50%) scale(1.07); } }
@keyframes softEntrance { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes musicBar { to { height: 15px; } }
@keyframes heroHeart { 50% { transform: translateY(-10px) scale(1.025); } }
@keyframes orbitFloat { 50% { transform: translateY(-12px) rotate(7deg); } }
@keyframes scrollHint { 50% { transform: translateY(8px); opacity: .45; } }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(12px) scale(.94); } }
@keyframes typing { to { transform: translateY(-5px); opacity: .35; } }
@keyframes heartbeat { 0%, 100% { transform: scale(.92); } 12% { transform: scale(1.08); } 24% { transform: scale(.96); } 36% { transform: scale(1.12); } 62% { transform: scale(.92); } }
@keyframes heartRing { from { opacity: .8; transform: scale(.45); } to { opacity: 0; transform: scale(1.5); } }
@keyframes paperReveal { from { opacity: 0; transform: translateY(50px) rotate(.7deg); } }
@keyframes proposalLine { from { opacity: 0; filter: blur(8px); transform: translateY(18px); } }
@keyframes proposalQuestion { from { opacity: 0; filter: blur(10px); transform: scale(.86); } }
@keyframes yesGlow { 50% { box-shadow: 0 18px 60px rgba(255,185,212,.4); transform: translateY(-2px) scale(1.025); } }
@keyframes celebrationEntrance { from { opacity: 0; transform: scale(.82) translateY(35px); } }
@keyframes giftFloat { 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
@keyframes touchHeart { to { opacity: 0; transform: translateY(-54px) rotate(15deg) scale(1.65); } }

@media (max-width: 900px) {
    .hero-scene { grid-template-columns: 1fr; align-content: center; text-align: center; }
    .hero-copy { order: 2; }
    .hero-heart-wrap { order: 1; width: min(57vw, 330px); }
    .hero-message { margin-inline: auto; }
    .hero-title-row { margin-inline: auto; }
    .signature { align-items: center; }
    .hero-ribbon { top: 13%; }
    .reason-orbit { grid-template-columns: repeat(2, 1fr); }
    .memory-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 700px; margin-inline: auto; }
    .gift-media-grid { grid-template-columns: 1fr; max-width: 540px; margin-inline: auto; }
    .optional-media img,
    .optional-media video { aspect-ratio: 16/10; }
}

@media (max-width: 600px) {
    .floating-header { width: calc(100% - 18px); padding: 7px 8px; }
    .music-label { display: none; }
    .pill-control { width: 42px; padding: 8px; justify-content: center; }
    .hero-scene { min-height: 100svh; padding: 105px 21px 90px; }
    .display-title { font-size: clamp(3.8rem, 20vw, 6.3rem); }
    .hero-title-row { gap: 11px; }
    .title-heart { width: 52px; font-size: 1.4rem; }
    .hero-ribbon { display: none; }
    .hero-heart-wrap { width: min(62vw, 270px); }
    .hero-message { font-size: 1.15rem; }
    .scroll-invitation { bottom: 18px; white-space: nowrap; }
    .reason-orbit { grid-template-columns: 1fr; gap: 12px; }
    .reason-card { min-height: 165px; }
    .memory-deck { gap: 14px; }
    .polaroid { padding: 7px 7px 14px; transform: rotate(var(--tilt)); }
    .polaroid:nth-child(even) { margin-top: 30px; }
    .polaroid-copy { padding: 10px 4px 0; }
    .polaroid-copy p { font-size: .48rem; }
    .polaroid-copy h3 { font-size: .95rem; }
    .photo-fallback b { font-size: .8rem; }
    .photo-fallback small { display: none; }
    .timeline::before { left: 17px; }
    .timeline-item,
    .timeline-item:nth-child(even) { width: 100%; margin-left: 0; padding: 0 0 25px 48px; justify-content: flex-start; }
    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot { top: 22px; right: auto; left: 0; }
    .timeline-card { padding: 20px; }
    .choice-card { padding: 44px 20px; }
    .choice-card .button { width: 100%; }
    .phone-shell { min-height: 590px; border-radius: 38px; }
    .chat-messages { min-height: 500px; }
    .letter-paper { margin-top: 55px; padding: 30px 22px; }
    .proposal-actions .button { width: min(100%, 330px); }
    .celebration-card { padding: 46px 20px; }
    .celebration-actions .button { width: 100%; }
    .couple-lockup { gap: 8px; }
    .memory-dialog[open] { display: block; }
    .memory-dialog img { height: min(48svh, 430px); min-height: 0; }
    .memory-dialog > div { padding: 18px 12px 22px; }
}

@media (hover: hover) and (pointer: fine) {
    body { cursor: default; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .petal-field,
    .intro-stars { display: none; }
    .reveal { opacity: 1; transform: none; }
}

@media (prefers-contrast: more) {
    :root { --muted: #673246; --border: rgba(91,23,51,.45); }
    .button-soft,
    .pill-control,
    .round-control { border-width: 2px; }
}
