:root {
    --bg: #06080c;
    --bg-soft: #0d1118;
    --panel: #121824;
    --panel-2: #171f2d;
    --header-bg: rgba(6, 8, 12, 0.82);
    --header-bg-strong: rgba(6, 8, 12, 0.96);
    --text: #e7edf8;
    --muted: #94a3b8;
    --text-soft: #b8c6dc;
    --title-strong: #eaf2ff;
    --meta-strong: #b7c7df;
    --accent: #3b82f6;
    --accent-2: #06b6d4;
    --accent-soft: #8ecaff;
    --accent-soft-2: #93c5fd;
    --accent-chip: #bfe2ff;
    --accent-chip-bg: rgba(59, 130, 246, 0.12);
    --accent-chip-border: rgba(59, 130, 246, 0.35);
    --line: rgba(148, 163, 184, 0.2);
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 16px 35px rgba(0, 0, 0, 0.4);
    --panel-gradient: linear-gradient(140deg, rgba(18, 24, 36, 0.92), rgba(23, 31, 45, 0.9));
    --role-gradient: linear-gradient(160deg, rgba(20, 28, 40, 0.95), rgba(16, 22, 33, 0.92));
    --chip-bg: rgba(148, 163, 184, 0.08);
    --chip-shadow: 0 20px 42px rgba(8, 16, 30, 0.55);
    --panel-hover-shadow: 0 20px 42px rgba(8, 16, 30, 0.5);
}

[data-theme="light"] {
    --bg: #f3f7ff;
    --bg-soft: #eef3ff;
    --panel: #ffffff;
    --panel-2: #f6f9ff;
    --header-bg: rgba(243, 247, 255, 0.78);
    --header-bg-strong: rgba(243, 247, 255, 0.96);
    --text: #0e1b32;
    --muted: #4f5f78;
    --text-soft: #334763;
    --title-strong: #13233d;
    --meta-strong: #2b466d;
    --accent: #2563eb;
    --accent-2: #0ea5e9;
    --accent-soft: #1d4ed8;
    --accent-soft-2: #2563eb;
    --accent-chip: #0f3f93;
    --accent-chip-bg: rgba(37, 99, 235, 0.08);
    --accent-chip-border: rgba(37, 99, 235, 0.22);
    --line: rgba(37, 99, 235, 0.22);
    --shadow: 0 12px 34px rgba(24, 48, 92, 0.12);
    --panel-gradient: linear-gradient(140deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.96));
    --role-gradient: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(241, 246, 255, 0.96));
    --chip-bg: rgba(37, 99, 235, 0.06);
    --chip-shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
    --panel-hover-shadow: 0 18px 40px rgba(24, 48, 92, 0.16);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Outfit", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 12% -5%, rgba(59, 130, 246, 0.2), transparent 33%),
                radial-gradient(circle at 90% 8%, rgba(6, 182, 212, 0.22), transparent 32%),
                linear-gradient(180deg, #05070a 0%, var(--bg) 35%, #05070a 100%);
    min-height: 100vh;
}

[data-theme="light"] body {
    background: radial-gradient(circle at 12% -5%, rgba(37, 99, 235, 0.15), transparent 32%),
                radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.16), transparent 33%),
                linear-gradient(180deg, #f9fbff 0%, #f3f7ff 45%, #edf3ff 100%);
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(520px circle at 8% calc(10% + var(--scroll-shift, 0px)), rgba(59, 130, 246, 0.14), transparent 58%),
        radial-gradient(440px circle at 92% calc(15% + var(--scroll-shift, 0px)), rgba(6, 182, 212, 0.13), transparent 57%);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(var(--scroll-progress, 0));
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 16px rgba(14, 165, 233, 0.6);
    z-index: 40;
}

a {
    color: inherit;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--header-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
    background: var(--header-bg-strong);
    border-bottom-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.nav-wrap {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.4px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    transition: 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(59, 130, 246, 0.18);
}

.theme-toggle {
    position: relative;
    width: 78px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.18), rgba(14, 165, 233, 0.14));
    cursor: pointer;
    flex: 0 0 auto;
    margin-left: 6px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    border-color: rgba(14, 165, 233, 0.6);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

.theme-toggle::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 5px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(5, 9, 18, 0.35);
    transition: transform 0.24s ease;
}

[data-theme="light"] .theme-toggle::before {
    transform: translateX(37px);
}

.theme-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    pointer-events: none;
    opacity: 0.9;
}

.theme-icon.sun {
    right: 10px;
}

.theme-icon.moon {
    left: 10px;
}

.page {
    padding: 54px 0 max(70px, 18vh);
}

.stack-section {
    margin-top: 36px;
    scroll-margin-top: 92px;
}

.hero-grid,
.split-grid,
.cards-grid,
.contact-grid,
.project-grid,
.skill-grid {
    display: grid;
    gap: 16px;
}

.hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

.panel,
.card {
    --parallax-y: 0px;
    --lift-y: 0px;
    background: var(--panel-gradient);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    transform: translateY(calc(var(--parallax-y) + var(--lift-y)));
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.panel.scrolled,
.card.scrolled {
    border-color: rgba(59, 130, 246, 0.34);
}

.tag {
    display: inline-block;
    font-size: 0.82rem;
    color: var(--accent-soft);
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 999px;
    padding: 6px 10px;
    margin-bottom: 12px;
}

h1 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.1;
    margin-bottom: 10px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

ul {
    padding-left: 18px;
}

p {
    color: var(--muted);
    line-height: 1.7;
}

.subtitle {
    font-size: 1.06rem;
    max-width: 56ch;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.btn {
    text-decoration: none;
    padding: 11px 16px;
    border-radius: 10px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
    color: #fff;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px rgba(14, 165, 233, 0.3);
}

.btn.ghost {
    border: 1px solid var(--line);
    color: var(--text);
    background: var(--chip-bg);
}

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

.profile-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    object-position: center 30%;
    filter: brightness(1.14) contrast(1.08) saturate(1.05);
    border-radius: 14px;
    border: 1px solid var(--line);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.stats div {
    text-align: center;
    padding: 10px;
    background: var(--chip-bg);
    border-radius: 10px;
}

.stats strong {
    display: block;
    color: var(--accent-soft-2);
    font-size: 1rem;
}

.quick-cards,
.cards-grid,
.project-grid,
.skill-grid,
.contact-grid {
    margin-top: 18px;
    grid-template-columns: repeat(2, 1fr);
}

.card {
    text-decoration: none;
}

.card:hover {
    --lift-y: -6px;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: var(--chip-shadow);
}

.panel:hover {
    --lift-y: -4px;
    border-color: rgba(96, 165, 250, 0.38);
    box-shadow: var(--panel-hover-shadow);
}

.section-title {
    margin-bottom: 10px;
}

.split-grid {
    grid-template-columns: 0.95fr 1.05fr;
}

.about-prose p + p {
    margin-top: 12px;
}

.about-prose {
    max-width: 92ch;
}

.about-prose p {
    color: var(--text-soft);
    line-height: 1.9;
}

#about .split-grid {
    margin-top: 22px;
    grid-template-columns: 1fr;
}

#about .split-grid .card {
    min-height: auto;
}

.feature-list {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-list span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--accent-chip-border);
    color: var(--accent-chip);
    background: var(--accent-chip-bg);
    font-weight: 600;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.feature-list span:hover {
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(147, 197, 253, 0.62);
}

.list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.list-item {
    background: var(--chip-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
}

.list-item small {
    color: var(--accent-soft-2);
    display: block;
    margin-bottom: 4px;
}

.timeline-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.role-card {
    position: relative;
    overflow: hidden;
    background: var(--role-gradient);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 18px 18px 18px 22px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.role-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #60a5fa, #22d3ee);
}

.role-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 35%, rgba(96, 165, 250, 0.08) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: sweep 4.8s ease-in-out infinite;
}

.role-card:hover {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, 0.45);
}

.role-title {
    font-size: 1.15rem;
    color: var(--title-strong);
    font-weight: 700;
    margin-bottom: 2px;
}

.role-meta {
    color: var(--meta-strong);
    font-weight: 600;
}

.role-date,
.role-location,
.role-stack {
    color: var(--muted);
    font-size: 0.95rem;
}

.role-date {
    margin-top: 4px;
}

.role-location {
    margin-top: 2px;
}

.role-stack {
    margin-top: 10px;
    color: var(--accent-soft-2);
    font-weight: 600;
}

.role-points {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.role-points li {
    color: var(--text);
    line-height: 1.55;
}

@keyframes sweep {
    0% {
        transform: translateX(-120%);
    }
    55% {
        transform: translateX(130%);
    }
    100% {
        transform: translateX(130%);
    }
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 20px 0 28px;
    text-align: center;
}

.parallax {
    will-change: transform;
}

.reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

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

@media (max-width: 920px) {
    .hero-grid,
    .split-grid,
    .quick-cards,
    .cards-grid,
    .project-grid,
    .skill-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .page {
        padding-top: 34px;
    }

    .panel,
    .card {
        padding: 18px;
    }

    .nav-wrap {
        padding: 10px 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-toggle {
        align-self: flex-end;
        margin-left: 0;
    }
}
