/* ======================= VARIABLES ======================= */
:root {
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover-color: #5a6268;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --text-color: #212529;
    --border-color: #dee2e6;
    --header-height: 70px;
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Lato', sans-serif;
}

body.dark-theme {
    --primary-color: #4dabf7;
    --primary-hover-color: #74c0fc;
    --secondary-color: #868e96;
    --secondary-hover-color: #adb5bd;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --border-color: #333;
}


/* ======================= GLOBAL STYLES ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: var(--font-primary);
    font-weight: 600;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}


/* ======================= HEADER / NAVIGATION ======================= */
.header {
    background-color: var(--surface-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

body.dark-theme .header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    height: var(--header-height);
    padding: 0 2rem;
}

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

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    padding: 0;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.nav-contact {
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    transition: background-color 0.3s;
}

.nav-contact:hover {
    background-color: var(--primary-hover-color);
    color: white;
    text-decoration: none;
}

.nav-contact:hover::after {
    width: 0;
}

.nav-controls {
    display: flex;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    text-transform: uppercase;
}

.theme-toggle:hover {
    color: var(--primary-color);
}

.theme-toggle .fa-sun {
    display: none;
}

body.dark-theme .theme-toggle .fa-sun {
    display: block;
}

body.dark-theme .theme-toggle .fa-moon {
    display: none;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
}


/* ======================= MAIN CONTENT PADDING ======================= */
main {
    padding-top: var(--header-height);
}

.page-container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}


/* ======================= HERO SECTION ======================= */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
    text-align: center;
    background-color: var(--surface-color);
    padding: 2rem;
}

.hero-text {
    max-width: 800px;
}

.hero-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--secondary-color);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    line-height: 1.2;
}

.typewriter-cursor {
    border-right: 4px solid var(--primary-color);
    animation: blink 1s step-end infinite;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 1.5rem auto;
    color: var(--secondary-color);
}

.hero-buttons {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-color);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--text-color);
    color: var(--background-color);
    border-color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-decoration: none;
}


/* ======================= ABOUT SNIPPET ======================= */
.about-snippet {
    padding: 5rem 0;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-image {
    flex-basis: 35%;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.about-text {
    flex-basis: 65%;
}

.about-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.btn-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-link:hover {
    transform: translateX(5px);
    text-decoration: none;
}


/* ======================= FEATURED PROJECTS ======================= */
.featured-projects {
    padding: 5rem 0;
    background-color: var(--surface-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--background-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

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

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    background-color: var(--surface-color);
    color: var(--secondary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}


/* ======================= FOOTER ======================= */
.footer {
    background-color: var(--surface-color);
    color: var(--secondary-color);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-socials {
    margin-bottom: 1rem;
}

.footer-socials a {
    color: var(--secondary-color);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s;
}

.footer-socials a:hover {
    color: var(--primary-color);
}


/* ======================= ANIMATIONS ======================= */
@keyframes fadeInAnimation {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}


/* ======================= RESPONSIVE DESIGN ======================= */
@media (max-width: 850px) {
    .navbar {
        justify-content: space-between;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: var(--header-height);
        flex-direction: column;
        background-color: var(--surface-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
    }
    
    .nav-contact {
        width: 80%;
        margin: 1rem auto;
        display: block;
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .about-container {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    .hero-description {
        font-size: 1rem;
    }
    .hero-buttons {
        flex-direction: column;
    }
}


/* ======================= PAGE SPECIFIC STYLES ======================= */

/* --- About Page --- */
.about-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
}
.about-page-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.about-page-intro h1 { margin-bottom: 1rem; }
.lead-text {
    font-size: 1.2rem;
    max-width: 700px;
    color: var(--secondary-color);
}
.about-page-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-align: center; /* This centers the titles */
}
.section-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 4rem 0;
}
.credentials-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.credential-block h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.credential-block h4 { font-size: 1.1rem; }
.credential-block p, .credential-block ul {
    color: var(--secondary-color);
    margin-top: 0.5rem;
}
.credential-block ul {
    list-style-position: inside;
    padding-left: 0;
}

/* --- Contact Page --- */
.contact-content { max-width: 800px; margin: 0 auto; text-align: center; }
.contact-subtitle { margin-bottom: 3rem; font-size: 1.1rem; color: var(--secondary-color); }
.contact-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; text-align: center; margin-bottom: 3rem; }
.contact-method i { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 1rem; }
.contact-method h3 { margin-bottom: 0.5rem; }
.contact-method p { font-size: 0.9rem; color: var(--secondary-color); margin-bottom: 1rem; }
.contact-method a { word-break: break-all; }
.contact-phone { display: block; margin-top: 0.5rem; }
.contact-form { background: var(--surface-color); padding: 2rem; border-radius: 8px; border: 1px solid var(--border-color); }
.contact-form h2 { margin-bottom: 1.5rem; }
.form-group { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
}
.contact-form button { width: 100%; padding: 1rem; font-size: 1rem; }

/* --- Projects Page --- */
.project-case-study {
    display: flex;
    gap: 2.5rem;
    background-color: var(--surface-color);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
}
.project-case-study:last-child { margin-bottom: 0; }
.project-cs-image { flex: 0 0 300px; }
.project-cs-image img { width: 100%; border-radius: 8px; }
.project-cs-content h3 { font-size: 1.8rem; margin-bottom: 1rem; }
.project-cs-content p { margin-bottom: 1rem; color: var(--secondary-color); }
.project-cs-content .btn { margin-top: 1rem; }
.btn.disabled { background-color: var(--secondary-color); color: var(--surface-color); cursor: not-allowed; }
.btn.disabled:hover { transform: none; box-shadow: none; }

/* --- Skills Page --- */
.skills-intro { text-align: center; max-width: 700px; margin: -1rem auto 3rem auto; color: var(--secondary-color); }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.skill-category { background-color: var(--surface-color); padding: 2rem; border-radius: 8px; border: 1px solid var(--border-color); }
.skill-category h3 { font-size: 1.3rem; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.75rem; }
.skill-item { margin-bottom: 1.5rem; }
.skill-item:last-child { margin-bottom: 0; }
.skill-item h4 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.skill-item p { font-size: 0.9rem; color: var(--secondary-color); margin-bottom: 0.75rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tags span { background-color: var(--background-color); border: 1px solid var(--border-color); color: var(--secondary-color); font-size: 0.8rem; padding: 0.25rem 0.75rem; border-radius: 15px; }

/* --- Services Page (Updated for a single column layout) --- */
.services-grid {
    display: grid;
    grid-template-columns: 1fr; /* This will now be a 1-column grid on ALL screen sizes */
    gap: 2rem;
    max-width: 800px; /* The cards will be wide but constrained to a readable width */
    margin: 0 auto;
}

.service-card {
    background-color: transparent;
    min-height: 250px;
    perspective: 1000px;
}
.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
.service-card:hover .service-card-inner {
    transform: rotateY(180deg);
}
.service-card-front, .service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}
.service-card-front { background-color: var(--surface-color); }
.service-card-front i { font-size: 3rem; color: var(--primary-color); margin-bottom: 1rem; }
.service-card-front h3 { font-size: 1.2rem; }
.service-card-back {
    background-color: var(--primary-color);
    color: white;
    transform: rotateY(180deg);
    padding: 1.5rem;
}
.service-card-back h4 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.service-card-back p { font-size: 0.9rem; margin-bottom: 1rem; }
.service-card-back ul { list-style: none; padding: 0; margin-bottom: 1.5rem; font-size: 0.85rem; }
.service-card-back .btn-link { color: white; border: 1px solid white; padding: 0.5rem 1rem; border-radius: 20px; }
.service-card-back .btn-link:hover { background: rgba(255,255,255,0.2); }

/* --- Insights Page --- */
.insights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.insight-card { background-color: var(--surface-color); border-radius: 8px; overflow: hidden; border: 1px solid var(--border-color); }
.insight-image { width: 100%; height: 200px; object-fit: cover; }
.insight-content { padding: 1.5rem; }
.insight-meta { font-size: 0.8rem; color: var(--secondary-color); margin-bottom: 0.5rem; text-transform: uppercase; }
.insight-title { font-size: 1.25rem; margin-bottom: 0.75rem; }
.insight-excerpt { font-size: 0.9rem; color: var(--secondary-color); margin-bottom: 1rem; }


/* --- Responsive Fixes for Pages --- */
@media (max-width: 768px) {
    .project-case-study { flex-direction: column; }
    .project-cs-image { flex: 0 0 auto; width: 100%; height: 250px; object-fit: cover; }
    .form-group { flex-direction: column; }
}

/* ======================= REFINED & RESTORED STYLES ======================= */

/* Hides the text logo in the navigation bar */
.nav-logo {
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
}

.theme-toggle span {
    margin-left: 8px;
    font-size: 0.9rem;
}

@media (max-width: 850px) {
    .theme-toggle span {
        display: none;
    }
}

/* Color for the homepage typewriter effect */
#typing-text {
    color: var(--primary-color);
}

/* Big, multi-colored style for your name in the hero section */
#artistic-name {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #4dabf7, #da77f2, #f783ac);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
@media (max-width: 768px) {
    #artistic-name { font-size: 3rem; line-height: 1.2; }
}
@media (max-width: 480px) {
    #artistic-name { font-size: 2.5rem; }
}


/* ======================= NEW CENTERED & COLORED TYPEWRITER FOR PAGE TITLES ======================= */

/*
 * This selector is more specific. It targets the ::before pseudo-element
 * of any H1 tag that has BOTH the .section-title class and a data-title attribute.
 * This ensures the animation happens correctly inside the centered H1.
*/
h1.section-title[data-title]::before {
    content: attr(data-title); /* Get the title from the data-title attribute */
    color: var(--primary-color); /* ADD THIS: This colors the animated text */
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    border-right: 3px solid var(--primary-color); /* The blinking cursor */
    animation: 
        typing 2s steps(40, end) forwards,
        blink .75s step-end infinite;
}

/* We also need to hide the decorative underline on the animating titles */
h1.section-title[data-title]::after {
    display: none;
}

/* Keyframes for the typing animation (expands the width) */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}


/* ===================================
   PROJECTS PAGE - ENHANCEMENTS
   =================================== */

/* --- Project Filter Buttons --- */
.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background-color: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 2rem; /* Pill shape */
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background-color: var(--primary-color-hover);
    color: #fff;
    border-color: var(--primary-color-hover);
}

.filter-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}


/* --- Project Case Study Enhancements --- */
.project-case-study {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-case-study:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color-tint);
}

/* Alternating Layout */
.project-case-study.project-cs-reverse {
    flex-direction: row-reverse;
}

.project-case-study .project-cs-image {
    flex: 1;
    min-width: 300px;
}

.project-case-study .project-cs-content {
    flex: 1.2; /* Give slightly more space to content */
}

/* Improved Project Tags */
.project-tags span {
    background-color: var(--primary-color-tint);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 1rem;
    display: inline-block;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
}

/* --- Enhanced Scroll Animation --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive Adjustments for Projects Page --- */
@media (max-width: 768px) {
    .project-case-study,
    .project-case-study.project-cs-reverse {
        flex-direction: column; /* Stack image and content vertically */
        padding: 1.5rem;
    }

    .project-case-study .project-cs-image {
        width: 100%;
        max-width: 400px; /* Limit image size on mobile */
    }
}
