:root {
    --bg: #f6f4ef;
    --surface: #fbfaf7;
    --surface-soft: #f1ede5;
    --surface-elevated: #f3eee4;
    --text: #1f1e1c;
    --muted: #5f5a52;
    --border: #dcd5c9;
    --accent: #9a8b6a;
    --accent-strong: #6f6247;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container {
    width: min(980px, 92%);
    margin: 0 auto;
}

.top-nav {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.nav-inner {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
}

.hero {
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
}

.hero-content {
    min-height: 60vh;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 4rem 0;
}

.label {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
}

.subtitle {
    margin: 0.5rem 0 1rem;
    color: var(--muted);
}

.bio {
    max-width: 52ch;
}

.experience-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.2rem 0 0;
    padding: 0;
}

.experience-list li {
    border: 1px solid var(--border);
    background: var(--surface-elevated);
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    color: var(--accent-strong);
}

.experience-list a,
.experience-list span {
    color: var(--accent-strong);
    text-decoration: none;
}

.hero-image-wrap {
    display: flex;
    justify-content: center;
}

.hero-image {
    width: min(340px, 100%);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}

.section {
    padding: 3rem 0;
}

.hint {
    margin-top: -0.4rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.work-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(300px, 420px);
    gap: 1.75rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    align-items: start;
}

.card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 0 0 1rem;
    scroll-snap-align: start;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    min-height: 260px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

.card p {
    margin-top: 0;
    color: var(--muted);
}

.project-details {
    margin-top: auto;
    padding-top: 0.5rem;
}

.project-details summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 500;
    list-style: none;
}

.project-details summary::-webkit-details-marker {
    display: none;
}

.project-details summary::after {
    content: " +";
}

.project-details[open] summary::after {
    content: " -";
}

.project-details-content {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition: grid-template-rows 240ms ease, opacity 200ms ease;
}

.project-details[open] .project-details-content {
    grid-template-rows: 1fr;
    opacity: 1;
}

.project-details-content p {
    overflow: hidden;
    margin: 0.6rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    border-top: 1px solid var(--border);
    padding-top: 0.55rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    margin: 0;
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-elevated);
}

.gallery-first-photo {
    object-position: center 48%;
}

.gallery-jpl-photo {
    object-position: center 28%;
}

.recognitions {
    padding-left: 1.1rem;
}

a {
    color: var(--accent-strong);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--text);
}

.contact {
    border-top: 1px solid var(--border);
    background: transparent;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.detail-page {
    max-width: 860px;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
}

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

.detail-block {
    margin-top: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 0 0 1rem;
}

.link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.link-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.link-list-item:last-child {
    border-bottom: none;
}

.link-list-item span {
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .container {
        width: min(980px, 94%);
    }

    .hero-content {
        min-height: auto;
        padding: 3.2rem 0;
    }
}

@media (max-width: 760px) {
    .nav-inner {
        overflow-x: auto;
        white-space: nowrap;
        gap: 1.2rem;
    }

    .section {
        padding: 2.2rem 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 2.5rem 0;
    }

    .hero-image {
        width: min(300px, 86vw);
    }

    .work-scroll {
        grid-auto-columns: minmax(84vw, 92vw);
        gap: 1rem;
    }

    .card {
        min-height: 240px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .contact-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .link-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    body {
        font-size: 0.97rem;
    }
}
