:root {
    /* Color Palette: Authoritative / Editorial */
    --bg-body: #f8fafc;
    --bg-white: #ffffff;
    --bg-nav: #ffffff;
    --bg-footer: #0f172a;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f1f5f9;

    /* Accents */
    --primary-blue: #0f172a;
    /* Navy Blue */
    --accent-blue: #3b82f6;
    /* Bright Blue for links/actions */
    --accent-red: #ef4444;
    /* Warning/Alerts only */
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Typography */
    --font-serif: 'Merriweather', 'Georgia', serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --radius-sm: 4px;
    --radius-md: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    color: var(--primary-blue);
    line-height: 1.3;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    h3 {
        font-size: 1.25rem;
        line-height: 1.5;
    }

    p {
        line-height: 1.7;
        margin-bottom: 1.2rem;
    }
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
}

/* Base Grids */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .container {
        padding: 0 16px;
    }

    .section-padding {
        padding: 40px 0;
    }
}

.section-padding {
    padding: 60px 0;
}

.text-center {
    text-align: center;
}

.text-blue {
    color: var(--accent-blue);
}

.text-muted {
    color: var(--text-muted);
}

.fw-bold {
    font-weight: 700;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95rem;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: white;
}

/* Card Style */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Header */
.main-header {
    background: #ffffff !important;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: background-color 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 40px;
    /* Add side padding for full-width layout */
}

.logo {
    font-family: var(--font-serif);
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary-blue);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-blue);
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-blue);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation Overlay */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 30px;
        gap: 20px;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-subtle);
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Mobile menu backdrop */
    .mobile-menu-backdrop {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-backdrop.active {
        display: block;
        opacity: 1;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* Footer */
.main-footer {
    background-color: var(--bg-footer);
    color: var(--text-inverse);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-family: var(--font-sans);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .main-footer {
        padding: 40px 0 20px;
        margin-top: 40px;
    }
}

/* Global Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 40px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-blue {
    background-color: #eff6ff;
    color: var(--accent-blue);
}

/* Conceptual: Organic Night Sky & Fireworks */
.hero-abstract {
    position: relative;
    background-color: #020617;
    /* Deepest Night Blue */
    padding: 140px 0 120px;
    overflow: hidden;
    color: white;
    width: 100%;
    max-width: 100vw;
}

/* Canvas Particle Layer - The Primary Visual */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.hero-separator {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.hero-heading {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-left: auto;
    margin-right: auto;
    border: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.1);
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-sub {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    color: #94a3b8;
    max-width: 750px;
    margin: 0 auto 2.5rem;
    font-weight: 300;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .hero-abstract {
        padding: 80px 0 60px;
    }

    .hero-content {
        padding: 0 15px;
    }

    .hero-heading {
        font-size: 1.75rem;
        line-height: 1.3;
        letter-spacing: -0.5px;
        word-break: break-word;
    }

    .hero-sub {
        font-size: 0.95rem;
        padding: 0 5px;
        line-height: 1.5;
    }
}

.hero-heading::after,
.hero-heading::before {

    border: none !important;
}

/* Article / Single Page Layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    /* Content | Sidebar */
    gap: 60px;
    padding: 60px 0;
    align-items: start;
}

@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: none;
        /* Hide TOC on mobile or move to top */
    }
}

.article-content {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.article-content h2 {
    font-size: 2rem;
    margin-top: 60px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    scroll-margin-top: 100px;
    /* Offset for sticky header */
    line-height: 1.4;
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--primary-blue);
}

.article-content p,
.article-content ul {
    margin-bottom: 24px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* Sticky Sidebar */
.article-sidebar {
    position: sticky;
    top: 100px;
    /* Below fixed header */
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 12px;
}

.toc-list a {
    font-size: 0.9rem;
    color: var(--accent-blue);
    display: block;
    line-height: 1.4;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: var(--primary-blue);
    text-decoration: underline;
}

/* Accordion Styles (FAQs) */
.accordion-item {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    background: white;
    overflow: hidden;
}

.accordion-header {
    padding: 20px 24px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f8fafc;
}

.accordion-content {
    display: none;
    /* JS will toggle this */
    padding: 0 24px 24px;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid transparent;
}

.accordion-item.active .accordion-content {
    display: block;
    border-top-color: var(--border-subtle);
}

.accordion-item.active .accordion-header {
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .accordion-header {
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .accordion-content {
        padding: 0 20px 20px;
        font-size: 0.9rem;
    }
}