/* Minimal Editorial Styles */

/*
  Design tokens (CSS variables)
  - Keep Tailwind utility classes as-is; this file provides a stable token layer
    for the custom CSS below.
*/

:root {
    /* Core colors */
    --color-primary: #0c0a09;
    --color-accent: #2563eb;

    /* Text */
    --color-text-primary: #0c0a09;
    --color-text-secondary: #78716c;
    --color-text-muted: #a8a29e;

    /* Backgrounds */
    --color-bg-main: #fafaf9;
    --color-bg-card: #ffffff;
    --color-bg-nav: rgba(250, 250, 249, 0.9);

    /* Surfaces / borders */
    --color-border: #e7e5e4;

    /* Component-specific */
    --color-filter-active-bg: #1c1917;
    --color-filter-active-text: #fafaf9;
    --color-filter-active-border: #1c1917;

    /* Scrollbar */
    --color-scrollbar-thumb: #d6d3d1;

    /* Radius */
    --radius-xs: 0.1875rem; /* 3px */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.25rem;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Font sizes */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 1.875rem;
    --fs-4xl: 2.25rem;
    --fs-5xl: 3rem;
    --fs-6xl: 3.75rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 18px 35px rgba(0, 0, 0, 0.12);

    /* Motion */
    --dur-fast: 150ms;
    --dur: 200ms;
    --dur-slow: 500ms;
    --ease-standard: ease;
    --motion-reveal-offset: 16px;

    color-scheme: light;
}

/* Dark mode variable set (matches the existing .dark class toggle) */
.dark {
    --color-primary: #fafaf9;
    --color-accent: #3b82f6;

    --color-text-primary: #f4f4f5;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;

    --color-bg-main: #09090b;
    --color-bg-card: #18181b;
    --color-bg-nav: rgba(9, 9, 11, 0.9);

    --color-border: #27272a;

    --color-filter-active-bg: #f4f4f5;
    --color-filter-active-text: #111111;
    --color-filter-active-border: #f4f4f5;

    --color-scrollbar-thumb: #3f3f46;

    /* Section surfaces (Fix 1 — hero -> sections transition) */
    --color-hero-surface: #0f172a;
    --color-section-surface: var(--color-bg-main);

    color-scheme: dark;
}

/* Navbar upgrades */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 60;
    background: transparent;
    pointer-events: none;
}

.scroll-progress__bar {
    height: 100%;
    width: 100%;
    background: var(--color-accent);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform var(--dur-fast) var(--ease-standard);
}

#site-header {
    /* When supported, backdrop-filter gives the frosted effect */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: box-shadow var(--dur) var(--ease-standard), background-color var(--dur) var(--ease-standard), -webkit-backdrop-filter var(--dur) var(--ease-standard), backdrop-filter var(--dur) var(--ease-standard);
}

#site-header.scrolled {
    background-color: var(--color-bg-nav);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-link {
    position: relative;
    transition: color var(--dur) var(--ease-standard);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--dur) var(--ease-standard), opacity var(--dur) var(--ease-standard);
    opacity: 0;
}

.nav-link.active {
    color: var(--color-text-primary);
}

.nav-link.active::after {
    transform: scaleX(1);
    opacity: 1;
}

/* Hero redesign */
.hero-mesh {
    position: absolute;
    inset: -30%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.28;
    filter: blur(48px);
    background:
        radial-gradient(circle at 20% 20%, var(--color-accent) 0%, transparent 55%),
        radial-gradient(circle at 80% 30%, var(--color-accent) 0%, transparent 58%),
        radial-gradient(circle at 40% 85%, var(--color-accent) 0%, transparent 60%);
    transform: translate3d(0, 0, 0) scale(1.05);
    animation: meshFloat 14s var(--ease-standard) infinite alternate;
}

@keyframes meshFloat {
    0% {
        transform: translate3d(-1.5%, 0.5%, 0) scale(1.05) rotate(0deg);
        opacity: 0.22;
    }
    100% {
        transform: translate3d(1.5%, -0.75%, 0) scale(1.12) rotate(8deg);
        opacity: 0.30;
    }
}

.profile-ring {
    --ring-size: 3px;
    position: relative;
    width: 10rem;
    height: 10rem;
    border-radius: 9999px;
}

@media (min-width: 640px) {
    .profile-ring {
        width: 13rem;
        height: 13rem;
        --ring-size: 3px;
    }
}

.profile-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--color-accent);
}

.profile-ring__inner {
    position: absolute;
    inset: var(--ring-size);
    border-radius: inherit;
    background: var(--color-bg-main);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.profile-ring__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.typewriter {
    display: inline-block;
    white-space: nowrap;
}

.typewriter-cursor {
    display: inline-block;
    width: 0.6ch;
    margin-left: 0.15ch;
    color: var(--color-accent);
    animation: caretBlink 950ms step-end infinite;
}

.typewriter-cursor::before {
    content: '▍';
}

@keyframes caretBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

html.js .fade-in-up {
    opacity: 0;
    transform: translateY(var(--motion-reveal-offset));
    animation: fadeInUp var(--dur-slow) var(--ease-standard) forwards;
    animation-delay: var(--d, 0ms);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

html:not(.js) .fade-in-up {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .hero-mesh {
        animation: none;
    }

    html.js .fade-in-up {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .typewriter-cursor {
        animation: none;
    }
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    overflow-x: clip;
    transition: background-color var(--dur) var(--ease-standard), color var(--dur) var(--ease-standard);
}

/* Accent button (Fix 2 — Contact button) */
.btn-accent {
    width: 100%;
    background: #3b82f6;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-accent:hover {
    background: #2563eb;
    background-color: #2563eb;
}

.btn-accent:not(:disabled):hover {
    background: #2563eb;
    background-color: #2563eb;
}

.btn-accent:focus,
.btn-accent:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* Fix 1 — Section transition (dark mode only) */
.dark .hero-surface {
    background: var(--color-hero-surface);
}

.dark .section-surface {
    background: var(--color-section-surface);
}

/* Subtle dividers between major sections (dark mode) */
.dark #projects.section-surface,
.dark #blog.section-surface,
.dark #about.section-surface,
.dark #experience.section-surface,
.dark #contact.section-surface {
    border-top: 0.5px solid rgba(255, 255, 255, 0.06);
}

.hero-surface,
.section-transition {
    position: relative;
}

.dark .hero-surface::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--color-section-surface));
    pointer-events: none;
}

.dark .section-transition::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: clamp(72px, 12vw, 140px);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0) 100%);
    pointer-events: none;
}

/* Scroll-triggered fade animations (base) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fade-up.visible,
.fade-left.visible,
.fade-right.visible,
.fade-in.visible {
    opacity: 1;
    transform: translate(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

@media (prefers-reduced-motion: reduce) {
    .fade-up, .fade-left, .fade-right, .fade-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

/* Mobile polish: touch targets + menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: max-height 240ms var(--ease-standard), opacity 200ms var(--ease-standard), transform 200ms var(--ease-standard);
}

#mobile-menu.open {
    max-height: 70vh;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    #mobile-menu {
        transition: none;
        transform: none;
    }
}

/* 44px minimum tap targets on mobile */
@media (max-width: 767px) {
    #theme-toggle,
    #theme-toggle-mobile,
    #mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    #mobile-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem 0.25rem;
        border-radius: var(--radius-md);
    }

    .project-filter {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    .project-icon-link {
        width: 2.75rem;
        height: 2.75rem;
    }

    #home a[aria-label],
    .footer-surface a[aria-label] {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    #mobile-menu {
        max-height: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        overflow: visible;
        transition: none;
    }
}

.footer-surface {
    background: color-mix(in srgb, var(--color-bg-main) 92%, #000 8%);
}

@supports not (color-mix(in srgb, #000 0%, #000 100%)) {
    .footer-surface {
        background: var(--color-bg-card);
    }
}

/* Scroll reveal */
html.js .reveal,
html.js .reveal-soft {
    opacity: 0;
    transform: translateY(var(--motion-reveal-offset));
    transition-delay: var(--reveal-delay, 0ms);
}

html.js .reveal {
    transition: opacity var(--dur-slow) var(--ease-standard), transform var(--dur-slow) var(--ease-standard);
    will-change: opacity, transform;
}

html.js .reveal.active,
html.js .reveal-soft.active {
    opacity: 1;
    transform: translateY(0);
}

html:not(.js) .reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html.js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Project filter active state */
.project-filter.active {
    background-color: var(--color-filter-active-bg);
    color: var(--color-filter-active-text);
    border-color: var(--color-filter-active-border);
}

/* Projects cards upgrade */
.project-card {
    --enter-y: 0px;
    --hover-y: 0px;
    transform: translateY(calc(var(--enter-y) + var(--hover-y)));
    transition:
        opacity var(--dur) var(--ease-standard),
        transform var(--dur) var(--ease-standard),
        box-shadow var(--dur) var(--ease-standard),
        border-color var(--dur) var(--ease-standard);
    will-change: transform;
}

/* Blog cards upgrade */
.blog-card {
    position: relative;
    cursor: pointer;
    transition: all 0.25s ease !important;
    will-change: transform;
}

.blog-card--featured {
    border-left: 3px solid #3b82f6;
}

/* Article reading progress bar (Fix 4) */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 70;
    pointer-events: none;
}

.reading-progress__bar {
    height: 100%;
    width: 0%;
    background: var(--article-accent, var(--color-accent, #3b82f6));
}

/* New per-article reading progress bar (id-based) */
#reading-progress-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: 0%;
        height: 3px;
        z-index: 9999;
        border-radius: 0 2px 2px 0;
        transition: width 0.1s linear;
        pointer-events: none;
}

/* Category gradients */
.article-ml #reading-progress-bar {
    background: linear-gradient(to right, #1d4ed8, #3b82f6, #06b6d4);
}
.article-cv #reading-progress-bar {
    background: linear-gradient(to right, #6d28d9, #a855f7, #ec4899);
}
.article-web #reading-progress-bar {
    background: linear-gradient(to right, #065f46, #059669, #34d399);
}
.article-accessibility #reading-progress-bar {
    background: linear-gradient(to right, #92400e, #ea580c, #fb923c);
}

/* Default fallback */
#reading-progress-bar {
    background: linear-gradient(to right, #1d4ed8, #3b82f6);
}

/* Scrolled state — reinforce frosted glass on scroll */
header#site-header.scrolled {
    background-color: rgba(250, 250, 249, 0.92);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
}

.dark header#site-header.scrolled {
    background-color: rgba(9, 9, 11, 0.92);
}

/* Active nav link — accent color in light, white in dark */
.nav-link.active {
    color: var(--color-accent);
}

.dark .nav-link.active {
    color: #f4f4f5;
}

nav a { transition: color 0.2s ease; }

/* Article hero fade into dark body (Fix 4) */
.blog-article-hero {
    position: relative;
    overflow: hidden;
}

.dark .blog-article-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    background: linear-gradient(to bottom, rgba(9, 9, 11, 0), rgba(9, 9, 11, 0.92));
    pointer-events: none;
}

/* Blog listing banners (Fix 1) */
.blog-card__banner {
    position: relative;
    height: 80px;
    border-radius: 12px 12px 0 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #1e3a5f, #3b82f6);
    background-size: 18px 18px, cover;
    background-position: 0 0, center;
    overflow: hidden;
}

.blog-card__banner--featured {
    height: 180px;
}

.blog-card__banner-title {
    position: absolute;
    bottom: 20px;
    left: 24px;
    z-index: 2;
    max-width: calc(100% - 48px);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.blog-card__banner--ml {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #1e3a5f, #3b82f6);
}

.blog-card__banner--cv {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #2d1b69, #7c3aed);
}

.blog-card__banner--web {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #064e3b, #059669);
}

.blog-card__banner--accessibility {
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(135deg, #7c2d12, #ea580c);
}

.blog-card__featured {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.20);
    backdrop-filter: blur(6px);
}

/* Experience timeline */
.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.625rem;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 1.5rem 1fr;
    column-gap: var(--space-4);
    padding-bottom: var(--space-8);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    grid-column: 1;
    display: flex;
    justify-content: center;
}

.timeline-marker::before {
    content: '';
    width: 0.5rem;      /* 8px */
    height: 0.5rem;     /* 8px */
    margin-top: 0.45rem;
    border-radius: 9999px;
    background: var(--color-accent);
    border: 2.5px solid var(--color-bg-main);
    box-shadow: 0 0 0 2px var(--color-accent);
    flex-shrink: 0;
}

/* Mobile: all cards stack to the left, full width */
.timeline-card {
    grid-column: 2;
}

.timeline-item--left .timeline-card,
.timeline-item--right .timeline-card {
    grid-column: 2;
}

@media (min-width: 768px) {
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        grid-template-columns: 1fr 3.5rem 1fr;
        align-items: start;
        column-gap: var(--space-6);
    }

    .timeline-marker {
        grid-column: 2;
    }

    .timeline-item--left .timeline-card {
        grid-column: 1;
    }

    .timeline-item--right .timeline-card {
        grid-column: 3;
    }
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
}

.dark .blog-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.blog-card.blog-card--featured {
    min-height: 320px;
    border-left: 3px solid #3b82f6 !important;
}

[data-blog-card] {
    transition: opacity var(--dur) var(--ease-standard);
}

@media (prefers-reduced-motion: reduce) {
    .blog-card {
        transition: none !important;
    }

    .blog-card:hover {
        transform: none;
    }

    [data-blog-card] {
        transition: none;
    }
}

.project-card {
    cursor: pointer;
}

.project-card:hover {
    --hover-y: -5px;
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--color-border) 30%, var(--color-accent) 70%);
}

.project-links {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.project-icon-link {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-bg-card) 92%, var(--color-accent) 8%);
    transition:
        transform var(--dur) var(--ease-standard),
        box-shadow var(--dur) var(--ease-standard),
        border-color var(--dur) var(--ease-standard),
        background-color var(--dur) var(--ease-standard);
}

.project-icon-link svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.project-card:hover .project-icon-link {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--color-border) 40%, var(--color-accent) 60%);
    box-shadow: var(--shadow-sm);
    background: color-mix(in srgb, var(--color-bg-card) 86%, var(--color-accent) 14%);
}

.project-tag {
    border: 1px solid var(--color-border);
    transition:
        transform var(--dur) var(--ease-standard),
        border-color var(--dur) var(--ease-standard),
        background-color var(--dur) var(--ease-standard),
        color var(--dur) var(--ease-standard);
}

.project-card:hover .project-tag {
    border-color: color-mix(in srgb, var(--color-border) 40%, var(--color-accent) 60%);
}

/* Per-card entrance animation (JS adds .card-entrance + .in-view) */
html.js .card-entrance {
    --enter-y: calc(var(--motion-reveal-offset) - 2px);
    opacity: 0;
    transition: opacity var(--dur-slow) var(--ease-standard), transform var(--dur-slow) var(--ease-standard);
}

html.js .card-entrance.in-view {
    --enter-y: 0px;
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .project-card,
    .project-icon-link,
    .project-tag {
        transition: none;
    }

    .project-card:hover {
        transform: none;
    }

    html.js .card-entrance {
        --enter-y: 0px;
        opacity: 1;
    }
}

/* ─── Project detail: rendered README content ────────────────────────────── */

.readme-content {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--color-text-secondary);
    overflow-x: auto;
}

.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4 {
    color: var(--color-text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

.readme-content h1 { font-size: 1.25rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4rem; }
.readme-content h2 { font-size: 1.1rem;  border-bottom: 1px solid var(--color-border); padding-bottom: 0.35rem; }
.readme-content h3 { font-size: 1rem; }
.readme-content h4 { font-size: 0.9rem; }

.readme-content p {
    margin-bottom: 0.75rem;
}

.readme-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.readme-content a:hover { opacity: 0.8; }

.readme-content ul,
.readme-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.readme-content ul { list-style-type: disc; }
.readme-content ol { list-style-type: decimal; }

.readme-content li { margin-bottom: 0.25rem; }
.readme-content li > ul,
.readme-content li > ol { margin-top: 0.25rem; margin-bottom: 0; }

.readme-content code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    background: #f3f4f6;
    color: #374151;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
}

.dark .readme-content code {
    background: #27272a;
    color: #a1a1aa;
}

.readme-content pre {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.readme-content pre code {
    background: transparent;
    color: #e6edf3;
    padding: 0;
    font-size: 0.8rem;
}

.readme-content blockquote {
    border-left: 3px solid var(--color-border);
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: var(--color-text-muted);
    font-style: italic;
}

.dark .readme-content blockquote { border-color: #3f3f46; }

.readme-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.25rem 0;
}

.dark .readme-content hr { border-color: #27272a; }

.readme-content img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
}

.readme-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
}

.readme-content th,
.readme-content td {
    border: 1px solid var(--color-border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.dark .readme-content th,
.dark .readme-content td { border-color: #27272a; }

.readme-content th {
    background: #f9fafb;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dark .readme-content th { background: #18181b; }

.readme-content tr:nth-child(even) { background: #f9fafb; }
.dark .readme-content tr:nth-child(even) { background: #18181b; }

.readme-content .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Blog syntax highlighting — works in both light + dark ───────────────── */

/* Base code/pre resets (overrides prism defaults without a theme file) */
code[class*="language-"],
pre[class*="language-"] {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    background: none;
    text-shadow: none;
    white-space: pre;
    word-break: normal;
    word-spacing: normal;
    tab-size: 4;
    hyphens: none;
}

/* Light mode tokens */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b7280; font-style: italic; }
.token.punctuation { color: #374151; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #d97706; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #059669; }
.token.operator, .token.entity, .token.url { color: #374151; }
.token.atrule, .token.attr-value, .token.keyword { color: #7c3aed; }
.token.function, .token.class-name { color: #2563eb; }
.token.regex, .token.important, .token.variable { color: #dc2626; }
.token.decorator { color: #7c3aed; }

/* Dark mode tokens */
.dark .token.comment, .dark .token.prolog { color: #9ca3af; font-style: italic; }
.dark .token.punctuation { color: #d1d5db; }
.dark .token.property, .dark .token.number, .dark .token.boolean { color: #fbbf24; }
.dark .token.selector, .dark .token.string, .dark .token.char, .dark .token.builtin { color: #34d399; }
.dark .token.operator, .dark .token.entity { color: #d1d5db; }
.dark .token.keyword, .dark .token.atrule { color: #a78bfa; }
.dark .token.function, .dark .token.class-name { color: #60a5fa; }
.dark .token.regex, .dark .token.variable { color: #f87171; }
.dark .token.decorator { color: #a78bfa; }

/* ─── Blog post article typography ────────────────────────────────────────── */

.blog-post-content {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--color-text-secondary);
}

.blog-post-content > * + * {
    margin-top: 1.5rem;
}

.blog-post-content p {
    color: var(--color-text-secondary);
}

.blog-post-content h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-top: 2.75rem;
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-subtle);
    line-height: 1.35;
}

.blog-post-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-post-content strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.blog-post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: opacity 0.15s;
}
.blog-post-content a:hover {
    opacity: 0.75;
}

.blog-post-content ul,
.blog-post-content ol {
    padding-left: 1.5rem;
    space-y: 0.5rem;
}
.blog-post-content ul { list-style-type: disc; }
.blog-post-content ol { list-style-type: decimal; }

.blog-post-content li {
    margin-top: 0.4rem;
    color: var(--color-text-secondary);
}

.blog-post-content li + li {
    margin-top: 0.4rem;
}

.blog-post-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.82em;
    background: #f4f4f5;
    color: #3b3b44;
    padding: 0.15em 0.4em;
    border-radius: 0.3rem;
    border: 1px solid #e4e4e7;
}
.dark .blog-post-content code {
    background: #27272a;
    color: #d4d4d8;
    border-color: #3f3f46;
}

/* Code blocks */
.code-block {
    margin: 1.75rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid #e4e4e7;
}
.dark .code-block {
    border-color: #3f3f46;
}

.code-block__header {
    background: #f4f4f5;
    border-bottom: 1px solid #e4e4e7;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: #71717a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dark .code-block__header {
    background: #18181b;
    border-color: #3f3f46;
    color: #71717a;
}

.code-block pre {
    background: #fafafa;
    padding: 1.25rem 1.25rem;
    overflow-x: auto;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.65;
}
.dark .code-block pre {
    background: #18181b;
}

.code-block pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: #27272a;
}
.dark .code-block pre code {
    color: #d4d4d8;
}

/* Lead (first) paragraph — slightly larger */
.blog-post-content > p:first-of-type {
    font-size: 1.0625rem;
    color: var(--color-text-primary);
    line-height: 1.9;
}

/* Blockquote as pull-quote */
.blog-post-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--color-accent);
    background: transparent;
    font-size: 1.0625rem;
    font-style: italic;
    color: var(--color-text-primary);
    line-height: 1.7;
}

/* Callout box — insight highlight */
.callout {
    margin: 2rem 0;
    padding: 1rem 1.25rem;
    border-radius: 0.625rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #78350f;
}
.dark .callout {
    border-color: #78350f;
    background: #1c1a07;
    color: #fde68a;
}
.callout strong {
    color: #92400e;
    font-weight: 600;
}
.dark .callout strong {
    color: #fcd34d;
}

/* Key takeaways box */
.takeaways {
    margin: 2.5rem 0 0;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e4e4e7;
    background: #fafafa;
}
.dark .takeaways {
    border-color: #3f3f46;
    background: #18181b;
}
.takeaways h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #71717a;
    margin-bottom: 0.875rem;
}
.dark .takeaways h3 {
    color: #71717a;
}
.takeaways ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.takeaways li {
    display: flex;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}
.takeaways li::before {
    content: '→';
    color: var(--color-accent);
    flex-shrink: 0;
    font-weight: 600;
}

/* Blog card hover effect (shared across index and blog listing) */
[data-blog-card]:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.dark [data-blog-card]:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* Blog filter active state */
.blog-filter.active {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ─── Skill pills ──────────────────────────────────────────────────────────── */

.skill-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    background: #f4f4f5;
    color: #52525b;
    border: 1px solid #e4e4e7;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    cursor: default;
    user-select: none;
}
.dark .skill-pill {
    background: #27272a;
    color: #a1a1aa;
    border-color: #3f3f46;
}
.skill-pill:hover {
    background: #e4e4e7;
    color: #18181b;
}
.dark .skill-pill:hover {
    background: #3f3f46;
    color: #f4f4f5;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: var(--radius-xs);
}
