:root {
    --bg-color: #000;
    --text-color: #fff;
    --overlay-bg: rgba(0,0,0,0.5);
    --transition: 0.3s;
    --arrow-color: rgba(255,255,255,0.7);
    --arrow-hover: rgba(255,255,255,0.9);
    --arrow-size: 40px;
    --fade-duration: 0.3s;
}

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

html, body {
    height: 100%;
    font-family: sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden; /* Prevent body scrolling */
}

#container {
    width: 100%;
    height: 100%;
    overflow: auto;
    scroll-snap-type: y mandatory;
    /* horizontal snap for desktop */
    scroll-behavior: smooth;
}

/* Desktop layout: horizontal scroll */
@media (min-width: 768px) {
    #container {
        scroll-snap-type: x mandatory;
        flex-direction: row;
        height: 100vh;
        display: flex;
    }
    .page {
        flex: 0 0 100vw;
        height: 100vh;
    }
}

/* Mobile layout: vertical scroll */
@media (max-width: 767px) {
    #container {
        scroll-snap-type: y mandatory;
    }
    .page {
        width: 100vw;
        height: 100vh;
    }
}

.page {
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Cover page */
.cover {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
}
.cover h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.cover h2 {
    font-size: 1.5rem;
    font-weight: normal;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Content pages */
.content-page {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
}
.content-page .text-box {
    width: 90%;
    max-width: 800px;
    background: var(--overlay-bg);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: opacity var(--fade-duration) ease;
}
.content-page .text-box p {
    line-height: 1.6;
    font-size: 1.2rem;
    margin: 0;
    transition: opacity var(--fade-duration) ease;
}

/* Fade out class */
.content-page .text-box.faded {
    opacity: 0;
}

/* Navigation arrows */
.nav-arrow {
    position: fixed;
    width: var(--arrow-size);
    height: var(--arrow-size);
    background: var(--arrow-color);
    border: none;
    border-radius: 50%;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.2s ease;
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.nav-arrow:hover {
    background: var(--arrow-hover);
    transform: scale(1.1);
}

/* Position arrows based on orientation */
@media (max-width: 767px) {
    /* Mobile: vertical arrows at bottom */
    .nav-arrow.prev {
        left: 20px;
        bottom: 20px;
        transform: none;
    }
    .nav-arrow.next {
        right: 20px;
        bottom: 20px;
        transform: none;
    }
}

@media (min-width: 768px) {
    /* Desktop: horizontal arrows at sides */
    .nav-arrow.prev {
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    .nav-arrow.next {
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
}

/* Hide arrows on cover page */
body.cover-page .nav-arrow { display: none; }