@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');

:root {
    --bg-color: #ffffff;
    --text-color: #111111;
    --accent-color: #333333;
    --link-color: #D32F2F; /* Vibrant Red */
    --grid-gap: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 16px;
    overflow-x: hidden;
}

canvas#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.4;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
}

/* Header */
header {
    grid-column: 1 / -1;
    margin-bottom: 80px;
    border-bottom: 2px solid var(--text-color);
    padding-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-content {
    flex: 1;
}

.profile-image-container {
    width: 170px;
    height: 230px;
    margin-left: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


h1 {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--accent-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contact-links {
    margin-top: 20px;
}

.contact-links a {
    font-size: 1.2rem; /* Slightly larger for icons */
    margin-right: 20px; /* Space between icons */
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s ease;
}

.contact-links a.email-text {
    font-size: 1rem; /* Smaller font size for email address */
    vertical-align: middle;
    font-weight: 400;
}

.contact-links a:hover {
    color: #555;
}

/* Sections */
section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    margin-bottom: 80px;
}

.section-title {
    grid-column: 1 / 4;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 5px;
    border-top: 2px solid var(--text-color);
}

.section-content {
    grid-column: 4 / -1;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    padding-left: 20px;
}

/* Typography & Content */
p {
    margin-bottom: 1.5em;
    font-size: 1.1rem;
    max-width: 800px;
}

/* General Text Links (excluding nav/works) */
.section-content a:not(.work-item):not(.link-btn) {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

.section-content a:not(.work-item):not(.link-btn):hover {
    border-bottom: 1px solid var(--link-color);
}

.item {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
}

.item-main {
    flex: 1;
    padding-right: 20px;
}

.item-title {
    font-weight: 600;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

.item-title a {
    text-decoration: none;
    color: var(--text-color);
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

.item-title a:hover {
    border-bottom: 1px solid var(--text-color);
}

.item-authors {
    font-size: 1rem;
    color: #444;
    display: block;
    margin-bottom: 2px;
}

.item-subtitle {
    font-weight: 300;
    font-size: 1rem;
    color: #555;
    display: block;
    font-style: italic;
}

.item-date {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    color: #666;
    white-space: nowrap;
}

/* New Link Buttons */
.item-links {
    margin-top: 6px;
}

.link-btn {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #D32F2F;
    border-radius: 4px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #555;
    margin-right: 10px;
    transition: all 0.2s ease;
    background-color: transparent;
}

.link-btn:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
    text-decoration: none;
}

.link-btn i {
    display: none;
}

/* Works Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    width: 100%;
}

.work-item {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.work-item:hover {
    transform: translateY(-5px);
}

.work-item img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    margin-bottom: 10px;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
    border: 1px solid #eee;
}

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

.work-title {
    font-weight: 600;
    font-size: 1rem;
    display: block;
}

.work-year {
    font-size: 0.85rem;
    color: #666;
}

/* Works Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85); /* Darker background with opacity */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: transparent;
    margin: 5% auto;
    padding: 20px;
    border: none;
    width: 90%;
    max-width: 1000px;
    position: relative;
    animation: fadeIn 0.3s;
    color: #fff; /* Light text for dark mode */
}

.close-btn {
    color: #ddd; /* Light close button */
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    position: absolute;
    right: 20px;
    top: 10px;
    z-index: 1001;
}

.close-btn:hover,
.close-btn:focus {
    color: #fff;
    text-decoration: none;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.2;
    color: #fff; /* White title */
}

.modal-year {
    font-family: 'Inter', monospace;
    font-size: 1rem;
    color: #ccc; /* Light grey year */
    margin-bottom: 20px;
    display: block;
}

.modal-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #eee; /* Light grey description */
    margin-bottom: 20px;
}

.modal-detail {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #bbb; /* Slightly darker grey detail */
}

.modal-detail a {
    color: #ff6b6b; /* Lighter red for dark background */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom 0.2s ease;
}

.modal-detail a:hover {
    border-bottom: 1px solid #ff6b6b;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@media (max-width: 900px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
}


/* Footer */
footer {
    grid-column: 1 / -1;
    border-top: 2px solid var(--text-color);
    padding-top: 40px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    width: 100%; /* Ensure full width */
    margin-left: 0; /* Reset margin just in case */
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 40px 20px;
    }
    
    header {
        flex-direction: column-reverse; /* Profile pic on top or between */
        align-items: center;
        text-align: center;
    }

    .header-content {
        width: 100%;
    }

    .profile-image-container {
        margin: 0 0 20px 0;
        width: 150px;
        height: 150px;
    }

    .profile-image-container .profile-image {
        object-position: 50% 20%; /* X: center, Y: 20% from top */
    }

    h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        grid-column: 1 / -1;
        margin-bottom: 20px;
        border-top: 2px solid var(--text-color);
        padding-top: 10px;
    }
    
    .section-content {
        grid-column: 1 / -1;
        border-top: none;
        padding-top: 0;
    }

    .subtitle {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .contact-links {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .contact-links a {
        margin: 0 10px;
    }
}
