:root {
    --bg: #050505;
    --bg-glow: rgba(94, 234, 212, 0.08);
    --panel: rgba(255, 255, 255, 0.045);
    --panel-hover: rgba(255, 255, 255, 0.075);
    --text: #f8fafc;
    --muted: #98a2b3;
    --soft: #cbd5e1;
    --line: rgba(148, 163, 184, 0.18);
    --accent: #5eead4;
    --accent-soft: rgba(94, 234, 212, 0.12);
    --toggle-bg: rgba(255, 255, 255, 0.08);
    --toggle-border: rgba(255, 255, 255, 0.16);
    --toggle-thumb: #f8fafc;
    --toggle-shadow: rgba(0, 0, 0, 0.28);
    color-scheme: dark;
}

:root[data-theme="light"] {
    --bg: #f8fafc;
    --bg-glow: rgba(20, 184, 166, 0.14);
    --panel: rgba(15, 23, 42, 0.035);
    --panel-hover: rgba(15, 23, 42, 0.065);
    --text: #0f172a;
    --muted: #475569;
    --soft: #334155;
    --line: rgba(15, 23, 42, 0.14);
    --accent: #0f766e;
    --accent-soft: rgba(15, 118, 110, 0.12);
    --toggle-bg: rgba(15, 23, 42, 0.08);
    --toggle-border: rgba(15, 23, 42, 0.14);
    --toggle-thumb: #ffffff;
    --toggle-shadow: rgba(15, 23, 42, 0.16);
    color-scheme: light;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    background-image: radial-gradient(circle at 15% 15%, var(--bg-glow), transparent 30%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background-color 420ms ease, color 420ms ease;
}

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

p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

body,
a,
p,
h1,
.hero h2,
.section-label,
.item-year,
.main-nav a,
.main-nav span,
.social-links a,
.item-card,
.item-card h3,
.tags li,
.theme-toggle,
.theme-toggle__track,
.theme-toggle__thumb,
.theme-toggle__icon {
    transition:
        background-color 420ms ease,
        border-color 420ms ease,
        box-shadow 420ms ease,
        color 420ms ease,
        opacity 260ms ease,
        transform 260ms ease,
        width 160ms ease;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 10;
    transform: translateY(-120%);
    border: 1px solid var(--accent);
    background: #000;
    color: var(--accent);
    padding: 10px 14px;
}

.skip-link:focus {
    transform: translateY(0);
}

.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.theme-toggle__track {
    position: relative;
    width: 62px;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--toggle-border);
    border-radius: inherit;
    background: var(--toggle-bg);
    box-shadow: 0 12px 28px var(--toggle-shadow);
    backdrop-filter: blur(14px);
}

.theme-toggle__thumb {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--toggle-thumb);
    box-shadow: 0 6px 14px var(--toggle-shadow);
}

.theme-toggle__icon {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
}

.theme-toggle__icon--sun {
    left: 11px;
    color: #f59e0b;
}

.theme-toggle__icon--moon {
    right: 11px;
    color: #94a3b8;
}

.theme-toggle__icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:root[data-theme="light"] .theme-toggle__thumb {
    transform: translateX(28px);
}

:root[data-theme="dark"] .theme-toggle__icon--sun,
:root[data-theme="light"] .theme-toggle__icon--moon {
    opacity: 0.45;
}

.site-shell {
    --sidebar-width: min(430px, 38vw);
    --column-gap: clamp(48px, 8vw, 120px);
    width: min(1120px, 90vw);
    margin: 0 auto;
}

.hero {
    position: fixed;
    left: max(5vw, calc((100vw - 1120px) / 2));
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 96px 0;
}

.eyebrow,
.section-label,
.item-year {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1 {
    margin-top: 14px;
    color: var(--text);
    font-size: clamp(2.5rem, 5vw, 4.25rem);
    line-height: 0.95;
}

.hero h2 {
    margin-top: 20px;
    color: var(--soft);
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 600;
}

.summary {
    max-width: 430px;
    margin-top: 20px;
}

.main-nav {
    display: grid;
    gap: 16px;
    margin: 32px 0 0;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 160ms ease;
}

.main-nav span {
    display: block;
    width: 34px;
    height: 1px;
    background: var(--muted);
    transition: width 160ms ease, background 160ms ease;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
    color: var(--text);
}

.main-nav a:hover span,
.main-nav a:focus span,
.main-nav a.active span {
    width: 64px;
    background: var(--text);
}

.social-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: auto;
}

.social-links a,
.resume-link {
    display: inline-flex;
    align-items: center;
    color: var(--soft);
    font-weight: 700;
    line-height: 1;
    transition: color 160ms ease;
}

.social-links a:hover,
.social-links a:focus,
.resume-link:hover,
.resume-link:focus,
.item-card h3 a:hover,
.item-card h3 a:focus {
    color: var(--accent);
}

.content {
    width: calc(100% - var(--sidebar-width) - var(--column-gap));
    margin-left: calc(var(--sidebar-width) + var(--column-gap));
    padding: 96px 0;
}

section {
    scroll-margin-top: 96px;
    margin-bottom: 128px;
}

section h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.section-label {
    margin-bottom: 24px;
}

section > p + p {
    margin-top: 16px;
}

.item-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 18px;
    margin: 0 -20px 18px;
    padding: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.item-card:hover,
.item-card:focus {
    transform: translateY(-2px);
    border-color: var(--line);
    background: var(--panel-hover);
    outline: none;
}

.item-card:hover h3,
.item-card:focus h3 {
    color: var(--accent);
}

.item-year {
    padding-top: 4px;
    color: var(--muted);
}

.item-card h3 {
    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.35;
}

.link-arrow {
    display: inline-block;
    margin-left: 4px;
    color: currentColor;
    transition: transform 160ms ease;
}

.item-card:hover .link-arrow,
.item-card:focus .link-arrow {
    transform: translate(3px, -3px);
}

.item-card p {
    margin-top: 10px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    list-style: none;
}

.tags li {
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 7px 12px;
}

.tags li.tag-favorite {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(250, 204, 21, 0.18);
    color: #facc15;
}

.tag-icon {
    font-size: 0.8em;
    line-height: 1;
}

.tags li.tag-personal {
    background: rgba(125, 211, 252, 0.16);
    color: #7dd3fc;
}

.tags li.tag-school {
    background: rgba(163, 230, 53, 0.16);
    color: #a3e635;
}

:root[data-theme="light"] .tags li.tag-favorite {
    background: rgba(202, 138, 4, 0.14);
    color: #854d0e;
}

:root[data-theme="light"] .tags li.tag-personal {
    background: rgba(2, 132, 199, 0.12);
    color: #0369a1;
}

:root[data-theme="light"] .tags li.tag-school {
    background: rgba(77, 124, 15, 0.12);
    color: #3f6212;
}

@media (max-width: 860px) {
    body {
        background: var(--bg);
    }

    .site-shell {
        display: block;
        width: min(680px, 90vw);
    }

    .hero {
        position: static;
        width: auto;
        height: auto;
        min-height: auto;
        padding: 64px 0 36px;
    }

    .main-nav {
        display: none;
    }

    .content {
        width: auto;
        margin-left: 0;
        padding: 36px 0 64px;
    }

    section {
        margin-bottom: 84px;
    }

    section h2 {
        position: static;
        width: auto;
        height: auto;
        margin: 0 0 18px;
        overflow: visible;
        clip: auto;
        color: var(--text);
        font-size: 1rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .section-label {
        display: none;
    }
}

@media (max-width: 560px) {
    .site-shell {
        width: min(100% - 32px, 680px);
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
    }

    .hero {
        padding-top: 44px;
    }

    .item-card {
        grid-template-columns: 1fr;
        margin-inline: 0;
        padding: 18px 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
    }

    .item-card:hover {
        transform: none;
        border-color: var(--line);
        background: transparent;
    }
}
