/* --- Global Styles & Variables --- */
:root {
    /* Light Mode (Default) */
    --bg-primary: #F8F8F8;
    --bg-secondary: #FFFFFF;
    --text-primary: #333333;
    --text-secondary: #555555;
    --accent-primary: #0057FF;
    --border-color: #EAEAEA;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --footer-bg: #FAFAFA;
    
    --font-family: 'Inter', sans-serif;
    --container-width: 1100px;
    --transition-speed: 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --text-primary: #EAEAEA;
    --text-secondary: #AAAAAA;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --footer-bg: #1A1A1A;
}

/* --- Base & Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }
p { font-weight: 400; margin-bottom: 1rem; color: var(--text-secondary);}
a { color: var(--accent-primary); text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* --- Utility Classes & Buttons --- */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.section-title { text-align: center; margin-bottom: 3rem; font-size: 2.5rem; color: var(--text-primary);}
.subsection-title { color: var(--text-secondary); text-align: center; margin-bottom: 2rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }

.btn { display: inline-block; padding: 0.75rem 1.5rem; border-radius: 5px; font-weight: 700; transition: transform var(--transition-speed), box-shadow var(--transition-speed); }
.btn-primary { background-color: var(--accent-primary); color: #FFF; position: relative; z-index: 1; overflow: hidden; border: 2px solid var(--accent-primary);}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0, 87, 255, 0.3); }
.btn-primary::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent); transition: left 0.5s ease; z-index: -1; }
.btn-primary:hover::before { left: 100%; }
.btn-secondary { background-color: transparent; color: var(--accent-primary); border: 2px solid var(--accent-primary); }
.btn-secondary:hover { background-color: var(--accent-primary); color: #FFF; }
.btn-large { padding: 1rem 2rem; font-size: 1.1rem; }

/* --- Header & Theme Switcher --- */
.header { position: fixed; top: 0; left: 0; width: 100%; background-color: color-mix(in srgb, var(--bg-primary) 90%, transparent); backdrop-filter: blur(10px); z-index: 1000; border-bottom: 1px solid var(--border-color); }
.navbar-container { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: none; }
.theme-switcher { display: flex; align-items: center; }
.theme-toggle-label { position: relative; display: inline-block; width: 50px; height: 26px; }
.theme-toggle-input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; border-radius: 26px; transition: var(--transition-speed); }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: var(--transition-speed); }
.theme-toggle-input:checked + .slider { background-color: var(--accent-primary); }
.theme-toggle-input:checked + .slider:before { transform: translateX(24px); }
.nav-links a { color: var(--text-primary); font-weight: 700; position: relative; }
.nav-links a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background-color: var(--accent-primary); transition: width var(--transition-speed); }
.nav-links a:hover::after { width: 100%; }

/* --- Hero Section & Animated Background --- */
.hero-section { position: relative; overflow: hidden; min-height: 100vh; display: flex; align-items: center; padding-top: 120px; padding-bottom: 60px; }
#hero-animation-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.hero-container { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3rem; }
.hero-text h1 { margin-bottom: 1rem; color: var(--text-primary); }
.hero-text p { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2rem; color: var(--text-secondary); }
.profile-picture { width: 250px; height: 250px; object-fit: cover; }
.animate-on-load { opacity: 0; transform: translateY(20px); animation: fadeInSlideUp 0.8s ease-out forwards; }
.animate-on-load:nth-child(2) { animation-delay: 0.2s; }
@keyframes fadeInSlideUp { to { opacity: 1; transform: translateY(0); } }

/* === NEW HERO IMAGE FRAME STYLE (Suggestion 2A) === */
.hero-image {
    position: relative;
}
.hero-image .profile-picture {
    border-radius: 12px;
    position: relative;
    z-index: 2;
}
.hero-image::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    z-index: 1;
    transition: var(--transition-speed);
}
.hero-image:hover::before {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}


/* --- Tech Stack Section --- */
.tech-stack-section { padding: 40px 0; border-bottom: 1px solid var(--border-color); }
@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
.scroller-container {
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}
.scroller {
    display: flex;
    gap: 3rem;
    width: max-content;
    animation: scroll 30s linear infinite;
}
.scroller:hover {
    animation-play-state: paused;
}
.scroller img {
    height: 40px;
    max-width: none;
    opacity: 0.7;
    transition: var(--transition-speed);
}
.scroller img:hover {
    opacity: 1;
}
[data-theme="dark"] .scroller img {
    filter: invert(1) brightness(1.5);
}

/* --- Project Section & Modal --- */
.projects-section { padding: 80px 0; }
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.project-card { cursor: pointer; background-color: var(--bg-secondary); border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px var(--shadow-color); transition: transform var(--transition-speed), box-shadow var(--transition-speed); }
.project-card:hover { transform: translateY(-10px); box-shadow: 0 10px 25px color-mix(in srgb, var(--shadow-color) 200%, transparent); }
.project-image { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 1.5rem; }
.card-content h3 { color: var(--text-primary); }
.skill-tag { display: inline-block; background-color: color-mix(in srgb, var(--accent-primary) 15%, transparent); color: var(--accent-primary); font-size: 0.8rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 12px; margin-top: 1rem; }
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); z-index: 2000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.4s ease; }
.modal.active { display: flex; opacity: 1; }
.modal-content { background: var(--bg-secondary); padding: 2rem; border-radius: 8px; max-width: 600px; width: 90%; position: relative; transform: translateY(-50px); transition: transform 0.4s ease; }
.modal.active .modal-content { transform: translateY(0); }
.modal-close { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 2rem; cursor: pointer; color: var(--text-secondary); }
.modal h3 { margin-bottom: 1.5rem; color: var(--text-primary); }
.modal-section { margin-bottom: 1rem; }
.modal-section h4 { color: var(--accent-primary); margin-bottom: 0.5rem; }
.modal-section ul { list-style: '✓  '; list-style-position: outside; padding-left: 1.5rem; }
.modal-section ul li { margin-bottom: 0.5rem; }
.metric { font-weight: 700; color: var(--text-primary); }

/* --- Process Section --- */
.process-section { padding: 80px 0; background-color: var(--bg-secondary); }
.process-wrapper { display: grid; grid-template-columns: 1fr; gap: 2rem; position: relative; }
.process-step { text-align: center; padding: 2rem; position: relative; }
.process-number { font-size: 3rem; font-weight: 700; color: var(--accent-primary); line-height: 1; margin-bottom: 1rem; }
.process-step h3 { color: var(--text-primary); }

/* --- About Me Section --- */
.about-section { padding: 80px 0; }
.about-container { display: flex; flex-direction: column; align-items: center; gap: 3rem; }
.about-text h2 { text-align: center; }
/* === NEW ABOUT ME IMAGE FRAME STYLE (Suggestion A) === */
.about-image {
    position: relative;
    padding-left: 12px; /* Make space for the accent line */
}
.about-image .profile-picture {
    border-radius: 12px;
}
.about-image::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: var(--accent-primary);
    border-radius: 2px;
}


/* --- Testimonials Section --- */
.testimonials-section { padding: 80px 0; background-color: var(--bg-secondary); }
.testimonial-wrapper { display: grid; grid-template-columns: 1fr; gap: 2rem; max-width: 900px; margin: 0 auto; }
.testimonial-card { background: var(--bg-primary); padding: 2rem; border-radius: 8px; text-align: center; border: 1px solid var(--border-color); }
.testimonial-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1.5rem; }
.testimonial-text { font-size: 1.1rem; font-style: italic; color: var(--text-secondary); margin-bottom: 1.5rem; }
.author-name { font-weight: 700; color: var(--text-primary); }
.author-title { font-size: 0.9rem; color: var(--text-secondary); }

/* --- Services Section (Accordion) --- */
.services-section { padding: 80px 0; }
.accordion { max-width: 700px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid var(--border-color); }
.accordion-header { width: 100%; background: none; border: none; text-align: left; padding: 1.5rem 1rem; font-size: 1.2rem; font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text-primary); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.accordion-content p { padding: 0 1rem 1.5rem; }
.accordion-icon { font-size: 1.5rem; font-weight: 400; transition: transform var(--transition-speed); }
.accordion-item.active .accordion-icon { transform: rotate(45deg); }

/* --- CTA Section --- */
.cta-section { padding: 80px 0; text-align: center; background-color: var(--bg-secondary); }
.cta-section h2 { font-size: 2.5rem; color: var(--text-primary); }
.cta-section p { max-width: 500px; margin: 1rem auto 2rem; font-size: 1.1rem; }
.cta-buttons { display: flex; flex-direction: column; gap: 1rem; justify-content: center; align-items: center; margin-top: 2rem; }

/* --- Footer --- */
.footer { background-color: var(--footer-bg); padding: 40px 0; border-top: 1px solid var(--border-color); }
.footer-container { display: flex; flex-direction: column; text-align: center; gap: 2rem; align-items: center; }
.footer-col h3 { color: var(--text-primary); }
.social-links { display: flex; gap: 1.5rem; }
.social-links a { color: var(--text-secondary); }
.social-links a:hover { color: var(--accent-primary); }

/* --- Scroll Animations --- */
.animate-on-scroll { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* --- Media Queries (Desktop) --- */
@media (min-width: 768px) {
    h1 { font-size: 4.5rem; }
    .nav-links { display: flex; align-items: center; gap: 2rem; }
    .hero-container { flex-direction: row; text-align: left; }
    .hero-text { flex: 1; }
    .hero-text p { margin-left: 0; }
    .profile-picture { 
        width: 350px; 
        height: 350px; 
    }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
    .process-wrapper { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
    .process-step { border-right: 1px solid var(--border-color); }
    .process-step:last-child { border-right: none; }
    .about-container { flex-direction: row; text-align: left; align-items: center; gap: 4rem; }
    .about-image { flex-basis: 350px; }
    .about-text h2 { text-align: left; }
    .testimonial-wrapper { grid-template-columns: repeat(2, 1fr); }
    .cta-buttons { flex-direction: row; gap: 2rem; }
    .footer-container { flex-direction: row; justify-content: space-between; }
}