:root {
    --bg-color: #0d1117;
    --surface-color: rgba(22, 27, 34, 0.7);
    --border-color: rgba(48, 54, 61, 0.8);
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-tint: rgba(88, 166, 255, 0.15);
    --accent-glow: rgba(88, 166, 255, 0.4);
    --nav-bg: rgba(13, 17, 23, 0.8);
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-color);
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Nerdy Grid Background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(to right, rgba(88, 166, 255, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(88, 166, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
    animation: grid-pulse 8s ease-in-out infinite;
}

@keyframes grid-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

.mono {
    font-family: var(--font-mono);
}

::selection {
    background-color: var(--accent-tint);
    color: var(--accent);
}

/* Typography */
h1, h2, h3, h4 {
    color: #f0f6fc;
    font-weight: 700;
}

p {
    color: var(--text-muted);
}

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

a:hover {
    color: #79c0ff;
    text-shadow: 0 0 8px var(--accent-tint);
}

/* Utilities */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(5px);
}

.btn-primary {
    background-color: var(--accent-tint);
    color: var(--accent);
    border-color: var(--accent);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background-color: rgba(88, 166, 255, 0.25);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-main);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

.section-heading {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
}

.section-heading h2 {
    font-size: 28px;
    white-space: nowrap;
    margin-right: 20px;
    color: #f0f6fc;
}

.heading-num {
    color: var(--accent);
    font-size: 20px;
    margin-right: 10px;
}

.section-heading .line {
    height: 1px;
    background-color: var(--border-color);
    flex-grow: 1;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #f0f6fc;
    font-family: var(--font-mono);
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--accent);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li {
    font-size: 13px;
    font-family: var(--font-mono);
}

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

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

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background-color: var(--accent);
    transition: var(--transition);
}

/* Main Content */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

section {
    padding: 60px 0;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section */
.hero {
    position: relative;
    padding-top: 100px;
    min-height: 80vh;
}

.greeting {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 20px;
}

.name {
    font-size: clamp(40px, 8vw, 70px);
    margin-bottom: 10px;
    line-height: 1.1;
    color: #f0f6fc;
    letter-spacing: -1px;
}

.subtitle {
    font-size: clamp(24px, 5vw, 50px);
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.2;
    font-weight: 400;
}

.description {
    max-width: 600px;
    font-size: 18px;
    margin-bottom: 20px;
}

.cta-group {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
}

.about-text p {
    margin-bottom: 15px;
    font-size: 16px;
}

.skills-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 10px;
    list-style: none;
    margin-top: 20px;
}

.skills-list li {
    font-size: 13px;
    color: var(--text-muted);
}

.skills-list li:hover {
    color: var(--accent);
}

.about-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.profile-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    position: relative;
    transition: var(--transition);
    background-color: var(--surface-color);
    filter: grayscale(100%) contrast(1.1);
}

.profile-img:hover {
    filter: grayscale(0%) contrast(1);
    border-color: var(--accent);
}

.about-image-wrapper::after {
    content: "";
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent);
    top: 15px;
    left: 15px;
    border-radius: 4px;
    z-index: -1;
    transition: var(--transition);
}

.about-image-wrapper:hover::after {
    transform: translate(-5px, -5px);
}

/* Projects / Experience Section */
.project-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Details/Summary based Experience Cards */
details.project-card {
    border-left: 2px solid var(--border-color);
    padding: 20px 30px;
    margin-bottom: 20px;
    transition: var(--transition);
    position: relative;
    background: transparent;
}

details.project-card:hover {
    border-left-color: var(--accent);
    background-color: var(--accent-tint);
}

details.project-card summary {
    cursor: pointer;
    list-style: none;
    outline: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

details.project-card summary::after {
    content: '>>';
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 14px;
    opacity: 0.5;
    transition: var(--transition);
}

details.project-card[open] summary::after {
    transform: rotate(90deg);
    opacity: 1;
}

details.project-card .details-content {
    margin-top: 15px;
    padding-left: 20px;
    color: var(--text-muted);
}

details.project-card .details-content ul {
    list-style: none;
}

details.project-card .details-content li {
    margin-bottom: 12px;
    font-size: 14px;
    position: relative;
}

details.project-card .details-content li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: -20px;
}

/* Static Cards for Publications */
div.project-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px 32px;
    transition: var(--transition);
    position: relative;
    backdrop-filter: blur(10px);
}

div.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.publication-link {
    color: inherit;
    text-decoration: none;
}

.project-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    text-align: left;
}

.project-title {
    font-size: 18px;
    color: #f0f6fc;
    font-weight: 600;
}

.project-overline {
    color: var(--accent);
    font-size: 13px;
}

/* Contact Section */
.contact {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Executive Summary Box */
.executive-summary {
    margin-bottom: 60px;
    background: var(--accent-tint);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--accent);
    backdrop-filter: blur(10px);
}

.executive-summary p {
    color: var(--accent);
    margin-bottom: 20px;
}

.executive-summary ul {
    list-style: none;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.executive-summary a {
    color: #f0f6fc;
    transition: var(--transition);
}

.executive-summary a:hover {
    color: var(--accent);
}

.contact .overline {
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 15px;
}

.contact .title {
    font-size: clamp(30px, 5vw, 50px);
    margin-bottom: 20px;
    color: #f0f6fc;
}

.contact p {
    font-size: 16px;
    margin-bottom: 50px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image-wrapper {
        margin-top: 50px;
    }
    
    section {
        padding: 80px 0;
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Menu Active State */
@media (max-width: 768px) {
    .nav-links.active {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 70px;
        right: 20px;
        background: var(--nav-bg);
        backdrop-filter: blur(20px);
        padding: 30px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        gap: 20px;
        width: 250px;
        animation: slideIn 0.3s ease-out;
    }

    @keyframes slideIn {
        from { transform: translateX(20px); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }
}

/* Section specific reveal delays */
section:nth-child(odd) {
    transition-delay: 0.1s;
}

section:nth-child(even) {
    transition-delay: 0.2s;
}
