/* ============================================
   GLOBAL STYLES
   ============================================ */

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

:root {
    --primary-color: #D4A574;
    --secondary-color: #C49060;
    --text-dark: #000000;
    --text-light: #4b5563;
    --bg-light: #FFF8DE;
    --bg-white: #FFF8DE;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    position: sticky;
    top: 0;
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-item:has(.icon),
.nav-item:has(.icon-img) {
    flex-basis: auto;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.icon {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.icon-img {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
    filter: invert(0);
}

.nav-link:hover .icon,
.nav-link:hover .icon-img {
    transform: scale(1.1);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    padding: 8rem 2rem 5.6rem 2rem;
    background-color: var(--bg-white);
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
}

.profile-image-container {
    margin-bottom: 3rem;
}

.profile-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.hero-name {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    line-height: 1.6;
    white-space: normal;
    margin-top: 0;
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about {
    padding: 4.8rem 2rem;
    background-color: var(--bg-white);
}

.container {
    max-width: 956px;
    margin: 0 auto;
}

.about h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-content p {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.9;
    text-align: justify;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects {
    padding: 4.8rem 2rem;
    background-color: var(--bg-white);
}

.projects h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
    text-align: center;
}

.carousel-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1190px;
    margin: 0 auto;
}

.carousel-viewport {
    flex: 1;
    overflow: hidden;
    width: 100%;
}

.projects-carousel {
    display: flex;
    gap: 2rem;
    overflow: visible;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.projects-carousel::-webkit-scrollbar {
    display: none;
}

.project-card {
    scroll-snap-align: start;
}

.carousel-btn {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.carousel-btn.prev-btn {
    order: -1;
}

.carousel-btn.next-btn {
    order: 1;
}

.project-card {
    background-color: transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 100%;
    padding: 0;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    width: 100%;
    height: 400px;
    background-color: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

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

.project-card:nth-child(2) .project-image img {
    object-fit: contain;
    object-position: center;
}

.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
}

.project-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.project-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    cursor: pointer;
}

.project-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.project-btn.github-btn {
    padding: 0.6rem;
    width: 44px;
    height: 44px;
}

.project-btn.github-btn svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   PUBLICATIONS SECTION
   ============================================ */

.publications {
    padding: 4.8rem 2rem;
    background-color: var(--bg-white);
}

.publications h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
    text-align: center;
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.publication-card {
    display: flex;
    gap: 2rem;
    background-color: transparent;
    padding: 2rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publication-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.publication-image {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.publication-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.publication-badge {
    display: inline-block;
    background-color: #0891b2;
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.publication-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.publication-authors {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.publication-venue {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.publication-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.pub-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: inline-block;
    background-color: transparent;
    cursor: pointer;
}

.pub-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* ============================================
   MODAL STYLES
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-white);
    padding: 3rem;
    border-radius: 8px;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.close-btn {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-dark);
}

.modal-content h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.modal-content p {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.8;
    text-align: justify;
}

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

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   BLOG SECTION
   ============================================ */

.blog-section {
    padding: 6rem 2rem;
    background-color: var(--bg-light);
    min-height: 60vh;
}

.blog-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3rem;
    text-align: center;
}

.blog-list {
    display: grid;
    gap: 2rem;
}

.blog-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.blog-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h2 a:hover {
    color: var(--secondary-color);
}

.blog-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
}

/* ============================================
   BLOG POST PAGE
   ============================================ */

.blog-post {
    padding: 4rem 2rem;
    background-color: var(--bg-white);
    min-height: 80vh;
}

.blog-post-header {
    margin-bottom: 3rem;
    text-align: center;
}

.blog-post-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-post-date {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.blog-post-description {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.8;
    max-width: 680px;
    margin: 0 auto;
}

.blog-post-content {
    max-width: 765px;
    margin: 0 auto 3rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.blog-post-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.blog-post-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

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

.blog-post-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

.blog-post-content table th,
.blog-post-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.blog-post-content table th {
    background-color: var(--bg-light);
    font-weight: 700;
    color: var(--text-dark);
}

.blog-post-content table tr:hover {
    background-color: var(--bg-light);
}

.blog-post-content code {
    background-color: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #d73a49;
}

.blog-post-content pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

.blog-post-content pre code {
    background-color: transparent;
    color: #f8f8f2;
    padding: 0;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
}

.blog-post-content hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2.5rem 0;
}

.blog-post-footer {
    max-width: 765px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.back-to-blog {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
    display: inline-block;
}

.back-to-blog:hover {
    color: var(--secondary-color);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background-color: var(--text-dark);
    color: var(--bg-white);
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer p {
    margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .nav-menu {
        gap: 1rem;
        width: 100%;
        justify-content: center;
        max-width: 400px;
        margin: 0 auto;
    }

    .nav-item:nth-child(1),
    .nav-item:nth-child(2),
    .nav-item:nth-child(3),
    .nav-item:nth-child(4) {
        min-width: fit-content;
    }

    .hero {
        padding: 4rem 1rem;
        min-height: auto;
    }

    .hero-name {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .profile-image {
        width: 150px;
        height: 150px;
    }

    .about {
        padding: 4rem 1rem;
    }

    .about h2 {
        font-size: 2rem;
    }

    .about-content p {
        font-size: 1rem;
    }

    .projects {
        padding: 4rem 1rem;
    }

    .projects h2 {
        font-size: 2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .project-image {
        height: 150px;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .blog-section {
        padding: 4rem 1rem;
    }

    .blog-section h1 {
        font-size: 2rem;
    }

    .blog-card {
        padding: 1.5rem;
    }

    .publication-card {
        flex-direction: column;
        gap: 1.5rem;
    }

    .publication-image {
        width: 100%;
        height: 150px;
    }

    .publication-title {
        font-size: 1.2rem;
    }

    .publication-authors {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-logo {
        font-size: 1.25rem;
    }

    .nav-container {
        padding: 0.8rem 1rem;
    }

    .nav-menu {
        gap: 0.5rem;
    }

    .icon {
        width: 20px;
        height: 20px;
    }

    .hero-name {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .profile-image {
        width: 120px;
        height: 120px;
    }

    .about h2,
    .blog-section h1,
    .projects h2 {
        font-size: 1.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .project-image {
        height: 120px;
    }

    .project-title {
        font-size: 1rem;
    }

    .project-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .project-btn.github-btn {
        padding: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .project-btn.github-btn svg {
        width: 18px;
        height: 18px;
    }
}
