/* ============================================
   RADIX IoT KNOWLEDGE BASE
   Brand-Aligned Design System v3.0
   Warm palette · Montserrat · Poppins · Source Sans
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --color-bg: #F5F0E8;
    --color-surface: #FEFDFB;
    --color-surface-hover: #FAF7F2;
    --color-border: #E2DACE;
    --color-border-light: #EDE8DF;
    --color-text-primary: #1B2A4A;
    --color-text-secondary: #4A5568;
    --color-text-tertiary: #8896A6;
    --color-accent: #5A9A1F;
    --color-accent-light: #E8F5D4;
    --color-accent-hover: #4A8519;
    --color-accent-subtle: #F0F8E4;
    --color-accent-glow: rgba(162, 212, 94, 0.2);
    --color-radix-green: #A2D45E;
    --color-radix-dark: #1B2A4A;
    --color-navy: #1B2A4A;
    --color-blue-soft: #7BA7C9;
    --color-sand: #D4C5A0;
    --color-mint: #E8F5ED;
    --color-code-bg: #1B2A4A;
    --color-code-text: #E2E8F0;
    --color-warning-bg: #FFF9EB;
    --color-warning-border: #F0D078;
    --color-warning-text: #7A5A1A;
    --color-info-bg: #EBF4FA;
    --color-info-border: #7BA7C9;
    --color-info-text: #1B4A6A;
    --color-success-bg: #EDF8F0;
    --color-success-border: #86D494;
    --color-success-text: #1A5C2A;
    --color-danger-bg: #FDF2F2;
    --color-danger-border: #E8A0A0;
    --color-danger-text: #8B1A1A;

    --font-heading: 'Montserrat', sans-serif;
    --font-subheading: 'Poppins', sans-serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-2xl: 24px;

    --shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.04);
    --shadow-md: 0 4px 8px -1px rgba(27, 42, 74, 0.06), 0 2px 4px -1px rgba(27, 42, 74, 0.03);
    --shadow-lg: 0 10px 20px -3px rgba(27, 42, 74, 0.08), 0 4px 8px -2px rgba(27, 42, 74, 0.03);
    --shadow-xl: 0 20px 30px -5px rgba(27, 42, 74, 0.1), 0 8px 12px -5px rgba(27, 42, 74, 0.03);
    --shadow-card: 0 1px 3px rgba(27, 42, 74, 0.04), 0 1px 2px rgba(27, 42, 74, 0.02);
    --shadow-card-hover: 0 12px 28px rgba(27, 42, 74, 0.1), 0 4px 10px rgba(27, 42, 74, 0.04);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);

    --max-width: 1280px;
    --header-height: 64px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-hover);
}

::selection {
    background: var(--color-accent-light);
    color: var(--color-accent);
}

/* --- Header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(254, 253, 251, 0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 218, 206, 0.6);
    height: var(--header-height);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-navy);
    flex-shrink: 0;
}

.logo-icon {
    transition: transform var(--transition-smooth);
    display: block;
}

.logo:hover .logo-icon {
    transform: scale(1.03);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.logo-accent {
    font-family: var(--font-subheading);
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 14px;
}

.footer-logo {
    display: block;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.site-footer:hover .footer-logo {
    opacity: 1;
}

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.header-search input {
    width: 100%;
    height: 40px;
    padding: 0 44px;
    border: 1px solid var(--color-border);
    border-radius: 100px;
    background: var(--color-bg);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-primary);
    transition: all var(--transition-smooth);
    outline: none;
}

.header-search input::placeholder {
    color: var(--color-text-tertiary);
}

.header-search input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
    background: var(--color-surface);
}

.header-search input:focus + .search-shortcut {
    opacity: 0;
}

.header-search:focus-within .search-icon {
    color: var(--color-accent);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--color-text-tertiary);
    font-family: var(--font-body);
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.header-nav {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 100px;
    font-family: var(--font-subheading);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--color-navy);
    background: var(--color-surface-hover);
}

.nav-link.active {
    color: var(--color-accent);
    background: var(--color-accent-subtle);
}

/* --- Hero Section --- */
.hero {
    background: url('../images/hero-pattern.png') center center / cover no-repeat;
    border-bottom: 1px solid var(--color-border);
    padding: 64px 32px 56px;
    position: relative;
    overflow: hidden;
}

/* White overlay to let text pop over the pattern */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.8) 60%, rgba(255,255,255,0.55) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5A9A1F;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-navy);
    margin-bottom: 14px;
    line-height: 1.08;
    text-transform: uppercase;
}

.hero-title-accent {
    background: linear-gradient(135deg, #5A9A1F 0%, #A2D45E 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--color-navy);
    opacity: 0.7;
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 56px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: -0.02em;
}

.stat-label {
    font-family: var(--font-subheading);
    font-size: 12px;
    color: var(--color-navy);
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* --- Filter Bar --- */
.filter-bar {
    background: rgba(254, 253, 251, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 32px;
    position: sticky;
    top: var(--header-height);
    z-index: 50;
}

.filter-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.pill {
    padding: 7px 16px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-smooth);
    white-space: nowrap;
    flex-shrink: 0;
}

.pill:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: var(--color-accent-subtle);
    transform: translateY(-1px);
}

.pill.active {
    background: var(--color-navy);
    color: white;
    border-color: var(--color-navy);
    box-shadow: 0 2px 8px rgba(27, 42, 74, 0.25);
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    color: var(--color-navy);
    border-color: var(--color-text-tertiary);
}

.view-btn.active {
    color: var(--color-navy);
    border-color: var(--color-navy);
    background: rgba(27, 42, 74, 0.06);
}

.version-filter {
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.version-filter:focus {
    border-color: var(--color-accent);
}

/* --- Main Content --- */
.content {
    padding: 36px 32px 48px;
    min-height: 60vh;
}

.content-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --- Article Grid --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.article-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
}

/* --- Article Card --- */
.article-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-navy), var(--color-blue-soft), var(--color-radix-green));
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.article-card:hover {
    border-color: rgba(27, 42, 74, 0.2);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-3px);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    transition: transform var(--transition-smooth);
}

.article-card:hover .card-icon {
    transform: scale(1.08);
}

.card-icon.installation { background: #DBEAFE; color: #2563EB; }
.card-icon.configuration { background: #E0E7FF; color: #4F46E5; }
.card-icon.troubleshooting { background: #FEE2E2; color: #DC2626; }
.card-icon.dashboards { background: #FCE7F3; color: #DB2777; }
.card-icon.scripting { background: #FEF3C7; color: #D97706; }
.card-icon.data-sources { background: #D1FAE5; color: #059669; }
.card-icon.api { background: #CFFAFE; color: #0891B2; }
.card-icon.security { background: #F3E8FF; color: #7C3AED; }
.card-icon.upgrade { background: #FFEDD5; color: #EA580C; }
.card-icon.system-admin { background: #E2E8F0; color: #475569; }

.card-version {
    font-family: var(--font-subheading);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--color-bg);
    color: var(--color-text-tertiary);
    white-space: nowrap;
    letter-spacing: 0.02em;
    border: 1px solid var(--color-border-light);
}

.card-title {
    font-family: var(--font-subheading);
    font-size: 17px;
    font-weight: 600;
    color: var(--color-navy);
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.card-description {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-tag {
    font-family: var(--font-subheading);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent);
    background: var(--color-accent-subtle);
    padding: 3px 10px;
    border-radius: 100px;
}

.card-difficulty {
    font-size: 12px;
    color: var(--color-text-tertiary);
    display: flex;
    align-items: center;
    gap: 3px;
}

.card-difficulty .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.card-difficulty .dot.filled { background: var(--color-accent); }
.card-difficulty .dot.empty { background: var(--color-border); }

.card-read-time {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* --- List View Card Variant --- */
.list-view .article-card {
    flex-direction: row;
    align-items: center;
    padding: 20px 28px;
    gap: 20px;
    border-radius: var(--radius-lg);
}

.list-view .card-header {
    flex-shrink: 0;
}

.list-view .card-description {
    -webkit-line-clamp: 1;
}

.list-view .card-footer {
    border-top: none;
    padding-top: 0;
    flex-shrink: 0;
}

/* --- Search Results Header --- */
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.search-results-header h2 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-navy);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.clear-search {
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-subheading);
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.clear-search:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.empty-state p {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-tertiary);
}

/* --- Article Detail Overlay --- */
.article-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--color-bg);
    overflow-y: auto;
    display: none;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-overlay.open {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-detail {
    max-width: 1100px;
    margin: 0 auto;
}

.article-detail-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(245, 240, 232, 0.88);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 218, 206, 0.6);
    padding: 14px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-subheading);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.back-btn:hover {
    border-color: var(--color-navy);
    color: var(--color-navy);
    background: var(--color-surface-hover);
}

.article-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.action-btn:hover {
    border-color: var(--color-navy);
    color: var(--color-navy);
    background: var(--color-surface-hover);
}

.article-detail-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    padding: 44px 32px 80px;
}

/* --- Table of Contents Sidebar --- */
.article-toc {
    position: sticky;
    top: 80px;
    align-self: start;
}

.article-toc h4 {
    font-family: var(--font-heading);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-tertiary);
    font-weight: 700;
    margin-bottom: 16px;
}

.article-toc nav a {
    display: block;
    padding: 5px 0;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-tertiary);
    border-left: 2px solid var(--color-border-light);
    padding-left: 16px;
    transition: all var(--transition-smooth);
    text-decoration: none;
    line-height: 1.4;
}

.article-toc nav a:hover {
    color: var(--color-text-secondary);
    border-left-color: var(--color-text-tertiary);
}

.article-toc nav a.active {
    color: var(--color-navy);
    border-left-color: var(--color-navy);
    font-weight: 600;
}

.article-toc nav a.toc-h3 {
    padding-left: 28px;
    font-size: 12px;
}

/* --- Article Content Styles --- */
.article-content {
    max-width: 740px;
}

.article-content .article-meta-header {
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
}

.article-content .article-meta-header h1 {
    font-family: var(--font-heading);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.15;
    color: var(--color-navy);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.article-content .meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article-content .meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-subheading);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
}

.article-content .meta-badge.category {
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border: 1px solid rgba(90, 154, 31, 0.2);
}

.article-content .meta-badge.version {
    background: var(--color-bg);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.article-content .meta-badge.difficulty-beginner {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid rgba(134, 212, 148, 0.3);
}

.article-content .meta-badge.difficulty-intermediate {
    background: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid rgba(240, 208, 120, 0.3);
}

.article-content .meta-badge.difficulty-advanced {
    background: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid rgba(232, 160, 160, 0.3);
}

/* Article typography */
.article-content h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--color-navy);
    margin-top: 44px;
    margin-bottom: 16px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border-light);
    text-transform: uppercase;
}

.article-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.article-content h3 {
    font-family: var(--font-subheading);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-navy);
    margin-top: 32px;
    margin-bottom: 12px;
}

.article-content p {
    font-family: var(--font-body);
    margin-bottom: 16px;
    line-height: 1.75;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.article-content ul, .article-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.article-content li {
    font-family: var(--font-body);
    margin-bottom: 8px;
    line-height: 1.7;
    color: var(--color-text-secondary);
    font-size: 15px;
}

.article-content strong {
    color: var(--color-navy);
    font-weight: 600;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: rgba(27, 42, 74, 0.06);
    border: 1px solid rgba(27, 42, 74, 0.1);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--color-navy);
}

.article-content pre {
    background: var(--color-code-bg);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    overflow-x: auto;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.article-content pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-code-text);
    font-size: 13px;
    line-height: 1.7;
}

.article-content pre .copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-family: var(--font-subheading);
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
}

.article-content pre:hover .copy-code-btn {
    opacity: 1;
}

.article-content pre .copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Callout boxes */
.article-content .callout {
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.article-content .callout-icon {
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1.7;
}

.article-content .callout p {
    margin-bottom: 0;
    font-size: 14px;
}

.article-content .callout.warning {
    background: var(--color-warning-bg);
    border-color: var(--color-warning-border);
}
.article-content .callout.warning p { color: var(--color-warning-text); }

.article-content .callout.info {
    background: var(--color-info-bg);
    border-color: var(--color-info-border);
}
.article-content .callout.info p { color: var(--color-info-text); }

.article-content .callout.success {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
}
.article-content .callout.success p { color: var(--color-success-text); }

.article-content .callout.danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger-border);
}
.article-content .callout.danger p { color: var(--color-danger-text); }

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.article-content th {
    font-family: var(--font-subheading);
    text-align: left;
    padding: 10px 16px;
    background: rgba(27, 42, 74, 0.04);
    font-weight: 600;
    color: var(--color-navy);
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
}

.article-content td {
    font-family: var(--font-body);
    padding: 10px 16px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-light);
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover td {
    background: var(--color-surface-hover);
}

/* Checklist items */
.article-content input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--color-accent);
}

/* Related articles */
.article-content .related-articles {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.article-content .related-articles h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    margin-bottom: 16px;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.article-content .related-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: all var(--transition-smooth);
    text-decoration: none;
    color: var(--color-text-secondary);
    font-family: var(--font-subheading);
    font-size: 14px;
    font-weight: 500;
}

.article-content .related-link:hover {
    border-color: var(--color-navy);
    color: var(--color-navy);
    background: var(--color-surface-hover);
    transform: translateX(4px);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    padding: 28px 32px;
    margin-top: 48px;
    position: relative;
    overflow: hidden;
}

/* Footer decorative waves */
.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0,20 C200,50 400,5 600,25 C800,45 1000,10 1200,30 C1350,42 1420,15 1440,20 L1440,0 L0,0 Z' fill='%23A2D45E' opacity='0.08'/%3E%3Cpath d='M0,15 C180,40 360,8 540,22 C720,36 900,12 1080,28 C1260,44 1380,10 1440,18 L1440,0 L0,0 Z' fill='%237BA7C9' opacity='0.06'/%3E%3Cpath d='M0,25 C240,8 480,38 720,18 C960,0 1100,35 1280,15 C1380,7 1420,25 1440,22 L1440,0 L0,0 Z' fill='%23D4C5A0' opacity='0.1'/%3E%3C/svg%3E") no-repeat top center;
    background-size: 100% 100%;
    pointer-events: none;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-brand {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-navy);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.footer-divider {
    color: var(--color-text-tertiary);
}

.footer-version {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-tertiary);
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-family: var(--font-subheading);
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

.footer-link:hover {
    color: var(--color-navy);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .article-detail-body {
        grid-template-columns: 1fr;
    }

    .article-toc {
        position: static;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        gap: 12px;
    }

    .header-nav {
        display: none;
    }

    .header-search {
        max-width: 100%;
    }

    .search-shortcut {
        display: none;
    }

    .hero {
        padding: 40px 16px 36px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero-stats {
        gap: 28px;
    }

    .stat-number {
        font-size: 24px;
    }

    .filter-bar {
        padding: 12px 16px;
    }

    .content {
        padding: 20px 16px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .article-card {
        padding: 22px;
    }

    .list-view .article-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-detail-header {
        padding: 12px 16px;
    }

    .article-detail-body {
        padding: 24px 16px 60px;
    }

    .article-content .article-meta-header h1 {
        font-size: 26px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* --- Print Styles (for PDF) --- */
@media print {
    .site-header,
    .filter-bar,
    .hero,
    .site-footer,
    .article-detail-header,
    .article-toc,
    .related-articles {
        display: none !important;
    }

    .article-overlay {
        position: static;
        background: white;
    }

    .article-detail-body {
        display: block;
        padding: 0;
    }

    .article-content {
        max-width: 100%;
    }

    .article-content pre {
        background: #f5f5f5 !important;
        border: 1px solid #ddd;
    }

    .article-content pre code {
        color: #333 !important;
    }
}

/* --- Loading Skeleton --- */
.skeleton-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--color-border-light) 25%, var(--color-bg) 50%, var(--color-border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    margin-bottom: 12px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }
.skeleton-line.title { height: 20px; width: 70%; margin-bottom: 16px; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- Product Splash Page --- */
.product-splash {
    min-height: calc(100vh - var(--header-height) - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 32px;
    background: url('../images/hero-pattern.png') center center / cover no-repeat;
    position: relative;
}

.product-splash::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.6) 100%);
    pointer-events: none;
}

.splash-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.splash-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.splash-title {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-navy);
    margin-bottom: 12px;
    line-height: 1.08;
    text-transform: uppercase;
}

.splash-subtitle {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--color-navy);
    opacity: 0.6;
    max-width: 480px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

.product-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 680px;
    margin: 0 auto;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    padding: 36px 28px 28px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-navy), var(--color-blue-soft), var(--color-radix-green));
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(27, 42, 74, 0.2);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card:active {
    transform: translateY(-2px);
}

.product-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-family: var(--font-subheading);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    background: var(--color-accent-subtle);
    color: var(--color-accent);
    border: 1px solid rgba(90, 154, 31, 0.2);
    letter-spacing: 0.02em;
}

.product-card-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 64px;
}

.product-card-icon img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.product-card-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-card-desc {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.product-card-meta {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.product-card-count {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-navy);
}

.product-card-label {
    font-family: var(--font-subheading);
    font-size: 13px;
    color: var(--color-text-tertiary);
    font-weight: 500;
}

.product-card-versions {
    font-family: var(--font-subheading);
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-bottom: 16px;
}

.product-card-arrow {
    display: flex;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
    color: var(--color-text-tertiary);
    transition: all var(--transition-smooth);
}

.product-card:hover .product-card-arrow {
    color: var(--color-accent);
    transform: translateX(4px);
}

/* errProof brand typography */
.errproof-brand {
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: -0.024em !important;
    text-transform: none !important;
}

/* ErrProof card dimmed slightly */
.errproof-card {
    opacity: 0.75;
}

.errproof-card:hover {
    opacity: 1;
}

/* --- Product Switcher (Header) --- */
.product-switcher {
    display: flex;
    gap: 2px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    padding: 3px;
    flex-shrink: 0;
}

.product-tab {
    font-family: var(--font-subheading);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 100px;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.product-tab:hover {
    color: var(--color-navy);
}

.product-tab.active {
    background: var(--color-navy);
    color: white;
    box-shadow: 0 1px 4px rgba(27, 42, 74, 0.25);
}

/* --- Splash responsive --- */
@media (max-width: 640px) {
    .product-cards {
        grid-template-columns: 1fr;
        max-width: 360px;
    }

    .splash-title {
        font-size: 34px;
    }

    .product-splash {
        padding: 40px 16px;
    }

    .product-card {
        padding: 28px 22px 22px;
    }
}

/* --- Card enter animation --- */
.article-card {
    animation: cardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.article-card:nth-child(1) { animation-delay: 0ms; }
.article-card:nth-child(2) { animation-delay: 40ms; }
.article-card:nth-child(3) { animation-delay: 80ms; }
.article-card:nth-child(4) { animation-delay: 120ms; }
.article-card:nth-child(5) { animation-delay: 160ms; }
.article-card:nth-child(6) { animation-delay: 200ms; }
.article-card:nth-child(7) { animation-delay: 240ms; }
.article-card:nth-child(8) { animation-delay: 280ms; }
.article-card:nth-child(9) { animation-delay: 320ms; }
.article-card:nth-child(10) { animation-delay: 360ms; }
.article-card:nth-child(11) { animation-delay: 400ms; }
.article-card:nth-child(12) { animation-delay: 440ms; }

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
