/* ===== Root & Reset ===== */
:root {
    /* Light */
    --bg: #f7f9fd;
    --ink: #0a192f;
    --text: #1f2430;
    --muted: #5b6b82;
    --card: #ffffff;
    --ring: #e5ecff;
    --accent: #64ffda;
    --accent-2: #42e3c1;
    --shadow: 0 12px 36px rgba(13, 23, 43, .08);

    /* Dark */
    --d-bg: #0b1220;
    --d-card: #10192b;
    --d-text: #f6fbff;
    --d-ink: #ffffff;
    --d-muted: #b9c7da;
    --d-ring: rgba(255, 255, 255, .15);
    --d-accent: #64ffda;
    --d-accent-2: #42e3c1;
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px
}

@media (max-width:720px) {
    html {
        scroll-padding-top: 72px
    }
}

body {
    margin: 0;
    line-height: 1.65;
    font-family: system-ui, -apple-system, Segoe UI, Inter, Roboto, Arial, sans-serif;
    color: var(--text);
    font-size: clamp(15px, 1.05vw, 18px);
    background:
        radial-gradient(1200px 600px at 10% -10%, #eaf6ff 0%, rgba(234, 246, 255, 0) 60%),
        radial-gradient(1000px 500px at 120% 10%, #fff8ed 0%, rgba(255, 248, 237, 0) 55%),
        repeating-linear-gradient(to bottom, rgba(10, 25, 47, .03) 0 40px, transparent 40px 80px),
        linear-gradient(180deg, #f9fbff 0%, #f3f6fd 60%, #eef2fb 100%);
}

img {
    max-width: 100%;
    display: block
}

a {
    color: inherit;
    text-decoration: none
}

.shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px
}

.skip {
    position: absolute;
    left: -9999px
}

.skip:focus {
    left: 1rem;
    top: 1rem;
    background: #000;
    color: #fff;
    padding: .5rem .75rem;
    border-radius: .5rem;
    z-index: 9999
}

/* ===== Header ===== */
.hdr {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 25, 47, .95);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, .08)
}

.hdr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0
}

.brand .title {
    margin: 0;
    font-size: clamp(1.05rem, 2.5vw, 1.3rem);
    color: #fff
}

.brand .subtitle {
    margin: 2px 0 0;
    color: #cfe7ff;
    font-size: .9rem
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.nav a {
    background: transparent;
    color: #e8f4ff;
    padding: .45rem .7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    font-weight: 700
}

.nav a:hover {
    background: rgba(255, 255, 255, .12)
}

.btn {
    background: #64ffda;
    color: #062225;
    border: 0;
    padding: .55rem .9rem;
    border-radius: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    transition: transform .15s ease, filter .2s ease
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(.95)
}

.btn.tiny {
    padding: .4rem .6rem;
    border-radius: 10px;
    font-size: .9rem
}

.btn.ghost {
    background: transparent;
    border: 2px solid var(--accent);
    color: #0a192f
}

.btn.ghost:hover {
    background: var(--accent);
    color: #062225
}

/* Hamburger activates earlier so brand fits */
.hamb {
    display: none;
    background: transparent;
    border: 0;
    width: 44px;
    height: 36px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 10px
}

.hamb span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #eaf6ff;
    border-radius: 3px
}

@media (max-width:1100px) {
    .hamb {
        display: inline-flex
    }

    .nav {
        position: fixed;
        inset: 60px 0 auto 0;
        background: #0a192f;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
        padding: 10px 14px;
        transform: translateY(-120%);
        transition: transform .25s ease;
        flex-wrap: nowrap;
        gap: 10px;
        overflow-x: auto
    }

    .nav.open {
        transform: translateY(0)
    }

    body.nav-open {
        overflow: hidden
    }

    .brand .subtitle {
        display: none
    }
}

/* Dark toggle */
.switch {
    position: relative;
    width: 50px;
    height: 24px;
    margin-left: auto
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.slider {
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background: #cfd8e3;
    transition: .3s
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 4px;
    top: 3px;
    border-radius: 50%;
    background: #fff;
    transition: .3s
}

.switch input:checked+.slider {
    background: var(--accent)
}

.switch input:checked+.slider:before {
    transform: translateX(26px)
}

/* ===== Cards & Sections ===== */
.card {
    background: var(--card);
    border: 1px solid var(--ring);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 22px;
    margin: 18px 0
}

.hero {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center
}

.avatar {
    width: 140px;
    height: 140px;
    border-radius: 100%;
    object-fit: cover;
    object-position: top center;
    border: 4px solid var(--accent)
}

h1,
h2,
h3 {
    color: #0a192f;
    margin: 0 0 10px
}

.lead {
    font-size: clamp(1rem, 1.1vw, 1.2rem)
}

p {
    margin: 0 0 12px
}

.meta {
    color: var(--muted);
    margin: .15rem 0 .5rem
}

/* Big hero name */
.display {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    font-size: clamp(1.6rem, 4.8vw, 2.4rem);
    line-height: 1.15;
    color: #0a192f
}

.display-sub {
    grid-column: 1 / -1;
    margin: 0 0 10px;
    color: #2b3a55;
    font-weight: 700
}

/* Badges */
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 12px
}

.badge {
    border: 2px solid var(--accent-2);
    background: rgba(100, 255, 218, .15);
    color: #0a192f;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .2px
}

/* Role Fit */
.rolefit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
    border: 1px dashed var(--ring);
    background: #fbfdff;
    padding: 14px;
    border-radius: 14px;
    margin: 8px 0 10px
}

.rolefit h4 {
    margin: 0 0 6px;
    color: #0a192f;
    font-size: .95rem
}

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

.pills span {
    background: #eef9ff;
    border: 1px solid #cfe7ff;
    color: #123;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .85rem
}

.rf-meta {
    display: flex;
    flex-direction: column;
    gap: 8px
}

/* Experience (accordion) */
.xp {
    border: 1px solid var(--ring);
    border-radius: 14px;
    margin: 12px 0;
    overflow: hidden;
    background: #fff
}

.xp-hd {
    width: 100%;
    text-align: left;
    background: #f9fbff;
    border: 0;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer
}

.xp-hd:hover {
    background: #eef6ff
}

.xp-hd h3 {
    margin: 0;
    color: #0a192f
}

.chev {
    font-weight: 900;
    color: #0a192f
}

.xp-body {
    display: none;
    border-top: 1px solid var(--ring);
    padding: 10px 16px
}

.xp-body.open {
    display: block;
    animation: fade .22s ease-out
}

.xp-body ul {
    margin: 10px 0 0 18px
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

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

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px
}

.chips span {
    background: #eef9ff;
    border: 1px solid #cfe7ff;
    color: #123;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .85rem
}

/* Projects */
.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr))
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr))
}

.proj {
    border: 1px solid var(--ring);
    border-radius: 14px;
    padding: 18px;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease
}

.proj:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08)
}

.note {
    margin-top: 12px;
    color: var(--muted)
}

.note a {
    color: #0e7c86;
    font-weight: 800
}

/* Lists */
.stack {
    padding-left: 18px
}

.edu {
    padding-left: 18px
}

/* Certs */
.cert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px dashed var(--ring);
    border-radius: 14px;
    padding: 18px;
    background: #fff
}

/* ===== Contact ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    align-items: start
}

.contact-info .quick {
    display: grid;
    gap: 10px;
    margin-top: 12px
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.contact-form .span-2 {
    grid-column: span 2
}

.contact-form .large {
    padding: .8rem 1.2rem;
    font-size: 1rem
}

/* Floating labels */
.field {
    position: relative
}

.field input,
.field textarea {
    width: 100%;
    padding: 14px 12px 12px;
    border-radius: 12px;
    border: 1.5px solid #cfd8e3;
    background: var(--card);
    color: #111;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s, color .2s;
}

.field textarea {
    resize: vertical
}

.field input:focus,
.field textarea:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, .15)
}

.field label {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 0 6px;
    background: var(--card);
    color: #6b7486;
    font-size: .95rem;
    transform-origin: left top;
    transition: transform .16s, color .16s, top .16s, background .16s;
}

.field input:focus+label,
.field input:not(:placeholder-shown)+label,
.field textarea:focus+label,
.field textarea:not(:placeholder-shown)+label {
    top: -8px;
    transform: scale(.86);
    color: #0a192f;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: #0a192f;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    z-index: 1000
}

.toast.show {
    opacity: 1
}

/* Footer & Top */
.ftr {
    background: #0a192f;
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, .08)
}

.ftr-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 0
}

.to-top {
    position: fixed;
    bottom: 18px;
    right: 18px;
    background: var(--accent);
    color: #082025;
    font-weight: 900;
    padding: 10px 14px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
    text-decoration: none;
    z-index: 999
}

.to-top:hover {
    transform: translateY(-2px)
}

/* ===== Dark Mode ===== */
body.dark {
    color: var(--d-text);
    background:
        radial-gradient(1000px 500px at -10% -10%, rgba(100, 255, 218, .08) 0%, rgba(100, 255, 218, 0) 60%),
        radial-gradient(900px 450px at 110% 0%, rgba(80, 170, 255, .12) 0%, rgba(80, 170, 255, 0) 55%),
        repeating-linear-gradient(to bottom, rgba(255, 255, 255, .04) 0 40px, transparent 40px 80px),
        linear-gradient(180deg, #0b1220 0%, #0d1628 60%, #0a1324 100%);
}

body.dark .hdr {
    background: rgba(13, 23, 43, .95);
    border-bottom-color: rgba(255, 255, 255, .08)
}

body.dark .nav a {
    border-color: rgba(255, 255, 255, .2);
    color: #eaf6ff
}

body.dark .nav a:hover {
    background: rgba(255, 255, 255, .12)
}

body.dark .btn {
    background: #0f203a;
    color: #eaf6ff
}

body.dark .btn:hover {
    background: #173356
}

body.dark .btn.ghost {
    border-color: var(--d-accent-2);
    color: #eaf6ff
}

body.dark .btn.ghost:hover {
    background: var(--d-accent);
    color: #062225
}

body.dark .card {
    background: var(--d-card);
    border-color: var(--d-ring)
}

body.dark h1,
body.dark h2,
body.dark h3 {
    color: var(--d-ink)
}

body.dark .meta {
    color: var(--d-muted)
}

body.dark .badge {
    border-color: var(--d-accent-2);
    background: rgba(100, 255, 218, .16);
    color: #eaf6ff
}

body.dark .rolefit {
    background: #0f1a2e;
    border-color: var(--d-ring)
}

body.dark .pills span {
    background: rgba(100, 255, 218, .12);
    border-color: var(--d-accent-2);
    color: #eaf6ff
}

body.dark .xp {
    background: var(--d-card);
    border-color: var(--d-ring)
}

body.dark .xp-hd {
    background: #0f1a2e;
    color: #eaf6ff
}

body.dark .xp-hd:hover {
    background: #14223a
}

body.dark .chev {
    color: #eaf6ff
}

body.dark .proj {
    background: var(--d-card);
    border-color: var(--d-ring)
}

body.dark .cert {
    background: var(--d-card);
    border-color: var(--d-ring)
}

body.dark .toast {
    background: #173356
}

body.dark .field input,
body.dark .field textarea {
    background: var(--d-card);
    color: var(--d-text);
    border-color: #31415b
}

body.dark .field label {
    background: var(--d-card);
    color: #c9d6ea
}

body.dark .field input:focus+label,
body.dark .field textarea:focus+label,
body.dark .field input:not(:placeholder-shown)+label,
body.dark .field textarea:not(:placeholder-shown)+label {
    color: #eaf6ff
}

/* ===== Responsive tweaks ===== */
@media (max-width:980px) {
    .rolefit {
        grid-template-columns: 1fr;
        gap: 10px
    }
}

@media (max-width:860px) {
    .hero {
        grid-template-columns: 100px 1fr
    }

    .avatar {
        width: 100px;
        height: 100px
    }
}

@media (max-width:720px) {
    .hero {
        grid-template-columns: 1fr
    }

    .avatar {
        width: 140px;
        height: 140px;
        margin: 0 auto 10px
    }

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

    .contact-form {
        grid-template-columns: 1fr
    }

    .contact-form .span-2 {
        grid-column: auto
    }
}