@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Sora:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Fraunces:opsz,wght,SOFT@9..144,400;9..144,500;9..144,600;9..144,700;9..144,800;9..144,900,0..100&display=swap');
@import url('timeline.css');

/* ═══════════════════════════════════════════════
   LIQUID GLASS THEME - Nilesh Sarkar Portfolio
   ═══════════════════════════════════════════════ */

:root {
    /* Core palette - white canvas, ink body, blue used sparingly for meaning */
    --bg-color: #ffffff;
    --text-color: #1a1a1f;
    --link-color: #059669;
    --accent-color: #5a5a62;
    --heading-color: #111115;
    --secondary-accent: #059669;

    /* Glass surfaces - quiet edges */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(60, 60, 70, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.04);
    --glass-blur: 24px;
    --glass-hover-bg: rgba(255, 255, 255, 0.78);
    --glass-hover-border: rgba(60, 60, 70, 0.2);
    --glass-inner-glow: inset 0 1px 0 0 rgba(255,255,255,0.7);

    /* Unified radius & easing */
    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 24px;
    --radius-xl: 28px;
    --radius-pill: 999px;
    --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.075);
    --transition-base: 0.25s var(--ease-smooth);

    /* Accents flattened to monochrome - kept as vars so cascading code still works */
    --gradient-primary: #1a1a1f;
    --gradient-warm: #1a1a1f;
    --gradient-cool: #1a1a1f;
    --gradient-green: #1a1a1f;

    /* Utility */
    --surface-elevated: rgba(255, 255, 255, 0.35);
    --surface-muted: rgba(0, 0, 0, 0.04);
    --code-surface: rgba(0, 0, 0, 0.05);
    --mark-bg: rgba(0, 0, 0, 0.08);
    --mark-text: #1a1a1f;

    /* Fonts */
    --font-main: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "IBM Plex Mono", "Menlo", "Consolas", monospace;
    --font-display: "Sora", "Inter", system-ui, sans-serif;
}

/* ── Reset & Base ───────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 1.5rem;
    /* native rubber-band overscroll on macOS / iOS / iPadOS */
    overscroll-behavior-y: auto;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    /* match the page background so rubber-band overscroll doesn't reveal
       a different colour underneath */
    background: var(--bg-color);
}

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}

section { scroll-margin-top: 1.5rem; }

body {
    font-family: var(--font-main);
    background: var(--bg-color);
    color: var(--text-color);
    max-width: 900px;
    margin: 0 auto;
    padding:
        clamp(1.5rem, 5vw, 3rem)
        clamp(1rem, 3vw, 2rem)
        calc(clamp(1.5rem, 5vw, 3rem) + 5rem + env(safe-area-inset-bottom, 0px))
        clamp(1rem, 3vw, 2rem);
    line-height: 1.65;
    font-size: clamp(15px, 1vw + 13px, 17px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    opacity: 1;
    visibility: visible;
    animation: fadeIn 0.45s var(--ease-smooth);
    position: relative;
}

body.home {
    max-width: 980px;
    isolation: isolate;
}

/* ── Minimal Background - flat neutral surface ──────── */
.bg-mesh {
    position: fixed;
    inset: 0;
    z-index: -10;
    background: var(--bg-color);
}

/* Blobs removed - using static radial gradients on .bg-mesh instead */

/* ── Animations ─────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 14px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

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

@keyframes pageEnter {
    from { opacity: 0; }
    60%  { opacity: 1; }
    to   { opacity: 1; }
}

@keyframes pageLoaderSweep {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Page transition - tighter timing, no transforms (transforms break
   position: fixed on the dock, so we keep this opacity-only).
   No `both` fill - body's resting opacity stays 1 even if the
   animation never fires, so the page can't end up stuck invisible. */
body {
    animation: pageEnter 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}

body.is-leaving {
    opacity: 0;
    transition: opacity 0.16s cubic-bezier(0.55, 0, 0.7, 0.3);
    animation: none;
    pointer-events: none;
}

/* ── Initial load bar - thin sweep across the top ─── */
.page-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: transparent;
    overflow: hidden;
    z-index: 10001;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s var(--ease-smooth);
}

.page-loader::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(5, 150, 105, 0.85) 50%,
        transparent 100%
    );
    animation: pageLoaderSweep 0.95s var(--ease-smooth) infinite;
    will-change: transform;
}

.page-loader.done {
    opacity: 0;
}

.reveal {
    opacity: 0;
    transform: translate3d(0, 10px, 0);
    transition:
        opacity 0.45s var(--ease-smooth),
        transform 0.45s var(--ease-smooth);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

header {
    animation: fadeInUp 0.45s var(--ease-smooth) both;
}

article, section {
    animation: none;
}

/* Cascaded fly-in for the home hero children — name, subtitle, status,
   links, photo each tick in one after the other for a snappy entrance. */
@keyframes flyInUp {
    from { opacity: 0; transform: translate3d(0, 12px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes flyInRight {
    from { opacity: 0; transform: translate3d(16px, 0, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

body.home header.home-hero .home-hero-text > * {
    animation: flyInUp 0.5s var(--ease-smooth) both;
}
body.home header.home-hero .home-hero-text > h1               { animation-delay: 0.08s; }
body.home header.home-hero .home-hero-text > .subtitle        { animation-delay: 0.16s; }
body.home header.home-hero .home-hero-text > .currently-line  { animation-delay: 0.24s; }
body.home header.home-hero .home-hero-text > .header-links    { animation-delay: 0.32s; }

body.home header.home-hero .profile-img {
    animation: flyInRight 0.55s var(--ease-spring) both;
    animation-delay: 0.18s;
}

/* Icon links pop in within their row */
body.home header.home-hero .header-links > * {
    animation: flyInUp 0.4s var(--ease-smooth) both;
}
body.home header.home-hero .header-links > *:nth-child(1) { animation-delay: 0.36s; }
body.home header.home-hero .header-links > *:nth-child(2) { animation-delay: 0.40s; }
body.home header.home-hero .header-links > *:nth-child(3) { animation-delay: 0.44s; }
body.home header.home-hero .header-links > *:nth-child(4) { animation-delay: 0.48s; }
body.home header.home-hero .header-links > *:nth-child(5) { animation-delay: 0.52s; }
body.home header.home-hero .header-links > *:nth-child(6) { animation-delay: 0.56s; }
body.home header.home-hero .header-links > *:nth-child(7) { animation-delay: 0.60s; }
body.home header.home-hero .header-links > *:nth-child(8) { animation-delay: 0.64s; }
body.home header.home-hero .header-links > *:nth-child(9) { animation-delay: 0.68s; }

/* No page-exit animation - instant navigation, no swipe-back delay */

/* Noise texture removed - caused recomposite on every scroll frame */

/* ── Glass Mixin - NO backdrop-filter on scroll elements ── */
.glass, section, .timeline-card, .featured-card, .content-box {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 6px 24px rgba(0, 0, 0, 0.03),
        var(--glass-inner-glow);
}


/* ── Header ─────────────────────────────────── */
header {
    border-bottom: none;
    padding-bottom: 2.5rem;
    padding-top: 2.5rem;
    margin: 0 auto 2.5rem auto;
    position: relative;
    text-align: center;
    overflow: hidden;
}

body.home header {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: clamp(1.8rem, 3vw, 2.6rem) clamp(1.2rem, 3vw, 2rem);
    background: rgba(255,255,255,0.7);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 8px 32px rgba(0, 0, 0, 0.04),
        0 1px 0 0 rgba(255,255,255,0.85) inset;
    text-align: center;
}

/* Home hero: text on left, photo on right (only on the actual home hero) */
body.home header.home-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.4rem, 3vw, 2.4rem);
    text-align: left;
}

.home-hero-text {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.home-hero-text h1 {
    text-align: left;
    margin-bottom: 0.6rem;
    /* Editorial serif display - Instrument Serif as primary, Fraunces as
       a variable-axis fallback with a slightly soft cut for character. */
    font-family: "Instrument Serif", "Fraunces", "DM Serif Display", Georgia, "Times New Roman", serif;
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    font-weight: 400;          /* Instrument Serif only ships at 400 */
    font-style: normal;
    letter-spacing: -0.01em;
    line-height: 1.05;
    font-feature-settings: "ss01" on, "liga" on;
    font-variation-settings: "opsz" 144, "SOFT" 30;
}

.home-hero-text .subtitle {
    font-size: clamp(0.85rem, 1vw + 0.6rem, 1.05rem);
}

.home-hero-text .subtitle {
    text-align: left;
    margin: 0.4rem 0 1.1rem;
    max-width: 100%;
}

.home-hero-text .header-links {
    justify-content: flex-start;
    margin-top: 1rem;
}

.home-hero-text .currently-line {
    text-align: left;
    margin: 0.4rem 0 0.9rem;
    max-width: 100%;
    font-size: 0.9rem;
}

.home-hero-text .hero-highlights {
    justify-content: flex-start;
    margin: 0 0 0.4rem;
    max-width: 100%;
}

@media (max-width: 640px) {
    body.home header.home-hero .home-hero-text .currently-line,
    body.home header.home-hero .home-hero-text .hero-highlights {
        text-align: center;
        justify-content: center;
    }
}

body.home header.home-hero .profile-img {
    width: 144px;
    height: 144px;
    margin: 0;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    body.home header.home-hero {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
    .home-hero-text,
    .home-hero-text h1,
    .home-hero-text .subtitle {
        text-align: center;
    }
    .home-hero-text .header-links {
        justify-content: center;
    }
    body.home header.home-hero .profile-img {
        width: 110px;
        height: 110px;
    }
}

/* Static subtle shine on header - no animation for perf */
body.home header::after {
    content: "";
    position: absolute;
    top: -20%;
    right: -20%;
    width: 50%;
    height: 140%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body:not(.home) header {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.78);
    padding: clamp(2rem, 3.5vw, 3rem) !important;
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: 0 8px 32px var(--glass-shadow), var(--glass-inner-glow);
}

body:not(.home) header:hover {
    box-shadow: 0 16px 48px rgba(5, 150, 105, 0.1);
    border-color: var(--glass-hover-border);
    background: var(--glass-hover-bg);
}

header > *:not(.dot-grid-canvas):not(::after) {
    position: relative;
    z-index: 1;
}

/* Dot grid canvas */
.dot-grid-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    border-radius: var(--radius-xl);
    z-index: 0;
}

/* ── Profile Image ──────────────────────────── */
.profile-img {
    display: block;
    margin: 0 auto;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--heading-color);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 5px rgba(0, 0, 0, 0.08),
        0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.35s var(--ease-spring), box-shadow 0.35s var(--ease-smooth);
    flex-shrink: 0;
}

.profile-img:hover {
    transform: scale(1.06);
    box-shadow:
        0 0 0 4px #fff,
        0 0 0 5px rgba(0, 0, 0, 0.18),
        0 10px 26px rgba(0, 0, 0, 0.12);
}

@media (max-width: 640px) {
    .profile-img { width: 110px; height: 110px; }
}
@media (max-width: 375px) {
    .profile-img { width: 100px; height: 100px; }
}

/* ── Typography ─────────────────────────────── */
h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    margin: 0 0 0.1rem 0;
    letter-spacing: -0.5px;
    line-height: 1.15;
    background: linear-gradient(120deg, #10b981 0%, #0ea5e9 55%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

header h1 {
    margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
    h1 { font-size: 1.8rem; letter-spacing: -0.3px; }
}

h2 {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    margin-top: 0;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    background: linear-gradient(120deg, #10b981 0%, #0ea5e9 60%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    border-bottom: none;
    padding-bottom: 0.8rem;
    font-weight: 700;
    position: relative;
}

/* Minimal underline for h2 */
h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 40px; height: 1px;
    background: var(--heading-color);
}

@media (max-width: 640px) {
    h2 { font-size: 0.95rem; letter-spacing: 0.8px; margin-bottom: 1rem; }
}

h3 {
    font-family: var(--font-main);
    font-size: 1.3rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--heading-color);
    font-weight: 600;
    letter-spacing: -0.2px;
}

h4 { font-size: 1.1rem; margin-top: 1.5rem; margin-bottom: 0.7rem; color: var(--heading-color); font-weight: 600; }
h5 { font-size: 1rem; margin-top: 1.2rem; margin-bottom: 0.6rem; color: var(--heading-color); font-weight: 600; letter-spacing: 0.3px; }
h6 { font-size: 0.95rem; margin-top: 1rem; margin-bottom: 0.5rem; color: var(--heading-color); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.9; }

@media (max-width: 640px) {
    h3 { font-size: 1.25rem; font-weight: 700; }
    h4 { font-size: 1.05rem; font-weight: 700; }
}

.subtitle {
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: clamp(1rem, 1.2vw + 0.7rem, 1.28rem);
    line-height: 1.55;
    margin: 0.8rem auto;
    max-width: 620px;
    opacity: 0.8;
    text-align: center;
}

p { margin-bottom: 1rem; }

/* ── Links ──────────────────────────────────── */
a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--transition-base), border-color var(--transition-base);
    font-weight: 500;
}

a:hover {
    color: var(--secondary-accent);
    border-bottom-color: var(--secondary-accent);
    background: transparent;
}

a, button {
    transition: color var(--transition-base), border-color var(--transition-base), background-color var(--transition-base);
}

.tag, .skill-pill, .btn-pill, .icon-link, .submit-btn, .timeline-logo-placeholder {
    transition: transform var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}

.featured-card, .project-card, .achievement-card, .content-box, .blog-card-link, .timeline-card {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* ── Sections (Glass Panels) ────────────────── */
section {
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 4vw, 3rem);
    margin: 2rem 0;
    transition: box-shadow var(--transition-base);
    position: relative;
}

@media (hover: hover) {
    section:hover {
        border-color: var(--glass-hover-border);
        box-shadow:
            0 1px 2px rgba(0, 0, 0, 0.03),
            0 8px 24px rgba(0, 0, 0, 0.04),
            var(--glass-inner-glow);
    }
}

section > * {
    position: relative;
    z-index: 1;
}

section h2 {
    font-size: clamp(1rem, 2vw, 1.15rem);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

section h3 { color: var(--heading-color); margin-bottom: 1rem; }
section { margin-bottom: 2rem; }

/* Dates removed from Research Experience + Research Projects timelines
   per request - markup stays in place so data is preserved, only hidden. */
#experience .timeline .date,
#projects   .timeline .date { display: none; }

/* Hide the timeline dot + connecting line too when dates are removed,
   since the dot's vertical position no longer matches anything meaningful. */
#experience .timeline li::before,
#experience .timeline::before,
#projects   .timeline li::before,
#projects   .timeline::before { display: none; }
#experience .timeline,
#projects   .timeline { margin-left: 0; }

/* ── Section underlines - thicker, gradient, per-domain colour */
#experience > h2::after,
#skills-glance > h2::after,
#featured-work > h2::after,
#leadership > h2::after,
#education > h2::after,
#latest-blogs > h2::after,
#contact > h2::after {
    width: 64px;
    height: 3px;
    border-radius: 3px;
}
#experience    > h2::after { background: linear-gradient(135deg, #059669, #10b981, #34d399); }
#skills-glance > h2::after { background: linear-gradient(135deg, #14b8a6, #06b6d4, #10b981); }
#featured-work > h2::after { background: linear-gradient(135deg, #0891b2, #34d399, #14b8a6); }
#leadership    > h2::after { background: linear-gradient(135deg, #ea580c, #f59e0b, #facc15); }
#education     > h2::after { background: linear-gradient(135deg, #2563eb, #0ea5e9, #475569); }
#latest-blogs  > h2::after { background: linear-gradient(135deg, #10b981, #0ea5e9, #38bdf8); }
#contact       > h2::after { background: linear-gradient(135deg, #059669, #10b981, #34d399); }

/* Subtle tinted frosted aura per section - just a whisper of colour
   under a mostly-white glass surface. No pinks or purples - palette
   stays within greens, blues, teals, ambers, slates. */
#experience    { background: linear-gradient(135deg, rgba(16,185,129,0.035),  rgba(14,165,233,0.02),  rgba(255,255,255,0.78)) !important; } /* emerald -> sky */
#projects      { background: linear-gradient(135deg, rgba(251,146,60,0.045),  rgba(16,185,129,0.025), rgba(255,255,255,0.78)) !important; } /* orange -> emerald */
#skills-glance { background: linear-gradient(135deg, rgba(20,184,166,0.04),   rgba(6,182,212,0.025),  rgba(255,255,255,0.78)) !important; } /* teal -> cyan */
#featured-work { background: linear-gradient(135deg, rgba(8,145,178,0.035),   rgba(16,185,129,0.02),  rgba(255,255,255,0.78)) !important; } /* cyan -> emerald */
#leadership    { background: linear-gradient(135deg, rgba(245,158,11,0.04),   rgba(217,119,6,0.022),  rgba(255,255,255,0.78)) !important; } /* amber -> orange */
#education     { background: linear-gradient(135deg, rgba(59,130,246,0.035),  rgba(71,85,105,0.02),   rgba(255,255,255,0.78)) !important; } /* blue -> slate */
#latest-blogs  { background: linear-gradient(135deg, rgba(59,130,246,0.035),  rgba(6,182,212,0.02),   rgba(255,255,255,0.78)) !important; } /* blue -> cyan */
#contact       { background: linear-gradient(135deg, rgba(16,185,129,0.035),  rgba(20,184,166,0.02),  rgba(255,255,255,0.78)) !important; } /* emerald -> teal */

/* Apply a subtle frosted-glass blur to all hero-level section cards so
   the section tints feel like glass rather than flat paint. */
#experience, #projects, #skills-glance, #featured-work,
#leadership, #education, #latest-blogs, #contact {
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
}

/* Per-section h2 - vibrant two/three-stop colour gradients (no black) */
#experience    > h2 { background: linear-gradient(120deg, #10b981, #0ea5e9, #2563eb);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#projects      > h2 { background: linear-gradient(120deg, #fb923c, #f59e0b, #10b981);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#skills-glance > h2 { background: linear-gradient(120deg, #14b8a6, #06b6d4, #10b981);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#featured-work > h2 { background: linear-gradient(120deg, #06b6d4, #10b981, #84cc16);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#leadership    > h2 { background: linear-gradient(120deg, #f59e0b, #f97316, #facc15);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#education     > h2 { background: linear-gradient(120deg, #2563eb, #0ea5e9, #475569);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#latest-blogs  > h2 { background: linear-gradient(120deg, #3b82f6, #06b6d4, #10b981);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
#contact       > h2 { background: linear-gradient(120deg, #10b981, #14b8a6, #06b6d4);  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

#projects > h2::after { background: linear-gradient(135deg, #fb923c, #f59e0b, #10b981); }

/* ── Uniform text styling ──────────────────────
   Links are a solid emerald green; emphasised <strong> elements get a
   vibrant gradient. Scoped to article/section body text so timeline
   `<b>` wrappers, blog titles, tag chips and dock items keep their
   existing colours. */
section p strong,
section li strong,
section ul strong,
article p strong,
article li strong,
article ul strong,
.content-box strong {
    background: linear-gradient(120deg, #10b981, #0ea5e9, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 700;
}

/* If the strong contains a link, the link colour wins back over the
   gradient (so anchor text stays solid emerald). */
section strong a,
article strong a,
.content-box strong a {
    background: none;
    -webkit-text-fill-color: var(--link-color);
    color: var(--link-color);
}

/* All inline links resolve to the solid emerald link colour, with a
   subtle underline-grow on hover for tactile feedback. */
a:not(.btn-pill):not(.icon-link):not(.nav-dock-item):not(.featured-card):not(.blog-link):not(.skill-pill):not(.spotlight-item):not(.contact-item):not(.timeline-major a) {
    color: var(--link-color);
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.28s cubic-bezier(0.22, 0.61, 0.36, 1), color 0.2s var(--ease-smooth);
    padding-bottom: 1px;
}

@media (hover: hover) {
    a:not(.btn-pill):not(.icon-link):not(.nav-dock-item):not(.featured-card):not(.blog-link):not(.skill-pill):not(.spotlight-item):not(.contact-item):not(.timeline-major a):hover {
        background-size: 100% 1px;
    }
}

/* Click ripple from the click point on .btn-pill - replaces the
   static radial flash with one that anchors to where you pressed. */
.btn-pill {
    --ripple-x: 50%;
    --ripple-y: 50%;
}
.btn-pill::after {
    background: radial-gradient(circle at var(--ripple-x) var(--ripple-y), rgba(255,255,255,0.55), transparent 55%);
}

/* ── Lists ──────────────────────────────────── */
ul { list-style-type: square; padding-left: 1.5rem; margin-top: 1rem; }
ul li::marker { color: var(--secondary-accent); }
li { margin-bottom: 1rem; line-height: 1.6; }

/* ── Currently Line ─────────────────────────── */
.currently-line {
    font-family: var(--font-main);
    font-size: 0.92rem;
    color: var(--accent-color);
    text-align: center;
    margin: 0.6rem auto 0;
    max-width: 600px;
    font-style: italic;
    opacity: 0.8;
    line-height: 1.5;
}

.currently-line strong {
    background: linear-gradient(120deg, #10b981 0%, #0ea5e9 55%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-style: normal;
    font-weight: 700;
}

/* ── Hero Stats Bar ─────────────────────────── */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.8rem auto 0;
    padding: 1.1rem 1.5rem;
    max-width: 540px;
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), var(--glass-inner-glow);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0 0.8rem;
}

.hero-stat-number {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--heading-color);
}

.hero-stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.hero-stat-divider {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.12), transparent);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .hero-stats { max-width: 100%; padding: 0.9rem 0.8rem; }
    .hero-stat { padding: 0 0.3rem; }
    .hero-stat-number { font-size: 1.3rem; }
    .hero-stat-label { font-size: 0.58rem; }
    .currently-line { font-size: 0.84rem; }
}

/* ── Header Links ───────────────────────────── */
.header-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.7rem;
}

.btn-offset { margin-left: 0.8rem; }

/* ── Icon Links ─────────────────────────────── */
.icon-link {
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

/* Brand colors - colour used to carry meaning (logos), not decoration */
.icon-link[aria-label="Email"]          { color: #D44638; }
.icon-link[aria-label="GitHub"]         { color: #181717; }
.icon-link[aria-label="LinkedIn"]       { color: #0A66C2; }
.icon-link[aria-label="Google Scholar"] { color: #4285F4; }
.icon-link[aria-label="ORCID"]          { color: #A6CE39; }
.icon-link[aria-label="X (Twitter)"]    { color: #0F1419; }
.icon-link[aria-label="Hugging Face"]   { color: inherit; }
/* HF logo is multi-colored - don't tint via currentColor */
.icon-link[aria-label="Hugging Face"] svg { color: inherit; }

@media (hover: hover) {
    .icon-link:hover {
        background: rgba(0, 0, 0, 0.04);
        border-color: rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }
    .icon-link[aria-label="Email"]:hover          { background: rgba(212, 70, 56, 0.08); border-color: rgba(212, 70, 56, 0.25); }
    .icon-link[aria-label="GitHub"]:hover         { background: rgba(24, 23, 23, 0.06); border-color: rgba(24, 23, 23, 0.2); }
    .icon-link[aria-label="LinkedIn"]:hover       { background: rgba(10, 102, 194, 0.08); border-color: rgba(10, 102, 194, 0.3); }
    .icon-link[aria-label="Google Scholar"]:hover { background: rgba(66, 133, 244, 0.08); border-color: rgba(66, 133, 244, 0.3); }
    .icon-link[aria-label="ORCID"]:hover          { background: rgba(166, 206, 57, 0.12); border-color: rgba(166, 206, 57, 0.4); }
    .icon-link[aria-label="X (Twitter)"]:hover    { background: rgba(15, 20, 25, 0.06); border-color: rgba(15, 20, 25, 0.2); }
    .icon-link[aria-label="Hugging Face"]:hover   { background: rgba(255, 210, 30, 0.18); border-color: rgba(255, 157, 11, 0.4); }
}

.icon-link:active { transform: translateY(0) scale(0.95); }

/* ── Buttons (Glass Pills) ──────────────────── */
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.62rem 1.25rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(17, 17, 21, 0.14);
    color: var(--heading-color);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    transition:
        transform 0.2s var(--ease-spring),
        border-color var(--transition-base),
        color var(--transition-base),
        box-shadow var(--transition-base),
        background-color var(--transition-base);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 1px 2px rgba(0, 0, 0, 0.06),
        0 6px 18px rgba(0, 0, 0, 0.07);
    letter-spacing: 0.2px;
}

@media (hover: hover) {
    .btn-pill:hover {
        border-color: rgba(17, 17, 21, 0.25);
        color: var(--heading-color);
        background: rgba(255, 255, 255, 0.78);
        transform: translateY(-2px) scale(1.03);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            0 6px 14px rgba(0, 0, 0, 0.08),
            0 14px 32px rgba(0, 0, 0, 0.1);
    }
}

.btn-pill:active {
    transform: translateY(0) scale(0.96);
    transition-duration: 0.08s;
}

/* Keyboard focus ring across every interactive element. Uses the same
   emerald accent everywhere for consistency. */
.btn-pill:focus-visible,
.icon-link:focus-visible,
.nav-dock-item:focus-visible,
.nav-dock-search:focus-visible,
.skill-pill:focus-visible,
.submit-btn:focus-visible,
.contact-item:focus-visible,
.blog-link:focus-visible,
.featured-card:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.15);
}

/* Click "flash" - briefly desaturate the white inner highlight on press
   so every button feels tactile. */
.btn-pill::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(255,255,255,0.4), transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-smooth);
}
.btn-pill { position: relative; overflow: hidden; }
.btn-pill:active::after { opacity: 1; transition-duration: 0.04s; }

/* Plain <button> defaults so any markup without .btn-pill still
   feels right. */
button:not(.btn-pill):not(.nav-dock-search):not(.submit-btn):not(.lightbox-close) {
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.18s var(--ease-spring), filter 0.18s var(--ease-smooth);
}
button:not(.btn-pill):not(.nav-dock-search):not(.submit-btn):not(.lightbox-close):hover {
    filter: brightness(1.05);
}
button:not(.btn-pill):not(.nav-dock-search):not(.submit-btn):not(.lightbox-close):active {
    transform: scale(0.97);
}

.btn-pill:active, .submit-btn:active, a.skill-pill:active, .tag:active {
    transform: translateY(0) scale(0.97);
    transition: transform 0.08s var(--ease-smooth);
}

.btn-pill.primary {
    background: linear-gradient(135deg, #1a1a1f, #0b0b10);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5),
        0 3px 8px rgba(0, 0, 0, 0.22),
        0 10px 26px rgba(0, 0, 0, 0.12);
}

@media (hover: hover) {
    .btn-pill.primary:hover {
        background: linear-gradient(135deg, #059669, #111115);
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.22),
            inset 0 -1px 0 rgba(0, 0, 0, 0.6),
            0 6px 16px rgba(5, 150, 105, 0.28),
            0 16px 36px rgba(0, 0, 0, 0.18);
        transform: translateY(-2px) scale(1.03);
        color: #fff;
    }
}

.btn-pill.primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-inline { display: inline-flex; }

/* ── Skills at a Glance ─────────────────────── */
#skills-glance { padding: clamp(1.5rem, 3vw, 2.5rem); }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill-group-title {
    font-family: var(--font-mono) !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: transparent !important;
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.7rem 0 !important;
    padding: 0;
    font-weight: 700;
}

.skill-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-pill {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--heading-color);
    font-weight: 500;
    transition: transform var(--transition-base), color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    white-space: nowrap;
}

.skill-pill:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Clickable skill pills - link styling */
a.skill-pill {
    text-decoration: none;
    border-bottom: none;
    cursor: pointer;
    color: var(--heading-color);
}

a.skill-pill:hover {
    color: var(--link-color);
    border-bottom: none;
}

/* Highlighted pills (NVIDIA stack) */
.skill-pill.highlight-pill {
    background: rgba(118, 185, 0, 0.14);
    border-color: rgba(118, 185, 0, 0.35);
    color: #3d6b0a;
    font-weight: 600;
}

.skill-pill.highlight-pill:hover {
    background: rgba(118, 185, 0, 0.22);
    border-color: rgba(118, 185, 0, 0.5);
    box-shadow: 0 4px 12px rgba(90, 150, 0, 0.14);
}

@media (max-width: 900px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
}
@media (max-width: 540px) {
    .skills-grid { grid-template-columns: 1fr; gap: 1rem; }
}

/* ── Featured Work Cards ────────────────────── */
.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
}

.featured-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none !important;
    color: inherit;
    position: relative;
    overflow: hidden;

    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

/* Shine sweep on featured cards (same as timeline) */
.featured-card .shine-layer {
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    pointer-events: none;
    z-index: 0;
}

.featured-card:hover {
    transform: translateY(-3px) translateZ(0);
    background: rgba(255, 255, 255, 0.55) !important;
    border-color: rgba(255,255,255,0.75);
}

.featured-card:hover .shine-layer {
    left: 150%;
}

.featured-card .featured-icon {
    width: 52px; height: 52px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.8);
    display: flex;
    align-items: center; justify-content: center;
    flex-shrink: 0;
    padding: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.featured-card .featured-info { flex: 1; min-width: 0; }

.featured-card .featured-info .featured-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 700;
    display: block;
    margin-bottom: 0.15rem;
}

.featured-card .featured-info h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.2rem 0 !important;
    color: var(--text-color);
    line-height: 1.3;
}

.featured-card .featured-info p {
    font-size: 0.86rem;
    color: var(--accent-color);
    margin: 0;
    line-height: 1.45;
}

.featured-arrow {
    font-size: 1.3rem;
    color: var(--accent-color);
    flex-shrink: 0;
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
    opacity: 0.4;
}

.featured-card:hover .featured-arrow {
    transform: translateX(5px);
    opacity: 1;
    color: var(--link-color);
}

/* Featured card accents - colour-coded by domain */
.featured-research {
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 16px rgba(5,150,105,0.06), var(--glass-inner-glow), inset 3px 0 0 0 rgba(5, 150, 105, 0.55);
}
.featured-research:hover {
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12), inset 3px 0 0 0 rgba(5, 150, 105, 0.75), inset 0 1px 0 0 rgba(255,255,255,0.85);
}
.featured-research .featured-label {
    background: linear-gradient(135deg, #059669, #34d399);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

.featured-industry {
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 16px rgba(5,150,105,0.06), var(--glass-inner-glow), inset 3px 0 0 0 rgba(5, 150, 105, 0.55);
}
.featured-industry:hover {
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.12), inset 3px 0 0 0 rgba(5, 150, 105, 0.75), inset 0 1px 0 0 rgba(255,255,255,0.85);
}
.featured-industry .featured-label {
    background: linear-gradient(135deg, #059669, #14b8a6);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

.featured-experiments {
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 4px 16px rgba(234,88,12,0.06), var(--glass-inner-glow), inset 3px 0 0 0 rgba(234, 88, 12, 0.55);
}
.featured-experiments:hover {
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.12), inset 3px 0 0 0 rgba(234, 88, 12, 0.75), inset 0 1px 0 0 rgba(255,255,255,0.85);
}
.featured-experiments .featured-label {
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}

@media (max-width: 640px) {
    .featured-card { padding: 1rem 1.1rem; gap: 1rem; }
    .featured-card .featured-icon { width: 44px; height: 44px; }
    .featured-card .featured-info h3 { font-size: 1rem; }
    .featured-card .featured-info p { font-size: 0.82rem; }
}

/* ── Tags ───────────────────────────────────── */
.tag {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--accent-color);
    background: rgba(255,255,255,0.55);
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    display: inline-block;
    margin-right: 5px;
    margin-top: 5px;
    border: 1px solid rgba(180, 195, 220, 0.3);
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
    box-shadow: 0 1px 3px rgba(0,20,60,0.04);
}

@media (hover: hover) {
    .tag:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
}

.tag.featured {
    background: linear-gradient(135deg, rgba(255,215,0,0.25), rgba(255,165,0,0.25));
    color: #92400E;
    font-weight: bold;
    border-color: rgba(255,215,0,0.5);
}

/* Tech Stack Colors - vibrant, readable */
.tag.pytorch { background: rgba(238, 76, 44, 0.13); color: #c41e1e; border-color: rgba(238, 76, 44, 0.28); }
.tag.cuda { background: rgba(118, 185, 0, 0.13); color: #4d7c0f; border-color: rgba(118, 185, 0, 0.28); }
.tag.nvidia { background: rgba(118, 185, 0, 0.13); color: #4d7c0f; border-color: rgba(118, 185, 0, 0.28); }
.tag.jax { background: rgba(66, 133, 244, 0.13); color: #1e50c0; border-color: rgba(66, 133, 244, 0.28); }
.tag.langchain { background: rgba(44, 62, 80, 0.12); color: #2c3a47; border-color: rgba(44, 62, 80, 0.25); }
.tag.langgraph { background: rgba(230, 126, 34, 0.13); color: #a83a0c; border-color: rgba(230, 126, 34, 0.28); }
.tag.vllm { background: rgba(0, 122, 255, 0.12); color: #0059bf; border-color: rgba(0, 122, 255, 0.25); }
.tag.huggingface { background: rgba(255, 210, 30, 0.14); color: #965a06; border-color: rgba(255, 210, 30, 0.3); }
.tag.linux { background: rgba(0, 0, 0, 0.07); color: #2d3440; border-color: rgba(0,0,0,0.12); }
.tag.docker { background: rgba(36, 150, 237, 0.13); color: #035f8c; border-color: rgba(36, 150, 237, 0.28); }
.tag.python { background: rgba(55, 118, 171, 0.13); color: #1740b0; border-color: rgba(55, 118, 171, 0.28); }
.tag.cpp { background: rgba(0, 89, 156, 0.13); color: #163698; border-color: rgba(0, 89, 156, 0.28); }
.tag.sql { background: rgba(242, 145, 17, 0.13); color: #964606; border-color: rgba(242, 145, 17, 0.28); }

/* Domain Tags - vibrant, readable */
.tag.design { background: rgba(217, 119, 6, 0.13); color: #964606; border-color: rgba(217, 119, 6, 0.28); }
.tag.agent { background: rgba(180, 83, 9, 0.13); color: #7a350b; border-color: rgba(180, 83, 9, 0.28); }
.tag.research { background: rgba(5, 150, 105, 0.12); color: #1640b0; border-color: rgba(5, 150, 105, 0.25); }
.tag.vision { background: rgba(103, 58, 183, 0.12); color: #4520a8; border-color: rgba(103, 58, 183, 0.25); }
.tag.systems { background: rgba(100, 116, 139, 0.13); color: #384150; border-color: rgba(100, 116, 139, 0.25); }
.tag.fun { background: rgba(255, 193, 7, 0.14); color: #964606; border-color: rgba(255, 193, 7, 0.28); }
.tag.medical { background: rgba(211, 47, 47, 0.13); color: #b91c1c; border-color: rgba(211, 47, 47, 0.28); }
.tag.cv { background: rgba(63, 81, 181, 0.12); color: #1640b0; border-color: rgba(63, 81, 181, 0.25); }
.tag.mech { background: rgba(230, 81, 0, 0.13); color: #a83a0c; border-color: rgba(230, 81, 0, 0.28); }
.tag.edge { background: rgba(121, 85, 72, 0.13); color: #5e3520; border-color: rgba(121, 85, 72, 0.28); }

.timestamp {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-right: 0.8rem;
    font-weight: 600;
}

/* ── Timeline ───────────────────────────────── */
/* Major timeline items - colourful left stripe + soft tint */
.timeline-major .timeline-card {
    position: relative;
    border-color: rgba(5, 150, 105, 0.22);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 6px 20px rgba(5, 150, 105, 0.06),
        inset 0 1px 0 0 rgba(255,255,255,0.7);
    overflow: hidden;
}

/* Replace the inset shadow with a true gradient stripe so it can be colourful */
.timeline-major .timeline-card::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #059669, #34d399);
    border-radius: 3px 0 0 3px;
    pointer-events: none;
}

.timeline-major .timeline-card:hover {
    border-color: rgba(5, 150, 105, 0.35);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 10px 28px rgba(5, 150, 105, 0.1),
        inset 0 1px 0 0 rgba(255,255,255,0.85);
}

.timeline-major .timeline-card:hover::before {
    background: linear-gradient(180deg, #059669, #34d399, #14b8a6);
}

.timeline-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.timeline-logo-placeholder {
    width: 56px; height: 56px;
    background: rgba(255,255,255,0.65);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center; justify-content: center;
    font-size: 0.7rem;
    color: var(--accent-color);
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,20,60,0.04);
}

@media (hover: hover) {
    .timeline-logo-placeholder:hover {
        transform: scale(1.06);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
        border-color: rgba(0, 0, 0, 0.2);
    }
}

.timeline-logo-placeholder svg, .timeline-logo-placeholder img { width: 70%; height: 70%; object-fit: contain; }

@media (max-width: 600px) {
    .timeline-content { flex-direction: column; gap: 0.5rem; }
    .timeline-logo-placeholder { margin-bottom: 0.5rem; width: 56px; height: 56px; }
}

/* ── Content Box ────────────────────────────── */
.content-box {
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03), var(--glass-inner-glow), inset 2px 0 0 0 rgba(0, 0, 0, 0.15);
}

.content-box:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), var(--glass-inner-glow), inset 2px 0 0 0 rgba(0, 0, 0, 0.25);
    border-color: var(--glass-hover-border);
    transform: translateY(-2px);
}

/* ── Blog Grid ──────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.blog-list { list-style: none; padding-left: 0; margin-top: 0; }
.blog-list .blog-post { list-style: none; margin-bottom: 0; }

.blog-card-link {
    display: block;
    height: 100%;
    padding: 1.25rem;
}

.blog-post .content-box.blog-link {
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
    text-decoration: none;
    border-bottom: none !important;
    border-radius: var(--radius-md);
}

.blog-post.featured .content-box.blog-link {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05), rgba(255, 255, 255, 0.7));
    border-color: rgba(5, 150, 105, 0.2);
    box-shadow:
        inset 3px 0 0 0 rgba(5, 150, 105, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 4px 16px rgba(5, 150, 105, 0.06);
    position: relative;
}

/* "Featured" pill removed per request; keep the green-tinted card style. */
.blog-post.featured .content-box.blog-link::after { content: none; }

.blog-post.featured .blog-title {
    color: var(--heading-color);
}

.blog-post.featured .content-box.blog-link:hover {
    transform: translateY(-3px);
    border-color: rgba(5, 150, 105, 0.35);
    box-shadow:
        inset 3px 0 0 0 rgba(5, 150, 105, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 10px 28px rgba(5, 150, 105, 0.1);
}

.blog-post .content-box.blog-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    background: var(--glass-hover-bg);
}

.blog-title {
    font-weight: 600;
    color: var(--link-color);
    display: block;
    margin-bottom: 0.3rem;
}

.blog-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-color);
    margin-bottom: 0.6rem;
    opacity: 0.8;
}

.blog-excerpt {
    font-size: 0.87rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.75;
}

.section-cta { text-align: center; margin-top: 2rem; }

@media (max-width: 640px) {
    #latest-blogs .blog-grid { grid-template-columns: 1fr; gap: 0.85rem; }
    #latest-blogs .blog-card-link { padding: 1rem; }
    #latest-blogs .blog-title { font-size: 1rem !important; line-height: 1.35; }
    #latest-blogs .blog-meta { font-size: 0.7rem; }
    #latest-blogs .blog-excerpt { font-size: 0.84rem; line-height: 1.52; }
}

/* ── Contact Section ────────────────────────── */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    margin-top: 2rem;
    align-items: start;
}

.contact-intro p { font-size: 1rem; color: var(--text-color); margin-bottom: 2rem; opacity: 0.85; }
.contact-meta { display: flex; flex-direction: column; gap: 1rem; }

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: none !important;
    transition: color 0.2s ease;
}

.contact-item:hover { color: var(--link-color); background: none !important; }
.contact-item svg { width: 20px; height: 20px; fill: currentColor; }

.contact-social-row { display: flex; gap: 1rem; margin-top: 0.5rem; }

/* Glass Form */
.contact-form { width: 100%; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.modern-input, .modern-textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(180, 195, 220, 0.35);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
}

.modern-input::placeholder, .modern-textarea::placeholder {
    color: var(--accent-color);
    opacity: 0.6;
    font-family: var(--font-mono);
    font-size: 0.83rem;
}

.modern-input:focus, .modern-textarea:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.4);
    background: rgba(255,255,255,0.95);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.modern-textarea { min-height: 140px; resize: vertical; margin-bottom: 1.2rem; }

.submit-btn {
    background: rgba(17, 17, 21, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.85rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: 0.5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.18),
        0 6px 20px rgba(0, 0, 0, 0.08);
}

.submit-btn:hover {
    background: rgba(0, 0, 0, 0.94);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 4px 14px rgba(0, 0, 0, 0.24),
        0 10px 28px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (max-width: 768px) {
    .contact-wrapper { grid-template-columns: 1fr; gap: 2.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .form-actions { flex-direction: column; align-items: stretch; }
    .form-actions .submit-btn { justify-content: center; width: 100%; }
}

/* Visit counter removed; keep a hard hide for any stale chip nodes. */
.visit-chip { display: none !important; }

/* Compute info removed site-wide per request. Hard-hide any stale
   markup that might still exist in cached pages. */
.compute-info { display: none !important; }

/* ── Footer ─────────────────────────────────── */
footer {
    margin-top: 3rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 1.5rem;
    font-size: 0.83rem;
    color: var(--accent-color);
    text-align: center;
}

footer .signature-name {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #0b0b10, #059669);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* ── Scroll Progress Bar ────────────────────── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: var(--heading-color);
    z-index: 10000;
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
}

/* Section indicator removed - replaced by .nav-dock */
.section-indicator { display: none !important; }

/* ── Floating Nav Dock - Apple Liquid Glass ─────────────────
   Stacked material:
     • base: heavy backdrop blur + saturation gives the "frosted lens"
       through which the page shows
     • inner highlight: top-edge specular ring (the light catching a
       glass dome)
     • inset bottom shadow: subtle depth so it sits on the page
     • exterior shadow: floating ambient drop */
.nav-dock {
    position: fixed;
    bottom: calc(1.4rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translate3d(0, 16px, 0) scale(0.96);
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem;
    isolation: isolate; /* contain pseudo-element blend modes */
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(24px) saturate(220%) brightness(1.04);
    -webkit-backdrop-filter: blur(24px) saturate(220%) brightness(1.04);
    box-shadow:
        /* outer ambient depth */
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 22px 60px rgba(0, 0, 0, 0.1),
        /* outline glow */
        0 0 0 0.5px rgba(255, 255, 255, 0.7),
        /* internal layering: top specular + bottom shadow */
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(255, 255, 255, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.45s var(--ease-smooth),
        transform 0.55s var(--ease-spring),
        background-color 0.3s var(--ease-smooth),
        box-shadow 0.3s var(--ease-smooth);
    will-change: opacity, transform;
}

/* Specular top sheen - thin curved light catch like a polished glass tube */
.nav-dock::before {
    content: "";
    position: absolute;
    inset: 1px 1px auto 1px;
    height: 45%;
    border-radius: var(--radius-pill) var(--radius-pill) 50% 50% / var(--radius-pill) var(--radius-pill) 100% 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.1) 75%, transparent);
    pointer-events: none;
    opacity: 0.55;
    z-index: -1;
}

/* Soft inner glow + a hint of refraction across the lower half */
.nav-dock::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,0.5), transparent 60%),
        radial-gradient(120% 80% at 50% 120%, rgba(255,255,255,0.18), transparent 60%);
    pointer-events: none;
    z-index: -1;
}

.nav-dock.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translate3d(0, 0, 0) scale(1);
}

@media (hover: hover) {
    .nav-dock:hover {
        background: rgba(255, 255, 255, 0.18);
        border-color: rgba(0, 0, 0, 0.14);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.65),
            inset 0 -1px 0 rgba(0, 0, 0, 0.06),
            0 6px 20px rgba(0, 0, 0, 0.07),
            0 24px 56px rgba(0, 0, 0, 0.06);
    }
}

.nav-dock-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: none;
    transition:
        background-color 0.22s var(--ease-smooth),
        color 0.22s var(--ease-smooth),
        transform 0.22s var(--ease-spring),
        box-shadow 0.22s var(--ease-smooth);
    white-space: nowrap;
    position: relative;
}

.nav-dock-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke: currentColor;
    transition: transform 0.22s var(--ease-spring);
}

.nav-dock-item:hover {
    background: rgba(255, 255, 255, 0.55);
    color: var(--heading-color);
    border-bottom: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-dock-item:hover svg {
    transform: scale(1.08);
}

.nav-dock-item:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}

.nav-dock-item.active {
    background: var(--heading-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.nav-dock-item.active:hover {
    background: #000;
    color: #fff;
    transform: translateY(-1px);
}

.nav-dock-divider {
    width: 1px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 0.2rem;
    flex-shrink: 0;
}

/* Spotlight trigger in dock */
.nav-dock-search {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-color);
}

.nav-dock-search .nav-dock-shortcut {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.32rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.08);
    color: var(--accent-color);
    letter-spacing: 0.5px;
    margin-left: 0.1rem;
}

/* ── Figure explainer paragraphs (after research figures) ─── */
.figure-explainer {
    margin: -0.6rem 0 2rem;
    padding: 1rem 1.2rem;
    border-left: 3px solid;
    border-image: linear-gradient(180deg, #10b981, #0ea5e9, #6366f1) 1;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.04), rgba(99, 102, 241, 0.02));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-color);
}

/* ── Image load-in (smooth, no layout jump) ─────────────────
   Strategy:
   1. Each <img> sits on a soft skeleton-gradient background while the
      pixels are still arriving. The size of the image is reserved by
      its width/height attrs, so nothing shifts when bytes land.
   2. The image fades in via opacity + scale + unblur. No vertical
      translate, so neighbouring content never visibly jumps.
   3. Hover (desktop only) lifts content images with a gentle scale
      and a soft shadow. Icons / dock / profile / timeline logos are
      exempt. */

img:not(.profile-img):not([data-no-anim]) {
    background:
        linear-gradient(135deg, rgba(15,23,42,0.04) 25%, rgba(15,23,42,0.08) 50%, rgba(15,23,42,0.04) 75%);
    background-size: 200% 200%;
    background-position: 0 0;
}

@keyframes imgFadeIn {
    0%   { opacity: 0; transform: scale(0.985); filter: blur(6px); }
    60%  { opacity: 0.9; }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes imgSkeleton {
    0%   { background-position: 0 50%; }
    100% { background-position: 200% 50%; }
}

img:not(.profile-img):not([data-no-anim]) {
    animation:
        imgFadeIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both,
        imgSkeleton 2.2s linear infinite;
    transition:
        transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
        filter 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Icons + dock + featured-card icons + timeline logos + profile = never animate */
.nav-dock img, .icon-link img, .featured-icon img,
.timeline-logo-placeholder img, .profile-img {
    animation: none;
    opacity: 1;
    background: none;
}

/* Once loaded the skeleton stops. JS adds .img-loaded after the load
   event so the looping pulse can be parked. */
img.img-loaded {
    animation: imgFadeIn 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
    background: none;
}

/* Hover on content images: gentle lift, brighter, soft shadow.
   Targets images inside article/section bodies (not the dock, icons,
   featured-card thumbnails, timeline logos, or the profile photo). */
@media (hover: hover) {
    article img:not(.profile-img):not(.no-hover),
    section img:not(.profile-img):not(.no-hover):not(.nav-dock img):not(.icon-link img):not(.featured-icon img):not(.timeline-logo-placeholder img) {
        cursor: zoom-in;
    }
    article img:not(.profile-img):not(.no-hover):hover,
    section img:not(.profile-img):not(.no-hover):not(.nav-dock img):not(.icon-link img):not(.featured-icon img):not(.timeline-logo-placeholder img):hover {
        transform: scale(1.012);
        filter: brightness(1.04) saturate(1.06);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    img { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ── Image Lightbox ─────────────────────────── */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(8, 10, 18, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s var(--ease-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    user-select: none;
}
.lightbox-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.lightbox-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    transform: scale(0.96);
    transition: transform 0.32s var(--ease-spring);
}
.lightbox-overlay.visible .lightbox-figure {
    transform: scale(1);
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.06);
    cursor: zoom-in;
    transition: transform 0.18s ease-out;
    will-change: transform;
    background: #0c1320;
}
.lightbox-caption {
    color: rgba(255, 255, 255, 0.78);
    font-family: var(--font-main);
    font-size: 0.92rem;
    text-align: center;
    max-width: 80ch;
    line-height: 1.5;
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s var(--ease-smooth), transform 0.18s var(--ease-spring), border-color 0.18s var(--ease-smooth);
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.08);
}
.lightbox-close:active { transform: scale(0.92); }

/* ── Spotlight Search Modal ────────────────── */
.spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 15, 25, 0.35);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s var(--ease-smooth);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12vh 1rem 1rem;
}

.spotlight-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.spotlight {
    width: 100%;
    max-width: 560px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    transition:
        transform 0.32s var(--ease-spring),
        opacity 0.22s var(--ease-smooth);
}

.spotlight-overlay.visible .spotlight {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.spotlight-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.spotlight-icon {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.spotlight-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-color);
    padding: 0.2rem 0;
}

.spotlight-input::placeholder {
    color: var(--accent-color);
    opacity: 0.6;
}

.spotlight-hint,
.spotlight-footer kbd {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.14rem 0.42rem;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.spotlight-results {
    list-style: none;
    padding: 0.35rem;
    margin: 0;
    max-height: 50vh;
    overflow-y: auto;
}

.spotlight-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.12s var(--ease-smooth);
    color: var(--text-color);
}

.spotlight-item.active {
    background: rgba(5, 150, 105, 0.1);
}

.spotlight-item-main {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    flex: 1;
    min-width: 0;
}

.spotlight-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--heading-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-item-desc {
    font-size: 0.78rem;
    color: var(--accent-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spotlight-item-group {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent-color);
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.spotlight-item.active .spotlight-item-group {
    color: var(--link-color);
    background: rgba(5, 150, 105, 0.12);
}

.spotlight-empty {
    list-style: none;
    padding: 1.4rem 1rem;
    text-align: center;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.spotlight-footer {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 1.1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.02);
    font-size: 0.72rem;
    color: var(--accent-color);
}

.spotlight-footer span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@media (max-width: 640px) {
    .spotlight-overlay { padding-top: 8vh; }
    .spotlight-input { font-size: 16px; }
    .nav-dock-search .nav-dock-shortcut { display: none; }
}

@media (max-width: 700px) {
    .nav-dock {
        bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
        padding: 0.4rem;
        gap: 0.15rem;
        max-width: calc(100vw - 1rem);
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
        scroll-behavior: smooth;
        overscroll-behavior-x: contain;
    }
    .nav-dock::-webkit-scrollbar { display: none; }

    .nav-dock-item {
        padding: 0.55rem 0.85rem;
        font-size: 0.74rem;
        min-height: 44px;            /* WCAG touch target */
        min-width: 44px;
        flex-shrink: 0;
        scroll-snap-align: center;
        justify-content: center;
    }
    .nav-dock-item .nav-dock-label { display: none; }
    .nav-dock-item svg { width: 20px; height: 20px; }
    .nav-dock-divider { display: none; }

    /* Make search a slightly emphasised pill on mobile so it's always
       findable even when the dock has been scrolled. */
    .nav-dock-search {
        background: rgba(16, 185, 129, 0.12);
        border: 1px solid rgba(16, 185, 129, 0.3);
        position: sticky;
        left: 0;
        z-index: 1;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .nav-dock-search .nav-dock-shortcut { display: none; }

    /* Active item: small green dot under the icon instead of the dark pill
       (the pill is too heavy at this size). */
    .nav-dock-item.active {
        background: rgba(16, 185, 129, 0.18);
        color: var(--heading-color);
        box-shadow: inset 0 -2px 0 0 #10b981;
    }
    .nav-dock-item.active:hover { background: rgba(16, 185, 129, 0.24); color: var(--heading-color); }
}

/* Tiny phones: tighter still */
@media (max-width: 380px) {
    .nav-dock {
        bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px));
        gap: 0.05rem;
        padding: 0.3rem;
    }
    .nav-dock-item {
        padding: 0.5rem 0.65rem;
        min-width: 40px;
        min-height: 40px;
    }
    .nav-dock-item svg { width: 18px; height: 18px; }
}


/* ── Misc legacy ────────────────────────────── */
.summit-stat {
    display: inline-block;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.6);
    padding: 1.5rem 2rem;
    margin: 0.5rem 0.5rem 0.5rem 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    min-width: 150px;
    text-align: center;
    /* backdrop-filter removed for scroll perf */
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.summit-stat .number { font-size: 1.8rem; font-weight: bold; color: var(--link-color); display: block; margin-bottom: 0.3rem; }
.summit-stat .label { font-size: 0.85rem; color: var(--accent-color); text-transform: uppercase; letter-spacing: 0.5px; }

.highlight-box {
    background: rgba(255,255,255,0.35);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px var(--glass-shadow), inset 3px 0 0 0 rgba(5, 150, 105, 0.2);
    /* backdrop-filter removed for scroll perf */
}

.achievement-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin: 2rem 0; }

.project-card-link { text-decoration: none; color: inherit; display: block; }
.project-card {
    background: var(--glass-bg);
    /* backdrop-filter removed for scroll perf */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
    box-shadow: 0 4px 15px var(--glass-shadow);
}

.project-card:hover {
    transform: translateY(-3px);
    background: var(--glass-hover-bg);
    border-color: var(--glass-hover-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.project-card h3 { margin: 0; font-size: 1.25rem; color: var(--heading-color); line-height: 1.3; }
.project-card p { font-size: 0.95rem; opacity: 0.8; margin: 0; line-height: 1.5; }
.project-card .card-footer { margin-top: auto; display: flex; justify-content: flex-end; font-family: var(--font-mono); font-size: 0.8rem; color: var(--link-color); font-weight: 600; }
.project-card .card-footer::after { content: ' →'; transition: transform 0.25s var(--ease-smooth); }
.project-card-link:hover .card-footer::after { transform: translateX(5px); }

.achievement-card {
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    /* backdrop-filter removed for scroll perf */
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.connection-badge {
    display: inline-block;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--heading-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-family: var(--font-mono);
    margin: 0.3rem 0.3rem 0.3rem 0;
}

.project-img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    transition: transform var(--transition-base), border-color var(--transition-base), color var(--transition-base), background-color var(--transition-base);
    cursor: zoom-in;
    display: block;
}

.project-img-large {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    margin: 2rem auto;
    display: block;
    box-shadow: 0 12px 48px rgba(5, 150, 105, 0.08);
}

.featured-image {
    margin: 3rem 0;
    text-align: center;
}

.caption {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-top: 1rem;
    font-style: italic;
}

.project-img:hover {
    transform: scale(1.04);
    box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

.project-visual-container { flex: 0 0 300px; max-width: 100%; }

mark, .highlight {
    background: var(--mark-bg);
    color: var(--mark-text);
    padding: 0.08em 0.3em;
    border-radius: 0.25rem;
}

.header-icon, .header-icon-link { display: none; }
.contact-icons { display: flex; gap: 1.5rem; margin-top: 1.5rem; }
.contact-icon { width: 32px; height: 32px; fill: var(--text-color); }

.hero-highlights {
    margin: 1.3rem auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    max-width: 780px;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(5, 150, 105, 0.2);
    border-radius: 999px;
    padding: 0.36rem 0.82rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-color);
    background: rgba(5, 150, 105, 0.06);
}

.hero-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--secondary-accent); }

.links { margin-top: 10px; font-size: 0.95rem; display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); }
.links a { color: var(--link-color); text-decoration: none; border-bottom: none; }
.links a:hover { text-decoration: underline; background: transparent; }

.logos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 2.5rem; margin-top: 2rem; align-items: center; justify-items: center; }
.logo-card { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; transition: transform 0.3s var(--ease-smooth); }
.logo-card:hover { transform: scale(1.08); }
.logo-container { width: 120px; height: 120px; display: flex; align-items: center; justify-content: center; }
.logo-container img { width: 100%; height: 100%; object-fit: contain; }
.logo-label { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent-color); text-align: center; font-weight: 600; margin: 0; }

@media (max-width: 640px) {
    .logos-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 2rem; }
    .logo-container { width: 100px; height: 100px; }
}

.reveal-on-load { animation: revealSlideUp 0.5s var(--ease-smooth) both; }
@keyframes revealSlideUp { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }

/* ── Hide Theme Toggle ──────────────────────── */
.theme-toggle-container, .theme-toggle, #themeToggle { display: none !important; }

/* ═══════════════════════════════════════════════
   RESPONSIVE - Every Device
   ═══════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 768px) {
    body { padding: 2rem 1.2rem; font-size: 16px; }
    .btn-offset { margin-left: 0; }
}

/* Mobile */
@media (max-width: 640px) {
    body { padding: 1.5rem 1rem; font-size: 15px; }
    body.home header { border-radius: var(--radius-lg); padding: 2rem 1.2rem; }
    section { border-radius: var(--radius-md); padding: 1.5rem; margin: 1.5rem 0; }
    .tag { font-size: 0.7rem; padding: 2px 7px; }
    .hero-highlights { gap: 0.5rem; }
    .hero-chip { font-size: 0.7rem; padding: 0.3rem 0.72rem; }
    .contact-social-row { flex-wrap: wrap; gap: 0.65rem; }
    .timestamp { font-size: 0.8rem; display: block; margin-bottom: 0.3rem; }
    .header-links { gap: 0.8rem; }
}

/* Small phones */
@media (max-width: 375px) {
    body { padding: 1.2rem 0.8rem; }
    h1 { font-size: 1.6rem; }
    body.home header { padding: 1.8rem 1rem; }
    section { padding: 1.3rem; }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    a:not(.icon-link):not(.blog-link) { min-height: 44px; display: inline-flex; align-items: center; }
    .btn-pill { min-height: 44px; }
    .featured-card { min-height: 72px; }
}

/* Large screens */
@media (min-width: 1200px) {
    body.home { max-width: 1020px; }
}

/* ═══════════════════════════════════════════════
   ESSAY MODE - minimal prose pages
   Opt in by adding class="essay" to <article>.
   A clean serif-reading "paper" surface laid over
   the site's gradient mesh. Site identity stays
   intact at header/footer; the prose itself
   becomes the focus.
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600;8..60,700&display=swap');

article.essay {
    max-width: 680px;
    margin: 0 auto;
    background: #fbfaf7;
    border: 1px solid rgba(120, 140, 175, 0.18);
    border-radius: var(--radius-lg);
    padding: clamp(2rem, 4.5vw, 3.5rem) clamp(1.6rem, 4vw, 3rem);
    box-shadow:
        0 1px 2px rgba(0, 20, 60, 0.04),
        0 16px 60px rgba(0, 30, 80, 0.06);
    font-family: "Source Serif 4", "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
    font-feature-settings: "kern", "liga", "onum";
}

article.essay section,
article.essay section:hover {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    border-radius: 0;
}

article.essay section + section {
    padding-top: 2.25rem;
    border-top: 1px solid rgba(120, 140, 175, 0.22);
}

article.essay section h2 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--link-color);
    background: none;
    -webkit-text-fill-color: var(--link-color);
    padding-bottom: 0;
    margin-bottom: 1.3rem;
    border-bottom: none;
}

article.essay section h2::after { display: none; }

article.essay p {
    font-family: "Source Serif 4", "Iowan Old Style", "Charter", Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.7;
    margin-bottom: 1.3rem;
    color: #1d1d1f;
    font-weight: 400;
}

/* Inline-bold lede - the substack-style prompt-then-prose */
article.essay p > strong:first-child {
    font-weight: 700;
    color: #000;
    font-size: 1.06em;
    letter-spacing: -0.005em;
    margin-right: 0.2em;
}

article.essay em {
    font-style: italic;
    color: #1d1d1f;
}

article.essay ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

article.essay ul li {
    padding-left: 1.4rem;
    position: relative;
    margin-bottom: 0.9rem;
    line-height: 1.75;
}

article.essay ul li::marker { content: none; }
article.essay ul li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: 500;
}

article.essay ul li b,
article.essay ul li strong {
    color: var(--heading-color);
    font-weight: 700;
}

/* Figures in essay mode - light frame, italic caption below */
article.essay .figure-frame {
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin: 2.5rem 0;
}

article.essay .figure-frame img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}

article.essay .figure-frame figcaption {
    background: transparent;
    color: var(--accent-color);
    font-size: 0.86rem;
    text-align: left;
    padding: 0.65rem 0.1rem 0 0.1rem;
    border-top: none;
    font-style: italic;
    line-height: 1.55;
}

/* Observation cards become a quiet inline list with a thin accent rule */
article.essay .obs-grid {
    display: block;
    margin: 1.4rem 0;
}

article.essay .obs-card {
    background: transparent;
    border: none;
    border-left: 2px solid var(--link-color);
    border-radius: 0;
    padding: 0.15rem 0 0.15rem 0.95rem;
    margin-bottom: 0.95rem;
}

article.essay .obs-card .obs-label {
    color: var(--link-color);
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
}

article.essay .obs-card .obs-value {
    font-size: 0.96rem;
    line-height: 1.65;
}

/* Content-box callouts flatten to a single-line accent rule */
article.essay .content-box {
    background: transparent;
    border: none;
    border-left: 2px solid var(--accent-color);
    border-radius: 0;
    padding: 0.15rem 0 0.15rem 0.95rem;
    box-shadow: none;
    margin: 1.6rem 0;
    font-size: 0.97rem;
}

/* Print */
@media print {
    .scroll-progress, .nav-dock, .dot-grid-canvas, .bg-mesh { display: none !important; }
    body { background: white; }
    section { background: white; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; transition: none; }
}

/* Balance padding on subpages */
@media (min-width: 641px) {
    body:not(.home) header {
        padding-left: clamp(1rem, 2.5vw, 2rem);
        padding-right: clamp(1rem, 2.5vw, 2rem);
    }
    body:not(.home) header h1,
    body:not(.home) header .subtitle,
    body:not(.home) header .header-links {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }
}
