:root {
    --bg-light: #fdfaf6;
    --pink-soft: #ffd1dc;
    --lavender-soft: #e6e6fa;
    --peach-soft: #ffdab9;
    --blue-soft: #d4f0ff;
    --text-main: #4a4a4a;
    --text-dark: #2c2c2c;
    --accent: #ff8fa3;
    
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --font-hand: 'Caveat', cursive;
}

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

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

/* Intro Screen */
.intro-screen {
    position: static;
    top: 0; left: 0; width: 100%; height: 100vh;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.intro-emojis {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.intro-emojis .emoji {
    display: inline-block;
    opacity: 1;
    transform: translateY(20px);
}
.intro-text {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    color: var(--text-dark);
    opacity: 1;
}

/* Base romantic typography */
.romantic {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-dark);
}
.handwritten {
    font-family: var(--font-hand);
    color: var(--text-main);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #fffaf0, #ffe6ea, #f0f4ff, #fff0f5);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    overflow: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#hero-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

.floating-emojis {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 2;
}
.float-emoji {
    position: absolute;
    font-size: 2.5rem;
    animation: float 6s ease-in-out infinite alternate;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    margin-top: 5vh;
}
.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.hero-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 2rem;
    background: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-image-wrapper {
    position: relative;
    display: inline-block;
    perspective: 1000px;
}
.hero-image-glow {
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef, #a1c4fd);
    border-radius: 25px;
    filter: blur(20px);
    opacity: 0.8;
    animation: pulseGlow 4s infinite alternate;
    z-index: -1;
}
@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.05); opacity: 1; }
}
.hero-image {
    max-height: 60vh;
    width: auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    transform-style: preserve-3d;
    will-change: transform;
    object-fit: cover;
    display: block;
}

/* Memories Section */
.memories {
    padding: 10rem 5%;
    background: var(--bg-light);
    position: relative;
}
.section-heading {
    text-align: center;
    margin-bottom: 5rem;
}
.section-heading h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}
.section-heading p {
    font-size: 2rem;
    color: var(--accent);
}
.scrapbook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}
.polaroid {
    background: #fff;
    padding: 15px 15px 60px 15px;
    border-radius: 2px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    position: relative;
    transform: rotate(var(--rot));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}
.polaroid:hover {
    transform: rotate(0deg) scale(1.05) translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.1);
    z-index: 10;
}
.tape {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 100px;
    height: 30px;
    background: rgba(255,255,255,0.4);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.6);
    z-index: 2;
}
.photo-placeholder {
    width: 10%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #f5f7fa, #e4ebf5);
    border: 1px dashed #ccc;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.caption {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    color: #555;
}

/* Engineer Section */
.engineer {
    padding: 8rem 5%;
    position: relative;
    background-color: var(--bg-light);
    background-image: 
        linear-gradient(rgba(135, 206, 235, 0.2) 1px, transparent 1px),
        linear-gradient(90deg, rgba(135, 206, 235, 0.2) 1px, transparent 1px);
    background-size: 40px 40px;
    overflow: hidden;
}
.engineer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4rem;
    padding: 3rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 30px 60px rgba(135, 206, 235, 0.15);
    position: relative;
}
.tech-lines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    border-radius: 24px;
    overflow: hidden;
}
.tech-lines::before {
    content: '';
    position: absolute;
    top: 50%; left: -50%;
    width: 200%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 143, 163, 0.5), transparent);
    animation: scanline 4s linear infinite;
}
@keyframes scanline {
    0% { transform: translateY(-200px) rotate(45deg); }
    100% { transform: translateY(400px) rotate(45deg); }
}

.terminal-ui {
    flex: 1;
    min-width: 320px;
    background: rgba(30, 30, 40, 0.85);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.terminal-header {
    background: rgba(0,0,0,0.3);
    padding: 10px 15px;
    display: flex;
    gap: 8px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-body {
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #e0e0e0;
    min-height: 250px;
}
.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: #a8c7fa;
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.engineer-text {
    flex: 1;
    min-width: 300px;
}
.engineer-text h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}
.engineer-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-dark);
}

/* Letter Section */
.letter-section {
    padding: 12rem 5%;
    position: relative;
    background: linear-gradient(to bottom, var(--bg-light), #fff0f5);
    text-align: center;
    overflow: hidden;
}
.letter-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.letter-container h2 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: var(--accent);
}
.text-large {
    font-size: 2.5rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    color: #555;
    text-shadow: 0 0 20px rgba(255,255,255,0.8);
}
.signature {
    font-size: 3rem;
    color: var(--accent);
}
.floating-hearts {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}
.floating-heart {
    position: absolute;
    color: #ffb6c1;
    opacity: 0;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0.5) rotate(0deg); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-20vh) scale(1.2) rotate(360deg); opacity: 0; }
}

/* Final Celebration */
.final-celebration {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #fff, #ffe6ea);
    overflow: hidden;
}
#confetti-canvas {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}
.final-content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.huge-text {
    font-size: clamp(4rem, 10vw, 8rem);
    background: linear-gradient(to right, #ff758c 0%, #ff7eb3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    animation: floatTitle 4s ease-in-out infinite;
}
.subtitle {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    color: #777;
    letter-spacing: 2px;
}
@keyframes floatTitle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes float {
    0% { transform: translateY(0) rotate(0); }
    100% { transform: translateY(-20px) rotate(10deg); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .section-heading h2 { font-size: 2.5rem; }
    .text-large { font-size: 1.8rem; }
    .hero-image { max-height: 50vh; }
    .engineer-container { padding: 2rem; gap: 2rem; }
    .terminal-body { font-size: 0.9rem; min-height: 200px; }
}
