:root {
    --bg-core: #050507;
    --text-main: #F4F1EB;
    --text-dim: rgba(244, 241, 235, 0.8);
    --accent-gold: #D4AF37;
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-letter: 'Cormorant Garamond', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-core);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden; 
    -webkit-font-smoothing: antialiased;
}

/* Film Grain */
.film-grain {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background-image: url('data:image/svg+xml,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* Scene Architecture */
.scene {
    position: absolute;
    top: 0; left: 0; width: 100vw; height: 100vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), filter 2s ease;
    filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.scene.is-active {
    opacity: 1;
    pointer-events: auto;
    filter: blur(0px);
    z-index: 10;
}

/* Typography */
h1 {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: clamp(2.5rem, 8vw, 4rem); 
    letter-spacing: 0.05em;
    margin: 1.5rem 0;
    font-style: normal;
}

p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 4.5vw, 1.1rem); 
    line-height: 1.8;
    color: var(--text-dim);
    font-style: normal;
    letter-spacing: 0.02em;
}

/* Scene 01 Elements */
.intro-text, .intro-mom, .intro-action {
    position: absolute;
    width: 100%;
}
.intro-text { top: 35%; }
.intro-mom { top: 45%; }
.intro-action { bottom: 15%; }

.fade-text {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 1.5s forwards ease;
}
.delay-1 { animation-delay: 1s; }
.delay-2 { animation-delay: 3s; }
.delay-4 { animation-delay: 6s; }
.delay-6 { animation-delay: 9s; }

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Nút bấm */
.cinematic-btn {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-main);
    padding: 14px 40px;
    border-radius: 30px;
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 4vw, 1rem);
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    display: inline-flex; 
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-weight: 400;
}

.cinematic-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

.text-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-heading);
    font-size: clamp(1rem, 4.5vw, 1.2rem);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
    font-style: normal;
}
.text-btn:hover { border-color: var(--text-main); }
.fade-in-late { opacity: 0; transition: opacity 2s ease; }

/* Scene 02: Memories */
.memory-image-container {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 2s ease;
    width: 100%;
}
.memory-image-container img {
    width: 90vw; 
    max-width: 500px;
    max-height: 55vh; 
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border-radius: 6px;
}
.memory-caption {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 6vw, 1.8rem);
    margin-top: 1.5rem;
    color: var(--text-main);
    font-style: normal;
    font-weight: 400;
    padding: 0 1rem;
}

/* Scene 04: Canvas & Star */
canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.guiding-star {
    position: absolute;
    top: 15%; right: 20%;
    width: 2px; height: 2px;
    background-color: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(212, 175, 55, 0.4);
    animation: twinkle 4s infinite ease-in-out;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.5); }
}

/* Scene 05: Letter (ĐÃ SỬA: Cho chữ bé lại, giảm lề, thêm thanh cuộn) */
.letter-paper {
    background: #111112;
    border: 1px solid rgba(255,255,255,0.1);
    padding: clamp(1.2rem, 5vw, 2.5rem); /* Đã giảm lề để tiết kiệm diện tích */
    max-width: 600px;
    width: 90%;
    border-radius: 4px;
    text-align: left;
    display: none;
    opacity: 0;
    max-height: 85vh; /* Chiều cao tối đa bằng 85% màn hình */
    overflow-y: auto; /* Bật cuộn nếu nội dung quá dài */
}
.letter-paper.is-open {
    display: block;
    animation: unfold 1.5s forwards ease;
}
.letter-paper p {
    font-family: var(--font-heading); 
    font-size: clamp(0.95rem, 4vw, 1.15rem); /* Đã cho chữ bé lại */
    color: var(--text-main);
    line-height: 1.6; /* Đã giảm khoảng cách dòng */
    margin-bottom: 1rem;
    font-style: normal;
}
@keyframes unfold {
    from { opacity: 0; transform: scale(0.95) translateY(20px); filter: blur(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}