* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary: #6366f1;
    /* Indigo */
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    /* Pink/Rose for warmth */
    --accent: #06b6d4;
    /* Cyan */
    --bg-main: #fcfdff;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text-main: #1e1b4b;
    /* Deep Indigo */
    --text-muted: #64748b;
    --border: rgba(226, 232, 240, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-rich: 0 20px 50px -12px rgba(99, 102, 241, 0.15);
}

body {
    margin: 0;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-main);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.3rem 0;
    /* Ultra-compact */
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    padding: 0 2rem;
    display: flex;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.logo {
    font-family: 'Outfit';
    font-weight: 900;
    font-size: 1.2rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.container {
    max-width: 1040px;
    /* Adjusted to accommodate padding nicely */
    margin: 0 auto;
    padding: 0 20px;
    /* Standard mobile gutter */
}

/* Base content wrappers */
.index-content,
.article-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.article-content {
    max-width: 800px;
    background: white;
    padding: 3.5rem 2.5rem;
    /* Exactly 2.5rem horizontal padding */
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    margin: 3rem auto 1rem;
    /* Restored auto to ensure centering on PC */
    box-sizing: border-box;
}

.hero {
    text-align: center;
    padding: 3rem 1.5rem;
    /* Reduced horizontal padding to allow h1 to breathe */
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-radius: 12px;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    width: 100%;
    box-sizing: border-box;
}

/* Article Hero Variation (Cleaner / Non-card look) */
.article-content .hero {
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--border);
    /* Stylish 1px divider */
    background: none;
    text-align: left;
    padding: 3rem 0;
    border-radius: 0;
}

.article-content .hero h1 {
    text-align: left;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-align: center;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

h2 {
    font-size: 1.6rem;
    font-weight: 900;
    padding: 0.75rem 0 0.75rem 1.25rem;
    border-left: 5px solid var(--primary);
    background: linear-gradient(to right, rgba(99, 102, 241, 0.05), transparent);
    margin: 1.5rem 0 1.5rem;
    color: var(--text-main);
}

h3 {
    font-size: 1.35rem;
    font-weight: 800;
    padding-left: 1rem;
    border-left: 2px solid var(--primary);
    margin: 1.5rem 0;
    color: var(--text-main);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.card h3 {
    font-size: 1.25rem;
    margin: 0;
    line-height: 1.4;
    border: none;
    padding: 0;
}

.card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-self: flex-start;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--secondary);
    267:
}

.breadcrumb span.sep {
    color: #cbd5e1;
    font-weight: 300;
}

/* --- Removed Duplicate Definitions --- */

/* --- Unified Navigation System --- */

/* 1. Large Article CTA (Individual Article Cross-links) */
.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.cta-card {
    position: relative;
    height: 320px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    align-items: flex-end;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-soft);
}

.cta-card .bg-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease;
    z-index: 1;
}

.cta-card:hover .bg-img {
    transform: none;
}

.cta-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
    z-index: 2;
}

.cta-card .content {
    position: relative;
    z-index: 3;
    padding: 2.5rem;
    width: 100%;
}

.cta-card .dir {
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 0.5rem;
    display: block;
}

.cta-card h4 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.cta-card:hover {
    transform: translateY(-5px);
    /* Reduced movement */
    box-shadow: var(--shadow-rich);
    border-color: var(--primary);
}

/* --- Article Table of Contents (Numbered & Professional) --- */
.toc {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 2rem;
    margin: 2rem 0;
}

.toc h4 {
    font-family: 'Outfit';
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.toc ol {
    padding-left: 1.5rem;
    margin: 0;
}

.toc li {
    font-family: 'Inter';
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.toc a {
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.3s ease;
}

.toc a:hover {
    color: var(--primary);
}

/* --- Article Header System (Classical) --- */
.article-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.article-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: left;
    color: var(--text-main);
    background: none;
    -webkit-text-fill-color: var(--text-main);
    line-height: 1.3;
    padding: 0;
    max-width: 100%;
}

.hero-figure,
.figure-box {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.hero-figure img,
.figure-box img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    margin-bottom: 0;
    /* Removed for flush caption */
}

.hero-caption,
.hero-figure figcaption,
.figure-box figcaption {
    padding: 0.5rem 1rem;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
    border-top: 1px solid var(--border);
}

.article-img {
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .article-header h1 {
        font-size: 1.5rem;
    }
}

/* 2. Small Category Labels (Category Cross-links) */
.category-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
    width: 100%;
}

.cat-label {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: all 0.2s ease-in-out;
    gap: 0.4rem;
}

.cat-label:hover {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

/* --- Integrated Footer Styles (Compact) --- */
footer {
    padding: 0.5rem 0;
    /* Matches Header compact height */
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    text-align: center;
}

.footer-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

/* High-tech Contact Link */
.footer-minimal a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Outfit';
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.6;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.footer-minimal a:hover {
    color: var(--primary);
    opacity: 1;
    border-bottom-color: var(--primary);
}

.footer-minimal p {
    color: var(--text-muted);
    font-family: 'Outfit';
    font-weight: 400;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    opacity: 0.45;
    margin: 0;
}

/* --- Mobile / Tablet Responsiveness --- */
@media (max-width: 900px) {
    .article-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    .container,
    .article-content,
    .index-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .article-content {
        padding: 2.5rem 1.25rem;
        border-radius: 8px;
        /* Synchronized sharp roundness */
        margin-top: 1rem;
    }

    .hero {
        padding: 3rem 1.25rem;
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* --- Product Card Component (Metadata Integration) --- */
.product-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.product-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.4;
}

.product-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 1.5rem auto;
    display: block;
    border-radius: 8px;
    mix-blend-mode: multiply;
    /* Works well for white-background product shots */
}

.product-score {
    background: var(--primary);
    color: white;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-family: 'Outfit';
    font-weight: 900;
    font-size: 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 0.9;
    min-width: 65px;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.product-score span {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 0.2rem;
}

.product-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.product-price {
    font-size: 1.75rem;
    font-family: 'Outfit';
    font-weight: 800;
    color: var(--text-main);
    border-left: 3px solid var(--secondary);
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

.product-price span {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.pros-cons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pros-cons h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    font-weight: 800;
}

.pros-cons ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-cons li {
    font-size: 0.9rem;
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    color: var(--text-main);
}

.pros-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 900;
}

.cons-list li::before {
    content: '×';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 900;
}

.amazon-btn {
    background: #232f3e;
    color: white !important;
    text-decoration: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 800;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    display: block;
    margin-top: 1rem;
}

.amazon-btn:hover {
    background: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Article Meta Styles */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 1rem 0 2rem;
    font-family: 'Outfit';
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-label {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: var(--primary);
}

@media (max-width: 640px) {
    .product-info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .product-score {
        padding: 0.4rem 0.6rem;
        font-size: 1.2rem;
    }
}

/* --- Technical & Specs Tables --- */
.tech-table-wrapper,
.specs-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 2.5rem 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.tech-table,
.specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
}

.tech-table th,
.specs-table th,
.tech-table td,
.specs-table td {
    padding: 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tech-table th,
.specs-table th {
    background: #f8fafc;
    font-family: 'Outfit';
    font-weight: 800;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.tech-table .row-label,
.specs-table .row-label {
    font-weight: 700;
    background: #fcfdff;
    width: 30%;
}

.tech-table tr:last-child td,
.specs-table tr:last-child td {
    border-bottom: none;
}

.tech-table tr:nth-child(even),
.specs-table tr:nth-child(even) {
    background: rgba(99, 102, 241, 0.02);
}

/* --- Checklist Box --- */
.check-list-box {
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.check-list-box h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--text-main);
}

.check-list-box ul {
    margin: 0.5rem 0 0;
    padding-left: 1.5rem;
}

.check-list-box li {
    margin-bottom: 0.3rem;
}

/* --- Mermaid --- */
border: 1px solid var(--border);
}

/* --- Added for Category Index Grids --- */
.article-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

@media (max-width: 900px) {
    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Added for Physics/Modern List Layout (Redesign) --- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
}

.list-card {
    display: flex;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    align-items: stretch;
}

.list-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-rich);
    border-color: var(--primary);
}

.list-card-img {
    width: 35%;
    min-width: 250px;
    background-size: cover;
    background-position: center;
}

.list-card-content {
    width: 65%;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-card h3 {
    margin: 0.5rem 0 1rem;
    font-size: 1.5rem;
    border: none;
    padding: 0;
    line-height: 1.3;
}

.list-card .desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .list-card {
        flex-direction: column;
    }

    .list-card-img {
        width: 100%;
        height: 200px;
    }

    .list-card-content {
        width: 100%;
        padding: 1.5rem;
    }

    .list-card h3 {
        font-size: 1.25rem;
    }
}