/*!
 * Rabiul Blog v1.9.0 (http://rabiulcste.github.io)
 * Copyright 2024 Rabiul <rabiulawal6@gmail.com>
 */

/* ======================================
   VARIABLES
   ====================================== */
:root {
    --text: #1d1d1f;
    --text-muted: #6b6b70;
    --bg-page: #fbfbfd;
    --bg-muted: #f5f5f7;
    --border-muted: #d2d2d7;
    --border-hairline: rgba(60, 60, 67, 0.12);
    --radius-soft: 8px;
    --radius-pill: 999em;
    --focus-ring: var(--text);
    --gradient-era: linear-gradient(
        118deg,
        #0d9488 0%,
        #2563eb 38%,
        #6366f1 58%,
        #9333ea 82%,
        #c026d3 100%
    );
    --navbar-bg: rgba(251, 251, 253, 0.72);
    --ease-standard: cubic-bezier(0.25, 0.1, 0.25, 1);
    --duration: 0.2s;
    --content-link: #1d1d1f;
    --content-link-hover: #0a0a0a;
    --font-sans: "Helvetica Neue", "SolaimanLipi", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    /* Type scale — single coherent rhythm */
    --text-micro: 0.75rem;
    --text-caption: 0.8125rem;
    --text-small: 0.875rem;
    --text-body: clamp(0.9375rem, 0.9rem + 0.14vw, 1rem);
    --text-body-lg: 1.0625rem;
    --text-subtitle: 1rem;
    --text-lede: 1.125rem;
    --text-title-sm: 1.25rem;
    --text-title-md: 1.375rem;
    --text-title-lg: 1.5rem;
    --text-headline: clamp(1.8125rem, 1.62rem + 0.42vw, 2.125rem);
    --text-display: clamp(1.5625rem, 1.38rem + 0.38vw, 1.8125rem);
    --leading-body: 1.5;
    --leading-prose: 1.55;
    --leading-snug: 1.3;
    --leading-tight: 1.15;
    --leading-display: 1.05;
    --track-display: -0.018em;
    --track-headline: -0.016em;
    --track-title: -0.01em;
    --track-ui: -0.011em;
    --track-normal: 0;
    --track-label: 0.02em;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-section: var(--space-6);
    --space-block: var(--space-4);
    /* Layout — horizontal padding for .wrap / navbar; code blocks bleed full-width on small screens */
    --gutter-x: 15px;
    /* Section rhythm (named so components don’t rely on calc tricks) */
    --space-about-h2-before: 1.75rem;
    --wrap-max: 680px;
}

@media (min-width: 640px)  { :root { --wrap-max: 720px; } }
@media (min-width: 1024px) { :root { --wrap-max: 760px; } }
@media (min-width: 1280px) { :root { --wrap-max: 800px; } }

/* Bengali posts: scoped via unicode-range so this only loads/applies to Bengali-script text */
@font-face {
    font-family: "SolaimanLipi";
    src: url("https://cdn.jsdelivr.net/gh/maateen/bangla-web-fonts@master/fonts/solaiman-lipi/solaimanlipi-normal-v1.0.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0980-09FF;
}
@font-face {
    font-family: "SolaimanLipi";
    src: url("https://cdn.jsdelivr.net/gh/maateen/bangla-web-fonts@master/fonts/solaiman-lipi/solaimanlipi-bold-v1.0.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0980-09FF;
}

/* ======================================
   BASE
   ====================================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: light;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-weight: 400;
    line-height: var(--leading-body);
    color: var(--text);
    background-color: var(--bg-page);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-optical-sizing: auto;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    font-variant-numeric: proportional-nums;
}

p { margin: 1em 0; }

/* Slightly more air between paragraphs on long-form pages */
.about-content > p,
.post-container > p {
    margin-top: 1.1em;
    margin-bottom: 1.1em;
}
.about-content > p:first-child,
.post-container > p:first-child {
    margin-top: 0;
}
.about-content > p:last-child,
.post-container > p:last-child {
    margin-bottom: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    line-height: var(--leading-tight);
    letter-spacing: var(--track-title);
    color: var(--text);
}

h1 { font-weight: 600; }

h4, h5, h6 {
    letter-spacing: var(--track-normal);
}

::selection { color: #fff; background: rgba(29, 29, 31, 0.75); }
img::selection { background: transparent; }

code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-variation-settings: normal;
}
.table-responsive { overflow-x: auto; }
pre code {
    display: block;
    white-space: pre;
    word-wrap: normal;
}

blockquote {
    color: var(--text-muted);
    font-style: italic;
    font-size: 1em;
    line-height: var(--leading-prose);
    letter-spacing: var(--track-normal);
    margin: 0;
    padding-left: var(--space-4);
    border-left: 3px solid var(--border-hairline);
}
blockquote p { margin: 0; font-size: 1em; }

/* ======================================
   LINKS
   ====================================== */
a {
    color: var(--content-link);
    text-decoration: none;
    transition: color var(--duration) var(--ease-standard),
        text-decoration-color var(--duration) var(--ease-standard),
        opacity var(--duration) var(--ease-standard);
}
a:hover, a:focus { color: var(--content-link-hover); }
a:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Body prose links get underline for scannability */
.profile-bio a,
.post-container a,
.about-content > p a,
.list-entry a {
    text-decoration: underline;
    text-decoration-color: var(--border-muted);
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
}
.profile-bio a:hover,
.post-container a:hover,
.about-content > p a:hover,
.list-entry a:hover {
    text-decoration-color: var(--text);
}

/* ======================================
   LAYOUT
   ====================================== */
.skip-link {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 9999;
    padding: var(--space-2) var(--space-3);
    background: var(--text);
    color: #fff;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--space-1);
    transform: translateY(-120%);
    transition: transform 0.2s;
}
.skip-link:focus {
    transform: translateY(0);
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.wrap {
    width: 100%;
    max-width: var(--wrap-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: max(var(--gutter-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gutter-x), env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}


/* Responsive 16:9 embed */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
}
.embed-responsive::before { content: ""; display: block; padding-top: 56.25%; }
.embed-responsive iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-container :is(h1, h2, h3, h4, h5, h6) { scroll-margin-top: 5rem; }

.d-none { display: none !important; }


article { overflow: hidden; }

main {
    min-height: 50vh;
}

/* ======================================
   NAVIGATION
   ====================================== */
.navbar {
    position: relative;
    z-index: 1030;
    padding: var(--space-3) 0;
    background-color: var(--navbar-bg);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-hairline);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .navbar { background-color: var(--bg-page); }
}
.navbar-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    width: 100%;
}

/* Site name — same large treatment on home (h1 + link) and inner pages (compact link) */
.navbar--home .navbar-brand--home {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}
.navbar-brand--home a,
.navbar-brand--compact {
    font-size: var(--text-display);
    font-weight: 600;
    line-height: var(--leading-display);
    letter-spacing: var(--track-display);
    color: var(--text);
    text-decoration: none;
    transition: color var(--duration) var(--ease-standard), opacity var(--duration) var(--ease-standard);
}
.navbar-brand--home a:hover,
.navbar-brand--compact:hover { color: var(--text); opacity: 0.85; }

.navbar--home .nav-link,
.navbar--compact .nav-link {
    font-size: var(--text-small);
    font-weight: 400;
}

/* Desktop nav — readable but secondary to page titles (not headline-sized) */
@media (min-width: 768px) {
    .navbar--home .nav-link,
    .navbar--compact .nav-link {
        font-size: var(--text-subtitle);
    }
    .navbar-nav {
        gap: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .navbar--home .nav-link,
    .navbar--compact .nav-link {
        font-size: var(--text-lede);
    }
}

.nav-link {
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    color: var(--text-muted);
    transition: color var(--duration) var(--ease-standard);
    position: relative;
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
    color: var(--text);
    font-weight: 500;
}
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1.5px;
    background: var(--text);
    border-radius: 1px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1.2;
    width: 100%;
}
.nav-item { margin: 0; }

/* ======================================
   HEADER / INTRO
   ====================================== */
.intro-header.title-hidden { margin-bottom: var(--space-5); }

.intro-header .post-heading { margin-top: var(--space-section); }

.intro-header .site-heading,
.intro-header .post-heading {
    padding: 0 0 var(--space-block);
    text-align: left;
}
.intro-header.title-hidden .site-heading--minimal {
    padding: 0;
}

.intro-header .site-heading h1 {
    font-size: var(--text-headline);
    font-weight: 600;
    line-height: var(--leading-display);
    letter-spacing: var(--track-headline);
    margin: 0;
    color: var(--text);
    display: block;
    text-wrap: balance;
}

.intro-header .subheading { display: block; }
.intro-header .site-heading .subheading {
    font-size: var(--text-subtitle);
    font-weight: 400;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    margin: var(--space-1) 0 0;
}

.intro-header .post-heading h1 {
    font-size: var(--text-title-lg);
    margin: 0 0 var(--space-2);
    line-height: var(--leading-tight);
    letter-spacing: var(--track-headline);
    text-wrap: balance;
}
.intro-header .post-heading .subheading {
    font-size: var(--text-subtitle);
    font-weight: 400;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    margin: 0 0 var(--space-2);
    color: var(--text-muted);
}
.intro-header .post-heading .meta {
    display: block;
    margin-top: var(--space-2);
    margin-bottom: var(--space-block);
    font-size: var(--text-small);
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    color: var(--text-muted);
}
.intro-header .post-heading .meta a {
    color: var(--text-muted);
    text-decoration: none;
}
.intro-header .post-heading .meta a:hover { color: var(--text); }

/* ======================================
   POST CONTENT
   ====================================== */
.post-container,
.about-content {
    line-height: var(--leading-prose);
    letter-spacing: var(--track-normal);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-wrap: pretty;
}

.post-container h1 {
    font-size: var(--text-title-lg);
    font-weight: 600;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-headline);
    text-wrap: balance;
}

.post-container h2 {
    font-size: var(--text-title-md);
    font-weight: 500;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-title);
    text-wrap: balance;
}

.post-container h3 {
    font-size: var(--text-lede);
    font-weight: 500;
    line-height: var(--leading-snug);
    padding: 1.25rem 0 0;
    letter-spacing: var(--track-normal);
}

.post-container h4,
.post-container h5,
.post-container h6 {
    font-weight: 500;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    color: var(--text-muted);
    margin: 1.25rem 0 var(--space-2);
}

.post-container h4 { font-size: var(--text-subtitle); }
.post-container h5 { font-size: var(--text-small); }
.post-container h6 { font-size: var(--text-caption); }

.post-container h1 + p,
.post-container h2 + p,
.post-container h3 + p,
.post-container h4 + p,
.post-container h5 + p,
.post-container h6 + p {
    margin-top: 0.625rem;
}

/* Spacer before top-level h2 sections */
.post-container > h2::before {
    content: " ";
    display: block;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.post-container ul,
.post-container ol { margin-bottom: 1.875rem; }

.post-container ol ol,
.post-container ol ul,
.post-container ul ol,
.post-container ul ul { margin-bottom: 0.3125rem; }

.post-container li { margin: 0 0 var(--space-2); }
.post-container li p { margin: 0 0 var(--space-2); }

.post-container li h1,
.post-container li h2,
.post-container li h3,
.post-container li h4,
.post-container li h5,
.post-container li h6 {
    line-height: 2;
    margin-top: 1.25rem;
}

/* ======================================
   TOP-OF-ARTICLE CATALOG
   ====================================== */
.top-catalog {
    margin: var(--space-5) 0;
    padding: var(--space-4);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-soft);
    font-size: var(--text-small);
    line-height: var(--leading-snug);
}
.top-catalog.fold { display: none; }

.top-catalog h5 {
    margin: 0 0 var(--space-2);
    font-size: var(--text-caption);
    font-weight: 500;
    line-height: var(--leading-snug);
    letter-spacing: var(--track-label);
    color: var(--text-muted);
}

.top-catalog .catalog-body {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.1em 1.5rem;
}

@media (min-width: 640px) {
    .top-catalog .catalog-body { grid-template-columns: 1fr 1fr; }
}

.top-catalog .catalog-body li { list-style: none; margin: 0; }
.top-catalog .catalog-body li a {
    display: block;
    padding: var(--space-1) 0;
    line-height: 1.4;
    color: var(--text-muted);
    text-decoration: underline;
    text-decoration-color: var(--border-muted);
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
}
.top-catalog .catalog-body li a:hover { color: var(--text); text-decoration-color: var(--text); }

.top-catalog .catalog-body .h1_nav,
.top-catalog .catalog-body .h2_nav {
    margin-left: 0;
    font-size: var(--text-small);
    font-weight: 500;
    letter-spacing: var(--track-ui);
}
.top-catalog .catalog-body .h1_nav > a,
.top-catalog .catalog-body .h2_nav > a {
    color: var(--text);
    text-decoration-color: var(--border-muted);
}
.top-catalog .catalog-body .h3_nav {
    margin-left: var(--space-3);
    font-size: var(--text-caption);
    font-weight: 400;
    letter-spacing: var(--track-ui);
}
.top-catalog .catalog-body .h4_nav,
.top-catalog .catalog-body .h5_nav,
.top-catalog .catalog-body .h6_nav {
    margin-left: var(--space-5);
    font-size: var(--text-caption);
    font-weight: 400;
    letter-spacing: var(--track-ui);
}

.top-catalog .catalog-body .active a {
    color: var(--text);
    font-weight: 500;
}

/* ======================================
   COMPONENTS
   ====================================== */

/* Tags */
.tags { margin: 0 0 var(--space-4); line-height: 1.5; }

.tags a {
    display: inline-block;
    padding: 0.3rem var(--space-3);
    margin: 0 var(--space-1) var(--space-1) 0;
    font-size: var(--text-micro);
    line-height: 1.5;
    letter-spacing: var(--track-ui);
    color: var(--text);
    background: rgba(29, 29, 31, 0.05);
    border: none;
    border-radius: var(--radius-pill);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration) var(--ease-standard),
        color var(--duration) var(--ease-standard),
        transform var(--duration) var(--ease-standard);
}
.tags a:hover {
    background: rgba(29, 29, 31, 0.11);
    color: var(--text);
    text-decoration: none;
    transform: translateY(-1px);
}

.tags a.tag-button--all,
.tags a.focus {
    background: var(--text);
    color: #fff;
}
.tags a.tag-button--all:hover,
.tags a.focus:hover {
    background: #2d2d2f;
}

/* Social links */
.social-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin: 1.25rem 0 0;
    padding: 0;
}
.social-links a {
    color: var(--text-muted);
    font-size: var(--text-small);
    font-weight: 400;
    text-decoration: underline;
    text-decoration-color: var(--border-muted);
    text-underline-offset: 0.14em;
    text-decoration-thickness: 1px;
    display: inline-flex;
    align-items: center;
    transition: color var(--duration) var(--ease-standard),
        text-decoration-color var(--duration) var(--ease-standard),
        transform var(--duration) var(--ease-standard);
}
.social-links a:hover,
.social-links a:focus {
    color: var(--text);
    text-decoration-color: var(--text);
    transform: translateY(-1px);
}
.social-links a svg.icon {
    width: 1em;
    height: 1em;
    margin-right: 0.4em;
    flex-shrink: 0;
    color: currentColor;
}

/* Section headings on home (about) page — stronger than body + paper titles (subtitle 1rem) */
.about-content > h2 {
    font-size: var(--text-title-md);
    font-weight: 500;
    line-height: var(--leading-tight);
    letter-spacing: var(--track-title);
    color: var(--text);
    margin-top: var(--space-about-h2-before);
    margin-bottom: var(--space-2);
    text-wrap: balance;
}

@media (min-width: 768px) {
    .about-content > h2 {
        font-size: var(--text-title-lg);
    }
}

/* About: misc list (talks + service) — plain stack, no rail */
.about-content .misc-list {
    margin-top: var(--space-5);
    margin-bottom: var(--space-5);
    padding: 0;
    list-style: none;
}

/* Publications: plain flowing paragraphs, one per entry */
.about-content .publication-list {
    margin-top: var(--space-2);
}

.publication-list-note {
    font-size: var(--text-small);
    color: var(--text-muted);
    margin: 0 0 var(--space-2);
    line-height: var(--leading-snug);
}

.about-content .about-subheading-note {
    font-size: var(--text-small);
    color: var(--text-muted);
    line-height: var(--leading-snug);
    margin: 0 0 var(--space-4);
}

/* Shared plain-paragraph style: publications and misc are both just lists of entries */
.list-entry {
    font-size: var(--text-body);
    line-height: var(--leading-snug);
    margin: 0 0 0.4em;
    color: var(--text-muted);
}
.list-entry:last-child { margin-bottom: 0; }
.list-entry-title { font-weight: 500; color: var(--text); }
.list-entry .link-group {
    font-size: var(--text-small);
    font-weight: 500;
}

/* Publications with a small ASCII glyph to the left */
.publication-list .list-entry {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.entry-art {
    flex-shrink: 0;
    width: 5em;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    line-height: 1.3;
    color: var(--border-muted);
    white-space: pre;
    margin: 0.2em 0 0;
    padding-bottom: 0.2em;
    overflow: visible;
    user-select: none;
}
.entry-art--filled {
    color: var(--text-muted);
}
.entry-text { margin: 0; }

/* Gradient text — “era of experience” & similar emphasis links */
.about-content > p a.gradient-text,
.post-container a.gradient-text,
.gradient-text {
    font-weight: 600;
    letter-spacing: var(--track-normal);
    text-decoration: none;
    color: var(--text);
    transition: filter var(--duration) var(--ease-standard), opacity var(--duration) var(--ease-standard);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .about-content > p a.gradient-text,
    .post-container a.gradient-text,
    .gradient-text {
        background-image: var(--gradient-era);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}
.about-content > p a.gradient-text:hover,
.post-container a.gradient-text:hover,
.gradient-text:hover {
    filter: brightness(1.07) saturate(1.1);
}

/* Profile — name lives in navbar on home; photo + bio only */
.profile {
    display: flex;
    flex-direction: column;
    row-gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.profile picture {
    display: block;
    margin: 0;
    line-height: 0;
}
.profile .social-links {
    margin-top: 0;
}
.profile img {
    display: block;
    width: 160px;
    height: 213px;
    object-fit: cover;
    object-position: center 18%;
}
.profile-bio {
    line-height: var(--leading-prose);
    letter-spacing: inherit;
}
.profile-bio > p:first-child { margin-top: 0; }
.about-content .research-note {
    font-size: var(--text-small);
    color: var(--text-muted);
    margin-top: var(--space-2);
    margin-bottom: var(--space-3);
    line-height: var(--leading-snug);
}
/* ======================================
   ARCHIVE
   ====================================== */
.archive-list { padding-top: 0; }
.archive-item {
    display: flex;
    align-items: baseline;
    margin-bottom: var(--space-3);
    line-height: var(--leading-snug);
}
.archive-date {
    color: var(--text-muted);
    font-size: var(--text-caption);
    font-variant-numeric: tabular-nums;
    min-width: 100px;
    margin-right: var(--space-4);
    letter-spacing: var(--track-ui);
}
.archive-item a {
    color: var(--text);
    font-size: var(--text-subtitle);
    letter-spacing: var(--track-title);
    text-decoration: none;
    transition: color var(--duration) var(--ease-standard);
}
.archive-item a:hover { color: var(--content-link-hover); text-decoration: underline; text-underline-offset: 2px; }

/* ======================================
   POST NAVIGATION
   ====================================== */
.post-end-spacer { margin-top: var(--space-6); }

.pager {
    margin-top: 2.5rem;
    padding: 0;
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
}
.pager-prev, .pager-next { max-width: 45%; }
.pager-placeholder { visibility: hidden; pointer-events: none; }
.pager-next { text-align: right; }
.pager a {
    font-size: var(--text-small);
    line-height: var(--leading-snug);
    letter-spacing: var(--track-ui);
    display: block;
    color: var(--text);
    transition: color var(--duration) var(--ease-standard);
}
.pager a:hover { color: var(--content-link-hover); }
.pager-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.15rem;
}
.pager-title {
    display: block;
    font-size: var(--text-subtitle);
    font-weight: 400;
    letter-spacing: var(--track-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======================================
   CODE HIGHLIGHTING
   ====================================== */
.highlighter-rouge .highlight {
    margin-bottom: 0.625rem;
    border-radius: var(--radius-soft);
    background: var(--bg-muted);
    border: 1px solid var(--border-hairline);
}
.highlighter-rouge .highlight pre {
    font-size: var(--text-small);
    line-height: var(--leading-body);
    color: var(--text-muted);
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    word-wrap: normal;
}
.highlighter-rouge .highlight .rouge-code pre { color: #abb2bf; }
.highlighter-rouge .highlight .table-responsive { margin: 0; border: 0; }
.highlighter-rouge .highlight .table { margin: 0; table-layout: fixed; }
.highlighter-rouge .highlight table > tbody > tr > td {
    margin: 0;
    border: 0;
    padding: 0;
}
.highlighter-rouge .highlight table > tbody > tr > td > pre { padding: 14px; }
.highlighter-rouge .highlight td.rouge-gutter { width: 56px; }
.highlighter-rouge .highlight .lineno { text-align: right; border-radius: 0; }

/* ======================================
   TABLES
   ====================================== */
table { margin-top: 0.625rem; }
table.table { width: 100%; border-collapse: collapse; }
table.table > tbody > tr > th,
table.table > tbody > tr > td,
table.table > thead > tr > th,
table.table > thead > tr > td {
    font-size: 90%;
    border-top: 1px solid var(--border-hairline);
    border-bottom: 1px solid var(--border-hairline);
}

/* ======================================
   FOOTER
   ====================================== */
footer {
    font-size: var(--text-body);
    line-height: var(--leading-body);
    padding: var(--space-6) 0;
    margin-top: var(--space-6);
    border-top: 1px solid var(--border-hairline);
    background-color: var(--bg-page);
}
footer .copyright {
    font-size: var(--text-caption);
    letter-spacing: var(--track-ui);
    color: var(--text-muted);
    margin: 0;
}

/* ======================================
   404 PAGE
   ====================================== */
.not-found {
    padding: 6.25rem 0;
    text-align: center;
}
.not-found .ascii-art {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    line-height: 1.2;
    color: var(--text);
    margin: 0 0 2.5rem;
    opacity: 0.9;
    white-space: pre;
}
.not-found p {
    font-size: var(--text-title-sm);
    line-height: var(--leading-snug);
    letter-spacing: var(--track-title);
    color: var(--text-muted);
    margin: 0;
    font-weight: 300;
}

/* ======================================
   ANCHOR.JS
   ====================================== */
@media (min-width: 800px) {
    .anchorjs-link {
        position: absolute;
        left: -0.75em;
        font-size: 1.1em;
        margin-top: -0.1em;
    }
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (min-width: 768px) {
    .post-container { padding-right: 2.5%; }
    .intro-header .post-heading h1 {
        font-size: var(--text-headline);
        line-height: var(--leading-display);
        letter-spacing: var(--track-display);
    }
    .intro-header .post-heading .subheading {
        font-size: var(--text-title-sm);
        line-height: var(--leading-snug);
    }
}

@media (max-width: 767px) {
    p { margin: 0.78125rem 0; }

    .post-container h1 { font-size: var(--text-title-md); }
    .post-container h2 { font-size: var(--text-title-sm); }
    .post-container h3 { font-size: var(--text-lede); }
    .post-container h4 { font-size: var(--text-subtitle); }
    .post-container h5 { font-size: var(--text-small); }
    .post-container h6 { font-size: var(--text-caption); }

    .post-container ul:not(.misc-list):not(.publication-list),
    .post-container ol { padding-left: 1.25rem; }
    .table-responsive { border: 0; }

    footer { padding: var(--space-5) 0 var(--space-6); }

    .navbar--home .navbar-brand--home a,
    .navbar-brand--compact {
        font-size: var(--text-title-md);
        letter-spacing: var(--track-headline);
    }
    .nav-link { padding: 0.25rem 0; display: inline-block; }

    .profile {
        row-gap: var(--space-3);
    }
    .profile img {
        width: 120px;
        height: 160px;
    }
    .profile .social-links {
        flex-wrap: nowrap;
    }
    .profile .social-links .git-ic { display: none; }
    .profile-bio > p:first-child { margin-top: 0; }

    .not-found .ascii-art { font-size: 0.5rem; }

    .highlighter-rouge .highlight {
        margin-left: calc(-1 * var(--gutter-x));
        margin-right: calc(-1 * var(--gutter-x));
        border-radius: 0;
    }
    .highlighter-rouge .highlight td.rouge-gutter { width: 36px; }
    .highlighter-rouge .highlight table > tbody > tr > td > pre { padding: 14px 10px; }
}

@media (max-width: 576px) {
    .profile { gap: var(--space-4); }
    .social-links { gap: 0.8rem; }
    .social-links a { font-size: var(--text-body-lg); }
}

@media (max-width: 480px) {
    .social-links { gap: 0.6rem; }
    .social-links a { font-size: var(--text-subtitle); }
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    /* The only motion that is not a transition: the 1px hover lift */
    .tags a:hover,
    .social-links a:hover,
    .social-links a:focus {
        transform: none;
    }
    .navbar {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background-color: var(--bg-page);
    }
}

/* ======================================
   INTERACTIVE VISUALIZATION UTILITIES
   ====================================== */
.play-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    border: 0.5px solid var(--border-muted);
    background: var(--bg-muted);
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1.5;
    transition: background var(--duration) var(--ease-standard),
                color var(--duration) var(--ease-standard);
}
.play-btn:hover {
    background: var(--border-muted);
    color: var(--text);
}
