:root{
    --bg:#ffffff;
    --muted:#4b5563;
    --card:#ffffff;
    --accent:#0ea5a4; /* modern teal */
    --accent-2:#075e5d; /* deeper accent for headings */
    --heading-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    --soft:#f7fdfd;
    --proj-font: 'Poppins', var(--heading-font), sans-serif;
}

*{box-sizing:border-box}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.site-font{font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial}
.body, body{
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    margin:0;
    background:var(--bg);
    color:#0f1724;
    -webkit-font-smoothing:antialiased;
    font-size:18px; /* slightly refined for balance */
    line-height:1.72;
}
.container{max-width:1100px;margin:56px auto;padding:32px}
.content{max-width:860px;margin:18px auto;padding:0 8px;text-align:left}
.spacer{height:8px}
.hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:56px 28px;border-radius:14px;background:linear-gradient(135deg, rgba(14,165,164,0.04), rgba(14,165,164,0.01));}
.hero-modern{padding:48px 12px}

/* Clean homepage layout tweaks */
.lead{max-width:860px;margin:18px auto 10px;padding:0 8px}
.lead-text{font-size:1.05rem;color:var(--muted);line-height:1.8;margin:0}

.two-column{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start;margin-top:18px}
.two-column .card{padding:20px}
.interest-list{list-style:disc;margin-left:20px;color:var(--muted);padding:0}

.contact-card{max-width:520px;margin:28px auto;padding:18px;border-radius:12px;background:linear-gradient(180deg,rgba(14,165,164,0.03),rgba(255,255,255,0.02));box-shadow:0 8px 20px rgba(14,165,164,0.03);text-align:left}
.contact-row{margin:8px 0}

@media(max-width:880px){
    .two-column{grid-template-columns:1fr;gap:12px}
    .hero-modern{padding:32px 8px}
    .profile-avatar{width:160px;height:160px}
}

/* When About is removed, center the remaining single card */
.single-column{max-width:860px;margin:18px auto;padding:0 8px}
.single-column .card{padding:22px}

/* Improve small-screen hero stacking and centering */
@media(max-width:560px){
    .hero-modern{flex-direction:column;align-items:center;text-align:center;gap:14px}
    .hero-modern > div{width:100%}
    .hero-avatar{order:-1}
    .hero-title{font-size:2.4rem}
    .summary{max-width:100%;font-size:1rem}
    .lead-text{font-size:1rem}
    .cta{display:flex;justify-content:center;gap:10px}
    .profile-avatar{width:140px;height:140px}
}

/* Photo modal / lightbox styles */
.photo-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:1200}
.photo-modal[aria-hidden="false"]{display:flex}
.photo-overlay{position:fixed;inset:0;background:rgba(3,7,18,0.6);backdrop-filter:blur(4px)}
.photo-dialog{position:relative;max-width:92vw;max-height:92vh;padding:12px;border-radius:10px;z-index:1210;display:flex;align-items:center;justify-content:center}
.photo-dialog img{max-width:100%;max-height:80vh;border-radius:8px;box-shadow:0 18px 40px rgba(2,6,23,0.5);transform-origin:center center}
.photo-close{position:absolute;right:8px;top:8px;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.06);color:#fff;border-radius:8px;padding:6px 8px;font-size:16px;cursor:pointer;z-index:1220}

/* make close button more visible on light backgrounds */
@media (prefers-color-scheme: light){
    .photo-close{background:#fff;border:0;color:#0f1724}
}

/* Allow keyboard focus outlines */
.photo-close:focus{outline:3px solid rgba(37,99,235,0.16);outline-offset:3px}
.hero h1, .hero-title{margin:0;font-weight:800;font-size:3.8rem;letter-spacing:-0.6px;font-family:var(--heading-font);color:var(--accent-2)}
.tagline{color:var(--muted);margin-top:10px;font-weight:600}
.summary{color:var(--muted);margin-top:14px;line-height:1.7;max-width:66ch;font-size:1.02rem}
.cta{margin-top:18px}
.btn{display:inline-block;padding:8px 12px;border-radius:999px;background:var(--accent);color:#fff;text-decoration:none;font-weight:600;margin-right:8px;font-size:0.95rem}
.btn.ghost{background:transparent;border:1px solid rgba(16,24,40,0.06);color:var(--muted);padding:7px 10px}
.hero-visual{height:0;display:none}

/* --- New sleek/navigation and research CTA styles --- */
.hero-content{max-width:60ch}

.research-cta{max-width:860px;margin:28px auto;padding:0 8px}
.research-cta .card{display:flex;align-items:center;gap:14px;padding:18px;border-radius:12px;background:linear-gradient(90deg,rgba(14,165,164,0.04),rgba(14,165,164,0.01));border:1px solid rgba(14,165,164,0.06)}
.research-cta h3{margin:0;font-size:1.1rem}
.research-cta .muted{color:var(--muted);margin:0}

/* slightly tighten hero spacing on desktop */
@media(min-width:880px){
    .hero-modern{padding:48px 24px}
    .hero-avatar{flex:0 0 240px}
}

/* Icon styles used in CTAs and contact links */
.icon{display:inline-flex;align-items:center;justify-content:center;margin-right:8px;vertical-align:middle}
.btn .icon{margin-right:8px}
.btn .label{vertical-align:middle}
.contact-link{color:var(--muted);text-decoration:none;display:inline-flex;align-items:center;gap:8px}
.contact-link .icon{margin:0 6px 0 0}

/* Smaller icons inside CTAs */
.btn .icon svg{width:14px;height:14px}
.contact-link .icon svg{width:14px;height:14px}
.contact-link:hover{color:var(--accent)}

.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:32px 0}
.card{background:var(--card);padding:18px;border-radius:12px;box-shadow:0 10px 28px rgba(16,24,40,0.06);transition:transform .18s ease,box-shadow .18s ease;border:1px solid rgba(16,24,40,0.03)}
.card h2{margin-top:0;color:#0f1724}
.card:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(16,24,40,0.06)}
.projects ul{list-style:none;padding-left:0;margin-top:12px}
.projects-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px;margin-top:18px}

/* Ensure project cards align consistently (equal-height cards) */
.projects-grid{align-items:stretch}
.proj-card{display:flex;flex-direction:column;height:100%}
.proj-body{flex:1;display:flex;flex-direction:column;justify-content:space-between}

/* Projects page specifics */
.projects-hero{text-align:center;padding:8px 12px;margin-bottom:6px}
.projects-hero .hero-title{font-size:2.6rem;letter-spacing:-0.6px}
.projects-intro{max-width:860px;margin:0 auto 8px auto;text-align:center}
.projects-hero .summary,
.projects-intro .summary {
    max-width:70ch;
    margin:6px auto 0;
    text-align:center;
}

/* Filter toolbar */
.projects-toolbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:12px auto 14px auto}
.filter-btn{appearance:none;border:0;cursor:pointer;padding:8px 12px;border-radius:999px;background:rgba(14,165,164,0.08);color:#075e5d;font-weight:700;font-size:0.9rem}
.filter-btn:hover{background:rgba(14,165,164,0.12)}
.filter-btn.active{background:var(--accent);color:#fff}
.filter-btn:focus{outline:3px solid rgba(14,165,164,0.14);outline-offset:3px}
.back-link{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(14,165,164,0.06);color:var(--accent);text-decoration:none;font-weight:600;box-shadow:0 6px 18px rgba(14,165,164,0.04);transition:transform .12s ease,box-shadow .12s ease,background .12s ease}
.back-link:hover{transform:translateY(-2px);box-shadow:0 12px 28px rgba(14,165,164,0.08);background:rgba(14,165,164,0.08);color:#075e5d}
.back-link:focus{outline:3px solid rgba(14,165,164,0.12);outline-offset:4px}
.back-link::before{content:'←';display:inline-block;font-size:1rem;line-height:1}

@media(max-width:560px){
    .back-link{padding:6px 10px;font-size:0.95rem}
}

.proj-card{display:block;color:inherit;text-decoration:none;border-radius:0;background:transparent;box-shadow:none;transition:none;padding:0;overflow:visible;border:0}
.proj-card .proj-body{padding:16px 18px;margin:4px 0;border:1px solid rgba(16,24,40,0.06);background:linear-gradient(135deg,rgba(14,165,164,0.035),rgba(14,165,164,0.01));border-radius:14px;display:flex;align-items:flex-start;gap:14px;position:relative;transition:background .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease}
.proj-card .proj-body::before{content:'';position:absolute;inset:0;border-radius:14px;padding:1px;background:linear-gradient(120deg,rgba(14,165,164,0.38),rgba(14,165,164,0.12));-webkit-mask:linear-gradient(#fff 0 0,#fff 100%);mask:linear-gradient(#fff 0 0,#fff 100%);opacity:0;transition:opacity .25s ease}
.proj-card:hover .proj-body{background:linear-gradient(135deg,rgba(14,165,164,0.09),rgba(14,165,164,0.02));border-color:rgba(14,165,164,0.28);box-shadow:0 8px 26px -4px rgba(14,165,164,0.18),0 4px 12px -2px rgba(14,165,164,0.12);transform:translateY(-3px)}
.proj-card:hover .proj-body::before{opacity:1}
.proj-card h3{margin:0;font-family:var(--heading-font);font-size:1.02rem;font-weight:700;color:#0f1724}
.proj-card p{margin:0;color:var(--muted);font-size:0.95rem}
.proj-card:hover{background:rgba(14,165,164,0.02)}

/* Small GitHub icon next to titles */
.gh-icon{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;color:var(--muted);opacity:0.9}
.gh-icon svg{width:14px;height:14px;vertical-align:middle}
.proj-card:hover .gh-icon{color:var(--accent);opacity:1}

/* Featured projects block */
.projects-featured{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin:8px 0 16px}
.featured-card{display:block;padding:14px 16px;border-radius:12px;background:linear-gradient(90deg,rgba(14,165,164,0.05),rgba(14,165,164,0.02));border:1px solid rgba(14,165,164,0.08);text-decoration:none;color:inherit}
.featured-card h3{margin:0 0 6px 0;font-family:var(--heading-font);font-size:1.06rem;color:#0f1724}
.featured-card h3 .tech-tag{margin-left:8px;top:0}
.featured-card p{margin:0;color:var(--muted);font-size:0.95rem}
.featured-card:hover{background:rgba(14,165,164,0.08);border-color:rgba(14,165,164,0.14)}

/* Clamp descriptions to two lines for uniform rows */
.proj-card p,
.featured-card p{
    display:-webkit-box;
    line-clamp:2;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

@media(max-width:560px){
    .projects-hero .hero-title{font-size:1.9rem}
}

/* Simple, academic project list (no thumbnails, no OG cards) */
.project-list{list-style:none;padding-left:0;margin-top:14px;display:flex;flex-direction:column;gap:12px}
.project-entry{background:var(--card);padding:16px;border-radius:10px;box-shadow:0 6px 18px rgba(16,24,40,0.04)}
.project-entry h3{margin:0 0 6px 0;font-family:var(--heading-font);font-size:1.12rem;font-weight:700;letter-spacing:0.2px}
.project-entry p{margin:0 0 8px 0;color:var(--muted)}
.project-entry .paper-meta{font-size:0.9rem;color:var(--muted)}
.project-entry a{color:var(--accent);text-decoration:none;font-family:var(--heading-font);font-weight:700;letter-spacing:0.2px;font-size:1.05rem}
.project-entry a:hover{text-decoration:none;}
.project-entry{display:flex;align-items:center;justify-content:space-between}
.project-entry::before{content:'';width:6px;height:6px;border-radius:999px;background:var(--accent);margin-right:12px;flex:0 0 auto}
.project-entry:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(16,24,40,0.06)}

/* Project page title styling (distinct font and visual emphasis) */
.hero:not(.hero-modern) h1{font-family:var(--proj-font);font-weight:700;color:var(--accent);font-size:2.2rem;letter-spacing:0.4px}
.hero:not(.hero-modern) .summary{font-size:1rem;color:var(--muted)}

/* Avatar in hero */
.hero-modern{display:flex;align-items:center;justify-content:space-between}
.hero-avatar{flex:0 0 260px;display:flex;align-items:center;justify-content:center}
.profile-avatar{width:220px;height:220px;border-radius:999px;object-fit:cover;border:4px solid rgba(14,165,164,0.12);box-shadow:0 12px 44px rgba(14,165,164,0.08)}

/* Keep older card classes for backward compatibility but prefer list for projects */
.proj-card-legacy{background:transparent;border-radius:12px;overflow:hidden}
.proj-card-legacy a{display:block;color:inherit;text-decoration:none;border-radius:12px;background:var(--card);box-shadow:0 8px 22px rgba(16,24,40,0.06);transition:transform .22s ease,box-shadow .22s ease}
.proj-card-legacy img{width:100%;height:160px;object-fit:cover;display:block}
.proj-body{padding:14px}
.proj-body h3{margin:0 0 8px 0;font-family:var(--heading-font)}
.proj-body p{margin:0 0 8px 0;color:var(--muted);font-size:0.98rem}
.proj-body .meta{font-size:0.86rem;color:var(--muted)}
.proj-card-legacy a:hover{transform:translateY(-6px);box-shadow:0 18px 40px rgba(16,24,40,0.08)}
.projects a{color:#0f1724;text-decoration:none}

/* Badge */
.badge{display:inline-block;padding:6px 8px;border-radius:999px;font-size:0.75rem;font-weight:700;color:#fff;background:var(--accent);margin-left:8px}
.proj-body .badge{float:right}

/* Lightweight tech tag (e.g., DGL) */
.tech-tag{display:inline-block;vertical-align:middle;margin-left:6px;padding:3px 7px;border-radius:8px;background:rgba(14,165,164,0.14);color:#075e5d;font-size:0.63rem;font-weight:700;letter-spacing:.5px;text-transform:uppercase;line-height:1.1;position:relative;top:-1px}
.proj-card:hover .tech-tag{background:var(--accent);color:#fff}
/* Color variants by data-tag attribute */
.tech-tag[data-tag="dgl"]{background:rgba(14,165,164,0.18);color:#075e5d}
.proj-card:hover .tech-tag[data-tag="dgl"]{background:#0ea5a4;color:#fff}

.tech-tag[data-tag="pyg"]{background:rgba(99,102,241,0.18);color:#3730a3}
.proj-card:hover .tech-tag[data-tag="pyg"]{background:#6366f1;color:#fff}

.tech-tag[data-tag="jax"]{background:rgba(245,158,11,0.22);color:#92400e}
.proj-card:hover .tech-tag[data-tag="jax"]{background:#f59e0b;color:#fff}

.tech-tag[data-tag="rl"]{background:rgba(59,130,246,0.20);color:#1e3a8a}
.proj-card:hover .tech-tag[data-tag="rl"]{background:#3b82f6;color:#fff}

.tech-tag[data-tag="bandits"]{background:rgba(234,88,12,0.24);color:#7c2d12}
.proj-card:hover .tech-tag[data-tag="bandits"]{background:#ea580c;color:#fff}

/* Subtle focus outline */
.tech-tag:focus{outline:2px solid rgba(0,0,0,0.25);outline-offset:2px}

.foot{margin-top:36px;color:var(--muted)}
.site-footer{margin-top:36px;padding-top:12px;border-top:1px solid rgba(16,24,40,0.04);color:var(--muted);font-size:0.9rem}


@media(max-width:880px){
    .hero{grid-template-columns:1fr;}
    .grid{grid-template-columns:1fr}
}

/* Academic-focused adjustments: left-aligned sections and tighter max width */
main{max-width:900px;margin:18px auto}
.card.content{padding:20px}

/* Project list as academic paper entries */
.paper-list{display:flex;flex-direction:column;gap:16px;margin-top:18px}
.paper-entry{display:flex;gap:16px;align-items:flex-start;background:var(--card);padding:14px;border-radius:10px;box-shadow:0 6px 18px rgba(16,24,40,0.04)}
.paper-thumb{width:140px;height:94px;flex:0 0 140px;object-fit:cover;border-radius:6px;background:var(--soft)}
.paper-info{flex:1}
.paper-info h3{margin:0 0 6px 0;font-family:var(--heading-font);font-size:1.15rem}
.paper-info p{margin:0 0 8px 0;color:var(--muted)}
.paper-meta{font-size:0.9rem;color:var(--muted)}
.paper-actions{margin-top:8px}
.paper-actions .btn{padding:8px 12px;font-size:0.95rem}

/* Accessibility: skip-link */
.skip-link{position:absolute;left:12px;top:12px;background:#fff;color:var(--accent);padding:8px 12px;border-radius:8px;box-shadow:0 6px 18px rgba(16,24,40,0.06);transform:translateY(-120%);transition:transform .18s ease}
.skip-link:focus{transform:translateY(0);outline:3px solid rgba(37,99,235,0.16)}

/* Buttons focus */
.btn:focus{outline:3px solid rgba(37,99,235,0.14);outline-offset:4px}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
    .card, .projects li, .hero-visual{transition:none;transform:none}
}
