/* 1. Overall Page Styles & Meta-Design */
:root {
    --bg-color: #111111;
    --text-color: #999999; /* Base text is now a bit darker grey */
    --accent-color: #EAEAEA; /* Highlighted text becomes whiter on hover */
    --header-font: 'Lora', serif;
    --body-font: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    font-size: 18px;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    position: relative;
    z-index: 1;
}

.content-section, .engagement-section, .lab-intro {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
}

/* 2. Animations */

/* Subtle Gradient Background Animation */
@keyframes subtle-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at bottom left, rgba(45, 44, 40, 0.2) 0%, transparent 70%),
                radial-gradient(ellipse at top right, rgba(50, 50, 60, 0.2) 0%, transparent 70%);
    background-size: 200% 200%;
    animation: subtle-shift 25s ease infinite;
    z-index: -2;
    pointer-events: none;
}

/* Fade-in on Scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.fade-in.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Animated Heading Underline */
.animated-heading {
    position: relative;
    display: inline-block;
    margin-bottom: 60px;
}

.animated-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s 0.3s ease-out;
}

.animated-heading.in-view::after {
    transform: scaleX(1);
}


/* 3. General Elements */
a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Header */
.main-header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background-color: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    font-family: var(--header-font);
}

.logo { font-size: 22px; font-weight: 500; }

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

.nav-link {
    font-family: var(--body-font);
    font-size: 0.95rem;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

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

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: -1;
}

.hero-background::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 200%; height: 200%;
    background: radial-gradient(circle at 20% 20%, rgba(112, 128, 144, 0.1), transparent 30%),
                radial-gradient(circle at 80% 70%, rgba(112, 128, 144, 0.05), transparent 30%);
    animation: slow-pulse 25s infinite alternate ease-in-out;
}

@keyframes slow-pulse {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(180deg); }
}

.hero-content h1 { font-family: var(--header-font); font-size: 4rem; font-weight: 400; margin: 0; }
.hero-content p { font-size: 1.2rem; max-width: 600px; margin: 20px auto 0; opacity: 0.9; }

/* Content Sections */
#thesis h2, #lab h2 {
    font-family: var(--header-font);
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
}

#lab { text-align: center; }
.lab-intro { text-align: center; padding-top: 0; padding-bottom: 20px; }
.project-block { margin-bottom: 100px; text-align: left; }

.project-description h3 {
    font-family: var(--header-font);
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-description p { margin-bottom: 10px; }
.project-description strong { font-weight: 500; color: #cccccc; }

/* Updated Highlight-on-hover functionality */
.highlight-on-hover { transition: color 0.3s ease; }
.highlight-on-hover:hover { color: var(--accent-color); }

/* New rule: When the mouse is over the thesis or any project block, all highlight-on-hover elements become highlighted */
#thesis:hover .highlight-on-hover,
.project-block:hover .highlight-on-hover {
    color: var(--accent-color);
}

/* Premium glistening effect for AI in Practice hero heading */
.hero-content h1 {
    position: relative;
    color: var(--text-color);
}

/* Using text-based glistening that only affects the actual text glyphs */
.hero-content h1:hover {
    background: linear-gradient(
        90deg,
        var(--text-color) 0%,
        #FFFFFF 45%,
        #FFFFFF 55%,
        var(--text-color) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    animation: smoothGlisten 3s linear infinite;
}

@keyframes smoothGlisten {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

/* Footer & Email Link */
.engagement-section { text-align: center; padding-top: 40px; padding-bottom: 80px; }
.contact-email { position: relative; padding-bottom: 4px; }
.contact-email::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}
.contact-email:hover::after { transform: scaleX(1); }

.main-footer-bottom { max-width: 800px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.main-footer-bottom hr { border: 0; height: 1px; background-color: #333; margin-bottom: 40px; }
.main-footer-bottom p { color: #888; font-size: 0.9rem; }

/* --- Custom CSS Icons & Animations --- */
.icon-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 48px; 
    width: 48px;
    contain: layout paint size;  /* Tells browser this won't affect layout outside */
    overflow: visible;           /* Allow arrow to be visible outside */
}

/* Icon: Funnel (Replaces Recruiter) */
.icon-funnel { display: flex; align-items: flex-end; gap: 6px; }
.icon-funnel div { width: 6px; background-color: #EAEAEA; border-radius: 2px; animation-name: pulse-funnel; animation-duration: 3s; animation-iteration-count: infinite; animation-play-state: paused; }
.funnel-bar-large { height: 32px; }
.funnel-bar-medium { height: 22px; }
.funnel-bar-small { height: 12px; }
.in-view .icon-funnel div { animation-play-state: running; }
.in-view .funnel-bar-large { animation-delay: 0s; }
.in-view .funnel-bar-medium { animation-delay: 0.2s; }
.in-view .funnel-bar-small { animation-delay: 0.4s; }
@keyframes pulse-funnel { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* Icon: GPT-4 Sheets */
.icon-gpt4-sheets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 32px; height: 32px; }
.icon-gpt4-sheets div { border: 2px solid #EAEAEA; border-radius: 2px; background-color: transparent; }
.in-view .icon-gpt4-sheets div { animation-name: pulse-grid; animation-duration: 5.4s; animation-iteration-count: infinite; animation-play-state: paused;}
.in-view .icon-gpt4-sheets { animation-play-state: running; }
.in-view .icon-gpt4-sheets div:nth-child(1) { animation-delay: 0s; }
.in-view .icon-gpt4-sheets div:nth-child(2) { animation-delay: 0.6s; }
.in-view .icon-gpt4-sheets div:nth-child(3) { animation-delay: 1.2s; }
.in-view .icon-gpt4-sheets div:nth-child(4) { animation-delay: 1.8s; }
.in-view .icon-gpt4-sheets div:nth-child(5) { animation-delay: 2.4s; }
.in-view .icon-gpt4-sheets div:nth-child(6) { animation-delay: 3.0s; }
.in-view .icon-gpt4-sheets div:nth-child(7) { animation-delay: 3.6s; }
.in-view .icon-gpt4-sheets div:nth-child(8) { animation-delay: 4.2s; }
.in-view .icon-gpt4-sheets div:nth-child(9) { animation-delay: 4.8s; }
@keyframes pulse-grid { 0%, 100% { background-color: transparent; } 5%, 15% { background-color: #EAEAEA; } 20% { background-color: transparent; } }

/* Icon: Synthesis Engine */
.icon-synthesis-engine { 
    position: relative; 
    height: 2px; 
    background-color: #EAEAEA; 
    animation-name: draw-line; 
    animation-duration: 3s; 
    animation-iteration-count: infinite; 
    animation-direction: alternate; 
    animation-timing-function: ease-in-out; 
    animation-play-state: paused; 
    will-change: width; /* Helps with performance */
}

/* Special handling for mobile devices */
@media (max-width: 767px) {
    .icon-synthesis-engine {
        /* On mobile, make this fixed size to prevent layout shifts */
        box-sizing: border-box;
        /* Apply hardware acceleration */
        transform: translateZ(0);
    }
}
.icon-synthesis-engine::before, .icon-synthesis-engine::after { content: ''; position: absolute; right: -1px; width: 10px; height: 2px; background-color: #EAEAEA; opacity: 0; animation-name: fade-in-simple; animation-duration: 3s; animation-iteration-count: infinite; animation-direction: alternate; animation-timing-function: ease-in-out; animation-play-state: paused; }
.in-view .icon-synthesis-engine, .in-view .icon-synthesis-engine::before, .in-view .icon-synthesis-engine::after { animation-play-state: running; }
@keyframes draw-line { 0% { width: 0; } 50%, 100% { width: 24px; } }
@keyframes fade-in-simple { 0%, 50% { opacity: 0; } 100% { opacity: 1; } }
.icon-synthesis-engine::before { top: -4px; transform: rotate(45deg); }
.icon-synthesis-engine::after { top: 4px; transform: rotate(-45deg); }

/* Icon: Knowledge Systems (New) */
.icon-knowledge-systems-new { display: flex; align-items: center; gap: 5px; }
.k-dot { width: 6px; height: 6px; background-color: #EAEAEA; border-radius: 50%; }
.k-dash { width: 12px; height: 2px; background-color: #EAEAEA; }
.in-view .k-dot:nth-child(1) { animation: alt-pulse 3s infinite ease-in-out; animation-play-state: running; }
.in-view .k-dot:nth-child(3) { animation: alt-pulse 3s 1.5s infinite ease-in-out; animation-play-state: running; }
.k-dot { animation-play-state: paused; }
@keyframes alt-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.6); opacity: 0.7; } }

/* Section separator styles */
.section-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.section-separator:hover {
    opacity: 0.8;
}

/* Chevron Down separator */
.chevron-down {
    width: 30px;
    height: 15px;
    position: relative;
}

.chevron-down::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 1px;
    background-color: var(--accent-color);
    transform: rotate(30deg);
    transform-origin: right;
}

.chevron-down::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 1px;
    background-color: var(--accent-color);
    transform: rotate(-30deg);
    transform-origin: left;
}

/* Dot separator alternative */
.dot-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 30px 0;
}

.dot-separator .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent-color);
    opacity: 0.5;
}

.dot-separator .dot:nth-child(2) {
    opacity: 0.7;
}

/* Line fade separator alternative */
.line-fade {
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-color), transparent);
    margin: 40px auto;
}

/* Star symbol separator alternative */
.star-separator {
    font-family: var(--header-font);
    font-size: 1.2rem;
    color: var(--accent-color);
    opacity: 0.7;
    text-align: center;
    padding: 30px 0;
}

/* Pulse animation for the chevron */
@keyframes gentle-pulse {
    0%, 100% { transform: translateY(0); opacity: 0.5; }
    50% { transform: translateY(3px); opacity: 0.8; }
}

.animate-pulse {
    animation: gentle-pulse 2s infinite ease-in-out;
}

/* Team Section Styles */
#people h2 {
    font-family: var(--header-font);
    font-size: 2.5rem;
    font-weight: 400;
    text-align: center;
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.team-member {
    display: flex;
    flex-direction: column;
}

.person-identity {
    margin-bottom: 15px;
}

.person-identity h3 {
    font-family: var(--header-font);
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 0 5px 0;
}

.person-role {
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    color: #666;
}

.linkedin-link {
    display: inline-block;
}

.linkedin-link svg {
    fill: var(--text-color);
    transition: fill 0.3s ease;
}

.linkedin-link:hover svg {
    fill: var(--accent-color);
}

.person-bio p {
    margin: 0;
}

/* Notes Section Styles */
.notes-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
    text-align: center;
}

.notes-section h2 {
    font-family: var(--header-font);
    font-size: 2.5rem;
    font-weight: 400;
}

.notes-intro {
    text-align: center;
    padding-top: 0;
    padding-bottom: 40px;
    margin-bottom: 40px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.note-preview {
    text-align: left;
    padding: 40px 0;
    border-top: 1px solid rgba(234, 234, 234, 0.1);
    transition: border-color 0.3s ease;
}

.note-preview:hover {
    border-top-color: rgba(234, 234, 234, 0.2);
}

.note-preview-meta {
    margin-bottom: 16px;
}

.note-preview-date {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: #666;
    text-transform: uppercase;
}

.note-preview-title {
    font-family: var(--header-font);
    font-size: 1.9rem;
    font-weight: 400;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.note-preview-link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.note-preview-excerpt {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 24px;
    color: #999;
}

.note-preview-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-note-link {
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    transition: color 0.3s ease;
}

.read-note-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

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

.read-note-link:hover::after {
    transform: scaleX(1);
}

.note-preview-length {
    font-size: 0.85rem;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body { font-size: 16px; }
    .content-section, .engagement-section { padding: 60px 20px; }
    .hero-content h1 { font-size: 2.8rem; }
    .hero-content p { font-size: 1rem; }
    #thesis h2, #lab h2, #people h2 { font-size: 2rem; }
    .project-description h3 { font-size: 1.5rem; }
    .main-header { padding: 15px 20px; }
    .logo { font-size: 20px; }
    
    .main-nav {
        gap: 12px;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .notes-section {
        padding: 60px 20px;
    }
    
    .notes-section h2 {
        font-size: 2rem;
    }
    
    .note-preview-title {
        font-size: 1.5rem;
    }
}
