/* --- 1. Global & Font Setup --- */
body {
    /* Set up the dark, ink-like color and use the new sketchy font */
    background-color: #FFFFFF; 
    margin: 0;
    padding: 0;
    font-family: 'Georgia', cursive; 
    color: #333; 
    display: flex; 
    justify-content: center;
    padding: 40px 20px;
    /* Apply the star falling animation to the entire body */
    overflow-x: hidden; 
}

/* Base style for elements that look hand-drawn */
.sketchy-text {
    font-family: 'Georgia', cursive;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- 2. Journal Page Styling --- */
.journal-page {
    width: 100%;
    max-width: 900px;
    background-color: #fcfcf4; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    padding: 30px;
    min-height: 90vh;
    border: 1px solid #c9c5b6; 
    position: relative;
    line-height: 1.5;
    /*z-index: 10; /* Keep content above the background stars */
}

/* === 3. HERO SECTION STYLES === */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 40px 0;
    border-bottom: 3px dashed #333; /* Sketchy divider line */
}

.landing-art-container {
    flex-basis: 40%;
    text-align: center;
}

.landing-art {
    max-width: 100%;
    height: auto;
    /* Sketchy border effect */
    border: 4px solid #333; 
    padding: 5px;
}

.welcome-text {
    flex-basis: 55%;
    text-align: center;
}

.welcome-text h1 {
    font-size: 4em;
    color: #333333; /* A strong, contrasting color for the main title */
    border: none;
    line-height: 1.1;
    margin: 0 0 20px 0;
}

.about-me-link-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.small-char {
    width: 50px;
    height: auto;
}

/* Floating button style */
.floating-button {
    text-decoration: none;
    color: #333;
    background-color: #A1A0D2; /* purple background */
    padding: 10px 20px;
    border: 3px solid #333;
    border-radius: 5px;
    display: inline-block;
    transition: all 0.2s ease-in-out;
    box-shadow: 5px 5px 0px 0px #333; /* Initial "floating" shadow */
}

.floating-button:hover {
    /* Push the button down on hover */
    transform: translate(2px, 2px); 
    box-shadow: 3px 3px 0px 0px #333; 
    background-color: #b2d335;
}


/* === 4. Collection Area Styles === */

.collection-notice {
    text-align: center;
    padding: 30px 0;
    margin: 40px 0;
    border-bottom: 3px dashed #333; /* Sketchy divider line */
}

.collection-notice h2 {
    font-size: 2em;
    margin-bottom: 20px;
}

.collection-targets {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.target-spot {
    width: 100px;
    height: 100px;
    border: 3px dashed #888; /* Shows the empty spot */
    border-radius: 50%; /* Optional: make it look like a landing zone */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Crucial for positioning the outline */
    opacity: 0.5; /* Fade the empty spot slightly */
    transition: opacity 0.3s;
}

.target-outline {
    width: 90%;
    height: 90%;
    object-fit: contain;
    opacity: 0.7; /* Make the outline faint */
}

/* Style for the collected state */
.target-collected {
    border: 3px solid #28a745; /* Green border when filled */
    opacity: 1; 
}


/* --- Great Job Popup Styles --- */
.great-job-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #E4DEE7; /* Light paper color */
    padding: 30px;
    text-align: center;
    z-index: 2147483647; /* Above everything else */
}

.great-job-image {
    max-width: 150px;
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

.draggable {
    position: absolute; 
    z-index: 1000; 
    cursor: grab; 
    /* CRITICAL FIX FOR MOBILE DRAGGING */
    touch-action: none; 
    /* Set the default desktop size (100px recommended for easy collection) */
    width: 100px; 
    height: auto; 
   /* NEW: Ensure characters don't disappear off the right side initially */
    max-width: 95vw;
}

/* NEW: Constrain the image size inside the container */
.draggable img {
    max-width: 100%; /* Image never exceeds 100px width */
    height: auto; 
    display: block;
}



/* === 5. WORK SECTION STYLES === */
.work-section {
    padding: 40px 0 40px 0;
    text-align: center;
}

.work-title {
    font-size: 3em;
    color: #333;
    border-bottom: 5px wavy #d17a7a; /* Wavy line for the sketchy feel */
    display: inline-block;
    margin-bottom: 30px;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.work-card {
    text-decoration: none;
    color: #333;
    background-color: #28B0BF; /* blue */
    padding: 40px 10px;
    border: 3px solid #333;
    border-radius: 8px;
    display: block;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating effect for grid cards */
.floating-card {
    transition: all 0.3s ease-in-out;
    box-shadow: 8px 8px 0px 0px #333; /* Stronger initial shadow */
}

.floating-card:hover {
    transform: translate(4px, 4px); /* Moves when hovered */
    box-shadow: 4px 4px 0px 0px #333;
    background-color: #b2d335; /* green change on hover */
}

.work-card span {
    font-size: 1.5em;
}

/* Placeholder card for future work */
.placeholder {
    background-color: #e0e0e0;
    color: #777;
}



.icon-button {
    /* Set the clickable area to be slightly larger than the icon (e.g., 35px) */
    width: 35px; 
    height: 35px; 
    padding: 0; 
    
    /* Center the icon */
    display: flex;
    align-items: center;
    justify-content: center;
                
}


.insta-img {
    /* Set the size for the image icon */
    width: 30px; 
    height: 30px;
    display: block;
}

/* --- 6. Mobile Responsiveness (Max Width 600px) --- */
@media (max-width: 600px) {
    /* 1. Stack the main art and welcome text vertically */
    .hero-section {
        flex-direction: column;
        text-align: center;
    }
    
    /* 2. Full width for the image and text blocks */
    .landing-art-container, 
    .welcome-text {
        flex-basis: 100%;
        margin-bottom: 20px;
    }
    
    /* 3. Stack the About Me / Instagram links vertically */
    .about-me-link-group {
        /* Set to column for vertical stacking */
        flex-direction: column; 
        align-items: center; 
        gap: 10px;
    }
    
    /* 4. Switch the main work grid to a single column */
    .work-grid {
        grid-template-columns: 1fr;
    }

    /* 5. Shrink the main title */
    .welcome-text h1 {
        font-size: 3em;
    }

    /* Mobile adjustments (to make sure the targets for draggable characters are easier to see) */
    .collection-targets {
        gap: 15px;
    }
    .target-spot {
        width: 70px;
        height: 70px;
    }

    /* NEW: Shrink draggable characters on mobile */
    .draggable {
        width: 70px; /* Smaller size for phone screens */
    }
}

/* --- 7. Illustration Page Styles --- */

.illustration-scroll-box {
    /* Critical for horizontal scrolling */
    display: flex;
    overflow-x: scroll; /* Allows scrolling right */
    overflow-y: hidden; 
    padding: 20px 0;
    
    /* Hides the scrollbar on most browsers */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
    
    /* Ensures items stay aligned */
    align-items: flex-start;
    gap: 30px; /* Space between illustrations */
    
    /* For snapping/slideshow effect on mobile */
    scroll-snap-type: x mandatory; 
}

/* Hide the scrollbar for webkit browsers (Chrome, Safari) */
.illustration-scroll-box::-webkit-scrollbar {
    display: none;
}

.illustration-item {
    /* DEFAULT: Desktop 3-column layout */
    /* Calculate width to show 3 items plus the gap in between */
    flex: 0 0 calc((100% / 3) - 20px); 
    height: 300px; /* Fixed height for uniformity */
    position: relative;
    cursor: pointer;
    border: 4px solid #333;
    box-shadow: 4px 4px 0px 0px #333;
    transition: all 0.2s;
    scroll-snap-align: center; /* For smooth scrolling to each item */
}

.illustration-item:hover {
    box-shadow: 6px 6px 0px 0px #333;
    transform: translateY(-2px);
}

.illustration-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures images fill the container without distortion */
    display: block;
}

/* --- Mobile View: Single Item Slideshow --- */
@media (max-width: 768px) {
    .illustration-item {
        /* CRITICAL: Shows only one item at a time (slideshow effect) */
        flex: 0 0 95%; 
        height: 250px;
        /* Padding on the scroll box provides space around the item */
    }
}


/* --- 8. Lightbox (Zoom-In) Styles --- */

.lightbox {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 9999; /* On top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    /* Blurry Background Effect */
    background-color: rgba(0, 0, 0, 0.7); /* Dark semi-transparent overlay */
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
    overflow: auto;
    text-align: center;
}

.lightbox-content {
    margin: 15% auto; /* Center vertically and horizontally */
    padding: 20px;
    background-color: transparent;
    width: 90%;
    max-width: 800px;
    animation: zoom-in 0.3s;
}

#lightbox-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    border: 5px solid white;
}

#lightbox-caption {
    color: white;
    font-size: 1.2em;
    font-family: Georgia, serif;
    margin: 0;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

@keyframes zoom-in {
    from {transform: scale(0.8);} 
    to {transform: scale(1);}
}
