:root {
    --bg: #f6f5f1;
    --surface: #ffffff;
    --ink: #16161a;
    --muted: #6b6a66;
    --line: #e2e0d9;
    --accent: #e4572e;
    --accent-ink: #ffffff;
    --serif: "Instrument Serif", Georgia, serif;
    --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121214;
        --surface: #1b1b1f;
        --ink: #ecebe6;
        --muted: #94938d;
        --line: #2c2c31;
        --accent: #ff7a50;
        --accent-ink: #121214;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 400 15px/1.6 var(--sans);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 64px 24px 48px;
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 72px;
}

/* ---------- Profile ---------- */

.profile {
    position: sticky;
    top: 64px;
    align-self: start;
}

.avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--line);
    filter: grayscale(1) contrast(1.05);
}

.eyebrow {
    margin: 28px 0 6px;
    font: 500 12px/1 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3fb950;
    box-shadow: 0 0 0 4px rgba(63, 185, 80, .18);
}

.name {
    margin: 0;
    font: 400 64px/1 var(--serif);
    letter-spacing: -.01em;
}

.name em {
    color: var(--accent);
}

.role {
    margin: 10px 0 0;
    font-size: 17px;
    font-weight: 500;
}

.bio {
    margin: 20px 0 0;
    color: var(--muted);
    max-width: 34ch;
}

.links {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--ink);
    font: 500 14px/1 var(--sans);
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    color: var(--ink);
    transition: background .2s, color .2s, border-color .2s, transform .2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn svg {
    width: 15px;
    height: 15px;
}

.btn--solid {
    background: var(--ink);
    color: var(--bg);
}

.btn--solid:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.btn--ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Sections ---------- */

.section + .section {
    margin-top: 72px;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--ink);
}

.section-head h2 {
    margin: 0;
    font: 400 36px/1.1 var(--serif);
}

.section-head span {
    font: 500 12px/1 var(--mono);
    color: var(--muted);
}

.group-label {
    margin: 32px 0 0;
    font: 500 12px/1 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Project list ---------- */

.projects {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    counter-reset: project;
}

.project-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 18px 4px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: padding .25s ease, background .25s ease;
}

.project-row::before {
    counter-increment: project;
    content: counter(project, decimal-leading-zero);
    font: 500 12px/1 var(--mono);
    color: var(--muted);
}

.project-title {
    display: block;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -.01em;
}

.project-meta {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag {
    font: 500 11px/1 var(--mono);
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    white-space: nowrap;
}

.arrow {
    display: inline-block;
    margin-left: 6px;
    color: var(--accent);
    opacity: 0;
    transform: translate(-6px, 4px);
    transition: opacity .25s, transform .25s;
}

a.project-row:hover {
    padding-left: 14px;
    background: var(--surface);
}

a.project-row:hover .arrow {
    opacity: 1;
    transform: translate(0, 0);
}

a.project-row:hover .tag {
    border-color: var(--accent);
    color: var(--accent);
}

/* ---------- Name card ---------- */

.namecard-img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .45);
}

/* ---------- Contact ---------- */

.contact textarea {
    width: 100%;
    min-height: 140px;
    margin-top: 20px;
    padding: 16px;
    resize: vertical;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.contact textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.contact textarea.invalid {
    border-color: var(--accent);
}

.contact-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hint {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Footer ---------- */

.footer {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    font: 500 12px/1.4 var(--mono);
    color: var(--muted);
}

.footer a {
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
}

/* ---------- Motion ---------- */

.reveal {
    animation: rise .7s cubic-bezier(.2, .7, .2, 1) both;
}

.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

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

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
        gap: 56px;
        padding-top: 40px;
    }

    .profile {
        position: static;
    }

    .name {
        font-size: 52px;
    }
}

@media (max-width: 520px) {
    .page {
        padding: 32px 16px 40px;
    }

    .project-row {
        grid-template-columns: 28px minmax(0, 1fr);
    }

    .tag {
        display: none;
    }

    .footer {
        flex-direction: column;
        padding: 20px 16px;
    }
}
