:root {
    --teal: #008080;
    --teal-dark: #006666;
    --ink: #172326;
    --muted: #5d6c70;
    --paper: #f7faf9;
    --card: #ffffff;
    --line: #d8e5e3;
    --max-width: 1180px;
}
[data-theme="dark"] {
    --ink: #edf5f3;
    --muted: #afc1bf;
    --paper: #101918;
    --card: #172321;
    --line: #2b4441;
    --teal-dark: #63c8c1;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ink: #edf5f3;
        --muted: #afc1bf;
        --paper: #101918;
        --card: #172321;
        --line: #2b4441;
        --teal-dark: #63c8c1;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    transition: color .25s ease, background-color .25s ease;
}
a { color: var(--teal-dark); }
a:hover { color: var(--teal); }
img { max-width: 100%; display: block; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(14px);
    transition: border-color .25s ease, background-color .25s ease;
}
.header-inner, main, .site-footer {
    width: min(100% - 2rem, var(--max-width));
    margin-inline: auto;
}
.header-inner {
    min-height: 4.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.header-actions { order: 3; display: flex; align-items: center; gap: .65rem; }
.brand {
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -.03em;
    text-decoration: none;
    transition: opacity .25s ease, transform .25s ease;
}
.brand span { color: var(--teal); }
.site-header.is-home .brand {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-.35rem);
}
.nav-toggle {
    display: none;
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    padding: 0;
    color: var(--ink);
    background: var(--card);
    font: inherit;
    cursor: pointer;
}
.nav-toggle span {
    position: absolute;
    left: .7rem;
    width: 1rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span:nth-child(1) { transform: translateY(-.3rem); }
.nav-toggle span:nth-child(3) { transform: translateY(.3rem); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg); }
.nav-toggle:hover { color: var(--teal); border-color: var(--teal); }
.back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 90%, transparent);
    box-shadow: 0 .5rem 1.5rem rgba(23, 35, 38, .12);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(.75rem);
    transition: opacity .2s ease, transform .2s ease, color .2s ease, border-color .2s ease;
}
.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover { color: var(--teal); border-color: var(--teal); }
.back-to-top span { font-size: 1.35rem; line-height: 1; }
.theme-toggle {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink);
    background: var(--card);
    font: inherit;
    cursor: pointer;
}
.theme-toggle:hover { color: var(--teal); border-color: var(--teal); }
.theme-icon { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.theme-icon-moon, [data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; fill: currentColor; stroke: none; }
.nav-list {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
}
.header-inner > nav { order: 2; margin-left: auto; }
.nav-list a { color: var(--muted); text-decoration: none; }
.nav-list a:hover, .nav-list a[aria-current="true"] { color: var(--teal); }
.language-link {
    display: inline-grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--teal) !important;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}
.language-link:hover { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.hero {
    min-height: min(720px, calc(100vh - 4.25rem));
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 7rem);
    padding: clamp(4rem, 10vw, 8rem) 0;
}
.eyebrow {
    margin: 0 0 .8rem;
    color: var(--teal);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -.045em; }
h1 { max-width: 780px; margin: 0; font-size: clamp(3.3rem, 9vw, 7.4rem); }
h1 span { color: var(--teal); }
h1 .name-primary { color: var(--ink); }
.name-character { display: inline-block; }
.name-primary .name-character { color: var(--ink); }
.name-accent .name-character { color: var(--teal); }
.hero-lead { max-width: 650px; margin: 1.5rem 0 0; color: var(--muted); font-size: clamp(1.1rem, 2vw, 1.35rem); }
.hero-actions, .social-links { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; }
.hero-actions { margin-top: 2rem; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: .65rem 1rem;
    border: 1px solid var(--teal);
    border-radius: 999px;
    color: #fff;
    background: var(--teal);
    font-weight: 750;
    text-decoration: none;
}
.button:hover { color: #fff; background: var(--teal-dark); }
.button.secondary { color: var(--teal-dark); background: transparent; }
.social-links { margin-top: 1.4rem; }
.social-links a {
    display: inline-grid;
    width: 2.6rem;
    height: 2.6rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.social-links a:hover { border-color: var(--teal); color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.social-links svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
.social-links img { width: 1.5rem; height: 1.5rem; object-fit: contain; filter: grayscale(1) saturate(0) brightness(.65); }
[data-theme="dark"] .social-links img { filter: grayscale(1) saturate(0) brightness(1.8); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .social-links img { filter: grayscale(1) saturate(0) brightness(1.8); }
}
.social-links a:hover { color: var(--teal); }
.hero-portrait { justify-self: end; position: relative; cursor: pointer; }
.hero-portrait::before {
    content: "";
    position: absolute;
    inset: 1.2rem -1.2rem -1.2rem 1.2rem;
    border: 1px solid var(--teal);
    border-radius: 1.5rem;
}
.hero-portrait img {
    position: relative;
    width: min(100%, 330px);
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 1.5rem;
}
.hero-portrait:focus-visible { outline: 3px solid var(--teal); outline-offset: .5rem; border-radius: 1.5rem; }
.egg-particle {
    position: fixed;
    z-index: 20;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    pointer-events: none;
}
.section { position: relative; padding: clamp(2.5rem, 5vw, 4rem) 0; border-top: 1px solid var(--line); }
.section:last-child { padding-bottom: clamp(2rem, 4vw, 3rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-heading .eyebrow, .section-heading h2, .section-heading .section-intro { opacity: 0; }
h2 { margin: 0; font-size: clamp(2.2rem, 5vw, 4rem); }
.section-intro { max-width: 40rem; margin: .8rem 0 0; color: var(--muted); }
.timeline {
    --timeline-axis: 0;
    --timeline-gap: 2rem;
    position: relative;
    margin-left: clamp(.75rem, 2vw, 1.5rem);
}
.timeline::before {
    content: "";
    position: absolute;
    top: .5rem;
    bottom: .5rem;
    left: calc(var(--timeline-axis) - 1px);
    width: 2px;
    background: linear-gradient(to bottom, var(--teal) var(--timeline-progress, 0%), var(--line) var(--timeline-progress, 0%));
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 5rem), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 calc(100% - 5rem), transparent 100%);
    transform-origin: top;
}
.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: var(--timeline-gap);
    padding: 0 0 2.8rem var(--timeline-gap);
    break-inside: avoid;
    page-break-inside: avoid;
}
.timeline-item::before {
    content: "";
    position: absolute;
    top: .2rem;
    left: var(--timeline-axis);
    width: 1rem;
    height: 1rem;
    border: 3px solid var(--paper);
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 1px var(--teal);
    transform: translateX(-50%);
    transition: background-color .25s ease;
}
.timeline-item.is-active::before { background: var(--teal); }
.date { color: var(--teal-dark); font-size: .85rem; font-weight: 800; text-align: left; }
h3 { margin: 0; font-size: clamp(1.35rem, 2.5vw, 2rem); }
.meta { margin: .35rem 0 .65rem; color: var(--teal-dark); font-weight: 700; }
.timeline-item p { max-width: 720px; margin: 0; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--card);
    will-change: transform;
    transition: border-color .25s ease, background-color .25s ease;
}
.card p { flex: 1; color: var(--muted); }
.card .button { align-self: flex-start; margin-top: .8rem; }
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: 0 1rem 2rem rgba(0, 128, 128, 0);
    transition: box-shadow .25s ease;
}
.card { position: relative; }
.card:hover::after { box-shadow: 0 1rem 2rem rgba(0, 128, 128, .12); }
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.skill-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--card); transition: border-color .25s ease, background-color .25s ease; }
.skill-card h3 { margin-bottom: 1rem; color: var(--teal-dark); font-size: 1.15rem; }
.skill-list { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.skill-list li { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .65rem; border-radius: .45rem; color: var(--ink); background: color-mix(in srgb, var(--teal) 12%, transparent); font-size: .88rem; font-weight: 700; }
.skill-icon { width: 1.25rem; height: 1.25rem; object-fit: contain; filter: grayscale(1) brightness(0); }
[data-theme="dark"] .skill-icon { filter: grayscale(1) brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .skill-icon { filter: grayscale(1) brightness(0) invert(1); }
}
.skill-flag { width: 1.25rem; font-size: 1.05rem; line-height: 1; text-align: center; }
.interest-list { display: flex; flex-wrap: wrap; gap: .7rem; padding: 0; list-style: none; }
.interest-list li { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.interest-icon { width: 1.25rem; height: 1.25rem; filter: grayscale(1) brightness(0); }
[data-theme="dark"] .interest-icon { filter: grayscale(1) brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .interest-icon { filter: grayscale(1) brightness(0) invert(1); }
}
.interest-list li:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }
.site-footer { padding: 1rem 0 2rem; color: var(--muted); font-size: .9rem; }
.reveal { opacity: 0; }
.button { position: relative; overflow: hidden; }
.button::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -55%;
    width: 35%;
    background: rgba(255, 255, 255, .25);
    transform: skewX(-20deg);
    pointer-events: none;
}
.button:hover::after { animation: button-sheen .65s ease; }
@keyframes button-sheen { to { left: 125%; } }
.nav-list a { position: relative; }
.nav-list a:not(.language-link)::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -.3rem;
    left: 0;
    height: 2px;
    background: var(--teal);
    transform: scaleX(0);
    transform-origin: left;
}
.nav-list a[aria-current="true"]::after { transform: scaleX(1); }
@media (max-width: 760px) {
    .header-inner { width: 100%; min-height: 3.8rem; padding-inline: 1rem; gap: 0; }
    .header-actions { margin-left: auto; }
    .nav-toggle { display: block; }
    .nav-list {
        display: none;
        position: absolute;
        top: 3.8rem;
        right: 1rem;
        left: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: .5rem;
        border: 1px solid var(--line);
        border-radius: .75rem;
        background: var(--card);
        box-shadow: 0 1rem 2rem rgba(23, 35, 38, .1);
    }
    .header-inner > nav { margin-left: 0; }
    .nav-list.is-open { display: flex; }
    .nav-list a { display: inline-block; align-self: flex-start; width: auto; padding: .65rem .75rem; }
    .nav-list a:not(.language-link)::after { right: .75rem; bottom: .35rem; left: .75rem; }
    .hero { min-height: auto; grid-template-columns: 1fr; padding: 3.5rem 0 3.75rem; }
    .hero-portrait { order: -1; justify-self: start; }
    .hero-portrait img { width: 170px; border-radius: 1rem; }
    .hero-portrait::before { inset: .7rem -.7rem -.7rem .7rem; border-radius: 1rem; }
    .section-heading { display: block; margin-bottom: 1.25rem; }
    .section:last-child { padding-bottom: 1.5rem; }
    .timeline { margin-left: .35rem; }
    .timeline-item { grid-template-columns: 1fr; gap: .25rem; padding-left: 1.6rem; }
    .card-grid, .skills-grid { grid-template-columns: 1fr; }
    .button { width: 100%; }
    .hero-actions { align-items: stretch; }
    .back-to-top { right: 1rem; bottom: 1rem; }
}
@media (max-width: 1200px) {
    .hero { padding-inline: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .section-heading .eyebrow, .section-heading h2, .section-heading .section-intro { opacity: 1; }
    .button:hover::after { animation: none; }
    body, .site-header, .brand, .card, .skill-card { transition: none; }
    .nav-toggle span, .back-to-top { transition: none; }
}
