:root {
    --ink: #06040d;
    --ink-soft: #0d0820;
    --ivory: #fffaf3;
    --muted: rgba(255, 250, 243, 0.62);
    --line: rgba(255, 255, 255, 0.13);
    --rose: #ff7198;
    --violet: #9a7cff;
    --gold: #ffd797;
    --cyan: #75e8ff;
    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "DM Sans", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background: var(--ink);
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--ink);
    color: var(--ivory);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

body.intro-active {
    height: 100vh;
    overflow: hidden;
}

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

button {
    color: inherit;
    font: inherit;
}

img,
video,
canvas {
    display: block;
}

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

.site-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 8%, rgba(79, 50, 122, 0.22), transparent 38%),
        linear-gradient(180deg, #07040f 0%, #0a0615 45%, #05030b 100%);
}

.aurora {
    position: absolute;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(95px);
    opacity: 0.16;
    mix-blend-mode: screen;
    will-change: transform;
}

.aurora-one {
    top: -25vw;
    left: -10vw;
    background: #b748e5;
    animation: auroraDriftOne 18s ease-in-out infinite alternate;
}

.aurora-two {
    top: 15vh;
    right: -27vw;
    background: #2de1d1;
    animation: auroraDriftTwo 22s ease-in-out infinite alternate;
}

.aurora-three {
    bottom: -26vw;
    left: 25vw;
    background: #ff4e8a;
    animation: auroraDriftOne 25s ease-in-out -8s infinite alternate;
}

#ambient-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

.film-grain {
    position: absolute;
    inset: -50%;
    opacity: 0.042;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
    animation: grainShift 0.25s steps(2) infinite;
}

#cursor-glow {
    position: fixed;
    z-index: 9999;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 125, 176, 0.1), transparent 67%);
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    transition: opacity 0.5s ease;
}

body:hover #cursor-glow {
    opacity: 1;
}

/* Opening film */
#cinematic-intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    overflow: hidden;
    background: #000;
    perspective: 1000px;
}

#warp-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.intro-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, transparent 22%, rgba(0, 0, 0, 0.2) 60%, rgba(0, 0, 0, 0.94) 118%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

.start-experience {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    width: 100%;
    height: 100%;
    padding: 24px;
    place-items: center;
    border: 0;
    background:
        radial-gradient(circle at center, rgba(135, 76, 195, 0.2), transparent 45%),
        rgba(0, 0, 5, 0.78);
    color: #fff;
    cursor: pointer;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

.start-experience > span {
    display: grid;
    gap: 10px;
    min-width: min(82vw, 290px);
    padding: 24px 32px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 42px rgba(169, 104, 255, 0.2);
    backdrop-filter: blur(12px);
}

.start-experience b {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.45rem, 5vw, 2rem);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.start-experience small {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.64rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.start-experience.is-starting > span {
    animation: startPulse 0.8s ease-in-out infinite alternate;
}

.start-experience.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.skip-intro {
    position: absolute;
    top: clamp(18px, 3vw, 34px);
    z-index: 20;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.68rem;
    transition: color 0.3s ease;
}

.skip-intro:hover {
    color: #fff;
}

.skip-intro {
    right: clamp(20px, 4vw, 54px);
}

.cosmic-title {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(90vw, 940px);
    text-align: center;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.84);
    filter: blur(14px);
    will-change: transform, opacity, filter;
}

.title-kicker,
.eyebrow {
    display: block;
    margin-bottom: 22px;
    color: var(--gold);
    font-size: clamp(0.64rem, 1vw, 0.78rem);
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.cosmic-title h1 {
    font-family: var(--serif);
    font-size: clamp(3.15rem, 8.5vw, 7.8rem);
    font-weight: 500;
    line-height: 0.82;
    letter-spacing: -0.04em;
    text-shadow:
        0 0 18px rgba(255, 255, 255, 0.58),
        0 0 65px rgba(176, 116, 255, 0.48),
        0 0 130px rgba(255, 76, 145, 0.28);
}

.cosmic-title h1 span {
    display: block;
    margin-top: 0.24em;
    color: var(--gold);
    font-family: "Great Vibes", cursive;
    font-size: 0.86em;
    letter-spacing: 0;
}

.cosmic-title h1 b {
    display: inline-block;
    font-family: var(--serif);
    font-size: 0.36em;
    font-weight: 400;
    vertical-align: top;
    animation: starPulse 1.6s ease-in-out infinite;
}

.title-flare {
    width: min(64vw, 570px);
    height: 1px;
    margin: 38px auto 0;
    transform: scaleX(0);
    background: linear-gradient(90deg, transparent, rgba(255, 238, 192, 0.95), transparent);
    box-shadow: 0 0 18px rgba(255, 215, 151, 0.75);
}

.gift-scene {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    width: min(90vw, 620px);
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transform: translate(-50%, -44%) scale(0.65);
    visibility: hidden;
}

.gift-kicker {
    margin-bottom: 38px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.gift-aura {
    position: absolute;
    top: 45%;
    left: 50%;
    width: 390px;
    height: 390px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 194, 222, 0.26), rgba(149, 95, 237, 0.08) 42%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: giftAura 2.2s ease-in-out infinite;
}

.gift-box {
    position: relative;
    width: 176px;
    height: 174px;
    border: 0;
    outline: 0;
    background: none;
    cursor: pointer;
    filter: drop-shadow(0 22px 26px rgba(0, 0, 0, 0.5));
    transform-style: preserve-3d;
    animation: giftFloat 2.6s ease-in-out infinite;
}

.gift-box:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 12px;
    border-radius: 8px;
}

.gift-shadow {
    position: absolute;
    bottom: -10px;
    left: 13px;
    width: 150px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    filter: blur(10px);
}

.gift-body,
.gift-lid {
    position: absolute;
    left: 50%;
    display: block;
    transform: translateX(-50%);
    background:
        linear-gradient(90deg, transparent 45%, #f7c36c 45%, #ffe0a2 55%, transparent 55%),
        linear-gradient(135deg, #8d215d, #c33078 50%, #821b58);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.12);
}

.gift-body {
    bottom: 0;
    width: 146px;
    height: 116px;
    border-radius: 3px 3px 13px 13px;
}

.gift-body i {
    position: absolute;
    top: 48%;
    left: 0;
    width: 100%;
    height: 13px;
    background: linear-gradient(90deg, #dca742, #ffe1a2, #d69c39);
}

.gift-lid {
    z-index: 3;
    top: 37px;
    width: 174px;
    height: 42px;
    border-radius: 7px;
    transform-origin: 12% 80%;
}

.gift-lid i {
    position: absolute;
    top: 0;
    left: 46%;
    width: 15%;
    height: 100%;
    background: linear-gradient(90deg, #d8a13e, #ffe3a8, #d7a03c);
}

.gift-bow {
    position: absolute;
    z-index: 2;
    top: 5px;
    width: 68px;
    height: 49px;
    border: 11px solid #f2c36e;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.35), 0 0 12px rgba(255, 198, 97, 0.2);
}

.gift-bow-left {
    left: 28px;
    border-radius: 70% 35% 65% 40%;
    transform: rotate(15deg);
}

.gift-bow-right {
    right: 28px;
    border-radius: 35% 70% 40% 65%;
    transform: rotate(-15deg);
}

.cinema-button {
    position: relative;
    z-index: 3;
    display: flex;
    margin-top: 46px;
    padding: 13px 13px 13px 25px;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(12px);
    cursor: pointer;
    font-size: 0.76rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    transition: border-color 0.35s ease, background 0.35s ease, transform 0.35s ease;
}

.cinema-button i {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--ivory);
    color: #170a18;
    font-size: 1rem;
    font-style: normal;
    transition: transform 0.35s ease;
}

.cinema-button:hover {
    border-color: rgba(255, 215, 151, 0.7);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.cinema-button:hover i {
    transform: rotate(-35deg);
}

.gift-spark {
    position: fixed;
    z-index: 1002;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    background: #fff3bd;
    box-shadow: 0 0 10px #ffd47e, 0 0 24px #ff6ca7;
}

/* Main film */
#main-content {
    position: relative;
    z-index: 2;
    display: none;
    opacity: 0;
    visibility: hidden;
}

.full-screen {
    position: relative;
    display: flex;
    min-height: 100svh;
    width: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cinematic-section {
    isolation: isolate;
}

#hero {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(500px, 1.08fr);
    gap: clamp(30px, 5vw, 86px);
    padding: 9vw;
    text-align: left;
}

#hero::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        radial-gradient(circle at 50% 46%, rgba(150, 95, 220, 0.2), transparent 30%),
        radial-gradient(circle at 50% 55%, rgba(255, 81, 138, 0.1), transparent 48%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
    grid-column: 2;
    grid-row: 1;
}

#tree-canvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: min(78svh, 780px);
    align-self: end;
    grid-column: 1;
    grid-row: 1;
    filter: drop-shadow(0 18px 36px rgba(255, 89, 147, 0.12));
    pointer-events: none;
}

.hero-title {
    font-family: var(--serif);
    font-size: clamp(3.2rem, 5.6vw, 6.6rem);
    font-weight: 500;
    line-height: 0.92;
    letter-spacing: -0.045em;
}

.hero-title span {
    color: transparent;
    background: linear-gradient(100deg, var(--gold), #fff7e8 47%, #ff9dc3 95%);
    background-clip: text;
    -webkit-background-clip: text;
}

.hero-subtitle {
    max-width: 680px;
    margin: 34px 0 0;
    color: rgba(255, 255, 255, 0.74);
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    line-height: 1.5;
}

.hero-wink {
    display: block;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.76rem;
}

#hero::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    opacity: 0;
    pointer-events: none;
}

.orbital-ring {
    position: absolute;
    border: 1px solid rgba(255, 215, 151, 0.13);
    border-radius: 50%;
    pointer-events: none;
}

.ring-one {
    width: min(86vw, 1000px);
    height: min(86vw, 1000px);
    transform: rotateX(70deg) rotateZ(-12deg);
    animation: orbitSpin 28s linear infinite;
}

.ring-two {
    width: min(60vw, 700px);
    height: min(60vw, 700px);
    transform: rotateX(67deg) rotateZ(26deg);
    animation: orbitSpin 22s linear reverse infinite;
}

.scroll-cue {
    position: absolute;
    bottom: clamp(24px, 4vw, 48px);
    left: 50%;
    z-index: 3;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 13px;
    color: rgba(255, 255, 255, 0.48);
    text-decoration: none;
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.scroll-cue i {
    position: relative;
    width: 1px;
    height: 42px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.17);
}

.scroll-cue i::after {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 70%;
    content: "";
    background: var(--gold);
    animation: scrollLine 1.8s ease-in-out infinite;
}

/* Memories */
#timeline {
    position: relative;
    padding: clamp(100px, 13vw, 190px) clamp(22px, 7vw, 110px);
}

.section-heading {
    max-width: 850px;
    margin: 0 auto clamp(80px, 12vw, 150px);
    text-align: center;
}

.section-heading h2 {
    font-family: var(--serif);
    font-size: clamp(3rem, 7vw, 6.8rem);
    font-weight: 500;
    line-height: 0.88;
    letter-spacing: -0.04em;
}

.section-heading h2 em {
    color: var(--gold);
    font-family: "Great Vibes", cursive;
    font-weight: 400;
}

.timeline-track {
    position: absolute;
    top: 400px;
    bottom: 240px;
    left: 50%;
    width: 1px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-track span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, var(--gold) 12%, var(--rose) 76%, transparent);
    transform: scaleY(0);
    transform-origin: top;
}

.memory-card {
    position: relative;
    display: grid;
    width: min(100%, 1050px);
    min-height: 720px;
    margin: 0 auto clamp(90px, 15vw, 230px);
    align-items: center;
    grid-template-columns: minmax(260px, 0.9fr) minmax(250px, 0.7fr);
    gap: clamp(40px, 7vw, 110px);
}

.memory-right {
    direction: rtl;
}

.memory-right > * {
    direction: ltr;
}

.memory-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4.25;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    background: #15101c;
    box-shadow: 0 45px 90px rgba(0, 0, 0, 0.4);
}

.memory-image::after {
    position: absolute;
    inset: 0;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.memory-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.04);
    transition: transform 1.15s cubic-bezier(0.2, 0.75, 0.3, 1), filter 0.8s ease;
}

.memory-image:hover img {
    filter: saturate(1.08) contrast(1.03);
    transform: scale(1.07);
}

.image-shine {
    position: absolute;
    z-index: 2;
    top: -20%;
    left: -80%;
    width: 40%;
    height: 140%;
    opacity: 0.3;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    pointer-events: none;
    transform: rotate(16deg);
    transition: left 1s cubic-bezier(0.25, 1, 0.5, 1);
}

.memory-image:hover .image-shine {
    left: 130%;
}

.memory-copy {
    position: relative;
    padding-left: clamp(20px, 4vw, 54px);
    border-left: 1px solid var(--line);
}

.memory-number {
    display: block;
    margin-bottom: 42px;
    color: rgba(255, 255, 255, 0.08);
    font-family: var(--serif);
    font-size: clamp(5rem, 10vw, 9rem);
    line-height: 0.5;
}

.memory-copy p {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.43);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.memory-copy h3 {
    color: var(--gold);
    font-family: var(--serif);
    font-size: clamp(2rem, 3.4vw, 3.4rem);
    font-weight: 500;
}

/* Films */
#gallery {
    position: relative;
    padding: clamp(100px, 13vw, 190px) clamp(16px, 5vw, 78px) clamp(150px, 16vw, 250px);
}

#gallery::before {
    position: absolute;
    inset: 10% 0;
    content: "";
    background: radial-gradient(ellipse at center, rgba(96, 49, 133, 0.2), transparent 66%);
    pointer-events: none;
}

.gallery-heading {
    position: relative;
    z-index: 2;
}

.section-note {
    margin-top: 28px;
    color: rgba(255, 255, 255, 0.44);
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.film-grid {
    position: relative;
    z-index: 2;
    display: grid;
    max-width: 1380px;
    margin: 0 auto;
    align-items: start;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(12px, 2vw, 30px);
}

.film-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 9 / 16;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: clamp(12px, 1.5vw, 22px);
    background: #0f0b15;
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.38);
    transform: translateZ(0);
}

.film-card:nth-child(even) {
    margin-top: clamp(40px, 7vw, 110px);
}

.film-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.78) brightness(0.78);
    transition: transform 1.1s cubic-bezier(0.2, 0.75, 0.3, 1), filter 0.8s ease;
}

.film-card:hover video,
.film-card.is-playing video {
    filter: saturate(1) brightness(0.92);
    transform: scale(1.045);
}

.film-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 18px;
    align-items: flex-end;
    justify-content: space-between;
    background: linear-gradient(180deg, transparent 58%, rgba(4, 2, 8, 0.84));
    pointer-events: none;
}

.film-overlay span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.film-overlay b {
    color: var(--gold);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 500;
}

/* Interactive wish cake */
#interactive-cake {
    min-height: 112svh;
    padding: clamp(100px, 11vw, 160px) 24px;
    background:
        radial-gradient(circle at 50% 64%, rgba(255, 113, 152, 0.14), transparent 28%),
        radial-gradient(circle at 28% 25%, rgba(154, 124, 255, 0.1), transparent 34%);
}

.cake-experience,
.secret-experience {
    position: relative;
    z-index: 3;
    width: min(100%, 1180px);
}

.experience-heading {
    margin-bottom: clamp(42px, 6vw, 74px);
}

.cake-stage {
    position: relative;
    display: flex;
    width: min(100%, 660px);
    min-height: 480px;
    margin: 0 auto;
    padding: 42px 24px 24px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 34px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
        rgba(8, 5, 17, 0.42);
    box-shadow: 0 40px 110px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
}

.cake-glow {
    position: absolute;
    top: 12%;
    left: 50%;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 151, 0.18), rgba(255, 113, 152, 0.08) 40%, transparent 70%);
    transform: translateX(-50%);
    animation: cakeGlowPulse 2.8s ease-in-out infinite;
}

.celebration-cake {
    position: relative;
    width: min(100%, 390px);
    height: 330px;
    filter: drop-shadow(0 30px 36px rgba(0, 0, 0, 0.38));
}

.cake-plate {
    position: absolute;
    bottom: 18px;
    left: 50%;
    width: 380px;
    max-width: 96%;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: linear-gradient(180deg, #f8e7da, #8c7891 48%, #342a40);
    box-shadow: 0 13px 20px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%);
}

.cake-tier {
    position: absolute;
    left: 50%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 8px),
        linear-gradient(110deg, #711445, #be326f 52%, #5f123e);
    box-shadow: inset -24px -12px 35px rgba(33, 4, 27, 0.34), inset 18px 5px 28px rgba(255, 255, 255, 0.08);
    transform: translateX(-50%);
}

.cake-tier-bottom {
    bottom: 40px;
    width: 330px;
    max-width: 86%;
    height: 104px;
    border-radius: 15px 15px 24px 24px;
}

.cake-tier-top {
    bottom: 138px;
    width: 238px;
    max-width: 64%;
    height: 86px;
    border-radius: 14px 14px 8px 8px;
}

.cake-icing {
    position: absolute;
    top: -2px;
    left: -1%;
    width: 102%;
    height: 24px;
    border-radius: 13px 13px 45% 45%;
    background: linear-gradient(90deg, #ffe6ca, #fff8e9 45%, #f5b9c9);
    box-shadow: 0 5px 10px rgba(61, 9, 40, 0.18);
}

.cake-icing::before,
.cake-icing::after {
    position: absolute;
    top: 13px;
    width: 30px;
    height: 23px;
    border-radius: 0 0 50% 50%;
    content: "";
    background: #ffe4d0;
}

.cake-icing::before {
    left: 19%;
}

.cake-icing::after {
    right: 24%;
    height: 31px;
}

.cake-sprinkle {
    position: absolute;
    width: 12px;
    height: 3px;
    border-radius: 20px;
    background: var(--gold);
    box-shadow: 0 0 6px currentColor;
}

.sprinkle-one { top: 45px; left: 15%; color: var(--cyan); transform: rotate(25deg); }
.sprinkle-two { top: 66px; left: 33%; color: var(--gold); transform: rotate(-18deg); }
.sprinkle-three { top: 48px; left: 51%; color: var(--violet); transform: rotate(42deg); }
.sprinkle-four { top: 72px; left: 68%; color: var(--cyan); transform: rotate(-34deg); }
.sprinkle-five { top: 48px; left: 84%; color: var(--rose); transform: rotate(18deg); }

.cake-candle {
    position: absolute;
    z-index: 7;
    bottom: 218px;
    left: 50%;
    width: 54px;
    height: 112px;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: pointer;
    transform: translateX(-50%);
}

.cake-candle:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 6px;
    border-radius: 30px;
}

.candle-body {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 18px;
    height: 72px;
    border-radius: 5px 5px 2px 2px;
    background: repeating-linear-gradient(135deg, #fff3d7 0 7px, #ff7198 7px 13px);
    box-shadow: inset 3px 0 5px rgba(255, 255, 255, 0.45), 0 5px 10px rgba(0, 0, 0, 0.26);
    transform: translateX(-50%);
}

.candle-wick {
    position: absolute;
    z-index: 2;
    bottom: 70px;
    left: 50%;
    width: 2px;
    height: 12px;
    border-radius: 2px;
    background: #312321;
    transform: translateX(-50%);
}

.cake-flame {
    position: absolute;
    z-index: 3;
    bottom: 80px;
    left: 50%;
    width: 24px;
    height: 37px;
    border-radius: 55% 45% 52% 48% / 68% 68% 32% 32%;
    background: radial-gradient(circle at 50% 72%, #fffbd9 0 12%, #ffd45f 27%, #ff7b35 62%, rgba(255, 71, 110, 0.55) 78%, transparent 80%);
    box-shadow: 0 0 12px #fff0ad, 0 0 30px rgba(255, 172, 57, 0.9), 0 0 60px rgba(255, 91, 145, 0.48);
    transform: translateX(-50%);
    transform-origin: 50% 100%;
    animation: candleFlicker 0.9s ease-in-out infinite alternate;
    transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cake-candle.is-out {
    cursor: default;
}

.cake-candle.is-out .cake-flame {
    opacity: 0;
    filter: blur(8px);
    transform: translateX(-50%) translateY(-20px) scale(0.12);
    animation: none;
}

.cake-status {
    position: relative;
    z-index: 3;
    margin-top: -2px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-align: center;
    text-transform: uppercase;
    transition: color 0.5s ease;
}

.cake-status.wish-sent {
    color: var(--gold);
}

.cake-orbit {
    position: absolute;
    width: min(84vw, 970px);
    height: min(32vw, 370px);
    border: 1px solid rgba(255, 215, 151, 0.09);
    border-radius: 50%;
    pointer-events: none;
}

.cake-orbit-one {
    transform: rotate(-8deg);
}

.cake-orbit-two {
    transform: rotate(13deg) scale(0.72);
}

/* Secret balloon prank */
#secret-surprise {
    min-height: 125svh;
    padding: clamp(110px, 12vw, 180px) 24px;
    background:
        radial-gradient(circle at 50% 58%, rgba(117, 232, 255, 0.08), transparent 28%),
        radial-gradient(circle at 52% 50%, rgba(154, 124, 255, 0.12), transparent 50%);
}

.secret-radial {
    position: absolute;
    width: min(88vw, 1100px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 70px, rgba(255, 255, 255, 0.022) 71px 72px);
    animation: secretRotate 45s linear infinite;
}

.secret-stage {
    position: relative;
    width: min(100%, 980px);
    height: 650px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 38px;
    background:
        radial-gradient(circle at 50% 55%, rgba(255, 215, 151, 0.12), transparent 27%),
        linear-gradient(150deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
    box-shadow: 0 42px 110px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
}

.balloon-field {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.prank-balloon {
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: 66px;
    height: 112px;
    border: 0;
    outline: 0;
    background: transparent;
    cursor: crosshair;
    transform: scale(var(--size)) rotate(var(--swing));
    transform-origin: 50% 10%;
    animation: balloonFloat 4.8s ease-in-out var(--delay) infinite;
    transition: opacity 0.12s ease, filter 0.12s ease, transform 0.12s ease;
}

.prank-balloon:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 4px;
    border-radius: 50%;
}

.prank-balloon > span {
    position: absolute;
    top: 0;
    left: 3px;
    width: 60px;
    height: 78px;
    border-radius: 50% 50% 46% 46%;
    background:
        radial-gradient(circle at 31% 24%, rgba(255, 255, 255, 0.74) 0 5%, rgba(255, 255, 255, 0.2) 6%, transparent 18%),
        linear-gradient(135deg, color-mix(in srgb, var(--balloon) 76%, white), var(--balloon) 46%, color-mix(in srgb, var(--balloon) 75%, black));
    box-shadow: inset -10px -12px 18px rgba(31, 4, 30, 0.18), 0 10px 23px color-mix(in srgb, var(--balloon) 28%, transparent);
}

.prank-balloon > span::before {
    position: absolute;
    bottom: -7px;
    left: 50%;
    width: 12px;
    height: 11px;
    content: "";
    background: var(--balloon);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    transform: translateX(-50%);
}

.prank-balloon > span::after {
    position: absolute;
    top: 84px;
    left: 50%;
    width: 1px;
    height: 29px;
    content: "";
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent);
    transform: translateX(-50%) rotate(calc(var(--swing) * -0.35));
    transform-origin: top;
}

.prank-balloon.is-popped {
    opacity: 0;
    filter: brightness(2) blur(4px);
    pointer-events: none;
    transform: scale(1.75) rotate(18deg);
    animation: none;
}

.mystery-gift {
    --gift-scale: 1;
    position: absolute;
    bottom: 102px;
    left: 50%;
    z-index: 2;
    width: 230px;
    height: 245px;
    filter: drop-shadow(0 32px 35px rgba(0, 0, 0, 0.44));
    transform: translateX(-50%) scale(var(--gift-scale));
    animation: mysteryGiftFloat 3s ease-in-out infinite;
}

.mystery-box,
.mystery-lid {
    position: absolute;
    left: 50%;
    display: block;
    background:
        linear-gradient(90deg, transparent 43%, #ffd797 43% 57%, transparent 57%),
        linear-gradient(135deg, #6850b7, #9a7cff 48%, #512d8b);
    transform: translateX(-50%);
}

.mystery-box {
    bottom: 0;
    width: 190px;
    height: 164px;
    border-radius: 4px 4px 20px 20px;
    box-shadow: inset -20px -20px 34px rgba(32, 14, 66, 0.25), inset 12px 8px 22px rgba(255, 255, 255, 0.1);
}

.mystery-lid {
    z-index: 3;
    top: 58px;
    width: 220px;
    height: 51px;
    border-radius: 9px;
}

.mystery-bow {
    position: absolute;
    z-index: 2;
    top: 5px;
    width: 83px;
    height: 63px;
    border: 13px solid var(--gold);
}

.mystery-bow-left {
    left: 29px;
    border-radius: 75% 35% 70% 42%;
    transform: rotate(14deg);
}

.mystery-bow-right {
    right: 29px;
    border-radius: 35% 75% 42% 70%;
    transform: rotate(-14deg);
}

.mystery-question {
    position: absolute;
    z-index: 5;
    top: 118px;
    left: 50%;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--serif);
    font-size: 4.2rem;
    line-height: 1;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.35);
    transform: translateX(-50%);
}

.balloon-counter {
    position: absolute;
    bottom: 35px;
    left: 50%;
    z-index: 6;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    transform: translateX(-50%);
    white-space: nowrap;
}

.balloon-counter span {
    color: var(--gold);
}

.prank-loader[hidden] {
    display: none;
}

.prank-loader {
    display: flex;
    width: min(92vw, 680px);
    min-height: 430px;
    margin: 0 auto;
    padding: 60px 30px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.38);
    text-align: center;
    backdrop-filter: blur(15px);
}

.prank-loader p {
    margin-top: 38px;
    color: var(--ivory);
    font-family: var(--serif);
    font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.prank-loader small {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.33);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.infinite-loader {
    position: relative;
    width: 98px;
    height: 48px;
}

.infinite-loader::before,
.infinite-loader::after {
    position: absolute;
    top: 2px;
    width: 42px;
    height: 42px;
    border: 3px solid transparent;
    border-top-color: var(--gold);
    border-right-color: var(--rose);
    border-radius: 50%;
    content: "";
    animation: infiniteLoopLeft 1.35s linear infinite;
}

.infinite-loader::before {
    left: 10px;
}

.infinite-loader::after {
    right: 10px;
    animation-name: infiniteLoopRight;
}

.infinite-loader span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ivory);
    box-shadow: 0 0 12px var(--gold);
    transform: translate(-50%, -50%);
    animation: loaderBlink 0.9s ease-in-out infinite alternate;
}

.infinite-loader span:nth-child(2) {
    margin-left: -13px;
    animation-delay: -0.3s;
}

.infinite-loader span:nth-child(3) {
    margin-left: 13px;
    animation-delay: -0.6s;
}

/* Finale */
#final-surprise {
    min-height: 115svh;
    padding: 100px 24px;
    background:
        radial-gradient(ellipse at 50% 77%, rgba(255, 76, 137, 0.2), transparent 28%),
        radial-gradient(ellipse at center, rgba(83, 45, 137, 0.16), transparent 56%);
    text-align: center;
}

#fireworks-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.final-horizon {
    position: absolute;
    bottom: 16%;
    left: 50%;
    width: 72vw;
    height: 1px;
    opacity: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 151, 0.8), transparent);
    box-shadow: 0 0 28px rgba(255, 120, 171, 0.7);
    transform: translateX(-50%) scaleX(0.2);
}

.final-content {
    position: relative;
    z-index: 3;
    max-width: 1000px;
}

.final-content h2 {
    font-family: var(--serif);
    font-size: clamp(3.4rem, 8vw, 7.8rem);
    font-weight: 500;
    line-height: 0.76;
    letter-spacing: -0.04em;
}

.final-content h2 span {
    color: var(--gold);
}

.final-content h2 em {
    display: inline-block;
    margin-top: 0.16em;
    color: #ff91b5;
    font-family: "Great Vibes", cursive;
    font-weight: 400;
}

.final-content h2 b {
    color: var(--rose);
    font-family: var(--serif);
    font-size: 0.33em;
    font-weight: 400;
    vertical-align: top;
    text-shadow: 0 0 18px rgba(255, 81, 139, 0.7);
}

.final-content > p:not(.eyebrow) {
    max-width: 620px;
    margin: 42px auto 0;
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--serif);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.final-signature {
    margin-top: 35px;
    color: rgba(255, 255, 255, 0.34);
    font-size: 0.68rem;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.rotate-notice {
    display: none;
}

@keyframes auroraDriftOne {
    to { transform: translate(14vw, 10vh) scale(1.14); }
}

@keyframes auroraDriftTwo {
    to { transform: translate(-13vw, 16vh) scale(0.86); }
}

@keyframes grainShift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2%, -1%); }
    50% { transform: translate(-1%, 2%); }
    75% { transform: translate(1%, 1%); }
    100% { transform: translate(-2%, -1%); }
}

@keyframes starPulse {
    50% { opacity: 0.45; transform: scale(0.65) rotate(45deg); }
}

@keyframes giftAura {
    50% { opacity: 0.65; transform: translate(-50%, -50%) scale(1.12); }
}

@keyframes startPulse {
    to {
        border-color: rgba(255, 255, 255, 0.55);
        box-shadow: 0 0 58px rgba(169, 104, 255, 0.38);
        transform: scale(1.025);
    }
}

@keyframes giftFloat {
    50% { transform: translateY(-9px) rotate(-1deg); }
}

@keyframes orbitSpin {
    to { transform: rotateX(70deg) rotateZ(348deg); }
}

@keyframes scrollLine {
    to { top: 130%; }
}

@keyframes cakeGlowPulse {
    50% { opacity: 0.62; transform: translateX(-50%) scale(1.12); }
}

@keyframes candleFlicker {
    0% { transform: translateX(-50%) rotate(-2deg) scale(0.96, 1.04); }
    45% { transform: translateX(-50%) rotate(2deg) scale(1.04, 0.94); }
    100% { transform: translateX(-50%) rotate(-1deg) scale(0.9, 1.1); }
}

@keyframes balloonFloat {
    0%, 100% { transform: translateY(0) scale(var(--size)) rotate(var(--swing)); }
    50% { transform: translateY(-14px) scale(var(--size)) rotate(3deg); }
}

@keyframes mysteryGiftFloat {
    0%, 100% { transform: translateX(-50%) translateY(0) scale(var(--gift-scale)) rotate(-0.5deg); }
    50% { transform: translateX(-50%) translateY(-10px) scale(var(--gift-scale)) rotate(0.5deg); }
}

@keyframes secretRotate {
    to { transform: rotate(360deg); }
}

@keyframes infiniteLoopLeft {
    to { transform: rotate(360deg); }
}

@keyframes infiniteLoopRight {
    to { transform: rotate(-360deg); }
}

@keyframes loaderBlink {
    to { opacity: 0.25; transform: translate(-50%, -50%) scale(0.55); }
}

@media (max-width: 900px) {
    #hero {
        display: flex;
        padding: 95px 32px;
        text-align: center;
    }

    #hero::after {
        opacity: 1;
        background:
            linear-gradient(180deg, rgba(6, 4, 13, 0.32), rgba(6, 4, 13, 0.6)),
            radial-gradient(circle at 50% 48%, rgba(6, 4, 13, 0.34), rgba(6, 4, 13, 0.72) 76%);
    }

    #tree-canvas {
        position: absolute;
        inset: 0;
        z-index: 0;
        width: 100%;
        height: 100%;
        opacity: 0.42;
        filter: saturate(0.85) drop-shadow(0 18px 28px rgba(255, 89, 147, 0.1));
        -webkit-mask-image: linear-gradient(180deg, transparent 2%, #000 23%, #000 86%, transparent);
        mask-image: linear-gradient(180deg, transparent 2%, #000 23%, #000 86%, transparent);
    }

    .hero-content {
        z-index: 2;
        max-width: 760px;
        grid-column: auto;
        grid-row: auto;
        text-shadow: 0 2px 22px rgba(0, 0, 0, 0.7);
    }

    .hero-subtitle {
        margin-right: auto;
        margin-left: auto;
    }

    .hero-title {
        font-size: clamp(3.2rem, 10vw, 5.5rem);
    }

    .memory-card {
        min-height: auto;
        grid-template-columns: minmax(220px, 0.9fr) minmax(190px, 0.6fr);
        gap: 38px;
    }

    .film-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .film-card:nth-child(even) {
        margin-top: 65px;
    }

    .secret-stage {
        height: 610px;
    }
}

@media (max-width: 620px) {
    #cursor-glow {
        display: none;
    }

    .sound-label {
        display: none;
    }

    .cosmic-title {
        width: 94vw;
    }

    .cosmic-title h1 {
        font-size: clamp(3.2rem, 15vw, 5rem);
        line-height: 0.86;
    }

    .title-kicker {
        margin-bottom: 18px;
        font-size: 0.55rem;
        letter-spacing: 0.22em;
    }

    .gift-scene {
        transform: translate(-50%, -45%) scale(0.65);
    }

    #hero {
        padding: 95px 22px;
    }

    #tree-canvas {
        opacity: 0.34;
    }

    .hero-title {
        font-size: clamp(3rem, 14vw, 4.5rem);
        line-height: 0.9;
    }

    .hero-subtitle {
        margin-top: 28px;
        font-size: 1.08rem;
    }

    .hero-wink {
        padding: 0 25px;
        line-height: 1.5;
    }

    .scroll-cue {
        width: 100%;
    }

    .section-heading {
        margin-bottom: 78px;
    }

    .section-heading h2 {
        font-size: clamp(3.15rem, 14vw, 4.4rem);
    }

    #timeline {
        padding: 100px 20px 30px;
    }

    .timeline-track {
        top: 350px;
        bottom: 80px;
        left: 31px;
    }

    .memory-card,
    .memory-right {
        display: block;
        width: 100%;
        margin-bottom: 135px;
        padding-left: 24px;
        direction: ltr;
    }

    .memory-image {
        aspect-ratio: 3 / 4.3;
    }

    .memory-copy {
        margin-top: 28px;
        padding-left: 20px;
    }

    .memory-number {
        position: absolute;
        right: 0;
        bottom: 1px;
        margin: 0;
        font-size: 6.5rem;
    }

    .memory-copy h3 {
        font-size: 2rem;
    }

    #gallery {
        padding: 100px 13px 160px;
    }

    .section-note {
        padding: 0 28px;
        line-height: 1.6;
    }

    .film-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .film-card:nth-child(even) {
        margin-top: 38px;
    }

    .film-overlay {
        padding: 12px;
    }

    .film-overlay span {
        font-size: 0.53rem;
    }

    #interactive-cake,
    #secret-surprise {
        padding: 100px 13px 130px;
    }

    .cake-stage {
        min-height: 445px;
        padding-inline: 10px;
        border-radius: 24px;
    }

    .celebration-cake {
        height: 315px;
    }

    .cake-tier-bottom {
        max-width: 88%;
    }

    .cake-tier-top {
        max-width: 66%;
    }

    .cake-candle {
        bottom: 203px;
    }

    .cake-status {
        padding: 0 18px;
        line-height: 1.6;
    }

    .secret-stage {
        height: 570px;
        border-radius: 24px;
    }

    .prank-balloon {
        width: 52px;
        height: 90px;
    }

    .prank-balloon > span {
        left: 2px;
        width: 48px;
        height: 63px;
    }

    .prank-balloon > span::after {
        top: 69px;
        height: 23px;
    }

    .mystery-gift {
        --gift-scale: 0.86;
        bottom: 104px;
        width: 210px;
    }

    .balloon-counter {
        bottom: 28px;
        font-size: 0.58rem;
    }

    .prank-loader {
        min-height: 390px;
        padding: 48px 20px;
        border-radius: 24px;
    }

    #final-surprise {
        padding-inline: 18px;
    }

    .final-content h2 {
        font-size: clamp(3.5rem, 15vw, 5.3rem);
        line-height: 0.8;
    }

    .final-content > p:not(.eyebrow) {
        margin-top: 34px;
        padding: 0 14px;
        font-size: 1.02rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    .rotate-notice {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: grid;
        padding: 30px;
        place-items: center;
        background: #06030c;
        color: var(--gold);
        text-align: center;
        font-family: var(--serif);
        font-size: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
