/* Teodor Font */
@font-face {
    font-family: 'Teodor';
    src: url('teodor/TeodorTRIAL-Regular-BF672198fb97abe.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Teodor';
    src: url('teodor/TeodorTRIAL-Medium-BF672198fb97adf.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Teodor';
    src: url('teodor/TeodorTRIAL-Light-BF672198fb5c0ea.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
}

/* Preload class to prevent flash of white */
.preload * {
    transition: none !important;
}

:root {
    --bg-color: #fafafa;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --nav-hover: #000000;
    --card-bg: #ffffff;
    --link-color: #1a1a1a;
    --border-color: #e0e0e0;
    --tag-bg: #f0f0f0;
    --tag-text: #333333;
    --tag-border: #d0d0d0;
}

.dark-theme {
    --bg-color: #0d1117;
    --text-color: #e6edf3;
    --text-muted: #8b949e;
    --nav-hover: #ffffff;
    --card-bg: #161b22;
    --link-color: #e6edf3;
    --border-color: #30363d;
    --tag-bg: #21262d;
    --tag-text: #e6edf3;
    --tag-border: #3d444d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Teodor', Georgia, serif;
    font-size: 19px;
    line-height: 1.7;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-time {
    font-size: 16px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.nav-location {
    font-size: 16px;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.top-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 17px;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

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

/* Hero Section */
.hero {
    display: flex;
    gap: 60px;
    align-items: flex-start;
    margin-bottom: 80px;
}

.hero-image {
    flex-shrink: 0;
}

.profile-picture {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 4px;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 42px;
    font-weight: 400;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.hero-content .greeting {
    font-size: 20px;
    font-weight: 400;
    margin: 0 0 16px 0;
    line-height: 1.7;
}

.hero-content .tagline {
    font-size: 20px;
    color: var(--text-color);
    margin: 0 0 16px 0;
    line-height: 1.7;
}

.hero-content .subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin: 0 0 24px 0;
}

.hero-content p {
    font-size: 19px;
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    align-items: center;
    justify-content: center;
}

.social-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

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

.social-links svg {
    display: block;
}

/* Bio list */
.bio-list {
    list-style: disc;
    padding-left: 20px;
    margin: 16px 0 0 0;
}

.bio-list li {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-color);
}

.bio-list .highlight {
    color: var(--text-muted);
    font-size: 15px;
}

/* Roles inline */
.roles {
    margin-top: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-color);
}

.roles .role {
    display: inline;
}

.roles .separator {
    margin: 0 8px;
    color: var(--text-muted);
}

.roles .highlight {
    color: var(--text-muted);
    font-size: 14px;
}

.roles a {
    color: var(--text-color);
}

/* Main Content */
.main-content {
    max-width: 100%;
    margin-top: 0;
}

.main-content h2 {
    font-size: 32px;
    font-weight: 400;
    margin: 60px 0 24px 0;
    letter-spacing: -0.01em;
}

.main-content h3 {
    font-size: 26px;
    font-weight: 400;
    margin: 40px 0 16px 0;
}

.main-content h4 {
    font-size: 20px;
    font-weight: 500;
    margin: 24px 0 12px 0;
    color: var(--text-muted);
}

.main-content p {
    font-size: 19px;
    line-height: 1.7;
    margin: 0 0 16px 0;
}

.main-content ul {
    padding-left: 24px;
    margin: 0 0 24px 0;
}

.main-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-color: rgba(128, 128, 128, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

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

/* Theme switcher button */
.theme-switch {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.theme-switch:hover {
    opacity: 0.7;
}

.theme-switch .icon {
    display: none;
}

.theme-switch .icon svg {
    width: 18px;
    height: 18px;
    fill: var(--text-muted);
    transition: fill 0.2s ease;
}

.theme-switch:hover .icon svg {
    fill: var(--text-color);
}

.dark-theme .theme-switch .icon-sun {
    display: none;
}

.dark-theme .theme-switch .icon-moon {
    display: flex;
}

.theme-switch .icon-sun {
    display: flex;
}

.theme-switch .icon-moon {
    display: none;
}

#theme-toggle {
    display: none;
}

/* Page Header for non-home pages */
.page-header {
    margin-bottom: 48px;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 400;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    border-color: var(--text-muted);
}

.card h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 8px 0;
}

.card p {
    margin: 8px 0;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background-color: var(--tag-bg);
    color: var(--tag-text);
    font-size: 13px;
    border: 1px solid var(--tag-border);
    transition: all 0.2s ease;
}

/* Grid for projects */
.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-container .card {
    display: flex;
    flex-direction: column;
}

.grid-container .card img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

.grid-container .card .description {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
}

.buttons {
    margin-top: 16px;
    display: flex;
    gap: 16px;
    justify-content: center;
}

.buttons a {
    font-size: 14px;
}

.prize {
    color: #d4af37 !important;
    font-size: 13px;
}

/* Publication entries */
.pub-entry {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

.pub-entry:hover {
    border-color: var(--text-muted);
}

.pub-entry h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.pub-entry .date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.pub-entry .authors {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

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

.pub-link {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.pub-link:hover {
    border-color: var(--text-color);
    background: var(--tag-bg);
}

.pub-link.disabled {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.6;
}

.pub-link.disabled:hover {
    border-color: var(--border-color);
    background: transparent;
}

/* Article cards */
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.article-card:hover {
    border-color: var(--text-muted);
}

.articles-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.articles-grid .article-card {
    flex: 1;
    min-width: 300px;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .container {
        padding: 40px 24px;
    }
    
    .top-nav {
        gap: 20px;
        margin-bottom: 60px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        flex-direction: column;
        gap: 32px;
        text-align: center;
        margin-bottom: 60px;
    }
    
    .hero-image {
        margin: 0 auto;
    }
    
    .profile-picture {
        width: 140px;
        height: 140px;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .theme-switch {
        top: 20px;
        right: 20px;
    }
}

@media screen and (max-width: 480px) {
    .container {
        padding: 30px 20px;
    }
    
    .top-nav {
        gap: 16px;
    }
    
    .top-nav a {
        font-size: 14px;
    }
    
    .hero-content h1 {
        font-size: 28px;
    }
    
    .profile-picture {
        width: 120px;
        height: 120px;
    }
    
    body {
        font-size: 16px;
    }
    
    .articles-grid {
        flex-direction: column;
    }
    
    .articles-grid .article-card {
        min-width: unset;
    }
}

/* Legacy support - hide old navbar */
.navbar {
    display: none;
}

.navhead {
    display: none;
}

.navlink {
    display: none;
}

.main {
    margin-left: 0;
    max-width: none;
}
