/* =========================================
   RESET & GLOBAL STYLES
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; 
}

body {
    background: #343334;
    color: #fff;
    line-height: 1.6;
    max-width: 100vw;
    overflow-x: hidden;
    position: relative;
}


/* =========================================
   NAVIGATION (Wide & Sleek Glass Pill)
   ========================================= */
nav {
    position: fixed;
    top: 15px; /* Moved slightly up to save space */
    left: 50%;
    transform: translateX(-50%);
    
    /* WIDTH SETTINGS */
    width: auto;
    min-width: 800px; /* Forces it to be wide enough for links */
    max-width: 95%;   /* Prevents it from hitting the screen edges */
    
    /* HEIGHT SETTINGS */
    padding: 0.3rem 2rem; /* Reduced top/bottom padding for a shorter bar */
    
    border-radius: 50px;
    
    /* Glass Effect */
    background: rgba(30, 30, 30, 0.7); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu {
    display: flex;
    justify-content: space-between; /* Spreads items out evenly */
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    width: 100%;
    flex-wrap: nowrap; /* CRITICAL: This prevents the second row */
}

.menu a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    
    /* Made links slightly more compact to save height */
    padding: 0.5rem 1rem; 
    font-size: 0.9rem;
    
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 20px;
    white-space: nowrap; /* CRITICAL: Prevents text from breaking */
}

/* Hover Effect */
.menu a.clickable:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* =========================================
   RESPONSIVE (Revert to full width on Tablet/Mobile)
   ========================================= */
/* I increased this to 900px. Since the menu is now wider, 
   we need to switch to Mobile view sooner so it doesn't get cut off. */
@media screen and (max-width: 900px) {
    nav {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        min-width: auto; /* Reset the wide width */
        border-radius: 0;
        justify-content: space-between;
        background: rgba(30, 30, 30, 0.95);
        padding: 0.5rem 1.5rem;
        height: 60px;
    }

    /* This hides the desktop text links when screen gets small */
    /* Your existing hamburger logic in the HTML/JS will handle the rest */
    .menu {
        display: none; 
    }
    
    .menu.active {
        display: flex; /* Restored by your existing JS when hamburger is clicked */
    }
}

/* =========================================
   LANDING PAGE WRAPPER
   ========================================= */
.landing-wrapper {
    height: 100vh;
    height: 100svh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.landing-wrapper .title-section {
    flex: 0 0 auto;       
    margin-top: 60px;
    padding-bottom: 1rem;
    padding-top: 1rem;
}

.landing-wrapper .hero {
    flex: 1;              
    display: flex;
    align-items: center; 
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.landing-wrapper .container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shapes-gif {
    max-height: 55vh;
    width: auto;          
    max-width: 90%;       
    margin: 0 auto;
    object-fit: contain;  
    display: block;
}

/* =========================================
   BACKGROUND ANIMATION
   ========================================= */
.background-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.engineering-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
    z-index: 1;
}

.agent-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    z-index: 0;
    animation: pulse-glow 3s infinite alternate ease-in-out;
}

.glow-blue { background: #5B9FE3; width: 600px; height: 500px; top: 23%; right: -150px; opacity: 0.3; animation-delay: 2s; }
.glow-green { background: #00f9b3; width: 500px; height: 350px; top: 42%; left: -200px; opacity: 0.3; animation-delay: 2s; }
.glow-red { background: #FF6B6B; width: 700px; height: 500px; bottom: -200px; left: -200px; opacity: 0.3; animation-delay: 2s; }

@keyframes pulse-glow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.3; }
    100% { transform: scale(1.1) translate(20px, 20px); opacity: 0.5; }
}

/* =========================================
   TITLE SECTION
   ========================================= */
.title-section {
    text-align: center;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    background: transparent;
}

.title-wrapper {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.author-name {
    font-size: 2.5rem;
    color: #ffe065;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-align: left;
}

.book-title-main {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0.5rem 0;
    text-align: left;
    white-space: nowrap;
    background: linear-gradient(90deg, #cb8df1, #42d3ff, #59f7b8, #ff7272);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    width: fit-content; 
}

.scroll-arrow {
    position: relative;
    width: 40px;
    height: 40px;
    margin: 1rem auto 0;
    cursor: pointer;
    z-index: 100;
    transition: transform 0.3s ease;
    display: block;
}
.scroll-arrow:hover { transform: scale(1.2); }
.scroll-arrow::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 25px; height: 25px;
    border-left: 4px solid #d9d9d9; border-bottom: 4px solid #d9d9d9;
    transform: translate(-50%, -50%) rotate(-45deg); animation: bounce 2s infinite;
}
@keyframes bounce {
    0%, 100% { transform: translate(-50%, -50%) rotate(-45deg) translate(0, 0); }
    50% { transform: translate(-50%, -50%) rotate(-45deg) translate(-10px, 10px); }
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.content {
    padding: 0;
    margin-top: 0;
    position: relative;
    z-index: 2;
    background: transparent;
    width: 100%;
    overflow-x: hidden;
}

.section {
    max-width: 800px;
    margin: 0 auto 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    background: transparent !important;
    position: relative;
    z-index: 1;
}

/* ABOUT BOOK */
.about-book { width: 100%; max-width: 1200px; padding: 2rem; margin: 0 auto 2rem auto; position: relative; box-sizing: border-box; }
.about-book h2 { padding: 0 0 1rem 0; margin-bottom: 1.5rem; text-align: center; color: #fff; font-size: 2rem; }
.about-book-container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; display: flex; align-items: flex-start; gap: 2rem; }
.book-3d-image { flex: 0 0 45%; max-width: 500px; width: 100%; height: auto; border-radius: 8px; object-fit: contain; }
.about-book-content { flex: 1; color: #fff; font-size: 1rem; line-height: 1.6; }

.features-box { background: rgba(91, 159, 227, 0.1); padding: 1.5rem; border-radius: 8px; margin: 2rem 0; }
.features-list { list-style: none; color: #fff; line-height: 1.8; margin-left: 2rem; }
.features-list li { margin-bottom: 1rem; display: block; padding-left: 1.5rem; text-indent: -1.5rem; }
.features-list li:before { content: "•"; color: #fff; font-size: 24px; line-height: 1; margin-right: 0.25rem; }

/* =========================================
   TESTIMONIALS (GRID LAYOUT FIX)
   ========================================= */
/* TESTIMONIALS - SINGLE CLEAN VERSION */
.testimonials-section {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem 2rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.testimonials-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #fff;
}

/* USE FLEXBOX INSTEAD OF GRID */
.testimonials-container {
    display: flex !important;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

.testimonial-card {
    flex: 1 1 calc(50% - 1rem);
    min-width: 300px;
    max-width: 550px;
    
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
    
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    
    opacity: 1 !important;
    visibility: visible !important;
    
    transition: all 0.2s ease;
}

.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(91, 159, 227, 0.4);
    transform: translateY(-2px);
}

.testimonial-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.testimonial-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.testimonial-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e0e0e0;
    font-style: italic;
    margin: 0;
}

.testimonial-author {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 700;
    margin-top: auto;
}

.testimonial-author .role {
    font-weight: 400;
    color: #bbb;
    font-size: 0.85rem;
}

.testimonial-author a {
    color: #5B9FE3;
    text-decoration: none;
}

.view-all-container {
    text-align: center;
    margin-top: 2rem;
    opacity: 1 !important;
    transform: none !important;
}

.view-all-link {
    color: #5B9FE3;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    display: inline-block;
    padding: 0.5rem 1rem;
}

.view-all-link:hover {
    color: #FFE066;
}

/* NO ANIMATIONS - they might be breaking layout */
@keyframes fadeIn {
    from { opacity: 1; }
    to { opacity: 1; }
}

/* Mobile */
@media screen and (max-width: 900px) {
    .testimonials-container {
        flex-direction: column;
        align-items: center;
    }
    
    .testimonial-card {
        flex: 1 1 100%;
        max-width: 600px;
    }
}

/* =========================================
   BUY THE BOOK
   ========================================= */
#buythebook {
    position: relative; z-index: 1; padding: 6rem 1rem; text-align: center; width: 100%;
    background-color: #F0F2F5; color: #1a1a1a;
}
#buythebook h2 { color: #1a1a1a; font-size: 2.5rem; font-weight: 800; margin-bottom: 3rem; letter-spacing: -0.5px; }
#buythebook .cards-container { max-width: 1400px; margin: 0 auto; display: flex; justify-content: center; align-items: stretch; flex-wrap: wrap; gap: 2rem; }
#buythebook .card {
    background: #ffffff; border: none; border-radius: 24px; width: 300px; max-width: 100%; padding: 2.5rem 2rem; margin: 0;
    box-shadow: 0 10px 40px -10px rgba(55, 20, 105, 0.08); transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column; align-items: center;
}
#buythebook .card:hover { transform: translateY(-10px); box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15); }
#buythebook .card img { height: 220px; width: auto; margin-bottom: 1.5rem; object-fit: contain; filter: drop-shadow(0 10px 10px rgba(0,0,0,0.1)); }
#buythebook .card .card-title { font-size: 1.4rem; font-weight: 700; color: #1a1a1a; margin-bottom: 1.5rem; }
#buythebook .card a {
    display: inline-block; width: 100%; background: linear-gradient(180deg, #35b074 0%, #02623c 100%); color: #fff; border: none;
    padding: 16px 20px; text-decoration: none; border-radius: 50px; margin-top: auto; font-weight: 600; font-size: 1.1rem;
    box-shadow: 0 5px 10px #00ad686f; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
#buythebook .card a:hover { background: linear-gradient(180deg, #45e497 0%, #05985d 100%); transform: translateY(-3px); box-shadow: 0 5px 10px #01c47690; }
.pdf-offer { text-align: center; margin-top: 4rem; color: #4a4a4a; font-size: 1.1rem; line-height: 1.6; max-width: 600px; margin-left: auto; margin-right: auto; }
.pdf-offer a { color: #5B9FE3; text-decoration: none; border-bottom: 2px solid rgba(91, 159, 227, 0.3); font-weight: bold; }
.pdf-offer a:hover { border-bottom-color: #5B9FE3; color: #1a1a1a; }

/* =========================================
   CHAPTERS
   ========================================= */
#chapters { width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 4rem; }
#chapters h2 { margin-bottom: 1.5rem; color: #fff; font-size: 2rem; }
#chapters .chapters-content { display: flex; align-items: center; gap: 2rem; }
#chapters .chapters-image { flex: 0 0 50%; max-width: 50%; height: auto; border-radius: 8px; object-fit: cover; }
#chapters .chapters-text { flex: 1; color: #fff; }
#chapters .chapters-list { list-style: none; padding: 0; margin: 1rem 0; }
#chapters .chapters-list li { margin-bottom: 1rem; display: flex; align-items: baseline; gap: 0.25rem; flex-wrap: wrap; margin-left: 2rem; }
#chapters .chapters-list li:before { content: "•"; color: #fff; font-size: 24px; line-height: 1; margin-right: 0.25rem; flex: 0 0 auto; }
#chapters .chapters-list a { color: #5B9FE3; text-decoration: none; word-break: break-word; }
#chapters .chapters-list a:hover { color: #FFE066; text-decoration: underline;} 
#chapters .buy-later-note { text-align: center; margin-top: 2rem; color: #fff; }

/* =========================================
   ABOUT AUTHOR
   ========================================= */
#about {
    border: none; background: linear-gradient(145deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%); backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.15); border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 3rem; margin-top: 4rem; margin-bottom: 4rem;
}
#about::before {
    content: ''; display: block; width: 99.8%; height: 6px; background: linear-gradient(90deg, #5B9FE3, #FFE066, #FF6B6B);
    position: absolute; top: 0; left: 0; border-radius: 20px 20px 0 0; opacity: 0.8;
}
#about h2 { text-align: left; margin-bottom: 2rem; font-size: 2rem; color: #fff; }
.about-wrapper { display: flex; gap: 3rem; align-items: flex-start; }
.about-wrapper img {
    width: 180px; height: 180px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.1); box-shadow: 0 0 20px rgba(91, 159, 227, 0.2);
}
.about-content { flex: 1; }
.about-content p { margin-bottom: 1.2rem; color: #e0e0e0; font-size: 1.05rem; }
#about a.regularlink {
    display: inline-block; color: #fff; text-decoration: none; background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px; border-radius: 20px; margin-right: 6px; margin-bottom: 6px; font-size: 0.9rem; font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1); transition: all 0.2s ease;
}
#about a.regularlink:hover { background: #5B9FE3; border-color: #5B9FE3; transform: translateY(-2px); color: #fff; }

/* =========================================
   HAMBURGER & FOOTER
   ========================================= */
.hamburger { display: none; flex-direction: column; justify-content: space-around; width: 30px; height: 25px; background: transparent; border: none; cursor: pointer; padding: 0; z-index: 1001; }
.hamburger span { width: 30px; height: 3px; background: #fff; border-radius: 10px; transition: all 0.3s linear; position: relative; transform-origin: 1px; }
.hamburger.active span:first-child { transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); }
.footer { background: transparent; padding: 1rem; text-align: center; position: relative; z-index: 2; margin-top: 0; }
.copyright { color: #fff; opacity: 0.7; font-size: 0.9rem; }

/* =========================================
   RESPONSIVE RULES
   ========================================= */
@media screen and (max-width: 1320px) {
  #buythebook .cards-container { width: 100%; padding: 10px 20px; flex-wrap: wrap; justify-content: center; }
  #buythebook .card { margin: 10px; }
}

@media screen and (max-width: 1024px) {
    .about-book-container { flex-direction: column; align-items: center; padding: 0 3rem; }
    .about-book h2 { padding: 0 3rem; }
    .book-3d-image { flex: 0 0 60%; max-width: 300px; }
    .about-book-content { flex: 1; text-align: left; }
}

/* TABLET/MOBILE (Stack Testimonials) */
@media screen and (max-width: 900px) {
    .testimonials-container {
        grid-template-columns: 1fr; /* Stack vertically */
    }
    .testimonials-section {
        padding: 3rem 1.5rem 5rem 1.5rem; 
    }
}

@media screen and (max-width: 768px) {
    .landing-wrapper .title-section { margin-top: 80px; }
    .shapes-gif { max-height: 40vh; }
    .agent-glow { filter: blur(80px); opacity: 0.50; }
    .glow-blue { width: 300px; height: 300px; }
    .glow-yellow { width: 250px; height: 250px; top: 30%; }
    .glow-red { width: 300px; height: 300px; }
    .menu { justify-content: center; }
    .title-wrapper { width: 100%; padding: 0; align-items: center; overflow: visible; }
    .author-name { color: #ffe065; font-size: 2rem; text-align: center; }
    .book-title-main { font-size: 2.5rem; text-align: center; white-space: nowrap; overflow: visible; padding: 0; max-width: 100%; display: block; }
    .scroll-arrow { width: 30px; height: 30px; }
    #chapters .chapters-image { display: none; }
    #chapters .chapters-text { flex: 0 0 100%; max-width: 100%; }
    .about-book-container { flex-direction: column; align-items: center; }
    .book-3d-image { flex: 0 0 70%; max-width: 250px; margin-bottom: 1.5rem; }
    .about-book-content { text-align: left; }
    
    #about { padding: 2rem 1.5rem; }
    #about h2 { text-align: center; }
    .about-wrapper { flex-direction: column; align-items: center; text-align: center; gap: 1.5rem; }
    .about-content p { text-align: left; }
    .about-content p:last-child { text-align: center; margin-top: 1.5rem; }
    
    #buythebook .cards-container { flex-direction: column; align-items: center; }
    #buythebook .card { width: 100%; max-width: 340px; }
}

@media screen and (max-width: 768px) and (orientation: portrait) {
    .scroll-arrow { display: none; }
    .hamburger { display: flex; position: fixed; top: 15px; right: 20px; }
    .menu { position: fixed; top: 0; right: -100%; height: 100vh; width: 100%; background: rgba(51, 50, 51, 0.98); flex-direction: column; justify-content: center; gap: 2rem; transition: right 0.3s ease-in-out; backdrop-filter: blur(5px); }
    .menu.active { right: 0; }
}

@media (max-width: 480px) {
    .about-book-container { padding: 0 1rem; }
    .book-3d-image { flex: 0 0 80%; max-width: 200px; }
    .about-book-content { font-size: 0.95rem; }
    .about-book { padding: 1.5rem 1rem; }
    .testimonials-section { padding: 1rem 0.5rem; }
    .testimonial-card { padding: 1rem; gap: 1rem; }
}