:root {
    --green: #2ecc71;
    --blue: #3498db;
    --bg: #1a1a2e;
    --surface: #16213e;
    --surface2: #0f3460;
    --text: #ffffff;
    --text-muted: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-h: 64px;
}

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

html { scroll-behavior: smooth; }

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

/* ── Background blobs ─────────────────────────── */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
}

.blob-1 {
    width: 500px; height: 500px;
    background: var(--green);
    top: -150px; left: -150px;
    animation: blobMove1 22s ease-in-out infinite alternate;
}

.blob-2 {
    width: 420px; height: 420px;
    background: var(--blue);
    bottom: -100px; right: -100px;
    animation: blobMove2 18s ease-in-out infinite alternate;
}

.blob-3 {
    width: 300px; height: 300px;
    background: var(--green);
    top: 50%; left: 60%;
    animation: blobMove3 25s ease-in-out infinite alternate;
    opacity: 0.12;
}

@keyframes blobMove1 { to { transform: translate(80px, 120px) scale(1.1); } }
@keyframes blobMove2 { to { transform: translate(-60px, -80px) scale(0.9); } }
@keyframes blobMove3 { to { transform: translate(-120px, 60px) scale(1.2); } }

/* ── Nav ──────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    transition: background 0.3s, backdrop-filter 0.3s, border-color 0.3s;
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(12px);
    border-color: var(--glass-border);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 1.1rem;
    background: linear-gradient(90deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: 2px;
}

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

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: linear-gradient(90deg, var(--green), var(--blue));
    transition: width 0.3s;
    border-radius: 2px;
}

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

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-burger span {
    display: block;
    width: 24px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Network canvas ───────────────────────────── */
#networkCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ── Hero ─────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--nav-h) + 40px) 24px 80px;
    position: relative;
}

.hero-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    color: var(--green);
    font-size: 0.95rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 12px;
    opacity: 0;
    animation: fadeUp 0.6s 0.2s forwards;
}

.hero-name {
    font-size: clamp(2.8rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeUp 0.6s 0.4s forwards;
}

.hero-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeUp 0.6s 0.6s forwards;
    letter-spacing: 1px;
}

.hero-specialty {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--text-muted);
    margin-bottom: 16px;
    min-height: 2em;
    opacity: 0;
    animation: fadeUp 0.6s 0.7s forwards;
}

.cursor {
    color: var(--green);
    animation: blink 0.8s step-end infinite;
    font-weight: 300;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    animation: fadeUp 0.6s 1s forwards;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 32px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: linear-gradient(135deg, var(--green), var(--blue));
    color: #fff;
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px rgba(46, 204, 113, 0.4);
}

.btn-outline {
    border: 1px solid var(--glass-border);
    color: var(--text);
    background: var(--glass);
    backdrop-filter: blur(8px);
}

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

/* ── Sections ─────────────────────────────────── */
.section {
    padding: 100px 24px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 56px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--green), var(--blue));
    border-radius: 2px;
}

/* ── About ────────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 56px;
    align-items: start;
}

.photo-frame {
    position: relative;
    width: 200px; height: 200px;
}

.photo-frame::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green), var(--blue));
    z-index: 0;
}

.photo-frame img {
    position: relative;
    z-index: 1;
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg);
}

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

.about-content strong { color: var(--text); }

.about-links {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.icon-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    background: var(--glass);
}

.icon-link:hover { color: var(--green); border-color: var(--green); }

/* ── Skills ───────────────────────────────────── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.skill-group {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    transition: border-color 0.3s, transform 0.3s;
}

.skill-group:hover {
    border-color: rgba(46, 204, 113, 0.3);
    transform: translateY(-4px);
}

.skill-group h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-weight: 600;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    transition: transform 0.15s;
}

.badge:hover { transform: scale(1.05); }

.badge.green {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: var(--green);
}

.badge.blue {
    background: rgba(52, 152, 219, 0.12);
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: var(--blue);
}

/* ── Stats ────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 64px;
}

.stat-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px 20px;
    text-align: center;
    transition: border-color 0.3s, transform 0.3s;
}

.stat-card:hover {
    border-color: rgba(46, 204, 113, 0.4);
    transform: translateY(-4px);
}

.stat-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--green), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

.stat-label span {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

/* ── Timeline ─────────────────────────────────── */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--green), var(--blue), transparent);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-marker {
    position: absolute;
    left: -28px; top: 20px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--green);
    transition: background 0.3s, border-color 0.3s;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.timeline-item:hover .timeline-marker {
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.15);
}

.timeline-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px;
    transition: border-color 0.3s, transform 0.3s;
}

.timeline-item:hover .timeline-card {
    border-color: rgba(46, 204, 113, 0.25);
    transform: translateX(4px);
}

.timeline-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--green);
    font-weight: 600;
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.timeline-card h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.timeline-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 16px;
}

.tl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tl-tags span {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    padding: 3px 10px;
    border-radius: 12px;
}

/* ── Projects ─────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.projects-loading {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 40px;
    text-align: center;
    grid-column: 1 / -1;
    font-family: 'JetBrains Mono', monospace;
}

.project-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    transform-style: preserve-3d;
}

.project-card:hover {
    border-color: rgba(52, 152, 219, 0.4);
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.1);
}

.project-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-card-name svg { flex-shrink: 0; opacity: 0.5; }

.project-card-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.6;
    flex: 1;
}

.project-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.project-lang {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.project-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.projects-more { text-align: center; }

/* ── Contact ──────────────────────────────────── */
.contact-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.contact-intro {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
    text-align: left;
    word-break: break-all;
}

.contact-item:hover {
    color: var(--text);
    border-color: var(--green);
    background: rgba(46, 204, 113, 0.06);
    transform: translateY(-2px);
}

.contact-item svg { flex-shrink: 0; color: var(--green); }

/* ── Footer ───────────────────────────────────── */
.footer {
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Scroll animations ────────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        flex-direction: column;
        background: rgba(26, 26, 46, 0.97);
        padding: 24px;
        gap: 20px;
        transform: translateY(calc(-100% - var(--nav-h)));
        transition: transform 0.35s ease;
        border-bottom: 1px solid var(--glass-border);
    }

    .nav-links.open { transform: translateY(0); }
    .nav-burger { display: flex; }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .photo-frame { margin: 0 auto; }
    .about-links { justify-content: center; }

    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-links {
        grid-template-columns: 1fr;
    }

    .timeline { padding-left: 24px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .section { padding: 72px 16px; }
    .contact-card { padding: 32px 24px; }
}
