/*
========================================
CSS VARIABLES - Easy to customize colors
========================================
*/
:root {
    --bg-primary: #f7f8fc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-soft: #eef2ff;
    --text-primary: #0f172a;
    --text-secondary: #4b5563;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent-dim: #1e40af;
    --border: #e2e8f0;
    --shadow-soft: 0 18px 48px rgba(15, 23, 42, 0.06);
    --gradient-1: #2563eb;
    --gradient-2: #7c3aed;
    --accent-rgb: 37, 99, 235;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background:
        radial-gradient(140% 140% at 15% 10%, rgba(15, 23, 42, 0.02), transparent 40%),
        radial-gradient(140% 140% at 85% 0%, rgba(15, 23, 42, 0.025), transparent 42%),
        linear-gradient(180deg, #f8fafc 0%, #f4f6f9 50%, #f8fafc 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Subtle grain texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.01;
    pointer-events: none;
    z-index: 1000;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

nav.scrolled {
    border-bottom-color: var(--border);
}

.logo {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--text-primary);
}

/* Hero Section */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4.75rem 2.6rem 3.1rem;
    position: relative;
    max-width: 1100px;
    margin: 1.5rem auto;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.hero h1 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(2.6rem, 6.5vw, 4rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.hero-bio {
    font-size: 1.12rem;
    color: var(--text-secondary);
    max-width: 620px;
    line-height: 1.6;
    margin-bottom: 0.4rem;
}

.hero-bio strong {
    color: var(--text-primary);
    font-weight: 500;
}

.hero-bio .accent {
    color: var(--accent);
}

.hero-location {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-location svg {
    width: 16px;
    height: 16px;
}

.hero-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.hero-link:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.hero-link svg {
    width: 16px;
    height: 16px;
}

/* Section styles */
section {
    position: relative;
    padding: 3.25rem 2.75rem;
    max-width: 1100px;
    margin: 2.2rem auto;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
    isolation: isolate;
    scroll-margin-top: 96px;
}

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

section + section {
    margin-top: 2.6rem;
}

.section-title {
    font-family: 'Instrument Serif', serif;
    font-size: 1.85rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--text-primary);
    box-shadow: 0 0 0 8px rgba(15, 23, 42, 0.05);
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.16), rgba(15, 23, 42, 0.08), transparent);
}

/* Featured Project */
.featured-project {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}

.featured-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.featured-project h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.featured-company {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.featured-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.featured-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.highlight-item {
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 8px;
}

.highlight-item h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.highlight-item p {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.project-link:hover {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.project-link svg {
    width: 16px;
    height: 16px;
}

/* Experience Timeline */
.experience-list {
    border-left: 1px solid var(--border);
    padding-left: 1.75rem;
    margin-left: 0.5rem;
}

.experience-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.experience-item:last-child {
    padding-bottom: 0;
}

.experience-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
}

.experience-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.experience-item h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.25rem;
    font-weight: 400;
}

.experience-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.experience-company {
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.experience-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Education */
.education-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.education-item h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.education-item .school {
    color: var(--accent);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.education-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.35rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.project-card h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    font-weight: 400;
}

.project-links {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.project-card-link:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.project-card-link svg {
    width: 16px;
    height: 16px;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-details {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
    padding-left: 1.1rem;
    margin: 0 0 1rem;
    display: grid;
    gap: 0.45rem;
    list-style: disc;
}

.project-details li {
    margin: 0;
}

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

.project-tech span {
    padding: 0.2rem 0.5rem;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Research Section */
.research-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.6rem;
    margin-bottom: 1.1rem;
}

.research-card:last-of-type {
    margin-bottom: 0;
}

.research-card h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.research-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.research-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.65;
}

.research-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.research-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.research-link:hover {
    color: var(--text-primary);
}

.research-link svg {
    width: 14px;
    height: 14px;
}

/* Creative Work */
.creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.creative-item {
    padding: 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.2s ease;
    display: block;
}

.creative-item:hover {
    border-color: var(--text-muted);
}

.creative-item h4 {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.creative-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.creative-item .tag {
    display: inline-block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* About Section */
.about {
    background: var(--bg-secondary);
    padding: 5rem 3rem;
}

.about-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.about-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
}

.about-text h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.4rem;
    font-weight: 400;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.about-text h3:first-child {
    margin-top: 0;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-sidebar h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.about-sidebar h4:first-child {
    margin-top: 0;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    padding: 0.35rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Contact Section */
.contact {
    text-align: center;
    padding: 3.5rem 2.5rem;
}

.contact-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.contact h2 {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(1.9rem, 4.5vw, 2.65rem);
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.contact p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

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

.contact-link svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Footer */
footer {
    padding: 1.5rem 3rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 0.9rem 1.25rem;
    }

    .nav-links {
        display: none;
    }

    section, .hero, .about, .contact {
        padding-left: 1.4rem;
        padding-right: 1.4rem;
    }

    .featured-project {
        padding: 1.5rem;
    }

    .experience-header {
        flex-direction: column;
    }

    .experience-list {
        padding-left: 1.5rem;
    }

    .creative-grid {
        grid-template-columns: 1fr;
    }
}
