:root {
    --bg: #0b1020;
    --surface: #0f172a;
    --muted: #94a3b8;
    --text: #e5e7eb;
    --brand: #22d3ee;
    --brand-2: #818cf8;
    --card: #0d152a;
    --ring: rgba(34, 211, 238, .4);
    --radius: 18px;
    --shadow: 0 20px 40px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}

.container {
    width: min(1140px, 92vw);
    margin: 0 auto
}

a {
    color: inherit;
    text-decoration: none
}

/* navbar */
.nav {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: saturate(160%) blur(10px);
    background: linear-gradient(to bottom, rgba(10, 15, 30, .9), rgba(10, 15, 30, .6));
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 0
}

.brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-weight: 800;
    letter-spacing: .3px
}

.logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 8px 16px rgba(34, 211, 238, .25);
}

.nav-links {
    display: flex;
    gap: .4rem
}

.nav-links a {
    padding: .55rem .9rem;
    border-radius: 10px;
    font-weight: 600;
    opacity: .85
}

.nav-links a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .06)
}

.nav-links a.active {
    background: rgba(34, 211, 238, .16);
    border: 1px solid rgba(34, 211, 238, .28)
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.25rem
}

@media (max-width:880px) {
    .menu-btn {
        display: block
    }

    .nav-links {
        display: none;
        position: absolute;
        right: 4vw;
        top: 58px;
        flex-direction: column;
        background: #0b1220;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 14px;
        padding: .6rem;
        box-shadow: var(--shadow)
    }

    .nav-links.open {
        display: flex
    }

    .nav-links a {
        width: 100%
    }
}

/* hero */
header {
    padding: min(18vh, 140px) 0 90px
}

.hero {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 2rem;
    align-items: center
}

h1 {
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    line-height: 1.12;
    margin: .25rem 0 .75rem
}

.lead {
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.125rem)
}

.chip {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    padding: .45rem .75rem;
    border-radius: 999px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: .9rem;
    overflow-wrap: anywhere;
    white-space: normal;
    max-width: 100%;
}

.chip a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px
}

.cta {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    margin-top: 1.2rem
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .85rem 1.1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #0b1020;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(129, 140, 248, .25), 0 4px 12px rgba(34, 211, 238, .25);
    transition: transform .2s ease, filter .2s ease
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05)
}

.btn.secondary {
    background: #101a32;
    color: var(--text);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08)
}

.portrait {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 18px;
    background: url('pic.png') center/cover no-repeat, linear-gradient(135deg, rgba(34, 211, 238, .25), rgba(129, 140, 248, .25));
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: var(--shadow);
}

@media (max-width:920px) {
    .hero {
        grid-template-columns: 1fr
    }

    header {
        padding-top: 110px
    }
}

/* sections */
section {
    padding: 80px 0
}

.section-title {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin-bottom: 14px
}

.section-title h2 {
    margin: 0;
    font-size: clamp(1.4rem, 2.6vw, 2rem)
}

.section-sub {
    color: var(--muted);
    margin: 0 0 18px
}

/* about */
.about {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 1.2rem
}

.card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--radius);
    padding: 1.1rem
}

.about-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem
}

@media (max-width:920px) {
    .about {
        grid-template-columns: 1fr
    }
}

/* skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem
}

@media (max-width:920px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr
    }
}

@media (max-width:560px) {
    .skills-grid {
        grid-template-columns: 1fr
    }
}

.skill {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 1rem
}

.bar {
    height: 10px;
    background: #0a1326;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .06)
}

.bar>span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    width: 0;
    transition: width 1.2s ease
}

/* projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem
}

@media (max-width:1024px) {
    .projects-grid {
        grid-template-columns: 1fr 1fr
    }
}

@media (max-width:640px) {
    .projects-grid {
        grid-template-columns: 1fr
    }
}

.project {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    transition: transform .25s ease, box-shadow .25s ease
}

.project:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .35)
}

.thumb {
    aspect-ratio: 16/9;
    background: #0a1326 center/cover no-repeat;
    border-bottom: 1px solid rgba(255, 255, 255, .06)
}

.project .body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem
}

.tags {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap
}

.tag {
    font-size: .8rem;
    padding: .28rem .5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .08);
    color: var(--muted)
}

.links {
    margin-top: auto;
    display: flex;
    gap: .6rem
}

/* resume */
.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

.resume-item {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 1rem
}

.resume-actions {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
    margin-top: .6rem
}

@media (max-width:920px) {
    .resume-grid {
        grid-template-columns: 1fr
    }
}

/* contact */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem
}

@media (max-width:920px) {
    .contact-grid {
        grid-template-columns: 1fr
    }
}

form {
    display: grid;
    gap: .8rem
}

input,
textarea {
    width: 100%;
    padding: .9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: #0a1326;
    color: var(--text);
    outline: none
}

input:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--ring)
}

.mailto-hint {
    color: var(--muted);
    font-size: .9rem;
    margin: .6rem 0 0
}

/* footer */
footer {
    padding: 48px 0;
    border-top: 1px solid rgba(255, 255, 255, .06);
    color: var(--muted)
}

.footer-inner {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap
}

/* socials */
.socials {
    display: flex;
    gap: .6rem
}

.socials a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #0a1326;
    border: 1px solid rgba(255, 255, 255, .06);
    color: var(--text)
}

/* reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .7s ease, transform .7s ease
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0)
}