/* Reset and base styles */
:root {
    --primary-color: #000;
    --secondary-color: #666;
    --background-color: #fff;
    --link-color: #5b9bd5;
    --nav-height: 60px;
    --max-width: 960px;
    --divider-color: #e5e5e5;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: var(--primary-color);
    background-color: var(--background-color);
    font-size: 16px;
}

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

a:hover {
    text-decoration: underline;
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.5rem 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--divider-color);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 4vw, 3rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hamburger menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 28px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.nav-toggle span {
    display: block;
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 18px; }

/* Hamburger → X animation */
.nav-toggle.active span:nth-child(1) {
    top: 11px;
    transform: rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    top: 11px;
    transform: rotate(-45deg);
}

/* Main content */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem clamp(1.5rem, 4vw, 3rem) 4rem;
}

/* Hero / Intro section */
.hero {
    display: flex;
    align-items: flex-start;
    gap: 3rem;
    margin-bottom: 3rem;
}

.hero-text {
    flex: 1;
}

.hero-text p {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1rem;
    line-height: 1.7;
}

.hero-text a {
    text-decoration: underline;
}

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

.hero-photo img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.cv-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

/* Social icons */
.social-icons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 3.5rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--divider-color);
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-icons a img {
    width: 24px;
    height: 24px;
}

/* Technical work section */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.work-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.work-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.work-thumbnail {
    flex-shrink: 0;
    width: 320px;
    height: 320px;
    cursor: pointer;
    object-fit: cover;
    border-radius: 4px;
    background: #f0f0f0;
}

.work-content {
    flex: 1;
}

.work-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.2rem;
}

.work-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.work-title a {
    color: var(--link-color);
    text-decoration: underline;
}

.work-title a:hover {
    text-decoration: underline;
}

.work-authors {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.3rem;
}

.work-links {
    font-size: 0.85rem;
}

.work-links a {
    color: var(--link-color);
    text-decoration: underline;
    margin-right: 0.8rem;
}

.work-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.work-note {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-style: italic;
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem clamp(1.5rem, 4vw, 3rem) 3rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Music page */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.music-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.music-content a {
    color: var(--link-color);
}

.music-links {
    list-style: disc;
    margin: 1rem 0 2rem 1.5rem;
}

.music-links li {
    margin-bottom: 0.5rem;
}

.music-links a {
    font-size: 0.95rem;
}

.spotify-embed {
    margin: 1.5rem 0 2rem;
}

.video-section-title {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--divider-color);
}

.video-subheading {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.video-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Blog listing */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.blog-item-title {
    font-size: 1rem;
    font-weight: 400;
}

.blog-item-title a {
    color: var(--link-color);
    text-decoration: underline;
}

.blog-item-title a:hover {
    text-decoration: underline;
}

.blog-item-date {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Blog post page */
.blog-post {
    max-width: 100%;
}

.blog-post-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.blog-post-date {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.blog-post-content {
    font-size: 0.95rem;
    line-height: 1.8;
}

.blog-post-content p {
    margin-bottom: 1.2rem;
}

.blog-post-content h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
}

.blog-post-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem;
}

.blog-post-content blockquote {
    border-left: 3px solid #ddd;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--secondary-color);
    font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
    margin: 1rem 0 1.2rem 1.5rem;
}

.blog-post-content li {
    margin-bottom: 0.4rem;
}

.blog-post-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.5rem auto;
    border-radius: 4px;
}

.blog-post-content a {
    color: var(--link-color);
    text-decoration: underline;
}

.blog-post-content a:hover {
    text-decoration: underline;
}

/* Audio player */
.audio-player {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 1.5rem 0;
}

.audio-player-label {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.audio-player audio {
    width: 100%;
    height: 36px;
}


/* Lightbox */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 600px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--divider-color);
        padding: 0.5rem 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem clamp(1.5rem, 4vw, 3rem);
        font-size: 1rem;
    }

    .nav {
        position: sticky;
    }

    .nav-container {
        position: relative;
    }

    .hero {
        flex-direction: column-reverse;
        align-items: center;
        text-align: left;
        gap: 1.5rem;
    }

    .hero-photo img {
        width: 140px;
        height: 140px;
    }

    .work-item {
        flex-direction: column;
    }

    .work-thumbnail {
        width: 100%;
        height: 200px;
    }

    .blog-post-title {
        font-size: 1.4rem;
    }
}
