/* Webyot Learning Post Styles */
:root {
    --max-width: 1240px;
    --radius-xl: 36px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --shadow-soft: 0 30px 90px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.06);
    --transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

body[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f8f8fa;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --text: #090909;
    --muted: #666666;
    --line: rgba(9, 9, 9, 0.08);
    --line-strong: rgba(9, 9, 9, 0.15);
    --accent: #111111;
    --accent-soft: rgba(0, 0, 0, 0.04);
    --header-bg: rgba(255, 255, 255, 0.75);
    --shadow-soft: 0 30px 90px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.06);
    --transition: 280ms cubic-bezier(0.4, 0, 0.2, 1);
    --glow: rgba(99, 102, 241, 0.08);
    --gradient-hero: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.06) 0%,
        rgba(168, 85, 247, 0.04) 50%,
        rgba(236, 72, 153, 0.03) 100%
    );
    --nav-active: rgba(99, 102, 241, 0.08);
}

body[data-theme="dark"] {
    --bg: #050505;
    --bg-alt: #0d0d0d;
    --surface: rgba(16, 16, 16, 0.82);
    --surface-strong: rgba(18, 18, 18, 0.96);
    --text: #f7f7f7;
    --muted: #a9a9a9;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.13);
    --accent: #ffffff;
    --accent-soft: rgba(255, 255, 255, 0.04);
    --header-bg: rgba(10, 10, 10, 0.75);
    --shadow-soft: 0 30px 90px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.28);
    --glow: rgba(139, 92, 246, 0.1);
    --gradient-hero: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.08) 0%,
        rgba(168, 85, 247, 0.06) 50%,
        rgba(236, 72, 153, 0.04) 100%
    );
    --nav-active: rgba(139, 92, 246, 0.12);
}

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

body {
    font-family:
        "Space Grotesk",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition:
        background 400ms cubic-bezier(0.4, 0, 0.2, 1),
        color 400ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* ─── Site Header (matches index page) ─── */

.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    background: var(--header-bg);
    backdrop-filter: blur(24px) saturate(1.4);
    z-index: 40;
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.site-header:hover {
    border-bottom-color: var(--line-strong);
}

.site-header.is-scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

.header-inner {
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 50;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    transition: opacity var(--transition);
    text-decoration: none;
    color: var(--text);
}

.brand:hover {
    opacity: 0.8;
}

.brand-mark {
    width: 2.7rem;
    height: 2.7rem;
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    position: relative;
    transition:
        transform var(--transition),
        border-color var(--transition);
    overflow: hidden;
}

body[data-theme="light"] .brand-mark {
    background: linear-gradient(135deg, #f5f3ff, #fdf2f8);
    border-color: #e0def7;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.brand-copy strong {
    font-size: 1rem;
    letter-spacing: -0.04em;
}

.brand-copy span {
    color: var(--muted);
    font-size: 0.82rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-nav a {
    color: var(--muted);
    font-size: 0.92rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    transition:
        color var(--transition),
        background var(--transition);
    position: relative;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--text);
    background: var(--accent-soft);
}

.site-nav a.is-active {
    color: var(--text);
    background: var(--nav-active);
}

/* Theme Toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.theme-toggle-label {
    color: var(--muted);
    font-size: 0.92rem;
    transition: color var(--transition);
}

.theme-toggle:hover .theme-toggle-label {
    color: var(--text);
}

.theme-toggle-track {
    width: 3rem;
    height: 1.8rem;
    padding: 0.18rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    transition: border-color var(--transition);
}

.theme-toggle:hover .theme-toggle-track {
    border-color: var(--text);
}

.theme-toggle-thumb {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--text);
    transform: translateX(0);
    transition:
        transform 350ms cubic-bezier(0.68, -0.3, 0.32, 1.3),
        background var(--transition);
}

body[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(1.18rem);
    background: var(--text);
}

/* Article Header */
.article-header {
    padding: 80px 24px 48px;
    max-width: 800px;
    margin: 0 auto;
}
.article-header .breadcrumb {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.article-header .breadcrumb a {
    color: #6366f1;
    text-decoration: none;
}
.article-header .breadcrumb a:hover {
    text-decoration: underline;
}
.article-header .tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 16px;
}
.article-header h1 {
    font-family: "Instrument Serif", serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--text);
}
.article-header .meta-row {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.article-header .meta-row span::after {
    content: "·";
    margin-left: 16px;
}
.article-header .meta-row span:last-child::after {
    content: "";
}

/* Article Content */
.article-content {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 24px 60px;
}
.article-content h2 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 48px 0 16px;
    color: var(--text);
    scroll-margin-top: 80px;
}
.article-content h3 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 32px 0 12px;
    color: var(--text);
}
.article-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
}
.article-content ul,
.article-content ol {
    margin: 0 0 20px 24px;
    font-size: 1.05rem;
    line-height: 1.8;
}
.article-content li {
    margin-bottom: 8px;
}
.article-content strong {
    font-weight: 600;
    color: var(--text);
}
.article-content a {
    color: #6366f1;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.article-content a:hover {
    color: #4f46e5;
}

/* Info Box */
.info-box {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    padding: 24px 28px;
    margin: 28px 0;
}
.info-box p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Comparison Table */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 32px;
    font-size: 0.92rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.comparison-table th {
    background: var(--bg-alt);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 2px solid var(--line-strong);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.comparison-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.comparison-table tr:last-child td {
    border-bottom: none;
}
.comparison-table tr:nth-child(even) {
    background: var(--bg-alt);
}

/* Pricing Table */
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 32px;
    font-size: 0.92rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.pricing-table th {
    background: var(--bg-alt);
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    border-bottom: 2px solid var(--line-strong);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.pricing-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.pricing-table tr:last-child td {
    border-bottom: none;
}

/* FAQ Section */
.faq-section {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 24px 60px;
}
.faq-section h2 {
    font-family: "Instrument Serif", serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 32px;
    text-align: center;
}
.faq-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.faq-item summary {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 18px 24px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-alt);
    transition: background 200ms;
}
.faq-item summary:hover {
    background: rgba(99, 102, 241, 0.04);
}
.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--muted);
    transition: transform 200ms;
}
.faq-item[open] summary::after {
    content: "−";
}
.faq-item .faq-answer {
    padding: 0 24px 20px;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text);
}
.faq-item .faq-answer p {
    margin-bottom: 12px;
}
.faq-item .faq-answer p:last-child {
    margin-bottom: 0;
}

/* CTA Section */
.cta-section {
    background: var(--bg-alt);
    border-top: 1px solid var(--line);
    padding: 80px 24px;
    text-align: center;
}
.cta-section h2 {
    font-family: "Instrument Serif", serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 400;
    margin-bottom: 16px;
}
.cta-section p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 540px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.cta-section .cta-button {
    display: inline-block;
    background: var(--text);
    color: var(--bg);
    padding: 14px 36px;
    border-radius: 10px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: opacity 200ms;
}
.cta-section .cta-button:hover {
    opacity: 0.85;
}

/* Footer */
.learning-footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--line);
    max-width: 1200px;
    margin: 0 auto;
}
.learning-footer p {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    color: var(--muted);
}
.learning-footer a {
    color: #6366f1;
    text-decoration: none;
}

/* Related Posts */
.related-posts {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 24px 60px;
}
.related-posts h2 {
    font-family: "Instrument Serif", serif;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 24px;
    text-align: center;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.related-card {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    transition: all 200ms;
}
.related-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.related-card .tag {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6366f1;
    margin-bottom: 8px;
    display: block;
}
.related-card h3 {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

/* Architecture Diagram (ASCII-style) */
.arch-diagram {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    overflow-x: auto;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre;
    color: var(--text);
}

/* Timeline */
.timeline {
    margin: 24px 0 32px;
}
.timeline-item {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    position: relative;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: -24px;
    width: 2px;
    background: var(--line);
}
.timeline-item:last-child::before {
    display: none;
}
.timeline-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    border: 2px solid #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6366f1;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.timeline-content h4 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.timeline-content p {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .article-header {
        padding: 60px 20px 32px;
    }
    .article-content {
        padding: 0 20px 40px;
    }
    .faq-section {
        padding: 0 20px 40px;
    }
    .related-posts {
        padding: 0 20px 40px;
    }
    .comparison-table {
        font-size: 0.82rem;
    }
    .comparison-table th,
    .comparison-table td {
        padding: 10px 12px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .header-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface-strong);
        border-bottom: 1px solid var(--line);
        padding: 1.5rem;
        gap: 1.5rem;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition:
            transform var(--transition),
            opacity var(--transition),
            visibility var(--transition);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .site-header.menu-open .header-actions {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
    }

    .site-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 0.8rem;
    }

    .site-nav a {
        display: block;
        width: 100%;
        padding: 0.8rem 1rem;
        font-size: 1.1rem;
    }

    .brand-copy span {
        display: none;
    }
}
