﻿:root {
    --bg-base: #110d12;
    --bg-soft: #2a1a20;
    --ink: #fff6ef;
    --ink-soft: #f2d8c7;
    --accent: #ff6b6b;
    --accent-2: #ff9e5d;
    --accent-3: #ffd78e;
    --card: rgba(255, 245, 238, 0.1);
    --card-border: rgba(255, 255, 255, 0.24);
    --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.32);
    --shadow-strong: 0 24px 65px rgba(0, 0, 0, 0.45);
    --radius: 24px;
    --font-hand: 'Caveat', cursive;
    --font-main: 'Manrope', sans-serif;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 107, 107, 0.2), transparent 35%),
        radial-gradient(circle at 90% 10%, rgba(255, 158, 93, 0.2), transparent 30%),
        linear-gradient(170deg, #24151d 0%, var(--bg-base) 45%, #140e14 100%);
    color: var(--ink);
    font-family: var(--font-main);
    overflow: hidden;
}

.scroll-container {
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.scene {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: 100svh;
    padding: 20px 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.js-ready .scene {
    opacity: 0;
    transform: translateY(26px);
}

.scene::before {
    content: '';
    position: absolute;
    inset: 16px;
    border-radius: calc(var(--radius) + 6px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.scene.scene-entered {
    opacity: 0.92;
    transform: translateY(0);
}

.scene.scene-active {
    opacity: 1;
    transform: translateY(0);
}

.scene-inner {
    width: min(860px, 94vw);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 2;
}

.kicker {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent-3);
    opacity: 0.92;
}

.title {
    font-family: var(--font-hand);
    line-height: 1.03;
    font-size: clamp(2rem, 9vw, 5rem);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.title span {
    color: var(--accent-2);
}

.lead {
    max-width: 560px;
    line-height: 1.62;
    color: var(--ink-soft);
    font-size: clamp(0.95rem, 2.8vw, 1.12rem);
}

.photo-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: min(860px, 92vw);
}

.photo-frame {
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--card-border);
    padding: 10px 10px 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photo-frame::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 11px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0.7;
}

.photo-frame img {
    width: 100%;
    border-radius: 14px;
    display: block;
}

.photo-frame:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: var(--shadow-strong);
}

.tilt-left {
    transform: rotate(-2deg);
}

.rotate-right {
    transform: rotate(2deg);
}

.wide img {
    max-height: 360px;
    object-fit: cover;
}

.special-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    align-items: start;
}

.police-file {
    border: 2px dashed rgba(255, 215, 142, 0.45);
}

.police-file::before {
    content: 'CASE #LOVE';
    position: absolute;
    top: 14px;
    right: 18px;
    font-family: ui-monospace, 'Courier New', monospace;
    font-size: 0.68rem;
    color: rgba(255, 246, 239, 0.7);
}

.stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg) scale(0.5);
    border: 3px solid #ff6b6b;
    color: #ff6b6b;
    padding: 6px 14px;
    text-transform: uppercase;
    font-size: clamp(1rem, 4vw, 1.8rem);
    font-weight: 800;
    opacity: 0;
    background: rgba(20, 14, 20, 0.44);
}

.scene-special.scene-active .stamp {
    animation: stamp-in 0.5s ease forwards;
    animation-delay: 0.4s;
}

@keyframes stamp-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-10deg) scale(1.8);
    }
    to {
        opacity: 0.95;
        transform: translate(-50%, -50%) rotate(-10deg) scale(1);
    }
}

.text-card {
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    text-align: left;
    display: grid;
    gap: 10px;
    box-shadow: var(--shadow-soft);
}

.text-card p {
    color: var(--ink-soft);
    line-height: 1.58;
}

.memory-grid {
    width: min(780px, 92vw);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.memory-card {
    min-height: 110px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    color: var(--ink);
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
}

.memory-card:hover {
    transform: translateY(-4px);
}

.memory-card.revealed {
    background: linear-gradient(145deg, rgba(255, 158, 93, 0.3), rgba(255, 107, 107, 0.25));
    color: #fff8ef;
}

.memory-status {
    color: var(--accent-3);
    letter-spacing: 0.03em;
    font-size: 0.92rem;
}

.circle-crop {
    border-radius: 999px;
    overflow: hidden;
    width: 200px;
    height: 200px;
    padding: 0;
    border: 3px solid rgba(255, 255, 255, 0.75);
}

.circle-crop::after {
    display: none;
}

.big-question {
    font-size: clamp(2.3rem, 10vw, 4.8rem);
}

.buttons-container {
    width: 100%;
    max-width: 400px;
    min-height: 62px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 13px 24px;
    font-family: var(--font-main);
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn.primary {
    color: #fff;
    background: linear-gradient(115deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 30px rgba(255, 107, 107, 0.42);
}

.btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn.secondary {
    color: #f3d5c0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    position: absolute;
}

.scene-finale {
    overflow: hidden;
}

.scene.scene-finale {
    opacity: 1;
}

.finale-inner {
    opacity: 0.65;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scene-finale.scene-active .finale-inner {
    opacity: 1;
}

.scene-finale.scene-finale-state .finale-inner {
    transform: scale(1.04);
}

.signature {
    margin-top: 6px;
    font-family: var(--font-hand);
    font-size: clamp(1.5rem, 7vw, 2.6rem);
    color: var(--accent-3);
}

.scroll-hint {
    text-transform: uppercase;
    letter-spacing: 0.11em;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    animation: nudge 1.5s ease-in-out infinite;
}

@keyframes nudge {
    0%,
    100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

.cinema-overlay {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 6;
    mix-blend-mode: screen;
}

.cinema-glow,
.cinema-grain,
.cinema-vignette,
.cinema-flare {
    position: absolute;
    inset: 0;
}

.cinema-glow {
    background:
        radial-gradient(circle at 20% 12%, rgba(255, 197, 148, 0.22), transparent 40%),
        radial-gradient(circle at 84% 22%, rgba(255, 107, 107, 0.2), transparent 34%);
    animation: glow-shift 14s ease-in-out infinite alternate;
}

.cinema-grain {
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.7px, transparent 0.7px);
    background-size: 3px 3px;
    opacity: 0.2;
    mix-blend-mode: soft-light;
}

.cinema-vignette {
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.58);
}

.cinema-flare {
    background: linear-gradient(105deg, transparent 25%, rgba(255, 194, 142, 0.14) 50%, transparent 75%);
    transform: translateX(-120%);
    animation: flare-pass 9s ease-in-out infinite;
}

@keyframes glow-shift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-18px); }
}

@keyframes flare-pass {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

#hearts-background {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 5;
    overflow: hidden;
}

.heart {
    position: fixed;
    top: -10vh;
    opacity: 0.6;
    filter: drop-shadow(0 5px 10px rgba(255, 90, 90, 0.25));
    animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(115vh) rotate(340deg); }
}

@media (min-width: 800px) {
    .photo-strip {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }

    .special-layout {
        grid-template-columns: 1fr 1fr;
    }

    .memory-grid {
        gap: 14px;
    }

    .memory-card {
        min-height: 130px;
    }
}

@media (max-width: 620px) {
    .scene {
        padding: 14px 10px;
    }

    .scene::before {
        inset: 10px;
        border-radius: 22px;
    }

    .memory-grid {
        grid-template-columns: 1fr;
    }

    .memory-card {
        min-height: 86px;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.perf-low .cinema-flare,
.perf-low .cinema-grain {
    display: none;
}

.perf-low .cinema-glow {
    animation: none;
}

.perf-medium .cinema-flare {
    opacity: 0.5;
}
