
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Legacy light-theme tokens (kept for compatibility; override in page <style> if needed) */
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --background-color: #f3f4f6;
    --surface-color: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;

    /* Canonical dark-theme tokens — used by most of this stylesheet.
       Pages may override any of these in a local <style> block. */
    --nav-h: 64px;
    --bg-base: #080c14;
    --bg-surface: #0f1623;
    --bg-card: #121a29;
    --accent: #00d4ff;
    --accent-dim: rgba(0, 212, 255, 0.08);
    --accent-glow: rgba(0, 212, 255, 0.18);
    --green: #00e5a0;
    --purple: #845ec2;
    --border: #1f2937;
    --border-color: #1f2937;
    --border-hover: rgba(0, 212, 255, 0.35);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #7a8ba0;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
    --transition: 0.2s ease;
    --radius: 8px;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

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

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

body {
    background-color: var(--background-color);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Navbar Enhancements */
.navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.skip-link:focus { top: 1rem; }

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Header Gradient & Hero Section */
header.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    padding: 6rem 0;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0% 100%);
}

header h1 {
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
}
.hero-name {
    font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 700; line-height: 1.05;
    letter-spacing: -0.03em; color: var(--text-primary);
    margin-bottom: 1.25rem;
}
.hero-name::after {
    content: '_';
    color: var(--accent);
    animation: blink 1.2s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Card Styles */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.btn-hero.primary {
    background: var(--accent); color: var(--bg-base);
    box-shadow: var(--accent-glow);
}
.btn-hero.primary:hover { background: #22ddff; box-shadow: 0 0 30px rgba(0,212,255,0.4); transform: translateY(-1px); }
.btn-hero.outline {
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border-hover);
}
.btn-hero.outline:hover { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.btn-sm-hero { padding: 0.5rem 1rem; font-size: 0.8rem; }

.hover-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--border-color-hover);
}

.card-title {
    font-weight: 600;
    color: var(--text-primary);
}

.card-text {
    color: var(--text-secondary);
}

.badge {
    font-weight: 500;
    padding: 0.5em 0.8em;
    border-radius: 9999px;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1e40af;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Modal Improvements */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 1.5rem 1rem;
}

.modal-title {
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-primary);
}

#readmeModalBody img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
}
.title-accent { color: var(--accent); font-family: var(--font-mono); margin-right: 0.4rem; }
.section-sub { color: var(--text-secondary); margin-bottom: 2.5rem; font-size: 0.95rem; }

/* Markdown specific styles inside modal */
#readmeModalBody h1, #readmeModalBody h2, #readmeModalBody h3 {
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#readmeModalBody h1 {
    font-size: 2.25rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

#readmeModalBody h2 {
    font-size: 1.875rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

#readmeModalBody a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

#readmeModalBody a:hover {
    text-decoration: underline;
}

#readmeModalBody pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

#readmeModalBody code {
    background: #f1f5f9;
    color: #db2777;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

#readmeModalBody pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}
.analytics-hdr .section-title { margin-bottom: 0.2rem; }
.tm-wrap { border-radius: var(--radius-lg); overflow: hidden; line-height: 0; }

/* ─── PROJECT GRID ─── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
/* Override dashboard.js Bootstrap col injection — do NOT use all:unset (resets display to inline) */
.project-grid > .col { display: block !important; min-width: 0; padding: 0; }
/* Cards created by dashboard.js get .card class */
.project-grid .card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.5rem !important;
    transition: border-color var(--transition), transform var(--transition), background var(--transition) !important;
    box-shadow: none !important;
}
.project-grid .card:hover,
.project-grid .hover-card:hover {
    border-color: var(--border-hover) !important;
    background: var(--bg-card-hover) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.08) !important;
}
.project-grid .card-title { color: var(--accent) !important; font-weight: 600 !important; }
.project-grid .card-text { color: var(--text-secondary) !important; font-size: 0.9rem !important; }
.project-grid .badge { background: var(--accent-dim) !important; color: var(--accent) !important; border: 1px solid var(--border-hover) !important; font-size: 0.75rem !important; }
.project-grid .btn-outline-primary {
    color: var(--accent) !important; border-color: var(--border-hover) !important;
    background: transparent !important; font-size: 0.8rem !important;
}
.project-grid .btn-outline-primary:hover { background: var(--accent-dim) !important; }
.project-grid .btn-dark {
    background: var(--bg-base) !important; border-color: var(--border) !important;
    color: var(--text-secondary) !important; font-size: 0.8rem !important;
}
.project-grid .btn-dark:hover { border-color: var(--border-hover) !important; color: var(--text-primary) !important; }
.project-grid .text-warning { color: #f5c542 !important; }
.project-grid .text-muted { color: var(--text-muted) !important; }

/* Loading ring */
.grid-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 4rem 0; }
.loading-ring {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── MODAL ─── */
.modal-dark { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); }
.modal-dark-header { background: var(--bg-surface); border-color: var(--border); color: var(--text-primary); }
.modal-dark-body { background: var(--bg-card); color: var(--text-primary); }
.modal-dark-body h1 { font-size: 1.8rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-top: 1.5rem; }
.modal-dark-body h2 { font-size: 1.5rem; margin-top: 1.5rem; }
.modal-dark-body h3 { font-size: 1.25rem; margin-top: 1.25rem; }
.modal-dark-body pre { background: var(--bg-base); padding: 1rem; border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--border); }
.modal-dark-body code { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); }
.modal-dark-body pre code { color: var(--text-primary); }
.modal-dark-body img { max-width: 100%; border-radius: var(--radius); margin: 0.75rem 0; }
.modal-dark-body a { color: var(--accent); }

/* ─── FOOTER ─── */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
}
.footer-inner {
    max-width: 1440px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem;
}
.footer-brand { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; }
.footer-copy { color: var(--text-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--text-secondary); font-size: 1.1rem; transition: color var(--transition); }
.footer-links a:hover { color: var(--accent); }

/* ─── FADE-IN ANIMATION (kept for dashboard.js .fade-in class) ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.5s ease-out forwards; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        flex-direction: column; align-items: flex-start;
        background: var(--bg-surface); border-top: 1px solid var(--border);
        padding: 1rem 1.5rem; gap: 0.5rem; width: 100%;
        position: absolute; top: var(--nav-h); left: 0; right: 0;
    }
    .stat-item { padding: 0 1.25rem; }
    .stat-divider { height: 28px; }
    .section-block { padding: 3.5rem 1rem; }
    .project-grid { grid-template-columns: 1fr; }
    .footer-inner { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
    .hero-name { font-size: 2.4rem; }
    .stats-inner { gap: 0.5rem; }
    .stat-divider { display: none; }
    .stat-item { padding: 0.5rem 1rem; }
}

/* ─────────────────────────────────────────
   ENHANCED GLOBAL STYLES v2
   ───────────────────────────────────────── */

/* ── SCROLL PROGRESS ── */
#scroll-progress {
    position: fixed; top: 0; left: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
    width: 0%; z-index: 9999; pointer-events: none;
    transition: width 80ms linear;
    will-change: width;
}

/* ── PAGE FADE-IN ── */
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
body { animation: pageEnter 0.45s ease-out both; }

/* ── REVEAL ON SCROLL ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.65s cubic-bezier(.4,0,.2,1), transform 0.65s cubic-bezier(.4,0,.2,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
.reveal-d4 { transition-delay: 0.32s; }

/* ── NAV SCROLLED STATE ── */
.site-nav.scrolled { background: rgba(8,12,20,0.98); box-shadow: 0 1px 20px rgba(0,0,0,0.4); }

/* ── MOBILE NAV ANIMATION ── */
.nav-links.show { animation: navSlide 0.22s ease-out both; }
@keyframes navSlide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ── TERMINAL CARD ── */
.terminal-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    overflow: hidden;
}
.terminal-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.t-dot.r { background: #ff5f57; }
.t-dot.y { background: #febc2e; }
.t-dot.g { background: #28c840; }
.terminal-title { font-size: 0.75rem; color: var(--text-muted); margin-left: 0.25rem; }
.terminal-body { padding: 1.25rem 1.5rem; font-size: 0.8rem; line-height: 2.1; }
.t-line { display: block; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text-primary); }
.t-out { color: var(--green); }
.t-comment { color: var(--text-muted); }
.t-err { color: #ff6b6b; }
.t-cursor { display: inline-block; width: 7px; height: 13px; background: var(--accent); animation: blink 1.2s step-end infinite; vertical-align: text-bottom; }

/* ── ABOUT SECTION ── */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-text h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.about-text p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 1.1rem; font-size: 0.95rem; }
.about-highlights { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.5rem; }
.about-hl { display: flex; align-items: center; gap: 0.65rem; font-size: 0.875rem; color: var(--text-secondary); }
.about-hl i { color: var(--green); width: 16px; flex-shrink: 0; font-size: 0.8rem; }

/* ── FEATURED WORK CARDS ── */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.work-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex; flex-direction: column; gap: 1rem;
    transition: all var(--transition);
    position: relative; overflow: hidden;
    cursor: pointer;
}
.work-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: var(--card-accent, var(--accent));
    opacity: 0; transition: opacity var(--transition);
}
.work-card:hover::before { opacity: 1; }
.work-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,212,255,0.06);
}
.wc-header { display: flex; align-items: flex-start; gap: 1rem; }
.wc-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.wc-meta { flex: 1; min-width: 0; }
.wc-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.2rem; }
.wc-sub { font-size: 0.8rem; color: var(--text-secondary); font-family: var(--font-mono); }
.wc-desc { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; flex: 1; }
.wc-highlights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.wc-highlights li { font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 0.5rem; }
.wc-highlights li::before { content: '→'; color: var(--accent); font-family: var(--font-mono); flex-shrink: 0; font-size: 0.75rem; margin-top: 0.05rem; }
.wc-tech { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tech-pill {
    background: var(--bg-surface); border: 1px solid var(--border);
    color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.75rem;
    padding: 0.2rem 0.55rem; border-radius: 12px;
    transition: color var(--transition), border-color var(--transition);
}
.wc-actions { display: flex; gap: 0.75rem; align-items: center; padding-top: 0.25rem; border-top: 1px solid var(--border); }

/* ── TECH STACK GRID ── */
.stack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 0.85rem; }
.stack-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 1rem 0.5rem;
    text-align: center; font-size: 0.8rem; color: var(--text-secondary);
    transition: all 0.2s; cursor: default;
}
.stack-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,212,255,0.08); }
.stack-item i { display: block; font-size: 1.5rem; margin-bottom: 0.4rem; }
.stack-item span { line-height: 1.25; display: block; }

/* ── FEATURED SECTION CTA ── */
.section-cta { text-align: center; margin-top: 2.5rem; }
.section-cta p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }

/* ── HERO TYPING ── */
#hero-typing { color: var(--accent); font-family: var(--font-mono); font-size: 0.9rem; display: block; margin-top: 0.5rem; height: 1.4em; }
.type-cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent); animation: blink 1.2s step-end infinite; vertical-align: text-bottom; margin-left: 1px; }

/* ── METRICS BAR for pages ── */
.metrics-row { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.metric-chip {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem; color: var(--text-secondary);
}
.metric-chip i { color: var(--accent); }
.metric-chip strong { color: var(--text-primary); font-family: var(--font-mono); }

/* ── BACK-TO-TOP BUTTON ── */
#back-to-top {
    position: fixed; bottom: 90px; right: 2rem; z-index: 500;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--accent); font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; pointer-events: none;
    transition: all var(--transition);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--accent); color: var(--bg-base); transform: translateY(-2px); }

/* ── RESPONSIVE ADDITIONS ── */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; }
    .work-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .stack-grid { grid-template-columns: repeat(4, 1fr); }
    .metrics-row { gap: 0.75rem; }
}

/* ── LAYOUT CONDENSING ── */
.hero-compact { min-height: 72vh; padding-top: calc(var(--nav-h) + 2.5rem); padding-bottom: 3rem; }
.stats-flush { margin-top: 0; }
.section-tight { padding: 2.5rem 0 !important; }
.section-block { padding: 3rem 0; }

/* ── EXPLORE SECTION HEADER ── */
.explore-header .section-title {
    color: #f1f5f9;
    text-shadow: 0 0 40px rgba(0,212,255,0.18);
}
.explore-header .section-sub {
    color: #94a3b8;
    font-size: 1rem;
}

/* ── EXPLORE CARDS ── */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.explore-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.explore-card:hover {
    transform: translateY(-5px);
    border-color: var(--ec-color, var(--accent));
    box-shadow: 0 12px 40px rgba(0,0,0,.3), 0 0 0 1px color-mix(in srgb, var(--ec-color, var(--accent)) 25%, transparent);
    text-decoration: none;
    color: inherit;
}
.ec-preview {
    position: relative;
    height: 100px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--ec-color) 8%, var(--bg-surface)) 0%, var(--bg-surface) 100%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    max-width: 480px;
    width: 100%;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    font-weight: 600;
    padding: 1rem 1.5rem;
    margin-bottom: -2px;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom: 2px solid var(--primary-color);
}

.btn-github {
    background-color: #24292e;
    color: white;
}

.btn-github:hover {
    background-color: #1b1f23;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(36, 41, 46, 0.4);
}

.btn-vault {
    background-color: #000;
    color: white;
}

.btn-vault:hover {
    background-color: #333;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
}

/* Footer Improvements */
footer {
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

/* Featured-work modal (portfolio.js) — styles moved out of inline JS for CSP-friendliness. */
#workModal {
    display: none;
}
#workModal.wm-open {
    display: flex;
}
body.modal-open {
    overflow: hidden;
}
.wm-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.wm-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.wm-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.wm-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.wm-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.75;
    padding-left: 1rem;
    margin: 0;
}
.wm-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}
.wm-section-label:not(:first-of-type) {
    margin-top: 1rem;
}
.wm-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.wm-highlight {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}
.wm-arrow {
    color: var(--accent);
    font-family: var(--font-mono);
    flex-shrink: 0;
}
.wm-tech-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.wm-tech-pill {
    background: var(--accent-dim);
    border: 1px solid var(--accent-glow);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.18rem 0.5rem;
    border-radius: 10px;
}
.wm-footer {
    border-top: 1px solid var(--accent-glow);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.btn-github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--accent);
    color: var(--bg-base);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background var(--transition);
}
.btn-github-link:hover {
    background: color-mix(in srgb, var(--accent) 85%, white);
    color: var(--bg-base);
}
.btn-close-modal {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
}
.btn-close-modal:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}
