/* GLOBAL RESET */
body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* NAVIGATION LINKS */
.nav-link {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    color: #000;
    background: #fff;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
    transition: transform 0.2s;
}

.nav-link:hover {
    transform: scale(1.1);
}

/* --- PAGE 1: INFINITE DOODLES --- */
#doodle-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    perspective: 100px;
}

/* The Doodle Item */
.doodle {
    position: absolute;
    bottom: -100px; /* Start below screen */
    opacity: 0.8;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.8)); /* Neon Glow */
    animation: floatUp linear forwards;
}

/* Hand-drawn "Wiggle" effect */
.doodle svg {
    width: 100%;
    height: 100%;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: wiggle 2s ease-in-out infinite;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-120vh) scale(0.5); opacity: 0; }
}

@keyframes wiggle {
    0% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
    100% { transform: rotate(-5deg); }
}

/* CENTER TITLE */
#hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    background: #000;
    padding: 20px;
    border: 4px solid #fff;
    z-index: 10;
    text-align: center;
}

/* --- PAGE 2: PHOTO STACK (Kept from before) --- */
.stack-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.photo {
    position: absolute;
    
    /* MÄÄRITTELEMME KOON UUDESTAAN 4:3 SUHTEESEEN */
    width: 60vw;            /* Leveys on 60% ruudun leveydestä */
    height: auto;           /* Korkeus lasketaan automaattisesti */
    aspect-ratio: 4 / 3;    /* Lukitsee muodon 4:3 suhteeseen */
    
    /* Estetään kuvaa menemästä liian korkeaksi leveillä näytöillä */
    max-height: 80vh;       
    
    /* Varmistetaan kuvan rajaus */
    object-fit: cover;      /* Täyttää laatikon (rajaa reunoilta jos tarvis) */
    
    /* Tyylittelyt (samat kuin aiemmin) */
    border: 15px solid white;
    background: #222;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Stack Logic */
.photo.top { z-index: 3; transform: scale(1) rotate(2deg); filter: grayscale(0%); }
.photo.middle { z-index: 2; transform: scale(0.95) rotate(-2deg); filter: grayscale(100%); }
.photo.bottom { z-index: 1; transform: scale(0.9) rotate(1deg); opacity: 0; }
.photo.exit { 
    z-index: 4; 
    transform: translateX(100vw) rotate(45deg); 
    opacity: 0; 
}