/* =========================================================
   DESIGN TOKENS
   ========================================================= */

:root {
    --bg: #f4f3ef;
    --bg-alt: #e9e8e3;

    --dark: #111315;
    --dark-alt: #191c1f;

    --text: #17191b;
    --text-muted: #686b6f;

    --text-dark: #e7e7e3;
    --text-dark-muted: #9b9d9f;

    --accent: #b45f35;

    --border: rgba(23, 25, 27, 0.16);
    --border-dark: rgba(255, 255, 255, 0.14);

    --header-bg: rgba(244, 243, 239, 0.92);

    --max-width: 1200px;

    --sans:
        Inter,
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;

    --serif:
        Georgia,
        "Times New Roman",
        serif;

    color-scheme: light;
}


/* =========================================================
   DARK THEME
   ========================================================= */

[data-theme="dark"] {
    --bg: #111315;
    --bg-alt: #191c1f;

    --dark: #0b0d0e;
    --dark-alt: #151719;

    --text: #e7e7e3;
    --text-muted: #9b9d9f;

    --text-dark: #e7e7e3;
    --text-dark-muted: #9b9d9f;

    --accent: #d47a4d;

    --border: rgba(255, 255, 255, 0.14);
    --border-dark: rgba(255, 255, 255, 0.14);

    --header-bg: rgba(17, 19, 21, 0.92);

    color-scheme: dark;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;

    transition:
        background 200ms ease,
        color 200ms ease;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}


/* =========================================================
   GLOBAL
   ========================================================= */

.container {
    width: min(
        calc(100% - 48px),
        var(--max-width)
    );

    margin-inline: auto;
}

.section {
    padding: 110px 0;

    transition:
        background 200ms ease,
        color 200ms ease;
}

.section-dark {
    background: var(--dark);
    color: var(--text-dark);
}

.section-muted {
    background: var(--bg-alt);
}

.eyebrow,
.card-label,
.section-number,
.item-date,
.timeline-date {
    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-heading {
    display: flex;
    align-items: baseline;
    gap: 24px;

    margin-bottom: 60px;

    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.section-dark .section-heading {
    border-color: var(--border-dark);
}

.section-number {
    color: var(--accent);
}

.section-heading h2 {
    margin: 0;

    font-family: var(--serif);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1;
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: var(--header-bg);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(14px);

    transition:
        background 200ms ease,
        border-color 200ms ease;
}

.nav-container {
    min-height: 82px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 28px;
}

.logo {
    display: flex;
    flex-direction: column;

    line-height: 1.15;

    margin-right: auto;
}

.logo-name {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.logo-subtitle {
    margin-top: 5px;

    color: var(--text-muted);

    font-size: 0.6rem;
    letter-spacing: 0.12em;

    transition: color 200ms ease;
}

.navigation {
    display: flex;
    align-items: center;

    gap: 28px;

    font-size: 0.8rem;
    font-weight: 600;
}

.navigation a {
    transition: color 150ms ease;
}

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


/* =========================================================
   THEME TOGGLE
   ========================================================= */

.theme-toggle {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    border: 1px solid var(--border);
    border-radius: 50%;

    background: transparent;
    color: var(--text);

    cursor: pointer;

    font-size: 1rem;

    transition:
        background 150ms ease,
        color 150ms ease,
        border-color 150ms ease;
}

.theme-toggle:hover {
    background: var(--text);
    color: var(--bg);
}

.theme-icon {
    line-height: 1;

    transition: transform 200ms ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(20deg);
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.menu-button {
    display: none;

    width: 38px;
    height: 38px;

    padding: 8px;

    border: 1px solid var(--border);
    background: transparent;

    cursor: pointer;
}

.menu-button span {
    display: block;

    width: 100%;
    height: 1px;

    margin: 5px 0;

    background: var(--text);
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
    min-height: calc(100vh - 82px);

    display: flex;
    align-items: center;

    padding: 100px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 300px;

    gap: 100px;

    align-items: end;
}

.hero-main {
    max-width: 800px;
}

.eyebrow {
    margin: 0 0 30px;

    color: var(--accent);
}

.hero h1 {
    margin: 0;

    font-family: var(--serif);
    font-size: clamp(5rem, 12vw, 10rem);
    font-weight: 400;

    line-height: 0.82;
    letter-spacing: -0.055em;
}

.hero h1 span {
    color: var(--accent);
}

.hero-description {
    max-width: 650px;

    margin: 55px 0 35px;

    color: var(--text-muted);

    font-size: 1.15rem;
}

.hero-links {
    display: flex;
    gap: 12px;
}

.button {
    display: inline-flex;

    padding: 13px 22px;

    border: 1px solid var(--text);

    font-size: 0.78rem;
    font-weight: 700;

    letter-spacing: 0.05em;
    text-transform: uppercase;

    transition:
        background 150ms ease,
        color 150ms ease,
        border-color 150ms ease;
}

.button-primary {
    background: var(--dark);
    color: white;
}

.button-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.button-secondary:hover {
    background: var(--dark);
    color: white;
}

[data-theme="dark"] .button-primary {
    background: var(--text);
    color: var(--dark);
}

[data-theme="dark"] .button-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

[data-theme="dark"] .button-secondary:hover {
    background: var(--text);
    color: var(--dark);
}


/* =========================================================
   HERO — CONTACT
   ========================================================= */

.hero-side {
    padding-bottom: 5px;
}

.contact-card {
    border-top: 2px solid var(--text);

    padding-top: 20px;
}

.card-label {
    margin: 0 0 18px;
}

.contact-card a,
.contact-card span {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 0.9rem;
}

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

.social-links {
    display: flex;
    flex-direction: column;

    margin-top: 45px;

    border-top: 1px solid var(--border);
}

.social-links a {
    padding: 10px 0;

    border-bottom: 1px solid var(--border);

    font-size: 0.8rem;
}

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


/* =========================================================
   RESEARCH
   ========================================================= */

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 1px;

    background: var(--border-dark);
}

.research-card {
    min-height: 350px;

    padding: 35px;

    background: var(--dark);
}

.research-number {
    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 700;
}

.research-card h3 {
    margin: 70px 0 15px;

    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 400;
}

.research-card p {
    color: var(--text-dark-muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 25px;
}

.tags span {
    padding: 4px 8px;

    border: 1px solid currentColor;

    font-size: 0.65rem;
    font-weight: 600;

    letter-spacing: 0.04em;
}


/* =========================================================
   EDUCATION
   ========================================================= */

.education-item {
    display: flex;
    justify-content: space-between;

    padding: 35px 0;

    border-top: 1px solid var(--border);
}

.education-item h3 {
    margin: 8px 0;

    font-family: var(--serif);
    font-size: 2.2rem;
    font-weight: 400;
}

.item-date {
    color: var(--accent);
}

.item-title {
    margin: 0;

    color: var(--text-muted);
}

.item-meta {
    color: var(--text-muted);
}


/* =========================================================
   EXPERIENCE
   ========================================================= */

.timeline-item {
    display: grid;
    grid-template-columns: 180px 1fr;

    padding: 45px 0;

    border-top: 1px solid var(--border);
}

.timeline-date {
    color: var(--accent);
}

.timeline-content {
    max-width: 750px;
}

.timeline-content h3 {
    margin: 0;

    font-size: 1.4rem;
    font-weight: 600;
}

.organization {
    margin: 4px 0 20px;

    color: var(--text-muted);
}

.timeline-content p:not(.organization) {
    max-width: 650px;
}


/* =========================================================
   PUBLICATIONS
   ========================================================= */

.publication {
    display: grid;
    grid-template-columns: 100px 1fr;

    padding: 35px 0;

    border-top: 1px solid var(--border);
}

.publication-year {
    color: var(--accent);

    font-size: 0.8rem;
    font-weight: 700;
}

.publication h3 {
    max-width: 750px;

    margin: 0 0 8px;

    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 400;
}

.publication p {
    margin: 0;

    color: var(--text-muted);
}

.text-link {
    display: inline-block;

    margin-top: 15px;

    color: var(--accent);

    font-size: 0.8rem;
    font-weight: 700;
}

.text-link:hover {
    text-decoration: underline;
}


/* =========================================================
   SKILLS
   ========================================================= */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 1px;

    background: var(--border-dark);
}

.skills-grid > div {
    min-height: 180px;

    padding: 35px;

    background: var(--dark);
}

.skills-grid h3 {
    margin: 0 0 15px;

    color: var(--accent);

    font-size: 0.75rem;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.skills-grid p {
    margin: 0;

    color: var(--text-dark);
}


/* =========================================================
   ABOUT PAGE
   ========================================================= */

.about-text {
    max-width: 780px;
}

.about-text p {
    color: var(--text-dark-muted);
    font-size: 1rem;
}

.about-text .large-text {
    margin: 0 0 45px;

    color: var(--text-dark);

    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
}

.about-text p + p {
    margin-top: 28px;
}

.about-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 60px;
}

.about-columns > div {
    padding-top: 20px;

    border-top: 2px solid var(--text);
}

.about-columns p:last-child {
    color: var(--text-muted);
}

.contact-large {
    max-width: 800px;
}

.contact-large p {
    color: var(--text-dark-muted);
}

.contact-large a {
    display: inline-block;

    margin-top: 10px;

    color: var(--accent);

    font-family: var(--serif);
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1;

    overflow-wrap: anywhere;
}

.contact-large a:hover {
    text-decoration: underline;
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    padding: 50px 0;

    background: var(--dark);
    color: var(--text-dark);

    transition:
        background 200ms ease,
        color 200ms ease;
}

.footer-grid {
    display: flex;
    justify-content: space-between;

    gap: 40px;
}

.footer-grid strong {
    font-size: 0.8rem;

    letter-spacing: 0.1em;
}

.footer-grid p {
    margin: 5px 0 0;

    color: var(--text-dark-muted);

    font-size: 0.75rem;
}

.footer-links {
    display: flex;
    gap: 25px;

    font-size: 0.75rem;
}

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


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 800px) {

    .container {
        width: min(
            calc(100% - 32px),
            var(--max-width)
        );
    }

    .section {
        padding: 75px 0;
    }


    /* Header */

    .navigation {
        display: none;
    }

    .theme-toggle {
        margin-left: auto;
    }

    .menu-button {
        display: block;
    }


    /* Hero */

    .hero {
        min-height: auto;

        padding: 90px 0;
    }

    .hero-grid {
        grid-template-columns: 1fr;

        gap: 60px;
    }

    .hero h1 {
        font-size: clamp(4rem, 19vw, 7rem);
    }

    .hero-description {
        margin-top: 40px;
    }


    /* Research */

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

    .research-card {
        min-height: auto;
    }

    .research-card h3 {
        margin-top: 50px;
    }


    /* Education */

    .education-item {
        flex-direction: column;

        gap: 20px;
    }


    /* Experience */

    .timeline-item {
        grid-template-columns: 1fr;

        gap: 15px;
    }


    /* Publications */

    .publication {
        grid-template-columns: 1fr;

        gap: 10px;
    }


    /* Skills */

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


    /* About */

    .about-columns {
        grid-template-columns: 1fr;

        gap: 40px;
    }

    .contact-large a {
        font-size: 2.5rem;
    }


    /* Footer */

    .footer-grid {
        flex-direction: column;
    }

    .footer-links {
        flex-wrap: wrap;
    }
}
