/* ============================================================
   Base
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-soft: #f7f9fb;
    --bg-profile: #f2f6f8;
    --bg-research: #ffffff;
    --bg-background: #f5f8fa;
    --bg-archive: #ffffff;
    --bg-contact: #eef3f6;

    --bg-dark: #11161c;
    --bg-dark-card: #171e26;

    --text: #17202a;
    --text-muted: #596572;
    --text-light: #aeb8c2;

    --border: #dce3e8;
    --border-dark: #2d3741;

    --accent: #1268a8;
    --accent-dark: #0b4d7d;
    --accent-light: #e7f2fa;

    --max-width: 1120px;

    --radius: 10px;
    --radius-small: 6px;

    --shadow: 0 8px 30px rgba(15, 30, 45, 0.06);
}


/* ============================================================
   Reset
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.7;
}

img {
    max-width: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: color .15s, text-decoration-color .15s;
    white-space: nowrap;
}

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

.container {
    width: min(calc(100% - 40px), var(--max-width));
    margin: 0 auto;
}


/* ============================================================
   Header
   ============================================================ */

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

    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-title {
    color: var(--text);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.site-title:hover {
    color: var(--text);
    text-decoration: none;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 26px;
}

.main-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--text);
    text-decoration: none;
}


/* Only show the main-nav on small screens when the nav link is "Martin Heckel" */
@media (max-width: 650px) {
    .main-nav {
        display: flex;
        align-items: center;
        gap: 0;
    }
    .main-nav a {
        display: none;
    }
    /* Match "Martin Heckel" by href or a class if one exists. We'll use a custom class. */
    .main-nav a.site-title-link,
    .main-nav a[data-main-nav-title] {
        display: inline;
    }
}

/* Example usage in HTML for best compatibility:
   <a href="/" class="site-title-link">Martin Heckel</a>
   OR
   <a href="/" data-main-nav-title>Martin Heckel</a>
*/



/* ============================================================
   Typography
   ============================================================ */

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 {
    /* Reduced from the previous 4rem maximum. */
    font-size: clamp(2.2rem, 4vw, 3.3rem);
    max-width: 900px;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 18px;
}

h3 {
    font-size: 1.2rem;
}

p {
    margin-top: 0;
}

.eyebrow {
    margin-bottom: 12px;

    color: var(--accent);

    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading {
    max-width: 720px;
    margin-bottom: 50px;
}

.section-heading > p:last-child {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.section-heading.small {
    margin-bottom: 30px;
}

.section-heading.small h2 {
    font-size: 1.8rem;
}


/* ============================================================
   Section colors
   ============================================================ */

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

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

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

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

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

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


/* ============================================================
   Hero
   ============================================================ */

.hero {
    padding: 115px 0 105px;
}

.hero h1 {
    margin-bottom: 24px;
}

.hero-subtitle {
    margin: -6px 0 28px;

    color: var(--accent);

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

.hero-text {
    max-width: 760px;

    color: var(--text-muted);
    font-size: 1.15rem;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    margin: 34px 0;
}

.hero-highlights span {
    padding: 6px 12px;

    border: 1px solid var(--border);
    border-radius: 100px;

    background: var(--bg-soft);

    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

/* Responsive hero layout */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 70px;
    align-items: center;
}

.hero-content {
    min-width: 0;
}

.hero-photo {
    width: 240px;
}

.hero-photo img {
    display: block;
    width: 240px;
    height: 300px;
    object-fit: cover;

    border-radius: 14px;
    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}

.hero-affiliation {
    margin: -18px 0 28px;

    color: var(--text-muted);
    font-size: 0.95rem;
}

.hero-affiliation a {
    font-weight: 600;
}

/* Responsive styles for the hero layout */
@media (max-width: 800px) {
    .hero-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }
    .hero-photo {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        /* optional: add some spacing from text */
        margin-top: 30px;
    }
    .hero-photo img {
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 6/7;
        min-height: 180px;
        object-fit: cover;
    }
}

/* For very small screens, tighten up further if needed */
@media (max-width: 500px) {
    .hero-layout {
        gap: 22px;
    }
    .hero-photo {
        max-width: 100%;
        margin-top: 18px;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        justify-content: center;
    }
    .hero-photo img {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }
}


/* ============================================================
   Sections
   ============================================================ */

.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--bg-dark);
    color: #f3f6f8;
}

.section-dark .section-heading > p:last-child {
    color: var(--text-light);
}

.section-dark .eyebrow {
    color: #66b7eb;
}

.section-footer {
    margin-top: 45px;
}

.text-link {
    font-weight: 600;
}

.text-link i {
    margin-left: 5px;
    font-size: 0.8em;
}


/* ============================================================
   Profile cards
   ============================================================ */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.profile-card {
    padding: 26px;

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

    background: #ffffff;
    box-shadow: var(--shadow);
}

.card-icon {
    width: 42px;
    height: 42px;

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

    margin-bottom: 20px;

    border-radius: var(--radius-small);

    background: var(--accent-light);
    color: var(--accent);
}

.profile-card h3 {
    margin-bottom: 10px;
}

.profile-card p {
    margin-bottom: 0;

    color: var(--text-muted);
    font-size: 0.92rem;
}


.skill-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;

    margin-top: 18px;
}

.skill-line strong {
    margin-right: 6px;
}

.skill-line span {
    padding: 3px 9px;

    border: 1px solid var(--border);
    border-radius: 4px;

    color: var(--text-muted);
    background: #ffffff;

    font-size: 0.82rem;
}


/* ============================================================
   Publications
   ============================================================ */

.publication-grid {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    max-width: 900px;
}

.publication-card {
    width: 100%;

    display: flex;
    flex-direction: column;

    padding: 28px;

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

    background: #ffffff;
    box-shadow: var(--shadow);
}

.publication-card + .publication-card {
    margin-top: 12px;
}

.publication-card h3 {
    max-width: 850px;
}

.publication-card .publication-links {
    margin-top: 18px;
}

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;

    margin-bottom: 13px;

    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.tag {
    padding: 2px 7px;

    border: 1px solid var(--border);
    border-radius: 4px;

    background: var(--bg-soft);

    font-size: 0.72rem;
}

.tag-accent {
    border-color: #b7d7eb;
    background: var(--accent-light);
    color: var(--accent-dark);
}

.authors {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.venue {
    margin-bottom: 0;

    color: var(--text-muted);
    font-size: 0.88rem;
}

.publication-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.publication-links a,
.publication-links .button-cite {
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--accent);
    text-decoration: none;
    transition: color .15s, text-decoration-color .15s;
    background: none;
    border: none;
    font-family: inherit;
    letter-spacing: 0;
    line-height: inherit;
    cursor: pointer;
    vertical-align: baseline;
    appearance: none;
    box-shadow: none;
    outline: none;
    display: inline;
    padding: 0;
    margin: 0 0 0 0.2em;
}

.publication-links a:first-of-type,
.publication-links .button-cite:first-of-type {
    margin-left: 0;
}

.publication-links a:hover,
.publication-links a:focus,
.publication-links .button-cite:hover,
.publication-links .button-cite:focus {
    color: var(--accent-dark);
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: .12em;
    text-decoration-skip-ink: auto;
    background: none;
    outline: none;
    box-shadow: none;
}

.publication-links i {
    margin-right: 3px;
}


/* Year dividers */

.publication-year-divider {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 16px;

    margin-top: 46px;
    margin-bottom: 16px;
}

.publication-year-divider:first-child {
    margin-top: 0;
}

.publication-year-divider::after {
    content: "";

    flex: 1;
    height: 1px;

    background: var(--border);
}

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

    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}


/* ============================================================
   Talks
   ============================================================ */

.talk-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    max-width: 850px;
}

.talk-year-divider {
    width: 100%;

    margin-top: 52px;
    margin-bottom: 24px;

    padding-bottom: 9px;

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

    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.talk-year-divider:first-child {
    margin-top: 0;
}

.talk-card {
    width: 100%;

    padding: 28px 30px;

    border: 1px solid var(--border-dark);
    border-radius: var(--radius);

    background: var(--bg-dark-card);
}

.talk-card h3 {
    margin-bottom: 20px;
    font-size: 1.35rem;
}

.talk-card .publication-meta {
    margin-bottom: 14px;
}

.section-dark .publication-meta {
    color: var(--text-light);
}

.section-dark .publication-links {
    margin-top: 0;
}

.section-dark .publication-links a,
.section-dark .publication-links .button-cite {
    color: #79c3ed;
}
.section-dark .publication-links a:hover,
.section-dark .publication-links a:focus,
.section-dark .publication-links .button-cite:hover,
.section-dark .publication-links .button-cite:focus {
    color: #a7d9f4;
}

.tag-talk {
    padding: 2px 7px;

    border: 1px solid #354452;
    border-radius: 4px;

    background: #202a34;

    color: #a7c4d8;

    font-size: 0.72rem;
}


/* ============================================================
   Timeline
   ============================================================ */

.timeline {
    position: relative;

    max-width: 850px;

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

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 25px;

    padding: 0 0 45px 30px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";

    position: absolute;
    left: -5px;
    top: 5px;

    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg-background);
}

.timeline-year {
    color: var(--text-muted);
    font-weight: 700;
}

.timeline-content h3 {
    margin-bottom: 5px;
}

.timeline-content > p {
    margin-bottom: 12px;
}


/* Thesis */

.thesis {
    display: block;

    max-width: 760px;

    padding: 13px 15px;

    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;

    background: #edf4f8;

    color: var(--text-muted);
    font-size: 0.9rem;
}

.thesis-label {
    display: block;

    margin-bottom: 3px;

    color: var(--accent-dark);

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* ============================================================
   Research trajectory
   ============================================================ */

.subsection {
    margin-top: 100px;
}

.research-trajectory {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.research-trajectory > div {
    padding: 25px;

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

    background: var(--bg-soft);
}

.trajectory-year {
    display: block;

    margin-bottom: 8px;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.research-trajectory strong {
    display: block;
    margin-bottom: 8px;
}

.research-trajectory p {
    margin: 0;

    color: var(--text-muted);
    font-size: 0.88rem;
}


/* ============================================================
   Archive
   ============================================================ */

.archive-list {
    border-top: 1px solid var(--border);
}

.archive-item {
    display: grid;
    grid-template-columns: 75px 1fr;
    gap: 20px;

    padding: 25px 0;

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

.archive-year {
    color: var(--text-muted);
    font-weight: 700;
}

.archive-item h3 {
    margin-bottom: 5px;
    font-size: 1.05rem;
}

.archive-item p {
    margin-bottom: 8px;

    color: var(--text-muted);
    font-size: 0.88rem;
}

.archive-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;

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

.other-work {
    margin-top: 40px;

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

    background: var(--bg-soft);
}

.other-work summary {
    padding: 20px 24px;

    cursor: pointer;

    font-weight: 700;
}

.other-work summary:hover {
    color: var(--accent);
}

.other-work .archive-list {
    padding: 0 24px;
}

.archive-list.compact .archive-item {
    padding: 18px 0;
}


/* ============================================================
   Contact
   ============================================================ */

.contact-section {
    max-width: 1000px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
}

.contact-card {
    padding: 28px;

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

    background: #ffffff;
}

.contact-card h3 {
    margin-bottom: 15px;
}

.contact-card .small {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.fingerprint {
    padding: 12px;
		margin-top: 12px;

    border-radius: var(--radius-small);

    background: var(--bg-dark);
    color: #dce5eb;

    font-family: monospace;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.contact-links {
    padding: 0;
    margin: 0;

    list-style: none;
}

.contact-links li {
    border-bottom: 1px solid var(--border);
}

.contact-links li:last-child {
    border-bottom: none;
}

.contact-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 0;

    font-weight: 600;
}


/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    background: var(--bg-dark);
    color: var(--text-light);

    padding: 28px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    font-size: 0.8rem;
}

/* Responsive footer fixes for mobile: 
   Only stack if really needed (≤420px),
   else keep as row even at small widths */
@media (max-width: 650px) {
    .footer-inner {
        flex-direction: row;
        gap: 10px;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
    }
}
@media (max-width: 420px) {
    .footer-inner {
        flex-direction: column;
        gap: 4px;
    }
}


/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {

    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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


@media (max-width: 650px) {

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

    /*
    .main-nav {
        display: none;
    }
    */

    .hero {
        padding: 80px 0 75px;
    }

    .section {
        padding: 70px 0;
    }

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

    .publication-card {
        padding: 23px;
    }

    .talk-card {
        padding: 24px;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 5px;
        padding-left: 24px;
    }

    .archive-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    /* Center .hero-photo in mobile as well */
    .hero-photo {
        max-width: 100%;
        margin-top: 18px;
        margin-left: auto;
        margin-right: auto;
        display: flex;
        justify-content: center;
    }
    .hero-photo img {
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    /* Moved to new block above for .footer-inner */

}


/* ============================================================
   Accessibility
   ============================================================ */

a:focus-visible,
summary:focus-visible,
.button-cite:focus-visible {
    outline: 3px solid #73bde8;
    outline-offset: 3px;
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Publication links bar and cite button styling for publication cards */
.publication-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
}

.publication-links a,
.publication-links .button-cite {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: color .15s, text-decoration-color .15s;
    background: none;
    border: none;
    font-family: inherit;
    letter-spacing: 0;
    line-height: inherit;
    cursor: pointer;
    vertical-align: baseline;
    appearance: none;
    box-shadow: none;
    outline: none;
    display: inline;
    padding: 0;
    margin: 0 0 0 0.2em;
}

.publication-links a:first-of-type,
.publication-links .button-cite:first-of-type {
    margin-left: 0;
}

.publication-links a:hover,
.publication-links a:focus,
.publication-links .button-cite:hover,
.publication-links .button-cite:focus {
    color: var(--accent-dark);
    text-decoration: underline;
    text-decoration-thickness: from-font;
    text-underline-offset: .12em;
    text-decoration-skip-ink: auto;
    background: none;
    outline: none;
    box-shadow: none;
}

/* Remove margin for the last link in publication-links */
.publication-links a:last-of-type,
.publication-links .button-cite:last-of-type {
    margin-right: 0;
}
