:root {
    /* --bg: #ffffff; */
    /* --text: #111111; */
    /* --muted: #6b7280; */
    /* --accent: #12a594; */
    /* --line: #e5e7eb; */
    /* --surface: #f9fafb; */
    /* --panel: #f1fffb; */
    /* --panel-border: #b1f0e2; */
    /* --chip: #f4fffd; */

    --logo-bg: transparent;
    --logo-border: transparent;
    --radius: 1rem;
    --gap: 1.5rem;
    font-size: 20px;

    --bg-alpha: 0.025;
    --bg: #111213;
    --text: #eeeeee;
    --muted: #9ca3af;
    --accent: #4b9bea;
    --line: #1f2933;
    --surface: #4b9bea0d;
    --panel: var(--surface);
    --chip: #1171d01f;
    --panel-border: #4b9bea66;
    --logo-bg: transparent;
    --logo-border: transparent;

    scroll-behavior: smooth;
}

/* @media (prefers-color-scheme: dark) {
    :root {
        --bg-alpha: 0.025;
        --bg: #111213;
        --text: #eeeeee;
        --muted: #9ca3af;
        --accent: #2dd4bf;
        --line: #1f2933;
        --surface: #161b22;
        --panel: rgba(45, 212, 191, var(--bg-alpha));
        --panel-border: rgba(45, 212, 191, 0.25);
        --chip: rgba(45, 212, 191, var(--bg-alpha));
        --logo-bg: transparent;
        --logo-border: transparent;
    }
} */

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

body {
    margin: 0;
    font-family: "Google Sans Code";
    background-color: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
}

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

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    line-height: 1.3;
    margin-top: 0;
}

h1 {
    margin-bottom: 0.75rem;
}

h2 {
    margin-bottom: 1.5rem;
}

section>h3 {
    margin: 2rem 0;
}

h4 {
    margin: 0.5rem 0 1rem 0;
}

p {
    margin: 0;
    flex: 10;
}

.subsection>p {
    margin: 1.5rem 0;
}

.container {
    max-width: 60rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.site-header {
    display: flex;
    gap: var(--gap);
    align-items: center;
    /* justify-content: space-between; */
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
}

.avatar {
    width: 125px;
    height: 125px;
    border-radius: 50%;
    object-fit: cover;
}

.lead {
    color: var(--muted);
    margin-bottom: 1rem;
}

.site-nav {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
}

.site-nav a {
    padding-bottom: 0.15rem;
}

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

section:last-of-type {
    border-bottom: none;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.section-heading h2 {
    margin: 0;
}

.to-top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background-color: var(--surface);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.to-top:hover,
.to-top:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--chip);
    text-decoration: none;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.intro-technology {
    display: grid;
    gap: var(--gap);
    margin-top: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.icon-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    padding: 1.5rem;

    /* background-color: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius); */
}

.icon-title {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.icon-row {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-items: center;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.icon-item span {
    line-height: 1.2;
    text-align: center;
}

.icon-item img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

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

.section-divider {
    height: 1px;
    background-color: var(--line);
    margin: 2.5rem 0;
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-start;
}

.card.more {
    justify-content: space-around;
}

.card-link {
    display: flex;
    flex-direction: column;
    /* height: 100%; */
    color: inherit;
}

.card-link[aria-disabled="true"] {
    pointer-events: none;
    cursor: default;
}

.card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top;
    flex-shrink: 0;
}

.card-image.logo {
    aspect-ratio: auto;
    object-fit: contain;
    padding: 1rem;
    background-color: var(--logo-bg);
    border-bottom: 1px solid var(--logo-border);
}

.card-image.logo.logo-flat {
    background-color: transparent;
    border-bottom: none;
}

.card-caption {
    display: block;
    padding: 1rem 1.25rem;
    text-align: center;
    font-size: 0.95rem;
}

.card-body {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    /* gap: 0.05rem; */
    /* flex: 1; */
    justify-content: space-between;
}

.projects-grid .card-body {
    align-items: flex-start;
    width: 100%;
    height: 100%;
}

.projects-grid .card {
    align-items: stretch;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 1rem;
}

.timeline {
    display: grid;
    gap: var(--gap);
}

.timeline-item {
    display: flex;
    gap: var(--gap);
    align-items: flex-start;
    background-color: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.timeline-logo {
    width: 120px;
    max-height: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

.timeline-content h3 {
    margin-bottom: 0.5rem;
}

.timeline-year {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.35rem;
}

.publications-grid .card {
    padding-bottom: 0;
}

.publication-card .card-link,
.publication-card .card-link[aria-disabled="true"] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
}

.publications-grid .card-image {
    object-fit: cover;
}

.teaching-subsection {
    margin-top: 2.5rem;
}

.teaching-subsection:first-of-type {
    margin-top: 1.5rem;
}

.teaching-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.teaching-grid--books {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.teaching-grid--books .card-image {
    aspect-ratio: 1 / 0;
    object-fit: cover;
    object-position: center;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    border-radius: 9999px;
    background-color: var(--chip);
    color: var(--accent);
    border: 1px solid var(--panel-border);
}

.tag img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    border: none;
    border-radius: 9999px;
    padding: 0;
    background-color: transparent;
}

.card-body--compact {
    padding: 1rem 1.25rem;
    gap: 0.5rem;
}

.card-body--compact h4 {
    margin: 0;
    font-size: 1rem;
}

.card-body--compact p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.card-year {
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    display: block;
    margin-bottom: 0.35rem;
}

.publication-meta {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.publication-year {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.publication-citation {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.publication-citation em {
    font-style: italic;
}

.publication-static {
    cursor: default;
    pointer-events: none;
}

.media-meta {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.media-year {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.media-description {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.intro {
    font-size: 1rem;
    color: var(--muted);
}

.subsection {
    margin-top: 2.5rem;
}

.subsection h3 {
    margin-bottom: 1rem;
}

.logo-grid .card-image.logo {
    padding: 1rem;
}

.site-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-links a {
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.4rem;
    border-radius: 9999px;
}

.footer-links a:hover {
    color: var(--accent);
    background-color: rgba(18, 165, 148, 0.12);
}

.footer-links svg {
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
}

@media (min-width: 900px) {
    .site-header {
        align-items: center;
    }

    .intro-technology {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .timeline {
        gap: var(--gap);
    }

    .timeline-item {
        padding: 1.5rem;
    }
}

@media (max-width: 899px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav {
        overflow-x: auto;
        width: 100%;
    }

    .icon-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 1.25rem;
    }

    .teaching-grid--books {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .timeline-item {
        flex-direction: column;
        align-items: center;
    }

    .icon-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem 1.5rem;
    }

    .teaching-grid--books {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
    }
}
