:root {
    color-scheme: light dark;
    --header-offset: 84px;
    --bg: #0b1020;
    --panel: rgba(255, 255, 255, 0.06);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.70);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 50px rgba(0,0,0,.35);
    --radius: 16px;
    --max: 1000px;
    --accent: #7cdbff;
    --accent2: #b2ff9e;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #f6f7fb;
        --panel: rgba(0, 0, 0, 0.04);
        --text: rgba(0, 0, 0, 0.88);
        --muted: rgba(0, 0, 0, 0.65);
        --border: rgba(0, 0, 0, 0.12);
        --shadow: 0 18px 50px rgba(0,0,0,.12);
        --accent: #0077ff;
        --accent2: #12b886;
    }
}

[data-theme="light"] {
    --bg: #f6f7fb;
    --panel: rgba(0, 0, 0, 0.04);
    --text: rgba(0, 0, 0, 0.88);
    --muted: rgba(0, 0, 0, 0.65);
    --border: rgba(0, 0, 0, 0.12);
    --shadow: 0 18px 50px rgba(0,0,0,.12);
    --accent: #0077ff;
    --accent2: #12b886;
}

[data-theme="dark"] {
    --bg: #0b1020;
    --panel: rgba(255, 255, 255, 0.06);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.70);
    --border: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 50px rgba(0,0,0,.35);
    --accent: #7cdbff;
    --accent2: #b2ff9e;
}

* { box-sizing: border-box; }

html {
    height: 100%;
    scroll-padding-top: var(--header-offset);
    scroll-behavior: smooth;
}

[id] {
    scroll-margin-top: var(--header-offset);
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.55;
    color: var(--text);
    background:
            radial-gradient(900px 400px at 15% 10%, rgba(124,219,255,.25), transparent 60%),
            radial-gradient(800px 380px at 90% 15%, rgba(178,255,158,.18), transparent 60%),
            var(--bg);
    background-repeat: no-repeat;
    background-color: var(--bg);
    background-attachment: fixed;
}

a { color: inherit; }

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 28px 18px 64px;
}

header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(10px);
    background: linear-gradient(to bottom, rgba(0,0,0,.25), rgba(0,0,0,0));
    border-bottom: 1px solid rgba(255,255,255,.06);
    z-index: 10;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) header {
        background: linear-gradient(to bottom, rgba(246,247,251,.92), rgba(246,247,251,0));
        border-bottom: 1px solid rgba(0,0,0,.06);
    }
}

[data-theme="light"] header {
    background: linear-gradient(to bottom, rgba(246,247,251,.92), rgba(246,247,251,0));
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: var(--shadow);
}

.brand strong { font-size: 0.98rem; letter-spacing: 0.2px; }
.brand span { display: block; font-size: 0.82rem; color: var(--muted); margin-top: -2px; }

.navlinks {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.chip {
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    text-decoration: none;
    font-size: 0.92rem;
    color: var(--muted);
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.chip:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.05);
    color: var(--text);
}

[data-theme="light"] .chip:hover { background: rgba(0,0,0,0.05); }

.btn {
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124,219,255,.18), rgba(178,255,158,.12));
    color: var(--text);
    padding: 9px 12px;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    transition: transform 160ms ease, filter 160ms ease;
}

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

.hero {
    margin-top: 26px;
    padding: 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow);
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 3.2vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 1.05rem;
    max-width: var(--max);
}

.cta-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.primary {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(124,219,255,.35), rgba(178,255,158,.22));
    font-weight: 600;
    transition: transform 160ms ease, filter 160ms ease;
}

.primary:hover { transform: translateY(-1px); filter: brightness(1.08); }

.secondary {
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255,255,255,0.02);
}

[data-theme="light"] .secondary { background: rgba(0,0,0,0.02); }

section { margin-top: 22px; }

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
}

.card {
    grid-column: span 12;
    padding: 18px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
}

.card.full { grid-column: span 12; }

@media (min-width: 760px) {
    .card.half { grid-column: span 6; }
    .card.third { grid-column: span 4; }
}

.card h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

.card p { margin: 0; color: var(--muted); }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    font-size: 0.85rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.02);
}

[data-theme="light"] .tag { background: rgba(0,0,0,0.02); }

.project-meta {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.project-meta a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,.35);
}

[data-theme="light"] .project-meta a { border-bottom-color: rgba(0,0,0,.35); }

.contact-form {
    margin-top: 14px;
    display: grid;
    gap: 12px;
    width: 100%;
}

.contact-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    color: var(--text);
    font: inherit;
}

[data-theme="light"] .contact-form input,
[data-theme="light"] .contact-form textarea {
    background: rgba(0,0,0,0.02);
}

.contact-form textarea { resize: vertical; min-height: 120px; }

footer {
    margin-top: 26px;
    color: var(--muted);
    font-size: 0.92rem;
}
