@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ===== Reset & CSS Variables ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg-base: #060608;
    --color-frame-outer: #090a0f;
    --color-frame-border: #1a1c26;
    --color-frame-glow: rgba(99, 102, 241, 0.15);

    --color-canvas: #0c0d12;
    --color-card-bg: #12131a;
    --color-card-border: #1e202d;
    --color-card-hover: #181a24;

    --color-text-title: #ffffff;
    --color-text-body: #a5a7b6;
    --color-text-muted: #64677a;
    --color-text-faint: #444759;

    --color-accent: #6366f1;
    --color-accent-hover: #4f46e5;
    --color-accent-soft: rgba(99, 102, 241, 0.12);
    --color-accent-glow: rgba(99, 102, 241, 0.35);

    --color-pill-bg: #171822;
    --color-pill-border: #232534;

    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-window: 24px;
    --radius-card: 16px;
    --radius-pill: 999px;
}

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg-base);
    height: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-body);
    background-color: var(--color-bg-base);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
        radial-gradient(#1f2333 1px, transparent 1px);
    background-size: 100% 100%, 32px 32px;
    background-position: center top, 0 0;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    padding: 20px 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Outer browser frame inspired by the screenshot */
.app-viewport-frame {
    max-width: 1440px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background: var(--color-canvas);
    border: 1px solid var(--color-frame-border);
    border-radius: var(--radius-window);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 60px -15px rgba(0, 0, 0, 0.8),
        0 0 50px -10px var(--color-frame-glow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 6px;
    color: #e2e8f0;
    overflow-wrap: break-word;
    word-break: break-word;
}

code a {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

code a:hover {
    color: #60a5fa;
}

/* ===== Top Nav (Command Bar) ===== */
nav.app-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 36px;
    background: rgba(12, 13, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-frame-border);
    flex-shrink: 0;
    z-index: 1000;
    flex-wrap: wrap;
    row-gap: 10px;
}

.nav-left,
.nav-right {
    min-width: 0;
    flex-shrink: 1;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
}

.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #171822;
    border: 1px solid #2b2e40;
    overflow: hidden;
    flex-shrink: 0;
    padding: 0;
}

.brand-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-title);
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.88rem;
    color: var(--color-text-muted);
    font-weight: 500;
    margin-left: 2px;
}

.nav-pill-switcher {
    display: flex;
    align-items: center;
    background: var(--color-pill-bg);
    border: 1px solid var(--color-pill-border);
    border-radius: var(--radius-pill);
    padding: 3px 6px;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.nav-pill-switcher::-webkit-scrollbar {
    display: none;
}

.nav-pill-switcher a,
.nav-pill-switcher button {
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-pill-switcher a {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.nav-pill-switcher a.active,
.nav-pill-switcher a:hover {
    color: var(--color-text-title);
}

.nav-pill-switcher a.active {
    background: #252738;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.nav-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-theme-btn:hover {
    color: var(--color-text-title);
    background: rgba(255, 255, 255, 0.08);
}

.nav-theme-btn .theme-svg {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), stroke 0.2s ease;
}

.nav-theme-btn:hover .sun-svg {
    transform: rotate(25deg) scale(1.15);
    color: #ffd60a;
}

/* Meme Light Mode Modal Popup ("We don't do that here") */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 4, 8, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: modalBackdropFadeIn 0.25s ease forwards;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    position: relative;
    z-index: 2;
    background: #11121a;
    border: 1px solid rgba(88, 101, 242, 0.4);
    border-radius: 20px;
    padding: 14px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(88, 101, 242, 0.25);
    max-width: 580px;
    width: 100%;
    animation: modalScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 10;
    background: rgba(15, 17, 26, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.modal-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

.modal-image-wrapper {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

.meme-popup-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-wrapper {
    position: relative;
    min-width: 0;
}

/* Elevated high-contrast Search Field Pill */
.search-field-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(99, 102, 241, 0.06) 100%), #161824;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-size: 0.84rem;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 0;
    width: clamp(260px, 24vw, 360px);
    max-width: 360px;
    position: relative;
}

.search-icon {
    font-size: 0.85rem;
    opacity: 0.85;
    flex-shrink: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-field-pill:hover {
    border-color: rgba(99, 102, 241, 0.65);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(99, 102, 241, 0.12) 100%), #1a1d2b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.search-field-pill:hover .search-icon {
    transform: scale(1.1);
    opacity: 1;
}

.search-field-pill:focus-within {
    border-color: #818cf8;
    background: #1c1f2e;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), 0 4px 18px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    width: clamp(280px, 27vw, 400px);
    max-width: 400px;
}

.search-field-pill:focus-within .search-icon {
    transform: scale(1.1);
    opacity: 1;
}

.search-field-pill input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 500;
    font-family: inherit;
    width: 100%;
}

.search-field-pill input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.search-clear-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.kbd-shortcut {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.42);
    padding: 2px 7px;
    border-radius: 6px;
    color: #c7d2fe;
    flex-shrink: 0;
    pointer-events: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Search Results Autocomplete Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    max-height: 440px;
    overflow-y: auto;
    background: rgba(17, 18, 26, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(88, 101, 242, 0.35);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(88, 101, 242, 0.18);
    z-index: 1000;
    padding: 6px 0;
}

.search-results-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-results-dropdown::-webkit-scrollbar-thumb {
    background: #2a2e45;
    border-radius: 3px;
}

.search-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--color-text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom: 1px solid #1c1f2e;
}

.search-dropdown-header span.count {
    color: var(--color-accent);
    font-weight: 700;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s ease, border-left 0.15s ease;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    text-decoration: none;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background: #191c2b;
    border-left-color: var(--color-accent);
}

.search-result-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.search-result-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f0f2ff;
    line-height: 1.3;
}

.search-result-tag {
    font-size: 0.66rem;
    font-family: var(--font-mono);
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(88, 101, 242, 0.15);
    color: #9aa7ff;
    border: 1px solid rgba(88, 101, 242, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-result-snippet {
    font-size: 0.74rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-highlight {
    background: rgba(255, 214, 10, 0.22);
    color: #ffd60a;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.search-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

/* Empty state on article stage */
.no-search-results {
    text-align: center;
    padding: 64px 24px;
    background: #11121a;
    border: 1px dashed #262a40;
    border-radius: 16px;
    margin: 32px 0;
}

.no-search-results .empty-icon {
    font-size: 2.4rem;
    margin-bottom: 12px;
    opacity: 0.7;
}

.no-search-results h3 {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 8px;
}

.no-search-results p {
    color: var(--color-text-muted);
    max-width: 440px;
    margin: 0 auto;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Highlight flash pulse when navigating from search */
@keyframes searchTargetPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.8);
        border-color: rgba(88, 101, 242, 1);
    }
    50% {
        box-shadow: 0 0 28px 8px rgba(88, 101, 242, 0.45);
        border-color: rgba(88, 101, 242, 0.9);
    }
    100% {
        box-shadow: none;
    }
}

.search-target-highlight {
    animation: searchTargetPulse 1.8s ease-out;
}

.btn-cta-get {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #060608;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cta-get:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
    background: #f1f2f8;
}

/* ===== Subheader / Breadcrumb Bar ===== */
.sub-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 36px;
    background: rgba(14, 15, 21, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
    z-index: 900;
}

.breadcrumb-label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-label span.divider {
    color: var(--color-text-faint);
}

.meta-status-tags {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--color-text-faint);
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 6px;
    box-shadow: 0 0 8px #10b981;
}

.commit-badge {
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ===== Main Two-Column Layout ===== */
.app-content-body {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ===== Sidebar: Table of Contents ===== */
aside.sidebar-toc {
    border-right: 1px solid var(--color-frame-border);
    padding: 0;
    background: rgba(14, 15, 21, 0.4);
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.toc-top-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 24px 20px 16px;
    scrollbar-width: thin;
    scrollbar-color: #242636 transparent;
}

.toc-top-section::-webkit-scrollbar {
    width: 4px;
}

.toc-top-section::-webkit-scrollbar-thumb {
    background: #242636;
    border-radius: 4px;
}

.toc-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 8px;
}

.toc-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-text-faint);
    text-transform: uppercase;
}

.toc-chapter-badge {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    background: #171822;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-card-border);
}

.toc-items-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-items-list li a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--color-text-muted);
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.45;
}

.toc-items-list li a span.toc-num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-text-faint);
    flex-shrink: 0;
    margin-top: 1px;
}

.toc-items-list li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.toc-items-list li a.active {
    color: #ffffff;
    background: #191b26;
    border-color: #2b2e40;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-weight: 600;
}

.toc-items-list li a.active span.toc-num {
    color: var(--color-accent);
}

/* Sidebar Footer (Reading progress & actions) - Permanently docked at bottom */
.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 16px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 14, 20, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.reading-progress-wrap {
    margin-bottom: 14px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.74rem;
    color: var(--color-text-faint);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.progress-track {
    width: 100%;
    height: 4px;
    background: #191b24;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), #818cf8);
    border-radius: 999px;
    transition: width 0.15s ease-out;
}

.sidebar-actions {
    display: flex;
    gap: 8px;
}

.btn-sidebar-tool {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(79, 70, 229, 0.10) 100%);
    border: 1px solid rgba(99, 102, 241, 0.42);
    color: #f1f3fa;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-sidebar-tool:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #818cf8;
    box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-sidebar-tool:active {
    transform: translateY(0) scale(0.98);
}

.btn-sidebar-tool.copied {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45) !important;
}

/* ===== Article Stage (Right Pane) ===== */
main.article-stage {
    padding: 48px 56px 90px;
    max-width: 980px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #242636 transparent;
}

main.article-stage::-webkit-scrollbar {
    width: 6px;
}

main.article-stage::-webkit-scrollbar-track {
    background: transparent;
}

main.article-stage::-webkit-scrollbar-thumb {
    background: #242636;
    border-radius: 6px;
}

main.article-stage::-webkit-scrollbar-thumb:hover {
    background: #363a50;
}

/* Hero Section (if displayed inside or above entries) */
.hero {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hero h1 {
    font-size: clamp(1.85rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text-title);
    margin-bottom: 14px;
    line-height: 1.15;
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    max-width: 780px;
}

/* Entries Styling */
.entry {
    scroll-margin-top: 32px;
    margin-bottom: 64px;
    content-visibility: auto;
    contain-intrinsic-size: auto 650px;
}

.entry-header {
    margin-bottom: 28px;
}

.entry-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--color-text-title);
    line-height: 1.2;
    margin: 12px 0 16px;
}

.blog-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

/* Author Avatar & Meta Card */
.author-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #111219;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    margin-top: 20px;
}

.author-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-avatar-chip {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #373950, #1c1d29);
    border: 1px solid #4a4d6b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    font-family: var(--font-mono);
}

.author-info-text .author-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--color-text-title);
}

.author-info-text .author-role {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.author-meta-right {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-text-faint);
}

/* Entry Body Prose */
.entry-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-body);
}

.entry-body p {
    margin-bottom: 22px;
}

.entry-body strong,
.entry-body b {
    color: #ffffff;
    font-weight: 600;
}

.entry-body ul {
    list-style: none;
    margin: 20px 0 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-body ul li {
    position: relative;
    padding-left: 24px;
    color: #c0c2d3;
}

.entry-body ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
}

/* Callout Quote Card */
blockquote.callout-quote {
    margin: 28px 0;
    padding: 22px 26px;
    background: #111219;
    border-left: 3px solid var(--color-accent);
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
    font-style: italic;
    color: #e2e8f0;
    font-size: 1.05rem;
    line-height: 1.65;
}

/* Code Snippet / Terminal Window */
.terminal-block {
    margin: 28px 0;
    background: #090a0f;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #12131c;
    border-bottom: 1px solid var(--color-card-border);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--color-text-faint);
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88, 0 0 14px rgba(0, 255, 136, 0.5);
}

.terminal-link {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}

.terminal-link:hover {
    color: #60a5fa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

.terminal-content {
    padding: 18px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.6;
    overflow-x: auto;
}

.terminal-content .comment {
    color: #64748b;
}

.terminal-content .commit-hash {
    color: #818cf8;
}

/* Topology Spec Card from Screenshot */
.topology-card {
    margin: 32px 0;
    background: #101118;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    padding: 24px;
}

.topology-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.topology-title-group h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.topology-title-group p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0;
}

.topology-badges {
    display: flex;
    gap: 8px;
}

.spec-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-muted);
    background: #171822;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #282a3a;
}

.topology-stages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stage-box {
    background: #151620;
    border: 1px solid #222432;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stage-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.stage-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.stage-desc {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

.stage-footer-metric {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--color-text-faint);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

/* Media / Video Container */
.entry-media {
    margin: 28px 0;
    border-radius: var(--radius-card);
    overflow: hidden;
    background: #090a0f;
    border: 1px solid var(--color-card-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.entry-media video,
.entry-media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    display: block;
    background: #000;
}

/* Divider between chapters */
.entry-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 72px 0;
}

/* Footer */
footer.app-footer {
    padding: 32px 0 0;
    margin-top: 60px;
    border-top: 1px solid var(--color-frame-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--color-text-faint);
}

/* Responsive */
@media (max-width: 1024px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 16px;
        margin: 0;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .app-viewport-frame {
        height: auto;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .app-content-body {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    aside.sidebar-toc {
        display: none;
    }

    main.article-stage {
        height: auto;
        overflow-y: visible;
        overflow-x: hidden;
        padding: 28px 20px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .topology-stages-grid {
        grid-template-columns: 1fr;
    }

    .entry {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .entry-body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .terminal-block {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    .terminal-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        box-sizing: border-box;
    }

    .topology-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .app-viewport-frame {
        border-radius: 0;
        border: none;
        border-left: none;
        border-right: none;
    }

    nav.app-navbar {
        padding: 12px 14px;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .nav-left {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        min-width: 0;
    }

    .nav-brand-group {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
    }

    .nav-pill-switcher {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 4px;
        box-sizing: border-box;
        gap: 4px;
    }

    .nav-pill-switcher::-webkit-scrollbar {
        display: none;
    }

    .nav-pill-switcher a,
    .nav-pill-switcher button {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 0.78rem;
        padding: 6px 12px;
    }

    .nav-right {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .search-wrapper {
        flex: 1;
        min-width: 0;
        width: 100%;
        position: relative;
    }

    .search-field-pill {
        min-width: 0;
        width: 100%;
        padding: 7px 10px;
        gap: 6px;
    }

    .search-field-pill input {
        min-width: 0;
        font-size: 0.8rem;
    }

    .kbd-shortcut {
        display: none; /* Hide ⌘K on mobile to save space */
    }

    .search-results-dropdown {
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
    }

    .btn-cta-get {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 7px 12px;
        font-size: 0.76rem;
    }

    .sub-nav-bar {
        padding: 10px 14px;
        font-size: 0.68rem;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sub-nav-bar::-webkit-scrollbar {
        display: none;
    }

    main.article-stage {
        padding: 20px 14px;
    }
}

@media (max-width: 640px) {
    main.article-stage {
        padding: 18px 12px;
    }

    .entry {
        padding: 18px 12px;
        margin-bottom: 24px;
    }

    .entry-header h2,
    .entry h2 {
        font-size: 1.35rem;
        line-height: 1.3;
        margin-bottom: 14px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .entry-body {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .entry-body p {
        margin-bottom: 16px;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    blockquote.callout-quote {
        margin: 20px 0;
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .author-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 12px;
        width: 100%;
        box-sizing: border-box;
    }

    .author-left {
        width: 100%;
        min-width: 0;
    }

    .author-info-text {
        min-width: 0;
        flex: 1;
    }

    .author-info-text .author-name {
        font-size: 0.86rem;
    }

    .author-info-text .author-role {
        font-size: 0.7rem;
        word-break: break-word;
    }

    .topology-card {
        padding: 14px 12px;
    }

    .topology-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .terminal-header {
        padding: 8px 10px;
        font-size: 0.68rem;
        flex-wrap: wrap;
        gap: 4px;
    }

    .terminal-content {
        padding: 10px 12px;
        font-size: 0.75rem;
        word-break: break-word;
    }

    .tech-callout {
        padding: 16px 12px;
    }

    footer.app-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding-top: 24px;
        margin-top: 36px;
        font-size: 0.74rem;
    }

    .modal-card {
        padding: 10px;
        border-radius: 14px;
        max-width: 92vw;
    }

    .modal-close-btn {
        top: 14px;
        right: 14px;
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}