/* ==========================================================================
   Base Styles & Design Tokens (Lighter Styles)
   ========================================================================== */
   
:root {
    --primary: #5AB2FF; /* Fresh engaging blue */
    --primary-hover: #3b91db;
    --secondary: #A0DEFF; 
    --bg-light: #F4FBFF; /* Icy smooth background */
    --bg-white: #FFFFFF;
    --text-dark: #1E293B;
    --text-body: #475569;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-light);
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); letter-spacing: -1px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.5px; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center { text-align: center; }
.text-white, .text-white h2, .text-white p { color: #ffffff; }

/* ==========================================================================
   UI Components (Buttons & Cards)
   ========================================================================== */

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(90, 178, 255, 0.4);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 178, 255, 0.6);
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    box-shadow: var(--glass-shadow);
}

.btn-secondary:hover {
    background-color: var(--text-dark);
    color: white;
    transform: translateY(-2px);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px 0 rgba(31, 38, 135, 0.1);
}

/* ==========================================================================
   Layouts
   ========================================================================== */

.content-section {
    padding: 6rem 0;
}

.light-bg {
    background-color: var(--bg-white);
}

.brand-bg {
    background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%);
    position: relative;
    overflow: hidden;
}

.brand-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg opacity="0.1" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="white" stroke-width="2"/></svg>') repeat;
    background-size: 150px;
    pointer-events: none;
}

.section-title {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
}

/* Grids */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.split-layout.reverse .text-block {
    order: 2;
}

.split-layout.reverse .stats-box {
    order: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */

.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

.footer-col .logo-icon {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

.login-btn {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
}

/* Burger Menu */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    z-index: 1100;
}
.burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}
.burger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.burger-btn.active span:nth-child(2) {
    opacity: 0;
}
.burger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    background: var(--bg-white);
    padding: 0.85rem 0;
    border-bottom: 1px solid #E2E8F0;
    margin-top: 68px; /* offset for fixed header */
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-body);
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '›';
    color: #94A3B8;
    font-size: 1.1rem;
}

.breadcrumb-list a {
    color: var(--primary);
    font-weight: 500;
}

.breadcrumb-list a:hover {
    text-decoration: underline;
}

.breadcrumb-current span {
    color: #64748B;
    font-weight: 400;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    position: relative;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}


.breadcrumbs + .page-header {
    padding-top: 4rem;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(180deg, rgba(232,241,245,0.2) 0%, rgba(244,251,255,1) 100%);
    z-index: -1;
}

.hero-text {
    max-width: 650px;
    margin: 0 auto;
    text-align: center;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* ==========================================================================
   Specific Sections
   ========================================================================== */

/* Split layout image */
.image-block {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.image-block img {
    border-radius: var(--radius-md);
    max-height: 500px;
    object-fit: contain;
}

/* Feature Cards */
.feature-card {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: white;
}
.feature-card:hover {
    background: rgba(255,255,255,0.15);
}
.feature-card h4 {
    color: white;
}
.icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Stats Box */
.stats-box {
    background: white;
}
.stats-list li {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
}
.stats-list li:last-child { border: none; }

/* Payments */
.payments-grid {
    margin-top: 3rem;
}
.payment-card h4 {
    color: var(--primary);
}

/* Author Section */
.author-card {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: white;
}
.author-image {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--bg-light);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.author-info {
    flex-grow: 1;
}
.author-info h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.glass-footer {
    background: #E8F1F5;
    padding: 4rem 0 2rem;
    border-top: 1px solid #D6E8F0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--text-body);
}

.footer-col a:hover {
    color: var(--primary);
}

.disclaimer {
    border-top: 1px solid #CBD5E1;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: #64748B;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
    .split-layout { grid-template-columns: 1fr; gap: 2rem; }
    .split-layout.reverse .text-block { order: 1; }
    .split-layout.reverse .stats-box { order: 2; }
    .author-card { flex-direction: column; text-align: center; }
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
}

@media (max-width: 768px) {
    .burger-btn { display: flex; }
    .nav-links {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 320px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 5rem 2rem 2rem;
        gap: 0;
        z-index: 1050;
        transition: right 0.35s ease;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    }
    .nav-links.open {
        right: 0;
    }
    .nav-links a {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.3);
        z-index: 999;
    }
    .nav-overlay.open {
        display: block;
    }
    .hero-buttons { flex-direction: column; }
    .content-section { padding: 3rem 0; }
    .hero-bg { background-position: 80% center; }
    .glass-card { padding: 1.5rem; border-radius: var(--radius-md); }
    .hero { min-height: 500px; height: auto; padding: 4rem 0 2rem; }
    h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
    .split-layout { gap: 2rem; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .breadcrumbs { display: none; }
    .grid-4 { grid-template-columns: 1fr; }
    .glass-card { padding: 1.25rem; }
}

/* Progress Bar / Content Layout */
.page-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
    padding-top: 3rem;
    padding-bottom: 0;
}

@media (max-width: 991px) {
    .page-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar TOC (Progress Bar) */
.sidebar-toc {
    position: sticky;
    top: 100px;
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sidebar-toc h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    border-left: 2px solid var(--glass-border);
}

.toc-list li {
    margin-bottom: 0px;
}

.toc-list a {
    display: block;
    padding: 0.7rem 0 0.7rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    line-height: 1.3;
}

.toc-list a::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    height: 100%;
    width: 2px;
    background: transparent;
    transition: all 0.3s ease;
}

.toc-list a:hover {
    color: var(--primary);
    background: linear-gradient(90deg, rgba(90, 178, 255, 0.05) 0%, transparent 100%);
}

.toc-list a.active {
    color: var(--primary);
    font-weight: 600;
    background: linear-gradient(90deg, rgba(90, 178, 255, 0.1) 0%, transparent 100%);
}

.toc-list a.active::before {
    background: var(--primary);
}

/* Article Content Blocks */
.content-block {
    margin-bottom: 3.5rem;
    scroll-margin-top: 100px; /* Essential for anchor smooth scrolling with sticky header */
}

.content-block h2 {
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    color: var(--text-dark);
}

.content-block h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.content-block p {
    margin-bottom: 1.2rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.content-block ul {
    margin-bottom: 1.5rem;
    list-style: disc;
    padding-left: 1.5rem;
}

.content-block li {
    margin-bottom: 0.5rem;
}

@media (max-width: 991px) {
    .page-layout {
        padding-top: 1rem;
        gap: 0;
    }
    .main-article {
        padding: 0 0.25rem;  /* Small extra breathing room inside grid */
    }
    .sidebar-toc {
        position: sticky;
        top: 65px; 
        z-index: 100;
        padding: 0.75rem 1.5rem;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        display: flex;
        align-items: center;
        margin: 0 -1.5rem 1.5rem -1.5rem;
        border-radius: 0;
        border-right: none;
        border-left: none;
        background: rgba(255, 255, 255, 0.95);
        border-bottom: 1px solid var(--glass-border);
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-toc h3 {
        display: none;
    }
    .sidebar-toc::-webkit-scrollbar {
        height: 0px;
    }
    .toc-list {
        display: flex;
        gap: 0.5rem;
        border-left: none;
        padding: 0.25rem 0;
    }
    .toc-list li {
        display: inline-block;
        flex-shrink: 0;
    }
    .toc-list a {
        padding: 0.4rem 1rem;
        background: var(--bg-white);
        border: 1px solid var(--glass-border);
        border-radius: 20px;
        white-space: nowrap;
        font-size: 0.85rem;
    }
    .toc-list a::before {
        display: none;
    }
    .toc-list a.active {
        background: var(--primary);
        color: white;
        border-color: var(--primary);
    }
    
    /* Mobile Article Typography & Proper Spacing */
    .content-block {
        margin-bottom: 2.5rem;
    }
    .content-block:first-of-type h2 {
        margin-top: 0.5rem;
    }
    .content-block h2 {
        margin-top: 2rem;
        margin-bottom: 1rem;
        font-size: 1.6rem;
        line-height: 1.3;
    }
    .content-block h3 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
        font-size: 1.2rem;
    }
    .content-block p {
        margin-bottom: 1rem;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    .content-block ul {
        margin-bottom: 1rem;
    }

    /* Prevent any inner elements from causing horizontal overflow */
    .content-block img,
    .content-block .glass-card {
        max-width: 100%;
        overflow: hidden;
    }
}
