/* ============================================
   Clean Academic Style
   ============================================ */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent: #58a6ff;
    --accent-green: #7ee787;
    --border-color: #30363d;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 800px;
    --transition: 0.2s ease;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-card: #ffffff;
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --text-muted: #8b949e;
    --accent: #0969da;
    --accent-green: #1a7f37;
    --border-color: #d0d7de;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-green);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin-bottom: 1em; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5em 0;
}

pre code {
    background: none;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .nav {
    background: rgba(255, 255, 255, 0.9);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.nav-logo:hover {
    color: var(--accent);
}

.logo-bracket {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    transition: all var(--transition);
}

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

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.sun-icon { display: none; }
.moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }

@media (max-width: 640px) {
    .nav-toggle { display: flex; }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.75rem;
        display: none;
    }
    
    .nav-menu.active { display: flex; }
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-content {
    padding-top: 4rem;
    min-height: 100vh;
}

.section {
    padding: 3rem 0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-tag { display: none; }

.section-title {
    font-size: 1.75rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ============================================
   Home / Hero
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem 2rem;
    background: radial-gradient(ellipse at top, var(--bg-secondary) 0%, var(--bg-primary) 60%);
}

.hero-content {
    max-width: var(--max-width);
    width: 100%;
}

.hero-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 4px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.hero-name-dark {
    color: var(--text-primary);
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-green);
    margin-bottom: 1.5rem;
    min-height: 1.5em;
}

.cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 560px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: all var(--transition);
}

.btn:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.github-mini-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
}

.mini-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    transition: color var(--transition);
}

.mini-stat:hover {
    color: var(--text-secondary);
}

.mini-stat svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Projects
   ============================================ */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.project-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    transition: all var(--transition);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-muted);
}

/* ============================================
   Blog
   ============================================ */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.category-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.category-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.blog-card {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    transition: all var(--transition);
}

.blog-card:hover {
    border-color: var(--accent);
}

.blog-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.blog-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.35rem 0 0.5rem;
    color: var(--text-primary);
}

.blog-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.blog-youtube {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #ff0033;
    letter-spacing: 0.02em;
}

/* ============================================
   Notes
   ============================================ */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.note-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

a.note-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color, #7c9cff);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.note-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.note-card-title {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary);
}

.note-card-blurb {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.note-card-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    margin-top: auto;
    opacity: 0.75;
}

.note-textbook {
    position: relative;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #1a1f3a 0%, #2c1f4a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.note-textbook img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.note-textbook-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.note-textbook.no-image .note-textbook-fallback {
    opacity: 1;
}

.notes-back {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.notes-back:hover {
    color: var(--accent-color, #7c9cff);
}

/* ============================================
   Book Rack (rotating textbook covers)
   ============================================ */
.book-rack {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 1.5rem 0;
    margin: 2rem 0 2.5rem;
    mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}

.book-rack-track {
    display: flex;
    gap: 1.75rem;
    width: max-content;
    margin: 0 auto;
}

.book-rack-track.scrolling {
    animation: bookRackScroll 45s linear infinite;
    margin: 0;
}

.book-rack:hover .book-rack-track.scrolling {
    animation-play-state: paused;
}

@keyframes bookRackScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.book-cover {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1f3a 0%, #2c1f4a 100%);
    box-shadow: 0 8px 22px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-cover:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 26px rgba(0,0,0,0.5);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-cover-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    opacity: 0;
    pointer-events: none;
}

.book-cover.no-image .book-cover-fallback {
    opacity: 1;
}

/* ============================================
   Subject folders (collapsible)
   ============================================ */
.subject-folders {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.subject-folder {
    background: var(--bg-secondary, rgba(255,255,255,0.03));
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.subject-folder[open] {
    border-color: var(--accent-color, #7c9cff);
}

.subject-folder summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.subject-folder summary::-webkit-details-marker { display: none; }

.subject-folder summary::before {
    content: '▸';
    display: inline-block;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    font-size: 0.85rem;
    width: 0.8rem;
}

.subject-folder[open] summary::before {
    transform: rotate(90deg);
}

.subject-name {
    font-weight: 500;
    color: var(--text-primary);
}

.subject-book { display: none; }

.subject-name { flex: 1; }

.subject-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.75;
    white-space: nowrap;
}

.note-page-list {
    list-style: none;
    margin: 0;
    padding: 0 1.25rem 1rem 2.6rem;
}

.note-page-list li {
    padding: 0.35rem 0;
    border-top: 1px dashed var(--border-color, rgba(255,255,255,0.08));
}

.note-page-list li:first-child {
    border-top: none;
}

.note-page-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.92rem;
}

.note-page-list a:hover {
    color: var(--accent-color, #7c9cff);
}

.note-empty {
    padding: 0 1.25rem 1rem 2.6rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

@media (max-width: 640px) {
    .subject-folder summary { flex-wrap: wrap; }
    .subject-book { width: 100%; flex: 0 0 100%; padding-left: 1.5rem; font-size: 0.8rem; }
    .book-cover { width: 170px; }
}

/* ============================================
   About
   ============================================ */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-image {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.image-frame {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-socials {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition);
}

.social-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.about-text { flex: 1; }

.about-intro {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-intro strong {
    color: var(--accent);
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-block {
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.detail-block h4 {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.detail-block p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.contact-section-inline {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.contact-section-inline h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.contact-intro {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.contact-icons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contact-icon-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.contact-icon-widget:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-icon-widget svg {
    width: 16px;
    height: 16px;
}

@media (min-width: 640px) {
    .about-content {
        flex-direction: row;
        gap: 2.5rem;
    }
    
    .about-image {
        align-items: center;
    }
}

/* ============================================
   Project Detail Page
   ============================================ */
.project-page-section {
    padding-top: 4rem;
}

.project-page-section .container {
    max-width: 800px;
}

.project-page-article {
    padding: 2rem 0;
}

.project-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.project-page-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-page-title {
    font-size: 2rem;
    margin: 0.5rem 0 1rem;
}

.project-page-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-page-github {
    margin-top: 1rem;
}

.project-page-github a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition);
}

.project-page-github a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.project-page-github svg {
    width: 18px;
    height: 18px;
}

.project-readme-content {
    line-height: 1.7;
}

.project-readme-content h1 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.project-readme-content h1:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.project-readme-content h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

.project-readme-content h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.project-readme-content ul,
.project-readme-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.project-readme-content li {
    margin-bottom: 0.4em;
}

.project-readme-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9rem;
}

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

.project-readme-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.project-readme-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5em 0;
    color: var(--text-secondary);
}

/* ============================================
   Blog Post Page
   ============================================ */
.blog-post-page-section {
    padding-top: 4rem;
}

.blog-post-page-section .container {
    max-width: 800px;
}

.blog-post-article {
    padding: 2rem 0;
}

.blog-post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-post-category {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-post-title {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.blog-post-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.blog-post-body {
    line-height: 1.7;
}

.blog-post-body h1 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.blog-post-body h1:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.blog-post-body h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

.blog-post-body h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.blog-post-body ul,
.blog-post-body ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.blog-post-body li {
    margin-bottom: 0.4em;
}

.blog-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.9rem;
}

.blog-post-body th,
.blog-post-body td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.75rem;
    text-align: left;
}

.blog-post-body th {
    background: var(--bg-secondary);
    font-weight: 600;
}

.blog-post-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1.5em 0;
    color: var(--text-secondary);
}

/* ============================================
   Code Blocks
   ============================================ */
.code-block-wrapper {
    position: relative;
    margin: 1.5em 0;
}

.code-copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--transition);
}

.code-block-wrapper:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.code-copy-btn.copied {
    color: var(--accent-green);
    border-color: var(--accent-green);
}

.code-copy-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.hljs {
    background: var(--bg-secondary) !important;
    padding: 1rem !important;
    border-radius: 6px;
}

/* ============================================
   Back Link
   ============================================ */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: color var(--transition);
}

.back-link:hover {
    color: var(--accent);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    background: var(--bg-secondary);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.footer-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   Image Zoom Modal
   ============================================ */
.image-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-zoom-modal.active {
    display: flex;
}

.image-zoom-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.zoom-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.image-zoomable {
    cursor: pointer;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .hero {
        padding-top: 5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .github-mini-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-icons-grid {
        flex-direction: column;
    }
    
    .contact-icon-widget {
        justify-content: center;
    }
}

/* KaTeX styling */
.katex-display {
    margin: 1.5em 0;
    overflow-x: visible;
}

.katex-display > .katex {
    overflow-x: visible;
    overflow-y: visible;
}

/* Collapsible sections */
.collapsible-section {
    margin: 1.5em 0;
}

.collapsible-section summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    padding: 4px 0;
}

.collapsible-section summary:hover {
    opacity: 0.8;
}

.collapsible-section summary::-webkit-details-marker {
    display: none;
}

.collapsible-section summary::before {
    content: "▶";
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.collapsible-section[open] summary::before {
    transform: rotate(90deg);
}

.collapsible-section[open] summary {
    margin-bottom: 0.5em;
}

.collapsible-content {
    padding-left: 1em;
    border-left: 2px solid var(--border-color);
}

.collapsible-content > *:first-child {
    margin-top: 0;
}

/* Embedded media (PDF, PPT) */
.embed-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5em 0;
}

.embed-container {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 280px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.embed-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-fullscreen-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.embed-fullscreen-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.embed-fullscreen-btn svg {
    width: 14px;
    height: 14px;
}

.embed-container iframe {
    width: 100%;
    height: 350px;
    border: none;
    display: block;
}

.embed-full {
    flex: 1 1 100%;
}

.embed-full iframe {
    height: 550px;
}

/* Fullscreen modal for embeds */
.embed-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 1rem;
    box-sizing: border-box;
}

.embed-modal.active {
    display: flex;
    flex-direction: column;
}

.embed-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 8px 8px 0 0;
}

.embed-modal-title {
    color: var(--text-primary);
    font-weight: 500;
}

.embed-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
}

.embed-modal-close:hover {
    color: var(--text-primary);
}

.embed-modal iframe {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 0 0 8px 8px;
    background: white;
}

@media (max-width: 768px) {
    .embed-container {
        flex: 1 1 100%;
    }
    
    .embed-container iframe {
        height: 300px;
    }
}

/* ============================================
   Blog tag rack (rotating pills)
   ============================================ */
.tag-rack {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0.5rem 0 1.5rem;
    mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.tag-rack-track {
    display: flex;
    gap: 0.6rem;
    width: max-content;
    margin: 0 auto;
    padding: 0 1rem;
}

.tag-rack-track.scrolling {
    animation: tagRackScroll 40s linear infinite;
    margin: 0;
}

.tag-rack:hover .tag-rack-track.scrolling {
    animation-play-state: paused;
}

@keyframes tagRackScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.tag-pill {
    flex: 0 0 auto;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tag-pill:hover {
    color: var(--text-primary);
    border-color: var(--accent-color, #7c9cff);
}

.tag-pill.active {
    color: #0e1220;
    background: #ffd166;
    border-color: #ffd166;
}

/* Blog card tag pills (non-interactive summary of a post's tags) */
.blog-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.blog-tag-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(124, 156, 255, 0.14);
    color: var(--accent-color, #7c9cff);
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.blog-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

/* Related posts */
.blog-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.blog-related-title {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.blog-card-compact { padding: 0.5rem 0; }
.blog-card-compact .blog-title { font-size: 1rem; margin-bottom: 0.35rem; }
.blog-card-compact .blog-excerpt { font-size: 0.85rem; }

/* Note page listing with numbering */
.note-page-list a {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.note-page-num {
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    min-width: 1.6rem;
}

.note-page-title { flex: 1; }

/* Contact-only About page */
.contact-icons-standalone {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 0 3rem;
}

/* ============================================
   Interactive blog embeds
   ============================================ */
.interactive-slot { margin: 2rem 0; }

.interactive-embed {
    background: var(--bg-card, #1c2128);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 10px;
    padding: 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.interactive-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.interactive-title {
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

.interactive-source {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--accent, #58a6ff);
}

.interactive-controls {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.interactive-controls input[type="range"] {
    flex: 1;
    accent-color: #ffd166;
}

.interactive-embed canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 6px;
    background: #0e1220;
    display: block;
}

.interactive-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.interactive-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 0.35rem;
    vertical-align: middle;
    border-radius: 2px;
}

/* ============================================
   Search page
   ============================================ */
.search-box {
    margin: 1rem 0 1.25rem;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: var(--bg-card, #1c2128);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-mono, monospace);
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent, #7c9cff);
    box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.15);
}

.search-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-filter-btn {
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono, monospace);
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.search-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent, #7c9cff);
}

.search-filter-btn.active {
    background: #ffd166;
    color: #0e1220;
    border-color: #ffd166;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result {
    display: flex;
    gap: 0.9rem;
    align-items: baseline;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color, rgba(255,255,255,0.08));
    border-radius: 8px;
    text-decoration: none;
    background: var(--bg-card, #1c2128);
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.search-result:hover {
    border-color: var(--accent, #7c9cff);
    transform: translateX(2px);
}

.search-result-tag {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
    color: #0e1220;
    font-weight: 600;
}

.search-result-tag-blog { background: #ffd166; }
.search-result-tag-notes { background: #7c9cff; }

.search-result-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
}

.search-result-title {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-result-crumbs {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: var(--font-mono, monospace);
}

.search-result mark {
    background: rgba(255, 209, 102, 0.35);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-empty {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

/* ============================================
   Intuition callout (reusable pastel blob)
   Use in markdown as:
       <div class="intuition"><strong>Intuition.</strong> ...</div>
   ============================================ */
.intuition {
    background: #f7f3ff;              /* very light lavender */
    border-left: 4px solid #a78bfa;   /* soft violet */
    color: #2b2545;
    padding: 0.9rem 1.1rem;
    margin: 1.25rem 0;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.intuition strong {
    color: #5b21b6;
    letter-spacing: 0.02em;
}

.intuition em { color: #4c1d95; }

.intuition p { margin: 0; }
.intuition p + p { margin-top: 0.4rem; }

/* Dark theme variant — still pastel but lifted to be readable on a dark page. */
[data-theme="dark"] .intuition,
:root:not([data-theme="light"]) .intuition {
    background: rgba(167, 139, 250, 0.10);
    color: #e0d9ff;
    border-left-color: #a78bfa;
}

[data-theme="dark"] .intuition strong,
:root:not([data-theme="light"]) .intuition strong {
    color: #c4b5fd;
}

/* ============================================
   Article figure sizing (blog + notes)
   ============================================ */
/* Article figures. Uses `<img>` (from markdown ![alt](file.svg)) and
   the interactive canvas. Do NOT include a bare `svg` selector here —
   KaTeX renders its stretchy delimiters (\left|, \sqrt, …) as inline
   <svg> elements and any `width: 100%` on those breaks the math. */
.blog-post-body img,
.blog-post-body .interactive-slot canvas {
    display: block;
    margin: 1.25rem auto;
    max-width: 480px;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: #f5f1ff;
}

.blog-post-body .interactive-slot canvas {
    max-width: 100%;
}

/* Opt-in: images marked `wide` span the full article width. */
.blog-post-body img.wide {
    max-width: 100%;
    width: 100%;
    cursor: zoom-in;
}


/* ============================================
   Sneak peek (mint pastel)
   Use in markdown as:
       <div class="sneak-peek"><strong>Sneak peek.</strong> ...</div>
   ============================================ */
.sneak-peek {
    background: #e6fff5;
    border-left: 4px solid #10b981;
    color: #063f2b;
    padding: 0.9rem 1.1rem;
    margin: 1.25rem 0;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.55;
}

.sneak-peek strong {
    color: #047857;
    letter-spacing: 0.02em;
}

.sneak-peek em { color: #065f46; }

.sneak-peek p { margin: 0; }
.sneak-peek p + p { margin-top: 0.4rem; }

[data-theme="dark"] .sneak-peek,
:root:not([data-theme="light"]) .sneak-peek {
    background: rgba(16, 185, 129, 0.10);
    color: #b6f4dc;
    border-left-color: #10b981;
}

[data-theme="dark"] .sneak-peek strong,
:root:not([data-theme="light"]) .sneak-peek strong {
    color: #6ee7b7;
}

/* ============================================
   Bulb — expandable off-ramp (default collapsed)
   Use in markdown as:
       <details class="bulb">
       <summary>Show a small example</summary>

       Body markdown here (leave blank lines).

       </details>
   ============================================ */
.bulb {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin: 1.1rem 0;
    padding: 0.15rem 0;
    color: #78350f;
}

.bulb summary {
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
    cursor: pointer;
    list-style: none;
    color: #78350f;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.bulb summary::-webkit-details-marker { display: none; }

.bulb summary::before {
    content: "💡";
    font-size: 1rem;
}

.bulb[open] summary {
    border-bottom: 1px dashed rgba(245, 158, 11, 0.4);
}

.bulb > *:not(summary) {
    padding: 0.4rem 1rem 0.85rem 1rem;
}

.bulb p { margin: 0.35rem 0; font-size: 0.92rem; line-height: 1.55; }
.bulb ul, .bulb ol { margin: 0.35rem 0 0.35rem 1.2rem; font-size: 0.92rem; }
.bulb code { background: rgba(245, 158, 11, 0.15); }

[data-theme="dark"] .bulb,
:root:not([data-theme="light"]) .bulb {
    background: rgba(245, 158, 11, 0.10);
    color: #fde68a;
    border-left-color: #f59e0b;
}

[data-theme="dark"] .bulb summary,
:root:not([data-theme="light"]) .bulb summary {
    color: #fde68a;
}

/* ============================================
   Nav-bar visitor counter (GoatCounter)
   Styled to match the theme-toggle button.
   ============================================ */
.nav-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 34px;
    padding: 0 0.65rem;
    margin-left: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    background: none;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all var(--transition);
}

.nav-counter:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.nav-counter svg {
    width: 15px;
    height: 15px;
    display: inline-block;
    background: none;
    max-width: none;
    margin: 0;
}

.nav-counter-value {
    letter-spacing: 0.03em;
    min-width: 1.6ch;
    text-align: right;
}

@media (max-width: 640px) {
    .nav-counter { padding: 0 0.5rem; font-size: 0.72rem; }
    .nav-counter svg { width: 13px; height: 13px; }
}

/* ============================================
   Comments / reactions block (giscus)
   ============================================ */
.post-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.post-comments-title {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 1rem;
}

.post-comments .giscus,
.post-comments .giscus-frame {
    width: 100%;
    min-height: 200px;
    border: none;
}

/* ============================================
   Image / visualization captions
   Any paragraph whose ONLY child is an <em>
   (i.e. `*text*` on its own line in markdown,
   the convention we use for figure captions)
   renders smaller and muted.
   ============================================ */
.blog-post-body p:has(> em:only-child) {
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-top: -0.4rem;
    margin-bottom: 1.4rem;
}

.blog-post-body p:has(> em:only-child) em {
    font-style: italic;
}

/* ============================================
   Inline search (top of blog / notes pages)
   ============================================ */
.inline-search-wrap {
    margin: 0.75rem 0 1.5rem;
}

/* ============================================
   Notes-landing category hover flyout
   Shows subject subfolders + last 5 notes.
   ============================================ */
.note-card-wrap {
    position: relative;
}

.notes-flyout {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--bg-card, #1c2128);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 14px 34px rgba(0,0,0,0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.note-card-wrap:hover .notes-flyout,
.note-card-wrap:focus-within .notes-flyout {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.notes-flyout-subjects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
}

.notes-flyout-sub {
    display: block;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.25;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.notes-flyout-sub:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.08);
}

.notes-flyout-recent {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--border-color, rgba(255,255,255,0.15));
}

.notes-flyout-recent h4 {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.notes-flyout-recent ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.notes-flyout-recent a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.83rem;
    color: var(--text-primary);
    padding: 0.25rem 0;
    text-decoration: none;
    line-height: 1.35;
}

.notes-flyout-recent a:hover {
    color: var(--accent);
}

.notes-flyout-sub-tag {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* No hover flyout on touch — tap the card to enter the category. */
@media (hover: none) {
    .notes-flyout { display: none !important; }
}
