* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Remove blue highlight on tap for all buttons and clickable elements */
button, a {
    -webkit-tap-highlight-color: transparent; /* Chrome, Safari, iOS */
    outline: none; /* remove focus outline if needed */
}
body {
 /* === HEADER & THEME TOGGLE POSITIONING === */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center; /* keeps the title centered */
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 3rem; /* increased spacing from top / menu button */
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem; /* pushes title lower */
}

.theme-toggle {
    position: fixed; /* moves to top-right */
    top: 1.5rem; /* same vertical as menu button */
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
    z-index: 1510; /* above everything else */
    -webkit-tap-highlight-color: transparent;
    outline: none;
    padding: 0.3rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    opacity: 1;
}

body.dark .theme-toggle {
    color: #f0f0f0;
}

body.light .theme-toggle {
    color: #121212;
}

/* Ensure header title does not overlap menu or theme button on small screens */
@media (max-width: 768px) {
    .header h1 {
        margin-top: 2rem;
        font-size: 1.8rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }
} 
    font-family: 'Inter', sans-serif;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(5px);
    z-index: -1;
    pointer-events: none;
}

body.dark {
    background-color: #121212;
    color: #f0f0f0;
}

body.light {
    background-color: #f5f5f5;
    color: #121212;
}

.gradient-bg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
    transition: background 0.4s ease;
}

body.dark .gradient-bg {
    background: radial-gradient(circle, rgba(139, 0, 0, 0.15), transparent 70%);
}

body.light .gradient-bg {
    background: radial-gradient(circle, rgba(0, 0, 0, 0.08), transparent 70%);
}

.header {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    z-index: 100;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.header.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    padding: 0.3rem;
    margin-left: 0.5rem;
}

.theme-toggle:focus {
    outline: none;
}

.theme-toggle:hover {
    transform: scale(1.1);
    opacity: 1;
}

body.dark .theme-toggle {
    color: #f0f0f0;
}

body.light .theme-toggle {
    color: #121212;
}

.container {
    max-width: 1200px;
    width: 100%;
    z-index: 1;
    position: relative;
}

h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.book-card {
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: visible;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border-radius: 20px;
    z-index: -1;
    transition: opacity 0.3s ease;
}

body.dark .book-card::before {
    background: radial-gradient(circle, rgba(139, 0, 0, 0.075), transparent 70%);
    opacity: 1;
}

body.light .book-card::before {
    background: radial-gradient(circle, rgba(139, 0, 0, 0.045), transparent 70%);
    opacity: 1;
}

.book-card:hover::before {
    opacity: 1.5;
}

body.dark .book-card {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light .book-card {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.book-card:hover {
    transform: translateY(-5px);
}

body.dark .book-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

body.light .book-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.book-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.book-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.8;
    font-weight: 400;
}

.coming-soon-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
}

body.dark .coming-soon-badge {
    background: #333333;
    color: #fcfcfc;
}

body.light .coming-soon-badge {
    background: rgba(0, 0, 0, 0.1);
    color: #000;
}

.book-subtitle {
    font-size: 0.95rem;
    font-style: italic;
    margin-bottom: 2rem;
    opacity: 0.7;
    font-weight: 400;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    overflow: visible;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    border-radius: 10px;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(20px);
}

body.dark .btn {
    background: #333333;
    color: #fff;
}

body.dark .btn::before {
    background: #83838300;
    opacity: 0.125;
}

body.light .btn {
    background: #333333;
    color: #fff;
}

body.light .btn::before {
    background: #ffffff00;
    opacity: 0.075;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn:hover::before {
    opacity: 0.2;
}

body.dark .btn:hover {
    background: #000000;
}

body.light .btn:hover {
    background: #000000;
}

.read-short-section {
    margin-top: 3rem;
    text-align: center;
}

.read-short-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.contact-section {
    text-align: center;
    margin-top: 4rem;
    opacity: 0.8;
}

/* Download Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup {
    background: inherit;
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    color: inherit;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    opacity: 1;
}

.popup-message {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

/* Instagram Button Styles */
.instagram-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 100;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
}

.instagram-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    border-radius: 50%;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(20px);
}

body.dark .instagram-btn {
    background: #8B0000;
    color: #fff;
}

body.dark .instagram-btn::before {
    background: #8B0000;
    opacity: 0.125;
}

body.light .instagram-btn {
    background: #000;
    color: #fff;
}

body.light .instagram-btn::before {
    background: #8B0000;
    opacity: 0.075;
}

.instagram-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.instagram-btn:hover::before {
    opacity: 0.2;
}

body.dark .instagram-btn:hover {
    background: #A00000;
}

body.light .instagram-btn:hover {
    background: #333;
}

/* Instagram Popup Styles */
.instagram-popup {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: inherit;
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.instagram-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.instagram-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.instagram-handle {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.copy-btn {
    background: #8B0000;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    animation: heartbeat-glow 2s ease-in-out infinite;
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    border-radius: 10px;
    z-index: -1;
    transition: opacity 0.3s ease;
    filter: blur(20px);
    background: #8B0000;
    opacity: 0.3;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.copy-btn:hover::before {
    opacity: 0.5;
}

.copy-btn:active {
    transform: translateY(0);
}

@keyframes heartbeat-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 0, 0, 0.6), 0 0 30px rgba(139, 0, 0, 0.4);
    }
}

.copy-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.copy-btn:active {
    transform: scale(0.95);
}

.contact-section a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.contact-section a:hover {
    opacity: 0.6;
}

/* Writing Page Styles */
.writing-page {
    display: none;
    min-height: 100vh;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    position: relative;
}

.writing-page.active {
    display: block;
}

.close-btn {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: inherit;
    line-height: 1;
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.writing-content {
    margin-top: 4rem;
}

.writing-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 3rem;
}

.writing-text {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: 4rem;
    white-space: pre-wrap;
}

.writing-attribution {
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 3rem;
}

.attribution-written {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.attribution-by {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.attribution-author {
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.read-another-btn {
    display: block;
    margin: 0 auto;
    padding: 0.75rem 2rem;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        padding: 2rem;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .writing-title {
        font-size: 2rem;
    }

    .writing-text {
        font-size: 1.1rem;
    }

    .close-btn {
        top: 1rem;
        left: 1rem;
        font-size: 2rem;
    }
    html, body {
  width: 100%;
  overflow-x: hidden !important;
}
}
/* Quick-fix: hide-on-scroll targets actually used in your HTML */
.header.hide,
.menu-toggle.hide,
.menu-wrapper.hide,
.theme-toggle.hide,
.menu-wrapper.hide {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
