*, *::before, *::after { 
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

/* ─── ANTI-PRINT & ANTI-SCREENSHOT ────────── */
@media print {
    html, body {
        display: none !important;
        visibility: hidden !important;
    }
}

img, picture {
    pointer-events: none !important; /* Prevent right click, drag, or long-press on images */
    -webkit-user-drag: none !important;
}

body, html {
    width: 100%;
    background: #000;
    background-image: radial-gradient(rgba(255,255,255,0.09) 1.5px, transparent 1.5px);
    background-size: 22px 22px;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    color: #fff;
}

/* ─── LAYERS ──────────────────────────────── */
#glitter {
    position: fixed; inset: 0;
    width: 100vw; height: 100vh;
    pointer-events: none;
    z-index: 450; /* Behind the book (#intro-scene is 500) */
    opacity: 0;
}

/* ─── GRAIN OVERLAY (DISABLED: Zero texture over images) ───────────────────────── */
#grain-overlay {
    display: none !important;
}

/* ─── SCROLL PROMPT ───────────────────────── */
#scroll-prompt {
    position: relative;
    z-index: 510;
    text-align: center;
    color: #fff;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    transition: opacity 0.3s ease;
}
#scroll-prompt p {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 500;
    margin: 0;
    opacity: 0.95;
    background: linear-gradient(90deg, #ff7eb3, #a8edea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(255, 126, 179, 0.4);
}
.mouse-icon {
    width: 22px; height: 36px;
    border: 2px solid rgba(255,255,255,0.75);
    border-radius: 12px;
    position: relative;
}
.mouse-icon::before {
    content: '';
    position: absolute;
    top: 6px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 7px;
    background: #ff7eb3;
    border-radius: 2px;
    animation: scrollWheel 1.5s infinite;
}
@keyframes scrollWheel {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* ─── FADE WHITE ──────────────────────────── */
#fade-white {
    position: fixed; inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 800;
}

/* ─── 3D MAGIC WORDS ─────────────────────────── */
#magic-words-3d {
    position: absolute;
    top: 50%; left: 50%;
    /* Counter-rotate so words stand upright from the open book */
    transform: translate(-50%, -50%) rotateX(-62deg);
    transform-style: preserve-3d;
    z-index: 700;
    pointer-events: none;
}
.magic-word {
    position: absolute;
    top: 50%; left: 50%;
    white-space: nowrap;
    font-family: 'Titan One', cursive, sans-serif;
    font-size: clamp(1.25rem, 3.8vw, 2.5rem);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #ffffff 0%, #ff80bf 35%, #a8edea 75%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    will-change: transform, opacity;
    text-align: center;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.95)) drop-shadow(0 0 12px rgba(255,126,179,0.7));
    user-select: none;
}


/* ─── INTRO SCENE ─────────────────────────── */
#intro-scene {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 500;
    pointer-events: none;
    padding-bottom: 50px;
    box-sizing: border-box;
}

#intro-header-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    pointer-events: none;
    user-select: none;
    max-width: 520px;
    padding: 0 16px;
}

#book-badge {
    font-family: 'Titan One', cursive, sans-serif;
    font-size: clamp(1.6rem, 4.5vw, 2.7rem);
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ff7eb3 0%, #c471ed 50%, #4facfe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.85)) drop-shadow(0 0 16px rgba(255, 126, 179, 0.6));
    line-height: 1.1;
    margin: 0;
}

/* Tagline above the book */
#book-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(0.8rem, 2.2vw, 1.12rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.03em;
    text-align: center;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6), 0 0 30px rgba(200,100,255,0.5);
    margin: 0;
    padding: 0;
    pointer-events: none;
    user-select: none;
}

/* 
  Perspective container.
  rotateX tilts the whole book away = "lying flat on a table" viewpoint.
  We use a high rotateX so we see it almost horizontally, like the photo.
*/
#book-perspective {
    perspective: 900px;
    perspective-origin: 50% -20%;  /* camera slightly above */
}

#book-closed {
    display: flex;
    align-items: stretch;
    transform-style: preserve-3d;
    transform: rotateX(62deg) rotateZ(0deg);
    will-change: transform;
    position: relative;
    opacity: 0;
    visibility: hidden;
}

/* ─── BOOK HALVES ─────────────────────────── */
:root {
    --hw: 140px;
    --bh: 200px;
}
@media (min-width: 400px) { :root { --hw: 170px; --bh: 240px; } }
@media (min-width: 600px) { :root { --hw: 210px; --bh: 295px; } }

/* Book halves MUST have preserve-3d for the faces to work */
#book-left, #book-right {
    width: var(--hw);
    height: var(--bh);
    position: relative;
    will-change: transform;
    border-radius: 4px;
    transform-style: preserve-3d;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

#book-left  { transform-origin: right center; }
#book-right { transform-origin: left center; }

/* 3D Faces */
.page-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 4px;
}

/* Paper faces (inside of the book, facing +Z when open) */
.paper-face {
    background: #fdfdfa; /* paper color */
    box-shadow: inset 0 0 20px rgba(0,0,0,0.06); /* subtle paper shadow */
    transform: rotateY(0deg);
}
/* Right paper gets a subtle shadow near the spine */
.right-paper { box-shadow: inset 20px 0 20px -10px rgba(0,0,0,0.08); }
.left-paper  { box-shadow: inset -20px 0 20px -10px rgba(0,0,0,0.08); }

/* Scribbles simulating text on the paper */
.paper-face::before {
    content: '';
    position: absolute;
    top: 12%; left: 15%; right: 15%; bottom: 12%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0.12) 0px,
        rgba(0,0,0,0.12) 3px,
        transparent 3px,
        transparent 20px
    );
    filter: blur(0.8px);
    opacity: 0.7;
    /* Mask out the bottom and right edges slightly to look like ragged text blocks */
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%), linear-gradient(to right, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

/* Ambient Glow lying flat on the open pages */
#internal-glow {
    position: absolute;
    top: 50%; left: 50%;
    width: 250%; height: 150%;
    transform: translate(-50%, -50%) translateZ(2px);
    background: radial-gradient(ellipse at center, rgba(160, 230, 255, 0.6) 0%, rgba(100, 180, 255, 0.2) 40%, transparent 70%);
    filter: blur(20px);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

/* Cover faces (outside of the book, facing -Z) */
.cover-face {
    transform: rotateY(180deg);
}

.left-cover {
    /* Since it's rotated 180deg, the visual right side is actually the left edge */
    background: linear-gradient(150deg, #ff758c 0%, #ff9eb5 40%, #c471ed 75%, #4facfe 100%);
    border-radius: 0 4px 4px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Front Cover Layout & Avatar */
.cover-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 100%;
    padding: 12px;
    box-sizing: border-box;
    user-select: none;
}

.cover-avatar-ring {
    position: relative;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.3) 50%, rgba(255,255,255,0.85));
    box-shadow: 
        0 8px 24px rgba(0,0,0,0.4),
        0 0 16px rgba(255,126,179,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

@media (min-width: 400px) {
    .cover-avatar {
        width: 105px;
        height: 105px;
    }
}

@media (min-width: 600px) {
    .cover-avatar {
        width: 125px;
        height: 125px;
    }
    .cover-content {
        gap: 14px;
    }
}

.cover-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: clamp(0.68rem, 2.2vw, 0.82rem);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    text-align: center;
    line-height: 1.2;
}

.right-cover {
    background: linear-gradient(150deg, #4facfe 0%, #c471ed 40%, #ff9eb5 75%, #ff758c 100%);
    border-radius: 4px 0 0 4px;
}

/* Spine — just a colored strip between the two halves */
#book-spine {
    width: 8px;
    height: var(--bh);
    background: linear-gradient(180deg, #ff7eb3, #c471ed, #4facfe);
    flex-shrink: 0;
    align-self: center;
    position: relative;
    box-shadow: 0 0 12px rgba(200,100,255,0.5);
    transform-style: preserve-3d;
}

/* ─── PRESENTATION ────────────────────────── */
.presentation-wrapper {
    width: 100vw; height: 100vh; height: 100dvh;
    position: relative;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
}

.panel {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    visibility: hidden;
    perspective: 1200px;
}
#panel-1 { visibility: visible; }

/* ─── SCRAPBOOK / MAGAZINE PAGE ─── */
.magazine-page {
    position: relative;
    width: auto;
    height: 86vh;
    max-height: 920px;
    max-width: 90vw;
    aspect-ratio: 9 / 16;
    background: #fdfdfd;
    padding: 10px;
    border-radius: 12px;
    box-shadow: 
        0 30px 60px rgba(0,0,0,0.75), 
        0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transform-style: preserve-3d;
}

.magazine-page picture {
    width: 100%;
    height: 100%;
    display: block;
}

.magazine-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

/* ZERO TEXTURE / NO OVERLAYS over mockup images */
.magazine-page::after {
    display: none !important;
}

/* ─── LIGHT BEAM (Inverted Cone) ─── */
#neon-burst {
    position: absolute;
    top: 50%; left: 50%;
    width: 500px; height: 600px;
    margin-top: -600px; /* Bottom edge at the spine center */
    margin-left: -250px; /* Center horizontally */
    transform-origin: center bottom;
    background: linear-gradient(to top, rgba(160, 230, 255, 0.95) 0%, rgba(100, 200, 255, 0.5) 40%, rgba(255,255,255,0) 100%);
    clip-path: polygon(48% 100%, 52% 100%, 100% 0%, 0% 0%); /* Apex at bottom, wide at top */
    filter: blur(15px);
    opacity: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Floating scroll button */
.float-scroll-btn {
    position: fixed;
    bottom: 18px; left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    color: #000;
    font-size: 1.4rem;
    line-height: 46px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    animation: fBtn 2s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
}
@keyframes fBtn {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(8px); }
}

/* CTA Button (last slide) */
.v3-cta-button {
    position: absolute;
    bottom: -35px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #ff7eb3, #4facfe);
    color: #fff;
    padding: 15px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform .2s, filter .2s;
    z-index: 100;
    letter-spacing: 1px;
}
.v3-cta-button:hover {
    transform: translateX(-50%) scale(1.06);
    filter: brightness(1.15);
}

/* ─── NEON BARS (top + bottom of presentation) ── */
.neon-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 20;
    pointer-events: none;
    background: linear-gradient(90deg,
        #ff7eb3 0%,
        #4facfe 40%,
        #78ffd6 70%,
        #ff7eb3 100%
    );
    background-size: 200% 100%;
    animation: neonShift 4s linear infinite;
}
.neon-bar--top    { top: 0; }
.neon-bar--bottom { bottom: 0; }

/* Glow layered via box-shadow */
.neon-bar--top {
    box-shadow:
        0  0  6px 1px rgba(255, 126, 179, 0.8),
        0  0 18px 3px rgba(79, 172, 254, 0.6),
        0  0 30px 5px rgba(120, 255, 214, 0.3);
}
.neon-bar--bottom {
    box-shadow:
        0  0  6px 1px rgba(255, 126, 179, 0.8),
        0  0 18px 3px rgba(79, 172, 254, 0.6),
        0  0 30px 5px rgba(120, 255, 214, 0.3);
}

@keyframes neonShift {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* ─── TOC (ÍNDICE FLUTUANTE) ─── */
#toc-sidebar {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    z-index: 1000;
    opacity: 0; /* starts hidden, fades in with JS */
    pointer-events: none; /* enabled when visible */
    transition: opacity 0.3s ease;
}

.toc-title {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    margin-bottom: 15px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 5px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding-left: 10px;
    position: relative;
}

.toc-list li::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.2s ease;
}

.toc-list li:hover, .toc-list li.active {
    color: #fff;
    transform: translateX(3px);
}

.toc-list li.active::before {
    background: #ff7eb3;
    box-shadow: 0 0 8px #ff7eb3;
    transform: translateY(-50%) scale(1.5);
}

/* ─── MAIN FOOTER ─── */
#main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    z-index: 1100;
    pointer-events: none; /* so it doesn't block clicks */
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
}

.signature {
    font-weight: 300;
}

.disclaimer {
    font-weight: 700;
    color: rgba(255, 100, 100, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* MOBILE ADJUSTMENTS */
@media (max-width: 768px) {
    /* Center book+tagline+prompt group in the vertical middle of the screen */
    #intro-scene {
        gap: 12px;
        padding-bottom: 40px;
    }

    #book-badge {
        font-size: clamp(1.4rem, 6.2vw, 1.95rem);
        letter-spacing: 2px;
    }

    /* Tagline smaller on mobile */
    #book-tagline {
        font-size: clamp(0.75rem, 3.6vw, 0.92rem);
        max-width: 290px;
        line-height: 1.35;
    }

    #scroll-prompt {
        gap: 8px;
        margin-top: 2px;
    }
    #scroll-prompt p {
        font-size: 0.72rem;
        letter-spacing: 0.8px;
    }
    .mouse-icon {
        width: 18px;
        height: 28px;
        border-width: 1.5px;
    }
    .mouse-icon::before {
        width: 3px;
        height: 5px;
        top: 4px;
    }

    #grain-overlay {
        display: none !important;
    }
    #glitter {
        display: none !important;
    }

    .magazine-page {
        width: 86vw;
        max-width: 390px;
        height: auto;
        max-height: 84vh;
        aspect-ratio: 9 / 16;
        padding: 6px;
        border-radius: 10px;
        box-shadow: 0 10px 24px rgba(0,0,0,0.55);
    }
    .magazine-page::after {
        display: none !important;
    }

    #toc-sidebar {
        display: block;
        top: 6%;
        left: 50%;
        transform: translateX(-50%);
        width: 94vw;
        max-width: 480px;
        padding: 6px 10px;
        border-radius: 24px;
        background: rgba(15, 15, 25, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.15);
    }
    .toc-title {
        display: none; /* Hide title on mobile for clean pill strip */
    }
    .toc-list {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 2px 2px;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
    }
    .toc-list::-webkit-scrollbar {
        display: none;
    }
    .toc-list li {
        font-size: 10.5px;
        font-weight: 500;
        margin-bottom: 0;
        padding: 4px 10px;
        border-radius: 16px;
        background: rgba(255,255,255,0.06);
        border: 1px solid rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.7);
        flex-shrink: 0;
    }
    .toc-list li::before {
        display: none;
    }
    .toc-list li:hover, .toc-list li.active {
        color: #fff;
        background: linear-gradient(135deg, rgba(255, 126, 179, 0.4), rgba(79, 172, 254, 0.4));
        border-color: rgba(255, 126, 179, 0.8);
        box-shadow: 0 0 10px rgba(255, 126, 179, 0.4);
        transform: scale(1.02);
    }
    
    #main-footer {
        flex-direction: column;
        text-align: center;
        font-size: 9px;
        padding: 5px;
        background: rgba(0,0,0,0.85);
    }
}
