/* ===========================================
   SECTION: VARIABLES & RESET
   =========================================== */
:root {
    /* Color Palette (60-30-10 Rule) */
    --primary: #0f172a; /* Deep Slate */
    --primary-dark: #020617; /* Darker Slate */
    --secondary: #1e293b; /* Card BG */
    --accent: #38bdf8; /* Sky Blue */
    --accent-glow: #0ea5e9; /* Darker Sky */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    
    /* Glassmorphism */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

    /* Spacing & Sizes */
    --container-width: 1200px;
    --header-height: 80px;
    --radius: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===========================================
   SECTION: UTILITIES & COMPONENTS
   =========================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.section-padding {
    padding: 80px 0;
}

.text-center {
    text-align: center;
}

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

.mb-4 {
    margin-bottom: 1.5rem;
}

/* ===========================================
   SECTION: HEADER & NAV
   =========================================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 1001;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 30px;
    margin: 0 auto;
}

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

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

/* ===========================================
   SECTION: HERO
   =========================================== */
.hero-section {
    padding-top: calc(var(--header-height) + 120px);
    padding-bottom: 120px;
    text-align: center;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.1), transparent 40%),
                linear-gradient(to bottom, var(--primary-dark), var(--primary));
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===========================================
   SECTION: CARDS & GRID
   =========================================== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 15px rgba(56, 189, 248, 0.3);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

/* ===========================================
   SECTION: ARTICLE CONTENT
   =========================================== */
.article-container {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    /* Reset properties inherited from global 'header' tag */
    position: static;
    height: auto;
    display: block;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
    z-index: auto;

    text-align: center;
    margin-bottom: 50px;
}

.article-header .card-meta {
    display: inline-block;
    background: rgba(6, 182, 212, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 20px;
    color: var(--accent);
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 25px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.article-body {
    font-size: 1.125rem;
    color: #d1d5db;
}

.article-body h2 {
    margin-top: 50px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #fff;
}

.article-body p {
    margin-bottom: 25px;
    line-height: 1.8;
}

.article-body ul {
    margin-bottom: 30px;
    padding-left: 20px;
    list-style: disc;
}

.article-body li {
    margin-bottom: 10px;
}

.breadcrumb {
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.breadcrumb a {
    color: var(--accent);
}

.breadcrumb span {
    margin: 0 5px;
}

/* ===========================================
   SECTION: FOOTER
   =========================================== */
footer {
    background: #020617;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    margin-bottom: 40px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .mobile-toggle {
        display: block;
        font-size: 1.5rem;
        color: #fff;
        cursor: pointer;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 20px 0;
    }
}

/* ===========================================
   SECTION: NEW UTILITIES
   =========================================== */
.hero-lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 40px;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.btn-outline:hover {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.service-card {
    padding: 30px;
    background: var(--primary);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%;
    transition: 0.3s;
}

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

.text-muted {
    color: var(--text-secondary);
}

/* Mobile toggle logic handled in Header section and media query */
/* Added by Rewrite */
.search-input {
    padding: 12px 20px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    outline: none;
    text-align: center;
    transition: 0.3s;
}
.search-input:focus {
    border-color: var(--color-teal);
    background: rgba(255, 255, 255, 0.1);
}

.cat-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    color: var(--color-text-gray);
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}
.cat-btn:hover, .cat-btn.active {
    background: var(--color-teal);
    color: white;
    border-color: var(--color-teal);
}

/* Mobile Menu Overlay */
.nav-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(15, 23, 42, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.nav-mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.nav-mobile-overlay a {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}
.nav-mobile-overlay a.active {
    color: var(--color-teal);
}
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001; /* Above overlay */
}
@media (max-width: 768px) {
    .mobile-toggle { display: block; }
}

/* TOC Widget */
#toc-widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}
#toc-widget h4 { margin-bottom: 15px; color: var(--color-teal); }
#toc-content ul { padding-left: 0; }
#toc-content li { margin-bottom: 8px; }
#toc-content li a { font-size: 0.9rem; color: var(--color-text-gray); }
#toc-content li a:hover { color: var(--color-teal); }
.related-articles-section { margin-top: 80px; padding-top: 40px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

