/* --- Global Styles & Variables --- */
:root {
    --primary-color: #0d6efd;
    --primary-hover-color: #0b5ed7;
    --dark-bg: #111827;
    --light-bg: #1f2937;
    --text-color: #f9fafb;
    --light-text-color: #9ca3af;
    --card-bg: #374151;
    --border-color: #4b5563;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

html.lenis {
    scroll-behavior: auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.7;
}

section {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Add padding-top to create space for the fixed header */
#projects, #contact-page {
    padding-top: 8rem;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 600;
}

h2 {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 4rem;
    font-weight: 700;
    color: var(--text-color);
}

h2:has(+ .section-intro) {
    margin-bottom: 1rem;
}

.section-intro {
    max-width: 760px;
    margin: 0 auto 2.75rem;
    text-align: center;
    color: var(--light-text-color);
    font-size: 1.05rem;
}

h2::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 5%;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Hero Section --- */
#hero {
    display: flex;
    align-items: center;
    min-height: 100vh;
    text-align: left;
    padding: 7rem 5% 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-kicker {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.hero-content h1 {
    font-size: 3.4rem;
    margin-bottom: 0.45rem;
    font-weight: 700;
}

.hero-content .subtitle {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.hero-lead {
    max-width: 640px;
    color: var(--light-text-color);
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
}

.hero-meta {
    color: var(--light-text-color);
    margin-bottom: 0.4rem;
    font-size: 0.98rem;
}

.hero-metrics {
    margin-top: 1rem;
}

#hero .button-container {
    justify-content: flex-start;
    margin-top: 1.5rem;
}

.cta-button.secondary {
    background: transparent;
    color: var(--text-color);
}

.cta-button.secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

#hero .social-links {
    display: flex;
    gap: 1.15rem;
    margin: 1.35rem 0 0;
}

#hero .social-links a {
    margin: 0;
    font-size: 1.35rem;
}

.hero-photo {
    display: flex;
    justify-content: center;
}

.hero-photo img {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--card-bg);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.45);
}

.social-links {
    margin-bottom: 2.5rem;
}

.social-links a {
    color: var(--light-text-color);
    font-size: 1.8rem;
    margin: 0 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    border: 2px solid var(--primary-color);
    cursor: pointer;
}

.cta-button:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

/* --- About Section --- */
.about-profile {
    max-width: 860px;
    margin: 0 auto;
    text-align: left;
}

.about-profile p {
    color: var(--light-text-color);
    font-size: 1.08rem;
    margin-bottom: 0.9rem;
}

.about-profile p:last-child {
    margin-bottom: 0;
}

.about-profile p.reveal:nth-child(2) {
    transition-delay: 0.14s;
}

.about-profile p.reveal:nth-child(3) {
    transition-delay: 0.28s;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}
.skill-card {
    background-color: var(--card-bg);
    padding: 1.5rem 1.15rem 1.25rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}
.skill-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}
.skill-card i {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin-bottom: 0.55rem;
}
.skill-card h3 {
    font-size: 1.05rem;
    color: var(--text-color);
    margin-bottom: 0.85rem;
}
.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
}
.skill-list li {
    background: rgba(13, 110, 253, 0.14);
    color: #dbeafe;
    border: 1px solid rgba(13, 110, 253, 0.4);
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.3;
}


/* --- Projects Section --- */
.project-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 7rem;
}
.project-showcase:last-child {
    margin-bottom: 0;
}
.project-showcase.alt-layout .project-image {
    order: 2;
}
.project-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: transform 0.3s;
}

.company-note {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.project-image img:hover {
    transform: scale(1.05);
}

.project-visual {
    min-height: 280px;
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.35), transparent 45%),
        linear-gradient(160deg, #1f2937, #111827);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.project-visual span {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-visual strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 2rem;
    line-height: 1.2;
}

.project-visual p {
    margin-top: 0.6rem;
    color: var(--light-text-color);
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.project-links a {
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--border-color);
    background-color: var(--light-bg);
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.project-links a:hover {
    color: white;
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.section-kicker {
    text-align: center;
    color: var(--light-text-color);
    max-width: 760px;
    margin: -2.5rem auto 3.5rem;
    font-size: 1.05rem;
}

.project-group {
    text-align: center;
    font-size: 1.8rem;
    margin: 1rem 0 3rem;
}

.project-group::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--primary-color);
    margin: 1rem auto 0;
    border-radius: 2px;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.75rem;
}

.project-card p {
    color: var(--light-text-color);
}

.stat-row,
.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.15rem;
}

.stat-row span,
.metric-row span {
    background: rgba(13, 110, 253, 0.14);
    color: #dbeafe;
    border: 1px solid rgba(13, 110, 253, 0.4);
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.project-card-hero {
    display: grid;
    grid-template-columns: 1fr 220px;
    align-items: start;
}

.project-card-intro {
    padding: 1.6rem 1.6rem 0.4rem;
}

.project-card-intro h3 {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin-bottom: 0.45rem;
}

.project-card-media {
    min-height: 0;
    padding: 1.5rem 1.5rem 0 0;
    background: transparent;
}

.project-card-media img,
.project-card-media .project-visual {
    display: block;
    width: 220px;
    height: 148px;
    min-height: 0;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    box-shadow: none;
}

.project-card-media img.is-banner {
    object-fit: contain;
    background: #fff;
}

.project-card-media img.is-logo {
    object-fit: contain;
    background: #1c1c1c;
}

.project-card-media .project-visual {
    min-height: 0;
    padding: 0.9rem 1rem;
    justify-content: flex-end;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: none;
}

.project-card-media .project-visual strong {
    font-size: 1.15rem;
    margin-top: 0.25rem;
}

.project-card-media .project-visual p {
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

.project-card-body {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 1.25rem 1.75rem;
    padding: 0.4rem 1.6rem 1.4rem;
}

.project-card-body h4 {
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

.project-card .project-links {
    padding: 0 1.6rem 1.4rem;
    margin-top: 0;
}

.project-card .tags {
    padding: 0 1.6rem;
}

.project-card ul {
    list-style: none;
    padding-left: 0;
}

.project-card li {
    color: var(--light-text-color);
    margin-bottom: 0.55rem;
    position: relative;
    padding-left: 1.4rem;
}

.project-card li::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

.project-details h3 {
    font-size: 2rem;
    color: var(--primary-color);
}
.project-details h4 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    color: var(--text-color);
}
.project-details .project-description {
    font-size: 1.1rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.project-problem {
    color: var(--light-text-color);
    margin-bottom: 1.25rem;
}

.project-problem strong {
    color: var(--text-color);
    font-weight: 600;
}
.project-details ul {
    list-style-type: none;
    padding-left: 0;
}
.project-details ul li {
    color: var(--light-text-color);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 25px;
}
.project-details ul li::before {
    content: '\f058'; /* Font Awesome check icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
    position: absolute;
    left: 0;
}
.tags {
    margin-top: 1.5rem;
}
.tags span {
    background-color: var(--light-bg);
    color: var(--light-text-color);
    padding: 0.4rem 0.9rem;
    border-radius: 5px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

/* --- Portfolio Link Section on Main Page --- */
#portfolio-link {
    text-align: center;
    background-color: var(--light-bg);
}
#portfolio-link > p {
    max-width: 680px;
    margin: -2.5rem auto 2rem;
    color: var(--light-text-color);
    font-size: 1.1rem;
}

#portfolio-link .education-card {
    text-align: left;
}

#portfolio-link .education-card p {
    max-width: none;
    margin: 0.45rem 0 0;
    font-size: 0.98rem;
}

/* --- Experience Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1.5px;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}
.timeline-item:nth-child(even) {
    left: 50%;
}
.timeline-dot {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    border: 3px solid var(--dark-bg);
    top: 24px;
    border-radius: 50%;
    z-index: 1;
}
.timeline-item:nth-child(odd) .timeline-dot { right: -9px; }
.timeline-item:nth-child(even) .timeline-dot { left: -8px; }

.timeline-content {
    padding: 20px 30px;
    background-color: var(--card-bg);
    border-radius: 8px;
    position: relative;
}
.timeline-content h3 { color: var(--text-color); }
.timeline-content .company { font-weight: bold; color: var(--primary-color); margin-bottom: 0.5rem; }
.timeline-content .date { font-style: italic; color: var(--light-text-color); margin-bottom: 1rem; }
.timeline-content ul { list-style-position: inside; text-align: left; }

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 920px;
    margin: 0 auto;
}

.experience-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.75rem 2rem;
    border-left: 4px solid var(--primary-color);
}

.experience-card h3 {
    margin-bottom: 0.35rem;
}

.experience-card .company {
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.experience-card .date {
    font-style: italic;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.experience-card .role-summary {
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.experience-card ul {
    padding-left: 1.2rem;
}

.experience-card li {
    color: var(--light-text-color);
    margin-bottom: 0.45rem;
}

/* --- Education Section --- */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.education-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    border-bottom: 4px solid var(--primary-color);
}
.education-card h4 { font-size: 1.2rem; color: var(--text-color); }
.education-card p { color: var(--light-text-color); }

.education-card.is-extra {
    display: none;
}

.education-grid.is-open .education-card.is-extra {
    display: block;
}

.view-all-wrap {
    text-align: center;
    margin-top: 1.75rem;
}

/* --- Contact Section & Page --- */
#contact {
    text-align: center;
}
#contact p, #contact-page p {
    max-width: 680px;
    margin: 0 auto 2.5rem;
    color: var(--light-text-color);
    font-size: 1.1rem;
}

.contact-details {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.9rem 1.6rem;
    max-width: 900px;
    margin: -1.5rem auto 2rem;
}

.contact-details a,
.contact-details span {
    color: var(--text-color);
    text-decoration: none;
}

.contact-details i {
    color: var(--primary-color);
    margin-right: 0.45rem;
}

.contact-form-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--light-bg);
    padding: 2.5rem;
    border-radius: 10px;
    text-align: left;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--dark-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* --- Footer --- */
footer {
    background-color: var(--light-bg);
    padding: 2.5rem 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.footer-social-links { margin-bottom: 1rem; }
.footer-social-links a {
    color: var(--light-text-color);
    font-size: 1.5rem;
    margin: 0 0.8rem;
    transition: color 0.3s ease;
}
.footer-social-links a:hover { color: var(--primary-color); }
footer p { color: var(--light-text-color); font-size: 0.9rem; }

/* --- Fade-in Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-in,
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Hamburger Menu Button --- */
.hamburger {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger-bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-photo {
        order: -1;
    }

    .hero-content h1 {
        font-size: 2.7rem;
    }

    .project-showcase, .project-showcase.alt-layout {
        grid-template-columns: 1fr;
    }
    .project-showcase.alt-layout .project-image {
        order: 1;
    }
    .project-showcase .project-details {
        order: 2;
    }

    .project-card-hero,
    .project-card-body {
        grid-template-columns: 1fr;
    }

    .project-card-media {
        order: -1;
        padding: 1.25rem 1.25rem 0;
    }

    .project-card-media img,
    .project-card-media .project-visual {
        width: 100%;
        height: 148px;
    }

    .project-card-media img.is-logo {
        width: 220px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.4rem; }
    h2 { font-size: 2.2rem; }

    #hero {
        min-height: auto;
        text-align: center;
        padding-top: 6.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
    }

    .hero-photo {
        order: -1;
    }

    .hero-photo img {
        width: 160px;
        height: 160px;
    }

    #hero .button-container,
    #hero .social-links,
    .hero-metrics {
        justify-content: center;
    }

    .hero-lead {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        height: 100vh;
        background-color: var(--light-bg);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    .nav-links.active {
        transform: translateX(0);
    }
    
    .hamburger.active .hamburger-bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .hamburger-bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .hamburger-bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item:nth-child(odd), .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }
    .timeline-item:nth-child(odd) .timeline-dot, .timeline-item:nth-child(even) .timeline-dot {
        left: 23px;
    }
}

@media (max-width: 600px) {
    .hero-content .subtitle {
        font-size: 1.05rem;
    }

    .experience-card {
        padding: 1.25rem 1rem;
    }

    .button-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .button-container .cta-button {
        width: 80%;
        max-width: 300px;
        text-align: center;
    }
}