:root {
    --page-bg: #fff;
    --surface: #fff;
    --surface-hover: #f4f5f6;
    --surface-subtle: #e9edeb;
    --text: #202124;
    --heading: #32383e;
    --body-text: #535860;
    --muted: #74777d;
    --subtle: #777c84;
    --quiet: #858b92;
    --icon-muted: #90949a;
    --line: #ededed;
    --line-soft: #e7e9eb;
    --timeline-line: #dce1e5;
    --node-border: #c5ccd2;
    --placeholder-bg: #e9ebee;
    --selection: #e5e0fa;
    --accent: #6254c6;
    --accent-soft: #e7e2f8;
    --accent-border: #9f91da;
    --accent-ring: #e9e5fa;
    --accent-panel: #eeebfa;
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--page-bg);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
}

@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;
        --page-bg: #15151e;
        --surface: #1e1d29;
        --surface-hover: #292635;
        --surface-subtle: #242230;
        --text: #ecebf4;
        --heading: #efedf8;
        --body-text: #c0bdcf;
        --muted: #aaa5bc;
        --subtle: #a6a0b8;
        --quiet: #9d96af;
        --icon-muted: #aaa2bd;
        --line: #30303d;
        --line-soft: #363341;
        --timeline-line: #494257;
        --node-border: #625b75;
        --placeholder-bg: #312d42;
        --selection: #4c3d72;
        --accent: #b3a4ff;
        --accent-soft: #332a4b;
        --accent-border: #7767a6;
        --accent-ring: #322940;
        --accent-panel: #211d30;
    }
    :root[data-theme="dark"] .technology-item img[src$="/unity.svg"],
    :root[data-theme="dark"] .project-platforms img[src$="/apple.svg"] { filter: invert(1); }
    :root[data-theme="dark"] .technology-item img[src$="/gdscript.svg"] { filter: brightness(1.6); }
    :root[data-theme="dark"] .client-logo { background: #fff; border-radius: 2px; }
}

* { box-sizing: border-box; }
body { margin: 0; }
::selection { background: var(--selection); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.skip-link { position: fixed; top: 12px; left: 12px; transform: translateY(-160%); z-index: 10; padding: 10px 16px; background: var(--text); color: var(--surface); font-size: 13px; border-radius: 4px; }
.skip-link:focus { transform: translateY(0); }
.site-controls { position: fixed; top: 18px; right: 22px; z-index: 5; display: flex; align-items: center; gap: 8px; }
.language-switcher { display: flex; align-items: center; gap: 5px; padding: 4px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; box-shadow: 0 2px 8px #20212406; }
.language-option { display: flex; align-items: center; justify-content: center; width: 38px; height: 30px; border: 1px solid transparent; border-radius: 4px; opacity: .5; transition: opacity 150ms ease, background-color 150ms ease; }
.language-option:hover { opacity: 1; background: var(--surface-hover); }
.language-option.is-selected { opacity: 1; background: var(--accent-soft); border-color: var(--accent-border); }
.language-flag { display: block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px #20212412; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.theme-toggle:disabled { cursor: default; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.theme-track { display: block; position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--node-border); }
.theme-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #00000020; transition: transform 180ms ease; }
.theme-toggle[aria-checked="true"] .theme-track { background: var(--accent); }
.theme-toggle[aria-checked="true"] .theme-thumb { transform: translateX(14px); }
.theme-toggle[aria-checked="false"] .theme-sun,
.theme-toggle[aria-checked="true"] .theme-moon { color: var(--accent); }

.profile-sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    inset: 0 auto 0 0;
    width: 280px;
    padding: 76px 32px 32px;
    overflow-y: auto;
    background: var(--accent-panel);
    border-right: 1px solid var(--line);
}
.profile-photo { display: block; width: 128px; height: 128px; margin: 0 auto 29px; border-radius: 50%; object-fit: cover; object-position: center; }
.profile-photo-toggle { padding: 0; border: 0; background: transparent; perspective: 700px; cursor: pointer; }
.profile-photo-toggle:disabled { cursor: default; }
.profile-photo-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.profile-photo-rotator { position: relative; display: block; width: 100%; height: 100%; border-radius: inherit; transform-style: preserve-3d; transition: transform 600ms cubic-bezier(.22, .7, .2, 1); }
.profile-photo-toggle.is-github .profile-photo-rotator { transform: rotateY(180deg); }
.profile-photo-face { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.profile-photo-back { transform: rotateY(180deg); }
.photo-placeholder { display: flex; align-items: center; justify-content: center; background: var(--placeholder-bg); color: var(--muted); font-size: 32px; font-weight: 500; letter-spacing: -1px; }
h1 { margin: 0; font-size: 27px; line-height: 1.3; font-weight: 650; letter-spacing: -1px; overflow-wrap: anywhere; }
.profile-title { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.identity, .social-links, .profile-languages, .sidebar-contact { flex-shrink: 0; }
.profile-location { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.profile-location svg { flex-shrink: 0; }
.social-links { display: flex; flex-direction: column; gap: 4px; margin-top: 32px; }
.social-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 8px 10px; margin-left: -10px; border-radius: 5px; color: var(--body-text); font-size: 13px; line-height: 1.5; transition: background-color 150ms ease, color 150ms ease; }
a.social-link:hover { background: var(--accent-soft); color: var(--accent); }
.social-icon { flex: 0 0 18px; }
.external-arrow { margin-left: auto; color: var(--icon-muted); font-size: 16px; }
.social-link-pending { color: var(--quiet); }
.pending-label { margin-left: auto; font-size: 10px; color: var(--muted); }
.profile-languages { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.profile-languages h2 { margin: 0 0 12px; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 500; letter-spacing: .3px; }
.spoken-languages { display: grid; gap: 6px; margin: 0; }
.spoken-languages > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.spoken-languages dt { color: var(--body-text); font-size: 12px; line-height: 1.7; }
.spoken-languages dd { margin: 0; color: var(--quiet); font-size: 10px; line-height: 1.7; }
.sidebar-contact { margin-top: auto; padding-top: 28px; }
.sidebar-contact p { margin: 0 0 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.sidebar-contact a { color: var(--body-text); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.sidebar-contact a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.profile-content {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
    align-items: start;
    margin-left: 280px;
    min-height: 100svh;
}
.overview { min-width: 0; padding: 76px clamp(28px, 3.3vw, 64px) 64px; }
@media screen and (min-width: 1151px) {
    .has-sticky-columns > .overview,
    .has-sticky-columns > .projects-column {
        position: sticky;
        top: var(--column-sticky-top, 0px);
    }
}
.overview h2, .projects-column h2 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 600; letter-spacing: -.9px; }
.roadmap-header, .projects-header { margin-bottom: 44px; }
.roadmap { --date-width: 106px; --roadmap-gap: 18px; list-style: none; padding: 0; margin: 0; }
.roadmap-stop { position: relative; display: grid; grid-template-columns: var(--date-width) 16px minmax(0, 1fr); column-gap: var(--roadmap-gap); padding-bottom: 48px; }
.roadmap-stop::before { content: ''; position: absolute; width: 1px; left: calc(var(--date-width) + var(--roadmap-gap) + 7px); top: 12px; bottom: -12px; background: var(--timeline-line); }
.roadmap-stop:last-child { padding-bottom: 0; }
.roadmap-stop:last-child::before { display: none; }
.roadmap-date { padding-top: 5px; }
.roadmap-date p { margin: 0; color: var(--subtle); font-size: 10px; line-height: 1.65; }
.current-label, .education-label { display: inline-block; margin-top: 10px; font-size: 9px; letter-spacing: .15px; }
.current-label { color: var(--accent); background: var(--accent-soft); padding: 4px 7px; border-radius: 4px; }
.education-label { color: var(--subtle); }
.roadmap-node { position: relative; z-index: 1; width: 15px; height: 15px; margin-top: 6px; border: 2px solid var(--node-border); border-radius: 50%; background: var(--surface); }
.roadmap-stop:not(:last-child):not(.roadmap-current) .roadmap-node { background: var(--accent-soft); border-color: var(--accent-border); }
.roadmap-current .roadmap-node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); }
.roadmap-education .roadmap-node { border-radius: 4px; width: 13px; height: 13px; margin-left: 1px; transform: rotate(45deg); }
.roadmap-detail { min-width: 0; padding-bottom: 1px; }
.company-heading { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: -8px; }
.company-logo { flex: 0 0 44px; width: 44px; height: 44px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.roadmap-detail h3 { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; letter-spacing: -.3px; overflow-wrap: anywhere; }
.roadmap-current h3 { color: var(--accent); }
.company-name-link { text-decoration: none; text-underline-offset: 3px; }
.company-name-link:hover { color: var(--accent); text-decoration: underline; }
.company-link-arrow { display: inline-block; margin-left: 5px; color: var(--icon-muted); font-size: 11px; font-weight: 400; white-space: nowrap; }
.client-company-link { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: 100%; color: var(--body-text); font-size: 11px; line-height: 1.6; }
.client-company-link:hover > span { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-role { margin: 8px 0 0; font-size: 12px; color: var(--body-text); line-height: 1.65; }
.entry-description { margin: 7px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.75; }
.client-assignment { margin-top: 12px; }
.client-logo { display: block; width: 76px; height: 23px; object-fit: contain; object-position: left center; }
.client-assignment .entry-description { margin-top: 6px; }
.education-grade { margin: 12px 0 0; color: var(--subtle); font-size: 11px; }
.education-grade strong { color: var(--body-text); font-size: 12px; font-weight: 600; margin-left: 6px; }
.technologies-section { margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--line); }
.technologies-section h2 { margin-bottom: 28px; font-size: 23px; letter-spacing: -.6px; }
.technology-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 24px 12px; list-style: none; padding: 0; margin: 0; }
.technology-item { display: flex; flex-direction: column; align-items: center; gap: 11px; min-width: 0; text-align: center; }
.technology-item img { display: block; width: 36px; height: 36px; object-fit: contain; }
.technology-item img[src$="/xunit.png"] { background: #242529; border-radius: 5px; }
.technology-item span { max-width: 100%; min-height: 29px; color: var(--muted); font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }

.projects-column { min-width: 0; min-height: 100svh; border-left: 1px solid var(--line); padding: 76px 36px 64px; }
.projects-column h2 { font-size: 25px; letter-spacing: -.7px; line-height: 1.456; }
.personal-project { padding-block: 24px; border-bottom: 1px solid var(--line); }
.personal-project:first-child { padding-top: 0; }
.personal-project:last-child { border-bottom: 0; }
.project-cover { display: block; overflow: hidden; margin-bottom: 18px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-subtle); }
.project-cover img { display: block; width: 100%; height: auto; transition: transform 180ms ease; }
a.project-cover:hover img { transform: scale(1.025); }
.project-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; color: var(--quiet); font-size: 10px; }
.project-meta span + span::before { content: '/'; margin-right: 10px; color: var(--node-border); }
.personal-project h3 { margin: 0; color: var(--heading); font-size: 16px; line-height: 1.45; font-weight: 600; letter-spacing: -.2px; overflow-wrap: anywhere; }
.personal-project h3 a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.personal-project h3 a:hover { color: var(--accent); }
.personal-project h3 a span { flex-shrink: 0; color: var(--icon-muted); font-weight: 400; }
.project-description { margin: 11px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.8; }
.project-platforms { display: flex; flex-wrap: wrap; gap: 8px 14px; list-style: none; padding: 0; margin: 16px 0 0; }
.project-platforms li { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.project-platforms img { display: block; width: 16px; height: 16px; object-fit: contain; }
.projects-github { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--body-text); }
.projects-github:hover { color: var(--accent); }
.error-page { max-width: 640px; margin: 100px auto; padding: 24px; }
.error-page h1 { font-size: 32px; }
.error-page p { color: var(--muted); line-height: 1.7; }
.error-page a { display: inline-block; margin-top: 12px; text-decoration: underline; }

@media (max-width: 1400px) and (min-width: 1151px) {
    .overview { padding-inline: 30px; }
    .projects-column { padding-inline: 28px; }
    .roadmap-stop { grid-template-columns: 16px minmax(0, 1fr); column-gap: 20px; padding-bottom: 36px; }
    .roadmap-stop::before { left: 7px; top: 10px; bottom: -10px; }
    .roadmap-date { grid-column: 2; grid-row: 1; padding-top: 0; margin-bottom: 14px; }
    .roadmap-node { grid-column: 1; grid-row: 1 / span 2; margin-top: 3px; }
    .roadmap-detail { grid-column: 2; }
    .current-label, .education-label { margin: 0 0 0 8px; }
}

@media (max-width: 1150px) {
    .profile-sidebar { width: 260px; padding: 60px 28px 28px; }
    .profile-content { display: block; margin-left: 260px; }
    .overview { padding: 60px 40px; }
    .projects-column { min-height: 0; border-left: 0; border-top: 1px solid var(--line); padding: 44px 40px; }
    .personal-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; align-items: start; }
    .personal-project { min-width: 0; }
    .personal-project:nth-child(2) { padding-top: 0; }
    .projects-header { margin-bottom: 28px; }
}

@media (max-width: 900px) {
    .roadmap-stop { grid-template-columns: 16px minmax(0, 1fr); column-gap: 20px; padding-bottom: 36px; }
    .roadmap-stop::before { left: 7px; top: 10px; bottom: -10px; }
    .roadmap-date { grid-column: 2; grid-row: 1; padding-top: 0; margin-bottom: 14px; }
    .roadmap-node { grid-column: 1; grid-row: 1 / span 2; margin-top: 3px; }
    .roadmap-detail { grid-column: 2; }
    .current-label, .education-label { margin: 0 0 0 8px; }
    .project-featured { display: block; }
    .project-featured .project-cover { max-width: 400px; margin-bottom: 18px; }
}

@media (max-width: 700px) {
    .site-controls { top: 14px; right: 16px; }
    .profile-sidebar { position: relative; inset: auto; width: 100%; padding: 84px 28px 30px; border-right: 0; border-bottom: 1px solid var(--line); }
    .profile-photo { width: 104px; height: 104px; margin-bottom: 23px; }
    h1 { font-size: 26px; }
    .social-links { margin-top: 24px; max-width: 260px; }
    .profile-content { margin-left: 0; min-height: 30svh; }
    .overview { padding: 36px 28px 44px; }
    .overview h2 { font-size: 27px; }
    .technologies-section { margin-top: 38px; padding-top: 26px; }
    .technologies-section h2 { font-size: 23px; }
    .roadmap-header { margin-bottom: 32px; }
    .roadmap-detail h3 { font-size: 17px; }
    .projects-column { padding: 36px 28px; }
    .projects-column h2 { font-size: 25px; }
    .personal-projects { display: block; }
    .personal-project:nth-child(2) { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
    .profile-sidebar { position: static; width: 100%; border: 0; padding: 0; background: var(--surface); }
    .profile-content { display: block; margin: 0; min-height: 0; }
    .overview { padding: 36px 0 0; }
    .projects-column { min-height: 0; padding: 36px 0 0; border: 0; }
    .personal-projects { display: block; }
    .personal-project, .roadmap-stop { break-inside: avoid; }
    .technologies-section { break-inside: avoid; }
    .project-cover { max-width: 220px; }
    .project-featured { display: block; }
    .skip-link, .site-controls { display: none; }
    .social-links { max-width: 240px; }
    .social-link-pending { display: none; }
}
