html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: #bfd3c3;
    /*font-family: Georgia, serif;*/
    font-family: 'Libre Baskerville', serif;
}

.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    position: relative;
}

.hero-wrapper {
    position: relative;
    width: 500px;
    display: inline-block;
    padding: 40px;    
    pointer-events: none;      /* creates outer buffer */
    animation: enableHover 0s forwards;
    animation-delay: 1.5s; /* same duration as fadeGrow */
}

/* Make sure final scale stays consistent */
.intropic {
    width: 450px;
    opacity: 0;
    transform: scale(0.95);
    animation: fadeGrow 1.5s ease-out forwards;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

/* Animation */
@keyframes enableHover {
    to {
        pointer-events: auto;
    }
}

@keyframes fadeGrow {
    to {
        opacity: 1;
        transform: scale(2.1);
    }
}

/* When hovering */
.hero-wrapper:hover .intropic {
    filter: blur(3px);
    opacity: 0.85;
}

/* START overlay */
.start-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    
    font-size: 2.2rem;
    letter-spacing: 6px;
    font-weight: bold;
    font-style: italic;
    color: #041901;
    text-decoration: none;

    opacity: 0;
    transition: opacity 0.4s ease, transform 0.2s ease;

    pointer-events: auto; /* ensure clickable */
}

/* Show START when hovering wrapper */
.hero-wrapper:hover .start-overlay {
    opacity: 1;
}

/* Grow when hovering START itself */
.start-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.intro-welcome {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 30px;
    color: #1B207A;
}

.intro-description {
    font-size: 1.3em;
    font-style: italic;
    margin-bottom: 40px;
    color: #1B207A;
}

.start-button {
    /*font-family: Georgia, serif;*/
    font-family: 'Libre Baskerville', serif;
    background-color: white;
    color: #1B207A;

    font-size: 1.7rem;      
    padding: 12px 18px;      
    border-radius: 10px; 
    text-decoration: none;     

    border: none;            
    cursor: pointer;
}

.floral-left {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 550px;
    height: auto;
}

.floral-right {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 550px;
    height: auto;
}
/* ========================= */
/* Gentle Side Sway */
/* ========================= */

@keyframes sway {
    0%   { transform: rotate(-3deg); }
    50%  { transform: rotate(3deg); }
    100% { transform: rotate(-3deg); }
}

/* Rose */
.rose {
    position: absolute;
    width: 300px;
    top: 55%;
    left: 10%;
    transform-origin: center;
    animation: sway 3s ease-in-out infinite;
}

/* Heart Envelope */
.heartenvelope {
    position: absolute;
    width: 230px;
    top: 20%;
    left: 80%;
    transform-origin: center;
    animation: sway 2.5s ease-in-out infinite;
}

/* -----------------enter page------------------- */

.back-arrow {
    position: absolute;
    top: 74px;
    left: 74px;
    z-index: 50;
}

.back-arrow img {
    width: 66px;
    transform: scale(0.75);
    transition: transform 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
    opacity: 0.8;
}

.back-arrow img:hover {
    transform: scale(0.75) translateX(-3px);
    opacity: 1;
}

.enter-page {
    min-height: 100vh;
    background-color: #bfd3c3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-bottom: 6rem;
}

.enter-title {
    font-family: 'Libre Baskerville', serif;
    color: #011e04;
    margin-top: 6rem;
    margin-bottom: 3rem;
}

.madlib-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem 2rem;
    width: 1000px;
    margin-bottom: 5rem;
}

@media (max-width: 768px) {
    .madlib-form {
        grid-template-columns: 1fr;
        width: 320px;
    }
}

.field {
    display: flex;
    flex-direction: column;
    text-align: left;
}

label {
    font-size: 0.9rem;
    color: rgb(255, 255, 255);
    margin-bottom: 0.55rem;
}

input {
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-family: Georgia, serif;
}

.reveal-button {
    /*font-family: Georgia, serif;*/
    font-family: 'Libre Baskerville', serif;
    background-color: #012107;
    color: #ffffff;

    font-size: 1.7rem;      
    padding: 12px 16px;      
    border-radius: 10px; 
    text-decoration: none;    

    border: none;            
    cursor: pointer;
    align-self: center;
}

/* -----------------reveal page------------------- */

.reveal-page {
    min-height: 100vh;
    max-height: 70%;
    overflow: hidden;
    background-color: #b7d3ba;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font-family: 'IM Fell English', serif;
    padding-top: 20px;  
}

.back-arrow {
    top: 20px;      /* closer to top */
    left: 20px;     /* closer to edge */
}

.scroll-container {
    position: relative;
    width: 1000px;
    max-width: 92%;
    animation: scrollAppear 0.8s ease forwards;
}

.scroll-front {
    position: relative;
}

.credits {
    position: absolute;
    bottom: 2%;
    right: 2%;
    font-size: 0.6rem;
    opacity: 0.8;
    text-align: left;
    z-index: 5;
    text-align: right;
    color: #012611;
}

.scroll-image {
    width: 95%;
    display: block;
    margin: 0 auto;   /* 👈 THIS centers it */
}

.story {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65%;
    text-align: center;

    opacity: 0;
    animation: textFadeIn 0.8s ease forwards;
    animation-delay: 1s;
}

@keyframes scrollAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -52%);
    }
}

.startover-button {
    font-family: 'IM Fell English', serif;
    background: none;          /* remove background */
    color: #000000;            /* black text */

    font-size: 1.7rem;
    padding: 0;                /* no button padding */
    border-radius: 0;
    text-decoration: none;

    border: none;
    cursor: pointer;
    margin-top: 2rem;
}

.startover-button:hover {
    opacity: 0.7;
}

/* ========================= */
/* SIDE DECORATIVE IMAGES */
/* ========================= */

.side-image {
    position: absolute;
    z-index: 1;
}

/* Left moon */
.left-image {
    left: 2%;        /* closer to edge */
    top: 18%;        /* slightly higher */
    transform: translateY(-50%);
    width: 400px; 
}

/* Right character */
.right-image {
    right: 3%;       /* closer to edge */
    bottom: 5%;      /* lower */
    width: 320px;   
}
/* ========================= */
/* MOBILE & TABLET VERSION */
/* ========================= */

@media (max-width: 1024px) {

    /* ---------------- INTRO PAGE ---------------- */

    .rose,
    .heartenvelope {
        display: none;
    }

    .intro {
        width: 100%;                 /* 👈 FIXED (was 50%) */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        gap: 30px;
    }

    .hero-wrapper {
        width: 85vw;                 /* 👈 FIXED (was 50vw) */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .intropic {
        width: 60%;
        margin-bottom: 0;
    }

    .start-overlay {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        opacity: 1;

        display: inline-block;      /* 👈 important */
        margin-top: 160px;

        background: #01230b;
        color: white;
        padding: 16px 32px;
        border-radius: 12px;

        font-size: 1.2rem;
        letter-spacing: 2px;

        transition: transform 0.1s ease;
    }

    .start-overlay:active {
        transform: scale(0.97);
    }

    /* Disable hover blur on mobile */
    .hero-wrapper:hover .intropic {
        filter: none;
        opacity: 1;
    }

    /* ---------------- REVEAL PAGE ---------------- */

    .left-image,
    .right-image,
    .credits,
    .scroll-image {
        display: none;
    }

    .scroll-container {
        width: 100%;
        max-width: 100%;
        animation: none;
    }

    .reveal-page {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 40px 20px;
    }

    .story {
        position: static;
        transform: none;
        width: 100%;
        opacity: 1;
        animation: none;
        text-align: center;
    }

    .story h1 {
        font-size: 1.6rem;
    }

    .story p,
    blockquote {
        font-size: 1rem;
        line-height: 1.6;
    }
}