:root {
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;

    /* Palette - Warm & Vibrant */
    --color-bg: #ffffff;
    /* Light off white */
    --color-text: #1E1E1E;
    /* Off black */
    --color-text-secondary: #818181;
    /* Faded Blue - Using for secondary text/subtitles for color */
    --color-text-nav: #69A6C0;
    --color-text-nav-hover: #ACD3E8;
    --color-accent: #F2A919;
    /* Tangerine - Pop */
    --color-hover-bg: #FFF8DB;
    /* Dark off white (Warm) */

    --border-hairline: 1px solid rgba(30, 30, 30, 0.1);
    --border-bold: 2px solid #1E1E1E;

    --max-width: 1000px;
    --grid-gap: 2rem;

    /* Type Scale - Massive & Tight */
    /* Reduced H1 as requested */
    --font-size-h1: clamp(2rem, 5vw, 3rem);
    --font-size-h2: clamp(1.5rem, 3vw, 2.5rem);
    --font-size-body: 1.05rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-body);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    border-left: var(--border-hairline);
    /* Subtle guideline */
    border-right: var(--border-hairline);
    min-height: 25vh;
}

/* Typography */
h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

h1 {
    font-size: var(--font-size-h1);
    color: var(--color-text);
    /* text-transform: uppercase; Removed */
}

h2 {
    font-size: var(--font-size-h2);
    margin-bottom: 1.5rem;
    /* Reduced from 2rem for tighter gap */
    padding-top: 2rem;
    border-top: var(--border-bold);
    /* Bold separation for sections */
    display: table;
    /* Shrink to fit content for the bold line? Or full width? Let's go full width for grid feel */
    width: 100%;
}

a {
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(21, 31, 39, 0.2);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

/* Header */
.site-header {
    padding: 2rem 0 0 0;
    /* Updated padding as requested */
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-block {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.title-block h1 {
    margin-bottom: 0.25rem;
}

.header-profile-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-bg);
    /* subtle border */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subtitle {
    font-size: 1.1rem;
    /* Slightly smaller subtitle */
    color: var(--color-text-secondary);
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Minimal Nav */
nav {
    display: flex;
    gap: 1.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    /* text-transform: uppercase; Removed */
    letter-spacing: 0.05em;
    padding-top: 0.5rem;
    /* Align with top of text */
}

.nav-tab {
    color: var(--color-text-nav);
    border: none;
    padding: 0;
}

.nav-tab.active,
.nav-tab:hover {
    color: var(--color-text-nav-hover);
}

/* Socials - Simple Grid */
.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    font-size: 1.25rem;
    border: none;
    color: var(--color-text);
}

.social-icons a:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

/* Sections */
section {
    margin-bottom: 4rem;
    /* Reduced section gap */
    display: none;
    /* Hide by default for tab logic */
}

section.active,
section#contact {
    display: block;
}

/* About - "Brand Story" Layout */
.profile-layout {
    display: block;
    /* No grid */
    max-width: 800px;
    /* Constrain width for readability since it's centered text focus now */
    margin: 0;
    /* Left align to match reference? Or User's "show up at front"? Reference was specific. */
    /* User said "just show up at the front". */
    /* Let's keep it left aligned with the header content (which is in .container) */
    /* .container has padding. So margin 0 is fine. */
}

.profile-text {
    font-size: 1.15rem;
    /* Editorial size */
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
}

.profile-text p:first-of-type {
    font-size: 1.5rem;
    /* Hero feel for the first paragraph */
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 2rem;
    line-height: 1.4;
}

.bio-secondary {
    color: var(--color-text-secondary);
    /* Faded Blue */
    opacity: 0.8;
    /* Slight transparency for "lighter" feel if the blue is too dark */
}

.profile-text p {
    margin-bottom: 2rem;
}

.profile-photo {
    /* No circle, raw rectangle or squircle */
    display: none;
}

.profile-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    filter: grayscale(100%);
    /* Editorial look */
    transition: filter 0.3s;
    display: none;
}

.profile-img:hover {
    filter: grayscale(0%);
}

/* Lists (News, Publications, Teaching) - The Grid Table */
.news-list,
.publications-list,
.teaching-list,
.industry-grid {
    display: flex;
    flex-direction: column;
    border-top: var(--border-hairline);
}

/* News Override for Timeline */
.news-list {
    border-top: none;
    /* Remove top border for timeline flow */
    border-left: 2px solid var(--color-text-nav);
    /* Timeline line */
    padding-left: 2rem;
    /* Spacing from line */
}

.news-list li {
    position: relative;
}

.news-list li::before {
    content: '';
    position: absolute;
    /* Center dot on the line. 
       Padding is 2rem. Line is at -2rem relative to content.
       Dot is 10px. Center of dot is 5px.
       We want center of dot to be at -2rem (approx center of 2px line).
       So left = -2rem - 5px + 1px (half line width) = -2rem - 4px approx.
       Let's tweak visually if needed, but calc is safe.
    */
    left: calc(-2rem - 5px);
    top: 2.5rem;
    /* Align with text baseline roughly (padding top is 2rem) */
    width: 12px;
    height: 12px;
    background-color: var(--color-text-nav);
    border-radius: 50%;
    outline: 4px solid var(--color-bg);
    /* Creates a gap in the line */
}

.news-list li,
.publication-item,
.teaching-list li,
.industry-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    /* Date/Year | Content */
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: var(--border-hairline);
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    align-items: baseline;
    transition: background-color 0.2s;
}

.news-list li:hover,
.publication-item:hover,
.teaching-list li:hover,
.industry-item:hover {
    background-color: var(--color-hover-bg);
    /* Warm hover */
    /* Very subtle hover bg */
    transform: none;
    box-shadow: none;
    border-color: var(--color-text);
    /* Darker border on hover */
}

.teaching-list li {
    padding: 1rem 0;
    /* Reduced spacing override for Teaching section */
}

/* Specific Content Alignments */
.news-date {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--color-text);
    text-transform: uppercase;
    background: none;
    padding: 0;
    text-align: left;
    letter-spacing: 0.05em;
    grid-column: 1;
    /* Explicitly place in column 1 */
}

.news-content {
    grid-column: 2;
    /* Content in column 2 */
}

/* News Footer Link */
.news-footer {
    text-align: right;
    /* Asymmetric placement? Or align with content? */
    /* Swiss style often likes alignment. Let's align with content column (col 2) but it's outside the grid list.. */
    /* Just right align for now or make it a block. */
    padding-top: 2rem;
    text-align: left;
    margin-left: 120px;
    /* Indent to match content column */
    padding-left: 2rem;
    /* Gap */
}

.news-footer a {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .news-footer {
        margin-left: 0;
        padding-left: 0;
    }
}


.date {
    /* Teaching date */
    font-weight: 700;
    text-transform: uppercase;
    background: none;
    color: var(--color-text);
    padding: 0;
    float: none;
    /* override previous float */
    font-size: 0.9rem;
}

/* Teaching override: Content is complex */
.teaching-list li {
    grid-template-columns: 1fr 120px;
    /* Content | Date (Right aligned for teaching?) Or stick to left? */
    /* Let's be consistent: Date Left? Or Context?
       Let's try: Date Left for everything. Swiss style loves alignment.
    */
    grid-template-columns: 120px 1fr;
    align-items: start;
}

.teaching-list .date {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
}

.teaching-info {
    grid-column: 2;
    grid-row: 1;
}

/* Publications Specifics */
.pub-image-container {
    display: block;
    /* Show images */
    width: 100px;
    height: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    /* Slight border for white papers */
    background: #fff;
    padding: 4px;
    /* White frame */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-top: 0.2rem;
    /* Optical alignment with Title Text */
}

.pub-image {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
    /* Square */
    object-fit: cover;
}

/* Re-thinking Pubs for Grid: 
   [Image]  [Content] 
*/

.publication-item {
    grid-template-columns: 100px 1fr;
    /* Image | Content */
    align-items: start;
    /* Top align */
    padding: 1rem 0;
    gap: 1.5rem;
}

.pub-year {
    font-weight: 700;
    color: var(--color-text);
    background: none;
    padding: 0;
    font-size: 0.9rem;
    color: var(--color-text-nav);
    font-weight: 600;
}

.pub-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pub-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
}

.pub-authors {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.pub-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 0.25rem;
    align-items: center;
    /* Align items */
}

.pub-venue {
    color: var(--color-accent);
    background: none;
    padding: 0;
}

.pub-links {
    margin-top: 0.5rem;
    gap: 1.5rem;
}

.pub-links a {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Minimal Mode Toggle */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    padding-top: 2rem;
    border-top: var(--border-bold);
}

.section-header h2 {
    border-top: none;
    padding-top: 0;
    margin-bottom: 0;
}

.view-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--color-text-nav);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Minimal Publications View */
.publications-list.minimal-view {
    border-top: none;
}

.minimal-view .category-header {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-nav);
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.minimal-view .publication-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    gap: 0.25rem;
    grid-template-columns: none;
}

.minimal-view .pub-image-container {
    display: none;
}

.minimal-view .pub-title {
    font-size: 1.1rem;
}

.minimal-view .pub-authors {
    font-size: 0.9rem;
}

.minimal-view .pub-meta {
    margin-top: 0;
    font-size: 0.8rem;
}

/* Industry - List View with Logos */
.industry-grid {
    display: flex;
    flex-direction: column;
    border-top: var(--border-hairline);
}

.industry-grid.minimal-view {
    border-top: none;
}

.industry-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    /* Logo | Content */
    gap: 2rem;
    padding: 2rem 0;
    border-bottom: var(--border-hairline);
    align-items: start;
    transition: background-color 0.2s;
}

.minimal-view .industry-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
    gap: 0.25rem;
    grid-template-columns: none;
}

.minimal-view .industry-logo-container {
    display: none;
}

.industry-item:hover {
    background-color: var(--color-hover-bg);
}

.industry-logo-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.industry-logo {
    width: 64px;
    height: 64px;
    object-fit: cover;
    /* or contain depending on logo */
    border-radius: 14px;
    /* App-like rounded corners */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
    background-color: white;
    /* Ensure transparency looks okay */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.industry-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.industry-header {
    display: flex;
    align-items: baseline;
    /* Align text baselines */
    gap: 0.75rem;
    flex-wrap: wrap;
}

.industry-company {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.industry-year {
    font-size: 0.85rem;
    color: var(--color-text-nav);
    /* Matching nav color as requested */
    font-weight: 500;
    /* Remove old pill styling if any */
    background: none;
    padding: 0;
    border-radius: 0;
}

.industry-team {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.25rem;
}

.industry-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.industry-link {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.industry-link:hover {
    color: var(--color-accent);
}

/* Note for Industry: The HTML structure has the year INSIDE .industry-content.
   We might need to modify HTML or use absolute positioning?
   Grid can't move nested children out easily without subgrid (not fully supported).
   Actually, let's keep it simple: formatting inside.
*/

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    /* Header & Nav */
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    nav {
        flex-wrap: wrap;
        /* Allow wrapping */
        gap: 1rem 1.5rem;
        /* Row gap | Column gap */
        width: 100%;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        /* Subtle separator if wrapped */
    }

    /* Industry List - Tighten for mobile */
    .industry-item {
        grid-template-columns: 60px 1fr;
        /* Smaller logo col */
        gap: 1rem;
        padding: 1.5rem 0;
    }

    .industry-year {
        grid-column: auto;
        /* reset */
    }

    .industry-logo {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    /* Publications - Smaller Figure on Left */
    .publication-item {
        grid-template-columns: 90px 1fr;
        /* Smaller figure col */
        gap: 1rem;
    }

    .pub-image-container {
        width: 90px;
        margin-top: 0.2rem;
    }

    .pub-title {
        font-size: 1.2rem;
        /* Slightly smaller title */
    }

    /* News Timeline - Adjust Spacing */
    .news-list {
        padding-left: 1.5rem;
    }

    .news-list li::before {
        left: calc(-1.5rem - 5px);
        /* Re-center dot */
    }

    /* Typography adjustments */
    .profile-text p:first-of-type {
        font-size: 1.3rem;
    }
}

/* Footer */
.site-footer {
    border-top: var(--border-bold);
    padding: 4rem 0;
    margin-top: 8rem;
    text-align: left;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}