:root {
    --bg: #0b1220;
    --surface: #0f172a;
    --muted: #94a3b8;
    --text: #e2e8f0;
    --brand: #22d3ee;
    --brand-2: #38bdf8;
    --ring: #7dd3fc;
    --card: #111827;
    --border: #1f2937;
    --shadow: 0 10px 30px rgba(2, 6, 23, .35);
    --radius: 16px;
    --maxw: 1100px;
    --padx: clamp(1rem, 2vw, 2rem);
    --lead: clamp(1.05rem, .9rem + .5vw, 1.25rem);
    --h1: clamp(2.2rem, 1.7rem + 2vw, 3.4rem);
    --h2: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem);
    --speed: 280ms;
    --header-height: 72px;
    color-scheme: dark
}

:root[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #0f172a;
    --muted: #94a3b8;
    --text: #e2e8f0;
    --card: #111827;
    --border: #1f2937;
    --shadow: 0 10px 30px rgba(2, 6, 23, .35);
    color-scheme: dark
}

:root[data-theme="light"] {
    --bg: #f8fafc;
    --surface: #fff;
    --muted: #475569;
    --text: #0f172a;
    --card: #fff;
    --border: #e2e8f0;
    --shadow: 0 10px 25px rgba(2, 6, 23, .08);
    color-scheme: light
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #f8fafc;
        --surface: #fff;
        --muted: #475569;
        --text: #0f172a;
        --card: #fff;
        --border: #e2e8f0;
        --shadow: 0 10px 25px rgba(2, 6, 23, .08);
        color-scheme: light
    }
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    padding-top: var(--header-height);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility
}

a {
    color: var(--brand-2);
    text-decoration: none
}

a:hover {
    text-decoration: underline
}

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

.container {
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: var(--padx)
}

.stack {
    display: grid;
    gap: clamp(1rem, 1.2vw, 1.4rem)
}

.row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface), rgba(255, 255, 255, 0));
    padding: .75rem 1rem;
    border-radius: 12px;
    transition: transform var(--speed), box-shadow var(--speed)
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none
}

.btn.primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #001018;
    border-color: transparent
}

.btn.ghost {
    background: transparent
}

header.site {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    backdrop-filter: saturate(140%) blur(8px);
    background: color-mix(in oklab, var(--surface), transparent 30%);
    border-bottom: 1px solid var(--border)
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem var(--padx)
}

.brand {
    display: flex;
    align-items: center;
    gap: .8rem;
    font-weight: 800;
    letter-spacing: .3px;
    font-size: 1.05rem;
    line-height: 1;
}

.brand img {
    width: 20px;
    height: 20px
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: .4rem
}

nav a {
    display: inline-block;
    padding: .55rem .8rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--muted)
}

nav a:hover {
    color: var(--text);
    background: color-mix(in oklab, var(--card), transparent 50%)
}

nav a.active {
    color: var(--brand);
    background: color-mix(in oklab, var(--brand), transparent 88%);
    position: relative
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    translate: -50% 0;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand)
}

.nav-controls {
    display: flex;
    gap: .4rem;
    align-items: center
}

.theme-toggle {
    border: 1px solid var(--border);
    background: var(--card);
    padding: .5rem;
    border-radius: 12px;
    cursor: pointer
}

.menu-toggle {
    display: none
}

@media (max-width: 840px) {
    nav ul {
        display: none;
        position: absolute;
        inset: 56px var(--padx) auto var(--padx);
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: .5rem;
        box-shadow: var(--shadow)
    }

    nav ul.open {
        display: grid;
        grid-template-columns: 1fr
    }

    .menu-toggle {
        display: inline-flex
    }
}

.hero {
    padding: clamp(4rem, 10vh, 9rem) 0 3rem;
    background: radial-gradient(1200px 600px at 70% -10%, color-mix(in oklab, var(--brand), transparent 80%), transparent 60%), radial-gradient(800px 500px at -10% 10%, color-mix(in oklab, var(--brand-2), transparent 82%), transparent 40%)
}

.hero h1 {
    font-size: var(--h1);
    letter-spacing: -.02em;
    margin: 0 0 .5rem
}

.lead {
    font-size: var(--lead);
    color: var(--muted);
    max-width: 62ch
}

section {
    padding: 4rem 0;
    scroll-margin-top: 80px
}

section h2 {
    font-size: var(--h2);
    letter-spacing: -.01em;
    margin: 0 0 .75rem
}

.kicker {
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .16em;
    color: var(--muted);
    font-weight: 700
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    box-shadow: var(--shadow)
}

.grid {
    display: grid;
    gap: 1rem
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

@media (max-width:720px) {

    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr
    }
}

.skills ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding: 0;
    margin: 0
}

.skills li {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: .45rem .7rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--muted)
}

.timeline {
    position: relative
}

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

.job {
    position: relative;
    padding-left: 2rem
}

.job::before {
    content: '';
    position: absolute;
    left: 4px;
    top: .6rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand-2), transparent 80%)
}

.projects .card a {
    display: block;
    font-weight: 700;
    margin-bottom: .3rem
}

.projects .project-title {
    margin: 0 0 .35rem;
    font-weight: 700;
    color: var(--brand-2);
    font-size: 1.05rem
}

.projects .project-title:hover {
    text-decoration: underline;
    cursor: pointer;
}

.carousel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius)
}

.carousel-track {
    display: flex;
    transition: transform var(--speed) ease
}

.carousel .slide {
    min-width: 100%;
    padding: 1.2rem
}

.carousel .controls {
    position: absolute;
    inset: auto 0 .5rem 0;
    display: flex;
    justify-content: center;
    gap: .4rem
}

.dot {
    width: 10px;
    height: 10px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--border);
    border: 1px solid var(--border)
}

.dot[aria-current="true"] {
    background: var(--brand-2);
    border-color: transparent
}

footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted)
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--speed) ease, transform var(--speed) ease
}

.reveal.revealed {
    opacity: 1;
    transform: none
}

@media print {

    header,
    .theme-toggle,
    .menu-toggle,
    .btn,
    .carousel .controls {
        display: none !important
    }

    body {
        background: #fff;
        color: #111
    }

    a {
        color: #111
    }

    .card {
        box-shadow: none
    }
}

form label {
    display: grid;
    gap: .2rem;
    color: var(--muted)
}

form span {
    font-weight: 600;
    color: var(--text)
}

input,
textarea,
button {
    font: inherit
}

.hero-actions {
    margin-top: .4rem
}

.card-title {
    margin: 0
}

.job-header {
    justify-content: space-between
}

.job-title {
    margin: .2rem 0
}

.quote {
    margin: 0
}

.quote p {
    font-size: 1.1rem
}

.quote footer {
    margin-top: .5rem;
    color: var(--muted)
}

.contact-form {
    position: relative
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: .7rem .8rem;
    margin-top: .3rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text)
}

.contact-form button[disabled] {
    opacity: .65;
    cursor: not-allowed
}

.honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none
}

.form-status {
    min-height: 1.2rem;
    font-size: .95rem;
    color: var(--muted)
}

.form-status.pending {
    color: var(--brand-2)
}

.form-status.success {
    color: #4ade80
}

.form-status.error {
    color: #f87171
}

.footer-meta {
    justify-content: space-between
}