/* ==========================================================
   CSS CUSTOM PROPERTIES & COLOR PALETTE
   ========================================================== */
:root {
    --bg-color: #020817;
    --section-bg: #0F172A;
    --primary-accent: #DFA798;
    --secondary-accent: #F5C4A8;
    --text-primary: #FFFFFF;
    --text-secondary: #CBD5E1;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ==========================================================
   RESET & ACCESSIBILITY
   ========================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary-accent);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-accent);
}

a:focus-visible,
button:focus-visible {
    outline: 2px dashed var(--secondary-accent);
    outline-offset: 4px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

ul,
ol {
    list-style-position: inside;
}

/* ==========================================================
   TYPOGRAPHY
   ========================================================== */
h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-top: 2rem;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-top: 1.5rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

/* ==========================================================
   LAYOUT & COMPONENTS
   ========================================================== */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(2, 8, 23, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary-accent);
}

#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--primary-accent);
    width: 0%;
    z-index: 1001;
}

/* Hero Section */
.hero {
    padding: 150px 5% 100px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-color) 0%, var(--section-bg) 100%);
}

.hero p {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.25rem;
}

/* Grid System */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

/* Sections & Cards */
section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

section:nth-child(even) {
    background-color: var(--section-bg);
}

.card {
    background-color: var(--bg-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-accent);
}

/* AEO & GEO Elements */
.definition-box {
    background-color: rgba(223, 167, 152, 0.1);
    border-left: 4px solid var(--primary-accent);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.fact-box {
    background-color: var(--section-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
}

.fact-box ul {
    list-style: none;
}

.fact-box li {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.fact-box li span:last-child {
    font-weight: bold;
    color: var(--secondary-accent);
}

/* Comparison Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background-color: var(--section-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background-color: rgba(223, 167, 152, 0.2);
    color: var(--primary-accent);
}

/* FAQ Accordion */
.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 1.5rem;
    background-color: var(--section-bg);
    color: var(--text-primary);
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--bg-color);
}

.faq-answer p {
    padding: 1.5rem;
    margin: 0;
}

/* Utilities & Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-accent);
    color: var(--bg-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--secondary-accent);
    color: var(--bg-color);
}

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-accent);
    color: var(--bg-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    border: none;
    z-index: 999;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.875rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--primary-accent);
}

/* Article Specific Layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    padding-top: 120px;
}

.toc {
    position: sticky;
    top: 100px;
    background-color: var(--section-bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.toc ul {
    list-style: none;
}

.toc a {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.toc a.active {
    color: var(--primary-accent);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .toc {
        position: relative;
        top: 0;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Simplified for code length, implement hamburger in JS */
    .hero {
        padding-top: 120px;
    }

    h1 {
        font-size: 2rem;
    }
}