:root {
    --bg: #0b1115;
    --bg-elev: #121a21;
    --text: #e6edf3;
    --muted: #9fb0bf;
    --card: #0f151a;
    --brand: #5ab0ff;
    --brand-strong: #2a92ff;
    --line: #1f2a33;
    --chip-bg: #101820;
    --success: #2ecc71;
}

[data-theme="light"] {
    --bg: #f7fbff;
    --bg-elev: #ffffff;
    --text: #0f1720;
    --muted: #475569;
    --card: #ffffff;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --line: #e2e8f0;
    --chip-bg: #f1f5f9;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.container { max-width: 1100px; padding: 0 20px; margin: 0 auto; }

.skip-link {
    position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { position: static; width: auto; height: auto; padding: 8px 12px; background: var(--brand); color: #fff; border-radius: 8px; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    background: color-mix(in oklab, var(--bg) 70%, transparent);
    border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; gap: 16px; padding: 12px 20px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; }
.brand-avatar { width: 28px; height: 28px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.brand-name { letter-spacing: 0.2px; }

.nav { margin-left: auto; }
.nav-list { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav-list a:hover { background: var(--chip-bg); }
.nav-list a.is-active { color: var(--brand); }

.nav-toggle { display: none; background: none; border: none; padding: 8px; border-radius: 8px; color: var(--text); }
.nav-toggle-bar { width: 22px; height: 2px; background: currentColor; position: relative; display: inline-block; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: currentColor; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

.icon-btn { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px; margin-left: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--chip-bg); }
.icon { display: block; }

main.container { padding: 32px 20px; }

.section { margin: 32px 0; }
.section h2 { margin: 0 0 14px; font-size: 1.6rem; letter-spacing: -0.01em; }

.hero { padding-top: 12px; }
.hero-grid { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; }
.hero .avatar { width: 180px; height: 180px; border-radius: 16px; object-fit: cover; border: 1px solid var(--line); }
.hero .subtitle { color: var(--muted); margin-top: 8px; }
.cta-row { display: flex; gap: 12px; margin-top: 16px; }
.btn { display: inline-block; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; border: none; }
.btn:hover { filter: brightness(1.05); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.timeline-item { padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-heading { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; }
.meta { color: var(--muted); margin: 4px 0 0; }

.experience-list { display: grid; gap: 16px; }
.xp { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--bg-elev); }
.xp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.xp .logo { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.xp ul { margin: 10px 0 0 0; padding-left: 20px; }
.xp li { margin-bottom: 8px; }

.skill-block + .skill-block { margin-top: 14px; }
.chips { display: flex; gap: 10px; list-style: none; padding: 0; margin: 8px 0 0; }
.chips.wrap { flex-wrap: wrap; }
.chip { background: var(--chip-bg); color: var(--text); border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; font-size: 0.9rem; }

.cards { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 14px; }
.project { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.project h3 { margin: 0 0 8px; font-size: 1.05rem; }
.project a { color: var(--brand); text-decoration: none; }
.project a:hover { text-decoration: underline; }

.book-list { display: grid; gap: 8px; padding-left: 18px; }

.inline-link { color: var(--brand); text-decoration: none; }
.inline-link:hover { text-decoration: underline; }

.icon-img { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }

.site-footer { border-top: 1px solid var(--line); margin-top: 32px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 28px; color: var(--muted); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 120px 1fr; }
    .hero .avatar { width: 120px; height: 120px; border-radius: 12px; }
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-block; }
    .nav-list { position: absolute; right: 20px; top: 56px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: none; flex-direction: column; min-width: 220px; }
    .nav-list.show { display: flex; }
    .nav-list a { padding: 10px 12px; }
    .timeline-heading { grid-template-columns: 1fr; }
}