/* ===== CSS VARIABLES ===== */
:root {
    --bg: #fafafa;
    --bg2: #f5f5f5;
    --surface: #ffffff;
    --surface2: #ebebeb;
    --accent: #171717;
    --accent2: #0070f3;
    --accent3: #7928ca;
    --text: #171717;
    --text-muted: #4d4d4d;
    --border: #ebebeb;
    --glow: 0px 1px 2px rgba(0,0,0,0.05), 0px 2px 4px rgba(0,0,0,0.05);
    --glow2: 0px 2px 4px rgba(0,0,0,0.06), 0px 8px 16px -8px rgba(0,0,0,0.06);
    --nav-h: 64px;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg2: #111111;
    --surface: #000000;
    --surface2: #222222;
    --accent: #ffffff;
    --accent2: #0070f3;
    --accent3: #a855f7;
    --text: #ffffff;
    --text-muted: #888888;
    --border: #333333;
    --glow: 0px 1px 2px rgba(0,0,0,0.4);
    --glow2: 0px 2px 8px rgba(0,0,0,0.4);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-feature-settings: "ss01", "ss02";
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition: background 0.4s, color 0.4s;
}

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

#bg-canvas {
    display: none;
}

/* NAV */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background 0.4s;
}

[data-theme="dark"] nav {
    background: rgba(10, 10, 10, 0.8);
}

.nav-logo {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-logo span {
    color: var(--text-muted);
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 100px;
    transition: background-color 0.2s, color 0.2s;
}

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: var(--text);
}

.theme-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--glow);
}

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

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--text);
    display: block;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 5%;
    z-index: 99;
    flex-direction: column;
    gap: 1.2rem;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.25s;
}

.mobile-menu a:hover {
    color: var(--accent);
}

/* PAGE HERO */
.page-hero {
    padding-top: calc(var(--nav-h) + 5rem);
    padding-bottom: 4rem;
    padding-left: 5%;
    padding-right: 5%;
    position: relative;
    z-index: 1;
    max-width: 900px;
}

.page-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: -0.2px;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 1rem;
}

.page-hero h1 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 600;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.page-hero h1 em {
    font-style: normal;
    color: var(--accent3);
}

.page-hero p {
    color: var(--text-muted);
    font-size: 1.15rem;
    line-height: 1.6;
    max-width: 600px;
}

/* SECTIONS */
.section {
    padding: 5rem 5%;
    position: relative;
    z-index: 1;
}

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

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: -0.2px;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 1rem;
}

.section-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -1px;
    margin-bottom: 3rem;
    line-height: 1.15;
    color: var(--text);
}

/* ABOUT GRID */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 5rem;
    align-items: start;
}

.about-avatar {
    position: relative;
}

.avatar-frame {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.avatar-symbol {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 600;
    color: var(--accent);
    user-select: none;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-badge {
    position: absolute;
    bottom: -0.5rem;
    right: -0.5rem;
    background: var(--accent);
    color: var(--bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    padding: 0.4rem 0.85rem;
    border-radius: 100px;
    white-space: nowrap;
    border: 1px solid var(--border);
    box-shadow: var(--glow);
}

.about-info h2 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.about-info .role-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent2);
    letter-spacing: -0.2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: block;
}

.about-info p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    font-size: 1.02rem;
}

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

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.tl-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.tl-item::before {
    content: '';
    position: absolute;
    left: -2.38rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
}

.tl-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent2);
    letter-spacing: -0.2px;
    margin-bottom: 0.3rem;
}

.tl-title {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.tl-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* SKILLS SECTION */
.skills-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3rem;
    box-shadow: var(--glow);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.skill-pct {
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.skill-bar {
    height: 4px;
    background: var(--bg2);
    border-radius: 100px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 100px;
    background: var(--accent);
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PROJECTS */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.8rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: var(--glow);
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.project-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: -0.2px;
    text-transform: uppercase;
    color: var(--accent2);
    margin-bottom: 0.5rem;
}

.project-name {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    background: var(--bg2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* BUTTONS */
.btn-primary {
    padding: 0px 24px;
    height: 48px;
    border-radius: 100px;
    background: var(--accent);
    color: var(--bg);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow);
    opacity: 0.9;
}

/* CTA STRIP */
.cta-strip {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    box-shadow: var(--glow2);
}

.cta-strip h3 {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--text);
}

.cta-strip p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* FOOTER */
footer {
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
    background: var(--surface);
}

footer span {
    color: var(--accent2);
}

/* REVEAL */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ANIMATIONS */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.page-hero>* {
    animation: fadeUp 0.8s ease both;
}

.page-hero>*:nth-child(2) {
    animation-delay: 0.15s;
}

.page-hero>*:nth-child(3) {
    animation-delay: 0.3s;
}

/* RESPONSIVE */
@media (max-width: 768px){
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .cta-strip {
        flex-direction: column;
    }

    .cta-strip>div {
        text-align: center;
    }

    .page-hero {
        padding-top: calc(var(--nav-h) + 3rem);
    }}