:root {
    --bg-primary: #0a0e14;
    --bg-secondary: #121820;
    --bg-tertiary: #1a222e;
    --text-primary: #e6e8eb;
    --text-secondary: #9ba3b4;
    --accent-primary: #00d4ff;
    --accent-secondary: #00ff88;
    --accent-danger: #ff4757;
    --border-color: #2a3542;
    --code-bg: #0d1117;
}

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

/* Accessibility: skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--accent-primary);
    color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 1rem;
}

/* Accessibility: visible focus for keyboard users */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

body {
    font-family: 'Work Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Background Grid Effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
}

/* Animated Background Gradient */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,212,255,0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    body::after { animation: none; }
    .terminal-prompt, .hero h1, .hero h2, .hero-description, .cta-buttons {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Container */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(60px + 2rem); /* account for fixed nav */
}

/* Header/Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    border-bottom: 1px solid var(--border-color);
    padding: 4rem 0;
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hero-photo-wrap {
    flex-shrink: 0;
}

.hero-photo {
    width: 280px;
    height: 280px;
    object-fit: cover;
    object-position: center top;
    border: 2px solid var(--accent-primary);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.15);
    display: block;
}

.terminal-prompt {
    color: var(--accent-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

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

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    animation: slideUp 0.8s ease 0.2s forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h2 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0;
    animation: slideUp 0.8s ease 0.4s forwards;
}

.hero-description {
    max-width: 700px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: slideUp 0.8s ease 0.6s forwards;
}

.accent-text {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: slideUp 0.8s ease 0.8s forwards;
}

.btn {
    padding: 0.8rem 2rem;
    border: 2px solid var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-download::before {
    background: var(--accent-secondary);
}

.btn-download:hover {
    color: var(--bg-primary);
    border-color: var(--accent-secondary);
}

.download-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-download:hover .download-icon {
    transform: translateY(3px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn:hover {
    color: var(--bg-primary);
}

.btn:hover::before {
    left: 0;
}

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

.btn-secondary::before {
    background: var(--bg-tertiary);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Section */
section {
    padding: 6rem 0;
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-number {
    color: var(--accent-primary);
    font-size: 1.2rem;
    font-weight: 600;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,212,255,0.1);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Experience Timeline */
.timeline {
    position: relative;
    padding-left: 3rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -3.5rem;
    top: 0.5rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    background: var(--bg-primary);
}

.timeline-date {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.timeline-company {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.8;
}

.timeline-description ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.timeline-description li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.timeline-description li::marker {
    color: var(--accent-primary);
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.3s ease;
}

.skill-category:hover {
    border-color: var(--accent-primary);
}

.skill-category h3 {
    color: var(--accent-primary);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3::before {
    content: '>';
    color: var(--accent-secondary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    padding: 0.4rem 0.8rem;
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.skill-tag:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-featured {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.project-featured:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px rgba(0,212,255,0.12);
}

.project-featured-header {
    margin-bottom: 1.5rem;
}

.project-featured-header .project-description {
    margin-bottom: 0;
}

.project-featured-body {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2.5rem;
    align-items: start;
}

.project-featured-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 700px) {
    .project-featured-body {
        grid-template-columns: 1fr;
    }
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,212,255,0.15);
}

.project-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--code-bg);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-size: 0.75rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    flex: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.project-bullets {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 1.5rem 1.1rem;
    padding: 0;
    font-size: 0.88rem;
}

.project-bullets li {
    margin-bottom: 0.35rem;
}

.project-link {
    display: inline-block;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.2s ease, gap 0.2s ease;
    letter-spacing: 0.5px;
}

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

.tech-badge {
    padding: 0.3rem 0.6rem;
    background: var(--bg-tertiary);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.contact-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.contact-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.contact-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.contact-card.no-link {
    cursor: default;
}

.contact-card.no-link:hover {
    transform: none;
    border-color: var(--border-color);
}

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

.footer-code {
    color: var(--accent-primary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Scroll indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 1000;
    transition: width 0.1s ease;
}

/* Thesis note paragraph */
.thesis-note {
    margin-top: 0.75rem;
}

/* Navigation */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-cursor {
    animation: blink 1.2s step-end infinite;
}

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

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
    letter-spacing: 0.5px;
}

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

.nav-links .nav-cta {
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    padding: 0.4rem 1rem;
    transition: all 0.2s ease;
}

.nav-links .nav-cta:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 200;
}

.nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent-primary);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* Contact intro text */
.contact-intro {
    max-width: 600px;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Languages block */
.languages-block {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: inline-block;
    min-width: 300px;
}

.languages-title {
    color: var(--accent-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.languages-title::before {
    content: '>';
    color: var(--accent-secondary);
}

.language-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.language-item {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.lang-name {
    color: var(--text-primary);
    font-weight: 500;
}

.lang-level {
    color: var(--accent-secondary);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline {
        padding-left: 2rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    .projects-grid,
    .skills-container {
        grid-template-columns: 1fr;
    }

    /* Show hamburger, hide desktop nav */
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(10, 14, 20, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-color);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        z-index: 99;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 0.75rem 2rem;
        font-size: 0.95rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child a {
        border-bottom: none;
        margin: 0.5rem 2rem;
        width: calc(100% - 4rem);
        text-align: center;
    }

    /* Hero: stack photo below text on mobile */
    .hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 2.5rem;
        min-height: auto;
        padding-bottom: 4rem;
    }

    .hero-photo {
        width: 160px;
        height: 160px;
    }
}