@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Syne:wght@500;600;700;800&display=swap');

:root {
    --bg: #090b10;
    --text: #f4f0e6;
    --text-muted: #a39e93;
    --muted: #a39e93;
    --line: rgba(244, 240, 230, 0.14);
    --signal: #d6ff4b;
    --signal-dim: rgba(214, 255, 75, 0.12);
    --ice: #9eb6ff;
    --accent: #d6ff4b;
    --accent2: #9eb6ff;
    --accent3: #f4f0e6;
    --card: rgba(244, 240, 230, 0.03);
    --card-border: rgba(244, 240, 230, 0.12);
    --rail: 228px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
}

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 1px 1px, rgba(244, 240, 230, 0.07) 1px, transparent 0) 0 0 / 28px 28px;
}

.app {
    position: relative;
    z-index: 1;
    margin-left: var(--rail);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.rail {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: var(--rail);
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.15rem 1.5rem;
    border-right: 1px solid var(--line);
    background: rgba(9, 11, 16, 0.9);
    backdrop-filter: blur(16px);
}

.mark {
    color: var(--text);
    text-decoration: none;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.nav-toggle span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.25s ease, top 0.25s ease;
}

.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 24px; }
.nav-toggle.open span:first-child { top: 20px; transform: rotate(40deg); }
.nav-toggle.open span:last-child { top: 20px; transform: rotate(-40deg); }

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 2.2rem;
}

.nav-links a {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.98rem;
    padding: 0.38rem 0.2rem;
    border-left: 2px solid transparent;
    padding-left: 0.7rem;
}

.nav-links a span {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--ice);
    width: 1.4rem;
}

.nav-links a:hover { color: var(--text); }
.nav-links a.is-active {
    color: var(--text);
    border-left-color: var(--signal);
}

.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    overflow: hidden;
    min-height: 100vh;
    padding: 4.5rem 3.2rem 6rem;
}

.hero-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0.8;
    filter: brightness(0.8);
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(9, 11, 16, 0.88) 0%, rgba(9, 11, 16, 0.62) 38%, rgba(9, 11, 16, 0.28) 68%, rgba(9, 11, 16, 0.45) 100%),
        linear-gradient(180deg, rgba(9, 11, 16, 0.35) 0%, transparent 22%, transparent 62%, #090b10 100%);
}

.hero-copy {
    position: relative;
    z-index: 2;
    min-width: 0;
    max-width: 40rem;
}

.kicker {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    font-size: 0.92rem;
    margin-bottom: 1.1rem;
}

.node {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 0 rgba(214, 255, 75, 0.7);
    animation: ping 2.8s ease-out infinite;
}

@keyframes ping {
    0% { box-shadow: 0 0 0 0 rgba(214, 255, 75, 0.55); }
    100% { box-shadow: 0 0 0 10px rgba(214, 255, 75, 0); }
}

h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 4.2vw, 4.15rem);
    line-height: 0.96;
    letter-spacing: -0.045em;
}

h1 span {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.28em;
    letter-spacing: 0.18em;
    color: var(--signal);
}

.roles {
    max-width: 36rem;
    margin-top: 1.25rem;
    color: var(--text);
    font-size: 1.12rem;
}

.where {
    margin-top: 0.45rem;
    color: var(--muted);
}

.metrics {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 2.2rem;
    border-top: 1px solid var(--line);
    max-width: 34rem;
}

.metric {
    padding: 1rem 1rem 1rem 0;
    border-bottom: 1px solid var(--line);
}

.metric:nth-child(odd) { padding-right: 1.2rem; }
.metric:nth-child(even) { padding-left: 1.2rem; border-left: 1px solid var(--line); }

.counter {
    display: block;
    font-family: 'Syne', sans-serif;
    font-size: 2.35rem;
    letter-spacing: -0.04em;
    line-height: 1;
}

.metric span:last-child {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-content {
    width: min(980px, calc(100% - 4rem));
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
    flex: 1;
}

.home .page-content { border-top: 1px solid var(--line); padding-top: 2.2rem; }

h2 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2rem, 4vw, 3.15rem);
    letter-spacing: -0.04em;
    line-height: 1.05;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

h2::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 0.55rem;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 12px rgba(214, 255, 75, 0.75);
    vertical-align: 0.12em;
}

h2 ~ h2 { margin-top: 3.4rem; }

.lede, .timeline-intro, .page-content > p {
    color: var(--muted);
    max-width: 44rem;
    margin-bottom: 1.6rem;
    font-size: 1.08rem;
}

.jumps { display: flex; flex-wrap: wrap; gap: 0.75rem 1.3rem; margin-top: 0.4rem; }
.jumps a {
    color: var(--text);
    text-decoration: none;
    font-family: 'Syne', sans-serif;
    border-bottom: 1px solid var(--signal);
    padding-bottom: 0.12rem;
}
.jumps a:hover { color: var(--signal); }

.ledger { margin-top: 0.4rem; }

.record {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 1.15rem 0.35rem;
    border-top: 1px solid var(--line);
}

.record:last-child { border-bottom: 1px solid var(--line); }
.record.has-img { grid-template-columns: 2.6rem minmax(0, 1fr) 96px; }

.idx {
    color: var(--signal);
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    padding-top: 0.28rem;
    letter-spacing: 0.06em;
}

.record h3, .skill h3, .timeline-content h3 {
    font-family: 'Syne', sans-serif;
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.record p, .skill p { color: var(--muted); margin-top: 0.28rem; font-size: 0.98rem; }

.record:hover { background: var(--signal-dim); }

.record-img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
}

.empty { color: var(--muted); padding: 0.8rem 0 1.2rem; }

.ledger-label, .publication-category > h3, .research-profiles h3 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin: 2.1rem 0 0.35rem;
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.category-count { color: var(--signal); font-size: 0.95rem; font-weight: 600; }

.profile-notes {
    max-width: 46rem;
    margin: 0.4rem 0 0.2rem 1.1rem;
    color: var(--muted);
}

.profile-notes li { margin: 0.55rem 0; }

.area-list { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.8rem; }

.area-list span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.38rem 0.75rem;
    font-size: 0.92rem;
    color: var(--text);
}

.area-list span::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 0.45rem;
    border-radius: 50%;
    background: var(--signal);
    transform: translateY(-1px);
}

.profile-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
    margin-top: 0.8rem;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 0.8rem 1rem 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--line);
    background: transparent;
    min-width: 0;
}

.profile-btn img, .profile-icon {
    width: 36px;
    height: 36px;
    font-size: 1.35rem;
    text-align: center;
    color: var(--ice);
    flex: 0 0 auto;
}

.profile-btn .label { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; }
.profile-btn .title { color: var(--text); font-family: 'Syne', sans-serif; font-size: 1.05rem; }
.profile-btn div { display: flex; flex-direction: column; }
.profile-btn:hover { background: var(--signal-dim); }

.timeline { margin-top: 0.5rem; }
.timeline-item {
    display: grid;
    grid-template-columns: 11.5rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.35rem 0;
    border-top: 1px solid var(--line);
}
.timeline-item:last-child { border-bottom: 1px solid var(--line); }
.timeline-date {
    color: var(--signal);
    font-size: 0.92rem;
    letter-spacing: 0.03em;
    padding-top: 0.2rem;
}
.timeline-content h4 {
    color: var(--ice);
    font-weight: 500;
    margin: 0.2rem 0 0.35rem;
}
.timeline-content p, .timeline-content li { color: var(--muted); }
.timeline-content ul { margin: 0.7rem 0 0 1.1rem; }
.timeline-content li { margin: 0.28rem 0; }

.contact-mail {
    display: inline-block;
    margin: 0.4rem 0 0.8rem;
    font-family: 'Syne', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    border-bottom: 2px solid var(--signal);
    line-height: 1.2;
}
.contact-line { color: var(--muted); font-size: 1.08rem; margin-top: 0.35rem; }
.contact-line a { color: var(--text); text-decoration: none; }

footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1.4rem 2.4rem 1.8rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
}
footer strong { display: block; color: var(--text); font-family: 'Syne', sans-serif; font-weight: 600; }
footer a { color: var(--signal); text-decoration: none; }
.copyright { text-align: right; }

.flash-container { width: min(980px, calc(100% - 4rem)); margin: 1rem auto 0; }
.flash-msg {
    border-left: 3px solid var(--signal);
    background: var(--signal-dim);
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
}
.flash-msg.error { border-left-color: #ff8d7a; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.9rem;
    margin-top: 0.8rem;
}
.card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(244, 240, 230, 0.03);
    overflow: hidden;
}
.card img { width: 100%; height: 140px; object-fit: cover; display: block; }
.card-content { padding: 0.95rem 1rem 1rem; }
.card-content h3 { font-family: 'Syne', sans-serif; font-size: 1rem; margin-bottom: 0.35rem; }
.card:hover { border-color: rgba(214, 255, 75, 0.55); }

.page-content input,
.page-content select,
.page-content textarea {
    background: #12151c;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
    .rail {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
    }
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        width: 100%;
        margin-top: 0.6rem;
        padding-bottom: 0.4rem;
    }
    .nav-links.open { display: flex; }
    .app { margin-left: 0; }
    .hero {
        align-items: flex-end;
        min-height: 100svh;
        padding: 5.5rem 1.15rem 3.2rem;
    }
    .hero-copy { width: 100%; }
    .kicker { display: block; max-width: 100%; }
    .node { display: inline-block; margin-right: 0.45rem; vertical-align: 1px; }
    h1 { font-size: clamp(1.65rem, 6.6vw, 2.45rem); }
    .roles { max-width: none; }
    .metrics { max-width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .page-content, .flash-container { width: min(980px, calc(100% - 2.2rem)); }
    .timeline-item, footer, .profile-links { grid-template-columns: 1fr; }
    .copyright { text-align: left; }
    .record.has-img { grid-template-columns: 2.4rem minmax(0, 1fr); }
    .record-img { grid-column: 2; width: 100%; height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .reveal { opacity: 1; transform: none; }
}
