body {
    margin: 0;
    color: #663300;
    /* height: 100vh; */
    /* Background moved to ::before to prevent mobile scroll jumps */
    background-color: #CCFFFF;
    /* perspective: 1px;*/
    overscroll-behavior: none;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    /* Fallback */
    height: 100svh;
    /* Stable height on mobile */
    z-index: -10;
    background-image: url("cloudscape_background.png");
    background-size: cover;
    background-position: center top;
}

.subtitle {
    position: relative;
    font-size: 2.5vw;
}

.main-content-wrapper {
    height: auto;
    min-height: 500vh;
    overflow-x: visible;
    overflow-y: visible;
    position: relative;
    /* overscroll-behavior: none; */
}

.scroll-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 500vh;
    overflow-x: hidden;
    overflow-y: scroll;
}

.parallax-layer {
    position: fixed;
    width: 100%;
    height: 100vh;
    /* Fallback */
    height: 100svh;
    /* Stable height, ignores URL bar resize */
    justify-content: center;
    align-items: center;
    will-change: transform;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
    -webkit-transform: translate3d(0, 0, 0);
}

.jy-house {
    width: 80vw;
    height: 100%;
    top: 0vh;
    left: 10vw;
    background-image: url("JY_HOUSE.png");
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    will-change: transform;
    -webkit-transform: translate3d(0, 0, 0);
}

.mid-layer-clouds {
    width: 100%;
    height: 500vh;
    background-image: url("cloudscape_midground_clean.png");
    background-position: center top;
    background-size: 100% auto;
    background-repeat: repeat-y;
    z-index: 2;
}

.jy-titles {
    width: 100vw;
    top: 60%;
    text-align: center;
    z-index: 3;
}

.jy-name {
    width: 86vw;
    left: 7vw;
    right: 7vw;
    max-width: 100%;
}

.balloon-frames {
    position: relative;
    z-index: 20;
    top: 100vh;
    width: 100%;
    overflow: visible;
    height: auto;
    min-height: 400vh;
    padding-bottom: 100vh;
}

.balloon-frames .content,
.balloon-frames .regular-wrapper,
.balloon-frames a,
.balloon-frames button,
.balloon-frames input,
.balloon-frames textarea {
    pointer-events: auto;
}

.regular-wrapper {
    position: relative;
    z-index: 100;
    width: 80vw;
    color: #663300;
    background-color: transparent;
    left: 10vw;
    border-style: solid;
    border-image: url(balloon_border.png);
    padding: 30vw 12vw 4vw 12vw;
    border-image-width: 30vw 13vw 4vw 13vw;
    border-image-slice: 1290 472 150 472;
    border-image-repeat: repeat repeat;
    box-sizing: border-box;
    overflow: visible;
    margin-bottom: 20vh;
}

.content {
    position: relative;
    margin: -0.25vh 0 -0.4vh 0;
    padding: 1vh 1vw 1vh 1vw;
    width: auto;
    background-color: white;
}

/* Make specific elements inside content interactive */
.content * {
    pointer-events: auto;
}

.allcenter {
    position: static;
    right: 20%;
    left: 20%;
}

.regular-img {
    width: 30vw;
    text-align: left;
}

.regular-txt {
    padding: 2vw;
    min-width: 20vw;
}

.spacer {
    position: relative;
    height: 20vh;
}

.left-floater {
    position: absolute;
    z-index: 100;
    height: 60vh;
    left: 0px;
    pointer-events: auto;
}

.floating-menu {
    position: relative;
    background: white;
    border-style: solid;
    border-top-right-radius: 2vw;
    border-bottom-right-radius: 2vw;
    border-color: #AF2405;
    width: 4vw;
    height: auto;
    left: 0px;
    top: 50%;
    transform: translateX(-60vw);
    transition: transform 0.3s ease-in-out;
}

.floating-menu button {
    position: relative;
    display: block;
    /* Make the buttons appear below each other */
}

button {
    left: 5px;
    background: white;
    border-style: solid;
    border-radius: 10px;
    border-color: #AF2405;
    font-family: "!Sketchy Times";
    color: #AF2405;
    /* Ruddy text */
    cursor: pointer;
    /* Pointer/hand icon */
    min-height: 4vh;
    width: auto;
    /* Set a width if needed */
    margin: 2px;
}

.menu-indicator {
    position: relative;
    top: 20%;
    left: 0;
    width: auto;
    padding: 5px;
    cursor: pointer;
    background: white;
    border-style: solid;
    border-top-right-radius: 2vw;
    border-bottom-right-radius: 2vw;
    border-color: #AF2405;
    font-family: "!Sketchy Times";
    color: #AF2405;
    /* Ruddy text */
    transition: transform 0.3s ease;
}

.menu-indicator.menu-open {
    transform: rotate(90deg) translateY(5px) translateX(10px);
}

/* Use JavaScript to toggle the menu open/close */
.menu-open .floating-menu {
    transform: translateX(0);
}

.story-navigation {
    margin: auto;
    width: 50%;
    text-align: center;
    padding: 10px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    /* Ensures padding is included in width */
}

#form-message {
    /* Style for success/error messages */
    margin-top: 10px;
}

/* Only disable pointer events on screens narrower than 768px (tablets/phones) */
@media (max-width: 768px) {
    .parallax-layer {
        pointer-events: none;
    }
}