@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

:root {
    --bg-deep: #0D0D0D;
    --bg-paper: #FDFBF7;
    --text-main: #E5E5E5;
    --text-muted: #A0A0A0;
    --accent: #B8860B; /* Muted Gold */
    --accent-warm: #4A3728; /* Earthy Brown */
    --serif: 'Cormorant Garamond', serif;
    --sans: 'Inter', sans-serif;
    --transition-slow: all 0.8s cubic-bezier(0.2, 0, 0.2, 1);
    
    /* Fluid Spacing & Type */
    --section-pad: clamp(5rem, 15vw, 12rem);
    --container-width: 1400px;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--sans);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, blockquote, .serif {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.2;
}

/* Typography Overhaul - Fluid */
h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 1.8rem); font-style: italic; }

p { font-size: clamp(0.95rem, 1.2vw, 1.1rem); letter-spacing: 0.01em; color: var(--text-muted); }

/* Layout & Spacing - Imperfect & Natural */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
}

section {
    padding: var(--section-pad) 0;
}

/* Navigation - Minimal & Elegant */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 1000;
    transition: var(--transition-slow);
    background: rgba(8, 8, 8, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

header.scrolled {
    background: rgba(5, 5, 5, 0.95);
    padding: 1.2rem 0;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    text-decoration: none !important;
    color: var(--text-main) !important;
    font-family: var(--serif);
    font-size: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.logo span { color: var(--accent); }

.nav-menu {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3.5rem;
}

.nav-menu a, 
.nav-menu a:link, 
.nav-menu a:visited {
    text-decoration: none !important;
    color: #E8E8E8 !important;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    transition: all 0.4s ease;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a:active {
    color: #fff !important;
    letter-spacing: 0.22em;
}

.nav-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2rem;
}

.nav-actions a:link,
.nav-actions a:visited,
.nav-actions a {
    text-decoration: none !important;
}

.btn-primary-nav {
    padding: 0.8rem 1.8rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff !important;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary-nav:hover {
    border-color: var(--accent);
    color: var(--accent) !important;
}

.nav-separator {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.12);
}

.nav-login-link {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E8E8E8 !important;
    text-decoration: none !important;
}

.btn-join {
    background: var(--accent);
    color: #000 !important;
    padding: 0.7rem 1.8rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-decoration: none !important;
    font-weight: 600;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.btn-join:hover {
    opacity: 0.85;
}

.user-first-name {
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sub-Header Styling */
.sub-header {
    padding: clamp(0.3rem, 1vw, 0.7rem) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(8, 8, 8, 0.5);
    transition: all 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    font-size: clamp(0.55rem, 0.8vw, 0.75rem); /* Smaller minimum for mobile */
}

.sub-header::-webkit-scrollbar { display: none; }

.sub-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-width: max-content;
    padding: 0 1rem;
    gap: clamp(0.8rem, 2vw, 3rem); /* Smaller gap minimum */
}

.sub-left {
    flex: 1;
    display: flex;
    gap: 2rem;
}

.sub-left a {
    color: var(--text-muted) !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
    white-space: nowrap; /* Prevent phone/email wrapping */
}

.sub-left a:hover { color: var(--accent) !important; }
.sub-left i { color: var(--accent); font-size: clamp(0.65rem, 0.8vw, 0.8rem); }

.sub-middle {
    flex: 1; /* Less space for middle now */
}

.search-bar {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    padding: 1px clamp(8px, 1vw, 12px);
    width: clamp(150px, 15vw, 250px); /* Fluid width */
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: rgba(184, 134, 11, 0.4);
    background: rgba(255, 255, 255, 0.05);
    width: clamp(200px, 20vw, 320px);
}

.search-bar input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 10px;
    width: 100%;
    font-size: 0.75rem;
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.search-bar button:hover { color: var(--accent); }

.sub-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
}

.sub-right a {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    text-decoration: none !important;
}

.sub-right a:hover {
    color: var(--accent) !important;
    transform: translateY(-2px);
}

/* Dropdown Styles Unified */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 10, 10, 0.98);
    min-width: 200px;
    box-shadow: 0px 10px 30px rgba(0,0,0,0.8);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 0.8rem 0;
    margin-top: 15px;
    backdrop-filter: blur(20px);
}

.nav-dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: flex;
    flex-direction: column;
}

.nav-dropdown-content a {
    color: #E8E8E8 !important;
    padding: 0.8rem 1.5rem !important;
    text-decoration: none !important;
    display: block !important;
    text-align: left;
    font-size: 0.75rem !important;
    letter-spacing: 0.12em !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

.nav-dropdown-content a:hover {
    background-color: rgba(184, 134, 11, 0.1) !important;
    color: var(--accent) !important;
    padding-left: 1.8rem !important;
}

/* Hero Section - Cinematic */
.hero {
    height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.4) contrast(1.1);
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(transparent, var(--bg-deep));
}

.hero-content {
    position: relative;
    z-index: 10;
    padding-top: 5vh;
}

.hero-content h1 {
    margin-bottom: 2rem;
    color: #fff;
    max-width: 800px;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
    max-width: 500px;
}

/* Buttons - Grounded */
.btn-story {
    padding: 1.2rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    transition: all 0.5s ease;
    display: inline-block;
}

.btn-story:hover {
    background: #fff;
    color: #000;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

/* Story Sections */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(3rem, 8vw, 8vw);
    align-items: center;
}

.story-image {
    position: relative;
}

.story-image img {
    width: 100%;
    height: auto;
    filter: grayscale(0.2);
}

.caption {
    font-family: var(--serif);
    font-style: italic;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
}

/* Handwritten Style */
.handwritten {
    font-family: var(--serif);
    font-style: italic;
    font-size: 2.5rem;
    line-height: 1.4;
    color: var(--text-main);
    border-left: 2px solid var(--accent);
    padding-left: 3rem;
    margin: 4rem 0;
}

/* Cards - Natural & Grounded */
.journey-card {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    transition: var(--transition-slow);
}

.journey-card:hover {
    border-color: var(--accent);
}

/* Bookstore - Organic */
.book-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: clamp(2rem, 5vw, 5rem);
}

.book-item {
    text-align: left;
}

.book-img-wrapper {
    background: #151515;
    padding: 4rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-img-wrapper img {
    max-width: 100%;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.5);
    transform: rotate(-5deg);
    transition: transform 0.6s ease;
}

.book-item:hover img {
    transform: rotate(0deg) scale(1.05);
}

/* Footer - Movement HQ */
footer {
    background: #050505;
    padding: 8rem 0 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 6rem;
}

.footer-title {
    font-family: var(--serif);
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Specific Adjustments */
@media (max-width: 968px) {
    .nav-menu, .nav-actions .btn-primary-nav, .nav-separator, .user-first-name { display: none !important; }
    .nav-actions { flex: none; gap: 0.5rem; }
    
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: pointer;
        z-index: 1001;
        padding: 10px;
    }
    .mobile-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background-color: #fff;
        transition: all 0.3s ease;
    }
    .mobile-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        right: -320px; /* Start off-screen */
        width: 300px; /* Quarter-way look */
        height: 100%;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(25px);
        z-index: 1000;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start; /* Align links to left of drawer */
        gap: 2rem;
        transition: right 0.6s cubic-bezier(0.2, 0, 0.2, 1);
        padding: 4rem 3rem;
        box-shadow: -15px 0 50px rgba(0,0,0,0.8);
        border-left: 1px solid rgba(255,255,255,0.05);
    }
    .mobile-menu-utility {
        width: 100%;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .m-util-top {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
    .m-util-top a {
        font-size: 1rem !important;
        color: var(--text-muted) !important;
        opacity: 1 !important;
        transform: none !important;
        padding: 0 !important;
        border: none !important;
        width: auto !important;
    }
    .m-util-top a:hover { color: var(--accent) !important; }
    .m-util-sep {
        width: 1px;
        height: 15px;
        background: rgba(255,255,255,0.1);
    }
    .mobile-menu-logo {
        font-family: var(--serif);
        font-size: 1.4rem;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: #fff;
        margin-bottom: 3rem;
        width: 100%;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--accent);
    }
    .mobile-menu-logo span { color: var(--accent); }
    .mobile-menu-overlay.active {
        right: 0;
    }
    /* Backdrop Dimming */
    body.menu-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.5s ease;
    }
    body.menu-open.active::after {
        opacity: 1;
        visibility: visible;
    }
    .mobile-menu-overlay a {
        font-size: 1.2rem;
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: #fff;
        text-decoration: none;
        font-family: var(--serif);
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
        border-bottom: 1px solid rgba(255,255,255,0.03);
        width: 100%;
        padding-bottom: 1rem;
    }
    .mobile-menu-overlay.active a {
        opacity: 1;
        transform: translateX(0);
    }
    /* Cascade delay for links */
    .mobile-menu-overlay.active a:nth-child(2) { transition-delay: 0.3s; }
    .mobile-menu-overlay.active a:nth-child(3) { transition-delay: 0.4s; }
    .mobile-menu-overlay.active a:nth-child(4) { transition-delay: 0.5s; }
    .mobile-menu-overlay.active a:nth-child(5) { transition-delay: 0.6s; }
    .mobile-menu-overlay.active a:nth-child(6) { transition-delay: 0.7s; }

    .hero-content { text-align: center; display: flex; flex-direction: column; align-items: center; }
    .hero-content div { display: flex; flex-direction: column; align-items: center; }
    .hero-content p { max-width: 100%; }
    .handwritten { font-size: 1.8rem; padding-left: 1.5rem; margin: 2rem 0; }
    
    .book-img-wrapper { padding: 2rem; }
    .book-img-wrapper img { max-width: 200px; }
}

@media (max-width: 480px) {
    .container { padding: 0 6vw; }
    .hero-content h1 { font-size: 2.5rem; }
    .btn-story { width: 100%; text-align: center; padding: 1rem 1.5rem; }
    .hero-content div div { flex-direction: column; width: 100%; }
}

/* AI Chat Widget */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: var(--sans);
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.chat-toggle:hover { transform: scale(1.1); }

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 15px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    transform-origin: bottom right;
    animation: chatOpen 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-window.active { display: flex; }

@keyframes chatOpen {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.chat-header {
    background: #075E54;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chat-header-info { display: flex; align-items: center; gap: 10px; }
.ai-avatar { width: 35px; height: 35px; border-radius: 50%; background: var(--accent); color: #000; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.chat-header h4 { font-size: 0.95rem; margin: 0; }
.online-status { font-size: 0.7rem; color: #dcf8c6; opacity: 0.8; }

.close-chat { background: transparent; border: none; color: white; cursor: pointer; font-size: 1.1rem; }

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
    background-size: cover;
    background-blend-mode: overlay;
    background-color: #0d0d0d;
}

.message { display: flex; }
.message.user { justify-content: flex-end; }
.message .bubble {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    position: relative;
}

.message.ai .bubble { background: #1e1e1e; color: #e1e1e1; border-top-left-radius: 0; }
.message.user .bubble { background: #056162; color: #fff; border-top-right-radius: 0; }

.chat-input-area {
    padding: 10px;
    background: #1e1e1e;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 8px 15px;
    color: white;
    outline: none;
    font-size: 0.9rem;
}

.chat-input-area button {
    background: #075E54;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
}

.whatsapp-fallback {
    padding: 10px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.whatsapp-fallback a {
    color: #25D366;
    text-decoration: none;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

@media (max-width: 480px) {
    .chat-window {
        width: 280px; /* Mini widget size for mobile */
        height: 400px;
        bottom: 80px;
        right: 10px;
        border-radius: 12px;
    }
    .ai-avatar { width: 30px; height: 30px; font-size: 0.8rem; }
    .chat-header h4 { font-size: 0.85rem; }
    .message .bubble { font-size: 0.8rem; padding: 6px 10px; }
    .chat-input-area input { font-size: 0.8rem; padding: 6px 12px; }
}

/* Typing Indicator Animation */
.typing-active { color: #25D366 !important; font-weight: bold; }
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span { width: 6px; height: 6px; background: #999; border-radius: 50%; display: inline-block; animation: bounce 1.4s infinite ease-in-out both; }
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}
