/* =========================================
   1. THE ROYAL PALETTE & BASE SETTINGS
   ========================================= */
:root {
    --royal-night: #0F172A;
    --royal-blue: #1E293B;
    --paper: #FDFBF7;
    --gold: #FFD700;
    --gold-muted: #C5A059;
    --text-dark: #1e293b;
    --text-light: #F8FAFC;

    --font-display: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    --font-hand: 'Caveat', cursive;

    --radius-lg: 24px;
    --shadow-glow: 0 0 40px rgba(255, 215, 0, 0.15);
    --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--royal-night);
    color: var(--text-dark);
    font-family: var(--font-body);
    overflow-x: hidden;
    /* Responsive base font size: 17px on mobile, 19px on desktop */
    font-size: clamp(17px, 2vw, 19px);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.text-light {
    color: var(--text-light);
}

.gold-text {
    color: var(--gold);
}

.handwritten {
    font-family: var(--font-hand);
    color: var(--gold);
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    transform: rotate(-3deg);
    display: inline-block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.section-padding {
    padding: clamp(60px, 10vw, 100px) 0;
    position: relative;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 0;
    transition: transform 0.3s ease-in-out, padding 0.3s ease;
}

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

.nav-logo {
    height: 45px;
    width: auto;
    display: block;
    transition: transform 0.2s ease;
}

.brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand a:hover .nav-logo {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.btn-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700;
    text-decoration: none;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-login:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--royal-night);
}

.trust-badge-header {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   3. HERO SECTION
   ========================================= */
.hero {
    min-height: 95vh;
    background: radial-gradient(circle at center top, #2C3E50, var(--royal-night));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 140px;
    /* Account for fixed header */
    padding-bottom: 80px;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    color: white;
    margin-bottom: 25px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    line-height: 1.1;
}

.hero-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.35rem;
    margin-bottom: 20px;
    max-width: 550px;
    line-height: 1.6;
}

/* Social Proof Pills */
.social-proof-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 700;
    backdrop-filter: blur(5px);
}

.desktop-pill {
    display: inline-flex;
    margin-bottom: 30px;
    margin-top: 10px;
}

.mobile-pill {
    display: none;
    margin-top: 20px;
    justify-content: center;
}

/* Hero CTA Buttons */
.hero-cta-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
}

.btn-cta {
    background: linear-gradient(135deg, #FFD700, #F59E0B);
    color: #0f172a;
    padding: 22px 45px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.3rem;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-cta:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.6);
}

.btn-cta:active {
    transform: translateY(0) scale(0.98);
}

.btn-cta.pulse {
    animation: pulse-btn 2s infinite;
}

@keyframes pulse-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

.trust-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
    align-items: center;
}

.trust-text i {
    color: #22c55e;
}

/* 3D Book Cover Container */
.hero-preview {
    position: relative;
    animation: float 6s ease-in-out infinite;
    display: flex;
    justify-content: center;
    perspective: 1000px;
    flex-direction: column;
    align-items: center;
}

.magic-book-cover {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 3/4.2;
    border-radius: 6px 20px 20px 6px;
    box-shadow: -15px 20px 40px rgba(0, 0, 0, 0.6), inset 4px 0 10px rgba(0, 0, 0, 0.5);
    border-left: 14px solid #1a2436;
    /* Spine */
    position: relative;
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.3s;
    background: #1e293b;
    overflow: hidden;
}

.magic-book-cover:hover {
    transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.8s ease-in-out;
    border-radius: 0 14px 14px 0;
}

.cover-hidden {
    opacity: 0;
}

.cover-visible {
    opacity: 1;
}

.book-shimmer {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shimmer 4s infinite linear;
    pointer-events: none;
    z-index: 10;
}

@keyframes shimmer {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(50%);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* =========================================
   4. JOURNEY / PROCESS SECTION
   ========================================= */
.process-section {
    background: white;
}

.journey-vertical-wrapper {
    position: relative;
    padding: 40px 0;
}

/* The Center Line */
.journey-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: repeating-linear-gradient(to bottom, #cbd5e1 0, #cbd5e1 10px, transparent 10px, transparent 20px);
    transform: translateX(-50%);
    z-index: 0;
}

/* Structural Classes for Journey Rows */
.journey-row-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.journey-layout-normal {
    flex-direction: row;
}

.journey-layout-reverse {
    flex-direction: row-reverse;
}

.journey-col-visual,
.journey-col-text {
    flex: 1;
}

.pad-r-40 {
    padding-right: 40px;
}

.pad-l-40 {
    padding-left: 40px;
}

.txt-right {
    text-align: right;
}

.txt-left {
    text-align: left;
}

.journey-center-node {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    border: 4px solid var(--royal-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--royal-blue);
    font-family: var(--font-display);
    font-size: 1.2rem;
    z-index: 5;
    box-shadow: 0 0 0 5px white;
    /* Halo to clear line */
}

/* Visual Animations */
.floating-icons {
    animation: floatIcons 4s ease-in-out infinite;
}

@keyframes floatIcons {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.magic-lens-visual img {
    transition: transform 0.3s ease;
}

.magic-lens-visual:hover img {
    transform: scale(1.05);
}

/* =========================================
   5. BOOK VIEWER (3D & RESPONSIVE)
   ========================================= */
.book-viewer-section {
    background: var(--royal-night);
    padding: 80px 0 150px;
    overflow: hidden;
    position: relative;
}

.book-viewport {
    perspective: 2500px;
    width: 100%;
    height: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    position: relative;
}

.book-3d-scene {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.sheet {
    position: absolute;
    top: 0;
    transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.sheet-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    overflow: hidden;
}

.sheet-front {
    z-index: 2;
    border-radius: 0 10px 10px 0;
    box-shadow: inset 10px 0 20px rgba(0, 0, 0, 0.1);
}

.sheet-back {
    transform: rotateY(180deg);
    z-index: 1;
    border-radius: 10px 0 0 10px;
    box-shadow: inset -10px 0 20px rgba(0, 0, 0, 0.1);
    background: #fdfbf7;
}

.book-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fffcf5;
}

/* DESKTOP BOOK LOGIC (Spread) */
@media (min-width: 901px) {
    .book-3d-scene {
        width: 840px;
        height: 600px;
    }

    .sheet {
        width: 50%;
        height: 100%;
        left: 50%;
        transform-origin: left center;
    }

    .sheet.flipped {
        transform: rotateY(-180deg);
    }
}

/* Navigation Buttons */
.book-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    z-index: 50;
}

.book-nav-btn:hover {
    background: var(--gold);
    color: var(--royal-night);
    scale: 1.1;
}

.book-prev {
    left: 20px;
}

.book-next {
    right: 20px;
}

/* =========================================
   6. PRICING SECTION
   ========================================= */
.pricing-section {
    background: #f8fafc;
}

.pricing-responsive-card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    max-width: 1000px;
    margin: 0 auto;
    border: 2px solid var(--gold-muted);
}

.pricing-col-visual {
    flex: 1;
    background: #fffcf5;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pricing-col-details {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.value-stack li {
    transition: transform 0.2s ease;
}

.value-stack li:hover {
    transform: translateX(5px);
}

/* =========================================
   7. REVIEWS & TIMELINE
   ========================================= */
.reviews-section {
    background: var(--paper);
    padding: 80px 0;
    border-top: 1px solid #eee;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.review-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

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

.review-img-wrap {
    height: 250px;
    width: 100%;
    background: #f1f5f9;
}

.review-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-content {
    padding: 25px;
}

.review-stars {
    color: #f59e0b;
    font-size: 1rem;
    margin-bottom: 10px;
}

.review-text {
    font-size: 1.1rem;
    color: #333;
    font-style: italic;
    margin-bottom: 15px;
}

.review-author {
    font-weight: 700;
    color: var(--royal-blue);
    font-size: 0.9rem;
}

.review-verified {
    color: #22c55e;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* Timeline */
.timeline-section {
    background: var(--royal-night);
    color: white;
    padding-bottom: 80px;
}

.timeline-flex {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    position: relative;
}

.timeline-flex::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1), var(--gold), rgba(255, 255, 255, 0.1));
    z-index: 0;
}

.timeline-item {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 22%;
    opacity: 0.9;
}

.timeline-icon {
    width: 80px;
    height: 80px;
    background: var(--royal-blue);
    border: 2px solid var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.8rem;
    color: var(--gold);
}

/* =========================================
   8. FOOTER & STICKY CTA
   ========================================= */
.magical-footer-cta {
    background: linear-gradient(180deg, var(--royal-night) 0%, #1e1b4b 100%);
    padding: 100px 20px 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.magic-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.magical-cta-btn {
    background: linear-gradient(135deg, #FFD700, #F59E0B);
    color: #0f172a;
    padding: 25px 60px;
    border-radius: 50px;
    font-weight: 900;
    font-size: 1.6rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    border: 2px solid #fff;
    position: relative;
    z-index: 5;
}

.magical-cta-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.6);
}

/* Sticky Mobile Bar */
.sticky-cta-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px 25px 20px;
    z-index: 9999;
    display: none;
    /* Hidden by default on desktop */
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

.sticky-btn {
    width: 100%;
    background: linear-gradient(135deg, #FFD700, #F59E0B);
    color: var(--royal-night);
    font-weight: 900;
    padding: 16px;
    border-radius: 50px;
    font-size: 1.2rem;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
    cursor: pointer;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* =========================================
   9. MOBILE RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 900px) {

    /* HEADER & NAV */
    header {
        padding: 10px 0;
    }

    .brand {
        font-size: 1.25rem;
    }

    .btn-login {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    .desktop-only {
        display: none !important;
    }

    /* Hides desktop nav items */
    .trust-badge-header {
        display: none !important;
    }

    /* HERO */
    .hero {
        padding-top: 100px;
        padding-bottom: 40px;
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 0 10px;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Reordering for Mobile: Handwritten -> Header -> Preview -> Paragraph -> CTA */
    .hero-content .handwritten {
        order: 1;
    }

    .hero-content h1 {
        order: 2;
        margin-top: 10px;
    }

    .hero-preview {
        order: 3;
        width: 100%;
        margin: 25px 0;
    }

    .hero-content p {
        order: 4;
        margin-bottom: 30px;
        font-size: 1.15rem;
    }

    .hero-cta-group {
        order: 5;
        width: 100%;
        align-items: center;
    }

    .btn-cta {
        width: 100%;
        justify-content: center;
    }

    .magic-book-cover {
        max-width: 280px;
    }

    .desktop-pill {
        display: none;
    }

    .mobile-pill {
        display: flex;
    }

    /* JOURNEY / PROCESS */
    .journey-vertical-wrapper {
        padding-left: 20px;
    }

    .journey-line {
        left: 20px;
        transform: none;
    }

    .journey-row-container {
        flex-direction: column !important;
        align-items: flex-start;
        margin-bottom: 50px;
        padding-left: 30px;
    }

    .journey-col-visual {
        order: 1;
        width: 100%;
        text-align: center !important;
        padding: 0 0 20px 0 !important;
    }

    .journey-col-text {
        order: 2;
        width: 100%;
        text-align: left !important;
        padding: 0 !important;
    }

    .journey-center-node {
        position: absolute;
        left: -20px;
        top: 0;
    }

    /* PRICING */
    .pricing-responsive-card {
        flex-direction: column;
        margin: 0 10px;
    }

    .pricing-col-visual {
        padding: 30px;
        min-height: 280px;
    }

    .pricing-col-details {
        padding: 30px 20px;
    }

    .pricing-col-details h3 {
        font-size: 1.6rem !important;
        text-align: center;
    }

    .value-stack li {
        font-size: 1rem !important;
    }

    .price-block {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* REVIEWS */
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* TIMELINE */
    .timeline-flex {
        flex-direction: column;
        gap: 40px;
    }

    .timeline-flex::before {
        display: none;
    }

    .timeline-item {
        width: 100%;
        opacity: 1;
        transform: none;
    }

    /* BOOK VIEWER MOBILE */
    .book-viewport {
        perspective: 1500px;
        height: 550px;
        overflow: visible;
        margin-top: 20px;
    }

    .book-3d-scene {
        width: 80vw;
        height: 120vw;
        max-width: 350px;
        max-height: 520px;
    }

    .sheet {
        width: 100%;
        height: 100%;
        left: 0;
        transform-origin: left center;
    }

    .sheet.flipped {
        transform: rotateY(-180deg);
    }

    /* Move nav buttons below book on mobile to avoid covering content */
    .book-nav-btn {
        top: auto;
        bottom: -80px;
        transform: none;
    }

    .book-prev {
        left: 20%;
    }

    .book-next {
        right: 20%;
    }

    /* FOOTER */
    .sticky-cta-bar {
        display: block;
    }

    footer {
        padding-bottom: 20px;
    }
}