/* =========================================
   GLOBAL RESET
========================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body,
html{
    width:100%;
    height:100%;

    overflow:hidden;

    background:#000;
    color:white;

    font-family:'Inter',sans-serif;

    animation:pageReveal 1.4s ease;
}

/* =========================================
   FEED
========================================= */

.feed-container{
    width:100vw;
    height:100vh;

    overflow-y:scroll;

    scroll-snap-type:y mandatory;

    scrollbar-width:none;
}

.feed-container::-webkit-scrollbar{
    display:none;
}

/* =========================================
   BOOK SECTION
========================================= */

.book-section{
    position:relative;

    width:100vw;
    height:100vh;

    overflow:hidden;

    display:flex;
    justify-content:center;
    align-items:center;

    scroll-snap-align:start;

    background-size:cover;
    background-position:center;

    transform-style:preserve-3d;
}

/* BACKGROUND LAYER */

.book-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    transform: scale(1.1) translateY(var(--parallax, 0rem));
    transition: transform 1.6s ease-out;
    z-index: -2;
}

/* ATMOSPHERIC OVERLAY */

.book-section::before{
    content:'';

    position:absolute;
    inset:0;

    background:
        radial-gradient(
            circle at center,
            rgba(0,0,0,0.15) 0%,
            rgba(0,0,0,0.55) 55%,
            rgba(0,0,0,0.92) 100%
        );

    z-index:-1;
}

/* ACTIVE SECTION */

.book-section.active::after{
    transform:
        scale(1.03)
        translateY(var(--parallax,0rem));
}

/* =========================================
   MAIN CONTENT — CINEMATIC
========================================= */

.main-content {
    position: relative;
    z-index: 5;
    width: min(90%, 44rem);
    padding: 1.5rem;
    text-align: center;
    transition:
        transform 1s cubic-bezier(0.19,1,0.22,1),
        opacity 1s ease,
        filter 1s ease;
}

.book-section:not(.active) .main-content {
    opacity: 0.35;
    transform: scale(0.92) translateY(2.5rem);
    filter: blur(0.2rem);
}

.book-section.active .main-content {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0rem);
}

/* =========================================
   TYPOGRAPHY — CINEMATIC
========================================= */

.book-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    margin-bottom: 0.4rem;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(1.5rem);
    transition: transform 1.2s ease, opacity 1s ease;
}

.book-section.active .book-title {
    opacity: 1;
    transform: translateY(0);
}

.author-name {
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    text-transform: uppercase;
    letter-spacing: 0.3rem;
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
    opacity: 0;
    transform: translateY(1rem);
    transition: transform 1.2s ease 0.3s, opacity 1s ease 0.3s;
}

.book-section.active .author-name {
    opacity: 0.7;
    transform: translateY(0);
}

.description {
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.9;
    font-weight: 300;
    letter-spacing: 0.02em;
    min-height: 5rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.book-section.active .description {
    opacity: 1;
}

/* TYPEWRITER CURSOR */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: rgba(255,255,255,0.7);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* CINEMATIC LINE — appears above title */
.cinematic-line {
    display: block;
    width: 2rem;
    height: 1px;
    background: rgba(255,255,255,0.4);
    margin: 0 auto 1.2rem auto;
    opacity: 0;
    transform: scaleX(0);
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.book-section.active .cinematic-line {
    opacity: 1;
    transform: scaleX(1);
}
/* =========================================
   TOP NAV
========================================= */
.top-nav {
    position: fixed;
    top: 2rem;
    right: 3rem;
    z-index: 9998;
    overflow: visible;
}

.login-btn{
    color:white;

    text-decoration:none;

    font-size:0.9rem;

    letter-spacing:0.08rem;

    opacity:0.8;

    transition:
        transform 0.4s ease,
        opacity 0.4s ease,
        letter-spacing 0.4s ease;
}

.login-btn:hover{
    transform:translateY(-0.2rem);

    letter-spacing:0.16rem;
}

/* =========================================
   SIDEBARS
========================================= */

.left-sidebar,
.right-sidebar{
    position:fixed;

    top:50%;

    transform:translateY(-50%);

    display:flex;
    flex-direction:column;

    z-index:100;
}

.left-sidebar{
    left:2rem;

    gap:2rem;
}

.right-sidebar{
    right:2rem;

    gap:1.7rem;
}

.sidebar-icon{
    opacity:0.6;

    cursor:pointer;

    transition:
        transform 0.5s ease,
        opacity 0.5s ease;
}

.sidebar-icon:hover{
    opacity:1;

    transform:
        translateY(-0.25rem)
        scale(1.08);
}

/* =========================================
   SCROLL BUTTONS
========================================= */

.scroll-nav-buttons{
    position:fixed;

    right:2rem;
    bottom:2rem;

    display:flex;
    flex-direction:column;

    gap:1rem;

    z-index:100;
}

.nav-btn{
    display:flex;
    justify-content:center;
    align-items:center;

    padding:0.7rem;

    border:none;

    border-radius:50%;

    background:rgba(255,255,255,0.1);

    color:white;

    cursor:pointer;

    backdrop-filter:blur(0.4rem);

    transition:
        transform 0.5s ease,
        background 0.5s ease;
}

.nav-btn:hover{
    transform:scale(1.08);

    background:rgba(255,255,255,0.18);
}

/* =========================================
   SCROLL INDICATOR
========================================= */

.scroll-indicator{
    position:fixed;

    top:5%;
    right:0.4rem;

    width:0.12rem;
    height:90%;

    background:rgba(255,255,255,0.1);

    z-index:100;
}

.scroll-thumb{
    width:100%;
    height:6rem;

    background:rgba(255,255,255,0.6);

    transition:transform 0.4s ease;

    box-shadow:
        0 0 1rem rgba(255,255,255,0.25),
        0 0 2rem rgba(255,255,255,0.12);
}

/* =========================================
   TRANSITION LAYER
========================================= */

#transition-layer{
    position:fixed;
    inset:0;

    z-index:9999;

    background:
        radial-gradient(
            circle at center,
            rgba(255,255,255,0.06) 0%,
            rgba(0,0,0,0.92) 55%,
            rgba(0,0,0,1) 100%
        );

    opacity:0;

    visibility:hidden;

    pointer-events:none;

    transform:scale(1.08);

    transition:
        opacity 0.8s ease,
        transform 1s cubic-bezier(0.77,0,0.175,1);
}

#transition-layer.active{
    opacity:1;

    visibility:visible;

    transform:scale(1);
}

/* =========================================
   ANIMATIONS
========================================= */

@keyframes pageReveal{

    from{
        opacity:0;

        filter:blur(0.6rem);

        transform:scale(1.03);
    }

    to{
        opacity:1;

        filter:blur(0rem);

        transform:scale(1);
    }

}

@keyframes floatIn{

    from{
        opacity:0;

        transform:translateY(2.5rem);

        filter:blur(0.5rem);
    }

    to{
        opacity:1;

        transform:translateY(0rem);

        filter:blur(0rem);
    }

}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media(max-width:48rem){

    .top-nav{
        top:1rem;
        right:1rem;
    }

    .left-sidebar{
        left:0.8rem;
        gap:1.2rem;
    }

    .right-sidebar{
        right:0.8rem;
        gap:1rem;
    }

    .sidebar-icon{
        width:1rem;
        height:1rem;
    }

    .scroll-nav-buttons{
        right:1rem;
        bottom:1rem;
        gap:0.7rem;
    }

    .nav-btn{
        padding:0.55rem;
    }

    .scroll-indicator{
        right:0.15rem;
        width:0.08rem;
    }

    .scroll-thumb{
        height:4rem;
    }

    .main-content{
        width:92%;
        padding:1rem;
    }

    .book-title{
        font-size:clamp(2.2rem,10vw,3.5rem);
    }

    .author-name{
        letter-spacing:0.15rem;
        margin-bottom:2rem;
    }

    .description{
        font-size:0.95rem;
        line-height:1.8;
    }

    .hook{
        font-size:0.85rem;
    }

}
/* =========================================
   BRAND / LOGO
========================================= */

.brand-container{
    position:fixed;

    top:1rem;
    left:1.5rem;

    transform:none; /* remove centering */

    z-index:300;

    display:flex;
    flex-direction:column;
    align-items:flex-start;

    gap:0.2rem;
}

.brand-logo{
    width: 10rem;

   

    image-rendering:auto;
    -webkit-font-smoothing:antialiased;
    

   
    pointer-events:none;

    animation:logoFloat 5s ease-in-out infinite;
}
.brand-title{
    font-family:'Playfair Display',serif;

    font-size:clamp(0.5rem,1vw,0.7rem);
    letter-spacing:0.55rem;

    font-weight:700;

    text-transform:uppercase;

    opacity:0.88;

    text-align:center;
    animation:logoFloat 5s ease-in-out infinite;
}

/* Floating cinematic movement */

@keyframes logoFloat{

    0%{
        transform:translateY(0rem);
    }

    50%{
        transform:translateY(-0.25rem);
    }

    100%{
        transform:translateY(0rem);
    }

}
/* User Menu */
.user-menu {
    position: relative;
    z-index: 9998;
}

.user-name {
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: border-color 0.3s;
}

.user-name:hover {
    border-color: rgba(255,255,255,0.4);
}

.user-dropdown {
    display: none;
    position: fixed;
    top: 5rem;
    right: 3rem;
    background: #0b0b12;
    border: 1px solid rgba(255,255,255,0.08);
    min-width: 160px;
    z-index: 9998;
}
.user-dropdown.open {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.dropdown-item:hover {
    color: #f8f4ee;
    background: rgba(255,255,255,0.04);
}
.auth-error {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 80, 80, 0.8);
    text-align: center;
    margin-bottom: 20px;
}
  .verify-icon {
            font-size: 2.5rem;
            margin-bottom: 1.2rem;
            display: block;
        }
        .verify-action {
            display: inline-block;
            margin-top: 2.5rem;
            padding: 14px 44px;
            border: 1px solid rgba(255,255,255,0.25);
            color: #f8f4ee;
            font-size: 11px;
            letter-spacing: 5px;
            text-transform: uppercase;
            text-decoration: none;
            transition: border-color 0.3s;
        }
        .verify-action:hover {
            border-color: rgba(255,255,255,0.6);
        }
.logout-btn {
    color: white;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.logout-btn:hover {
    opacity: 1;
}
.action-btn {
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.liked {
    opacity: 1 !important;
    color: rgba(255, 80, 80, 0.9) !important;
    filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.6));
}

.action-btn.saved {
    opacity: 1 !important;
    color: rgba(255, 180, 80, 0.9) !important;
    filter: drop-shadow(0 0 6px rgba(255, 180, 80, 0.6));
}
/* UNMUTE OVERLAY */
#unmute-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 10, 0.85);
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: opacity 0.6s ease;
}

#unmute-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.unmute-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: white;
    text-align: center;
}

.unmute-icon {
    width: 56px;
    height: 56px;
    opacity: 0.9;
    animation: pulse 2s infinite;
}

.unmute-content p {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    letter-spacing: 0.1em;
    opacity: 0.85;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* MUTE BUTTON */
#mute-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    color: white;
}

#mute-btn:hover {
    background: rgba(255,255,255,0.15);
}
/* =========================================
   DAILY FACT BUBBLE
========================================= */
#fact-bubble {
    position: fixed;
    top: 90px;       /* Puts it just below the LOGOUT button */
    right: 35px;     /* Aligns it to the right side */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#fact-bubble-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,180,80,0.3), rgba(255,140,40,0.15));
    border: 1px solid rgba(255,180,80,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,180,80,0.9);
    box-shadow: 0 0 20px rgba(255,180,80,0.3), 0 0 40px rgba(255,180,80,0.15);
    animation: factGlow 2.5s ease-in-out infinite;
    transition: transform 0.3s ease;
}

#fact-bubble:hover #fact-bubble-inner {
    transform: scale(1.1);
}

.fact-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,180,80,0.7);
}

.fact-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ff4444;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: badgePulse 1.5s infinite;
    display: none;
}

.fact-badge.visible {
    display: flex;
}

@keyframes factGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(255,180,80,0.3), 0 0 40px rgba(255,180,80,0.15); }
    50%       { box-shadow: 0 0 30px rgba(255,180,80,0.5), 0 0 60px rgba(255,180,80,0.25); }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.2); }
}

/* =========================================
   FACT POPUP
========================================= */
#fact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#fact-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#fact-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 9001;
    width: min(90%, 480px);
    background: linear-gradient(145deg, #1a1308, #120e05);
    border: 1px solid rgba(255,180,80,0.3);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(255,180,80,0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#fact-popup.active {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

#fact-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.08);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

#fact-close:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.fact-popup-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.fact-popup-header {
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255,180,80,0.8);
    margin-bottom: 1rem;
}

.fact-popup-divider {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,180,80,0.5), transparent);
    margin: 1rem auto;
}

.fact-popup-did {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    margin-bottom: 1rem;
    font-style: italic;
}

.fact-popup-text {
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    line-height: 1.8;
    color: #f8f4ee;
    margin-bottom: 1rem;
}

.fact-popup-category {
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,180,80,0.6);
    margin-bottom: 0.3rem;
}

.fact-popup-hour {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
    margin-bottom: 1.5rem;
}

.fact-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, rgba(255,180,80,0.2), rgba(255,140,40,0.1));
    border: 1px solid rgba(255,180,80,0.4);
    color: rgba(255,180,80,0.9);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
    transition: all 0.3s ease;
}

.fact-share-btn:hover {
    background: linear-gradient(135deg, rgba(255,180,80,0.3), rgba(255,140,40,0.2));
    border-color: rgba(255,180,80,0.7);
}

.fact-popup-close-btn {
    width: 100%;
    padding: 0.9rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.fact-popup-close-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
/* =========================================
   SEARCH READER ACTIVE SLIDE
========================================= */
.search-slide.active .cinematic-line {
    opacity: 1;
    transform: scaleX(1);
    display: block;
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.8), transparent);
    margin: 0 auto 1.5rem;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

.search-slide.active .book-title {
    opacity: 1;
    transform: translateY(0);
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: #f8f4ee;
    margin-bottom: 0.5rem;
    transition: transform 1.2s ease, opacity 1s ease;
}

.search-slide.active .author-name {
    opacity: 0.7;
    transform: translateY(0);
    transition: transform 1.2s ease 0.3s, opacity 1s ease 0.3s;
}

.search-slide.active .description {
    opacity: 1;
    transition: opacity 0.5s ease 0.6s;
}
#fullscreen-toggle {
    position: fixed;
    bottom: clamp(1.5rem, 3vw, 2rem);
    left: clamp(5rem, 8vw, 6rem);
    z-index: 1000;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50%;
    width: clamp(2.4rem, 3vw, 2.8rem);
    height: clamp(2.4rem, 3vw, 2.8rem);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background 0.3s ease;
}

#fullscreen-toggle:hover {
    background: rgba(255,255,255,0.15);
}

#fullscreen-toggle svg {
    width: clamp(1rem, 1.5vw, 1.2rem);
    height: clamp(1rem, 1.5vw, 1.2rem);
}