/* --- Base Styles & Variables --- */
:root {
    /* Light Mode Colors */
    --bg-color: #fff;
    --bg-secondary-color: #f9fafb; /* Used for sections like services, stats */
    --text-color: #333;
    --heading-color: #111;
    --primary-color: #000; /* Black for primary buttons, highlights */
    --primary-hover-color: #444;
    --secondary-color: #555; /* Subdued text */
    --border-color: #ddd;
    --card-border-color: #ddd;
    --white: #fff;
    --primary-btn-text-color: #fff;
    --secondary-btn-text-color: #000;
    --secondary-btn-bg-color: transparent;
    --secondary-btn-hover-bg-color: #f9fafb;
    --secondary-btn-border-color: #ddd;
    --tag-bg-color: #fff;
    --tag-border-color: #ddd;
    --tag-text-color: #555;
    --tag-active-bg-color: #000;
    --tag-active-text-color: #fff;
    --tag-hover-bg-color: #f0f0f0;
    --tag-hover-border-color: #bbb;
    --form-input-bg: transparent;
    --form-input-border: #ddd;
    --form-input-focus-border: #000;
    --placeholder-color: #aaa;
    --nav-bg-color: rgba(255, 255, 255, 0.95);
    --nav-text-color: #333;
    --nav-link-hover-color: #000;
    --nav-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --highlight-card-bg: #000;
    --highlight-card-text: #fff;
    --highlight-card-text-muted: rgba(255, 255, 255, 0.85);
    --highlight-experience-bg: #000;
    --highlight-experience-text: #fff;
    --highlight-experience-text-muted: rgba(255, 255, 255, 0.85);
    --roadmap-line-color: #ddd;
    --roadmap-dot-color: #000;
    --roadmap-dot-border: #fff;
    --roadmap-dot-shadow: 0 0 0 3px var(--roadmap-dot-color);
    --section-graphic-color: #000;
    --education-item-border-left: #000;
    --popup-bg: #fff;
    --popup-border: #ddd;
    --highlight-text-bg: #f0f0f0;
    --highlight-text-color: #111;
    --photo-shadow: 0 10px 30px rgba(0,0,0,0.1);
    --svg-path-color: black; /* For inline SVG backgrounds */

    /* Gradients (Keep or adjust as needed) */
    --gradient-start: #ffcc00;
    --gradient-mid: #ff6b6b;
    --gradient-end: #5f27cd;
    --gradient-text-start: #ff3c8e;
    --gradient-text-mid: #a145f4;
    --gradient-text-end: #1e90ff;

    /* General */
    --font-primary: 'Poppins', sans-serif;
    --container-width: 1140px;
    --nav-height: 60px; /* Define nav height */
}

/* Dark Mode Variables - GitHub Inspired */
html.dark-mode {
    --bg-color: #0d1117; /* Very dark grey, almost black */
    --bg-secondary-color: #161b22; /* Slightly lighter dark grey for sections */
    --text-color: #c9d1d9; /* Light grey text */
    --heading-color: #f0f6fc; /* Near white headings */
    --primary-color: #bb86fc; /* Using a purple accent for primary in dark mode */
    --primary-hover-color: #a16ae8;
    --secondary-color: #8b949e; /* Grey for subdued text */
    --border-color: #30363d; /* Darker grey border */
    --card-border-color: #30363d;
    --white: #f0f6fc; /* Represents the brightest text/elements */
    --primary-btn-text-color: #0d1117; /* Dark text on purple button */
    --secondary-btn-text-color: #c9d1d9; /* Light grey text */
    --secondary-btn-bg-color: transparent;
    --secondary-btn-hover-bg-color: #21262d; /* Darker grey hover */
    --secondary-btn-border-color: #30363d;
    --tag-bg-color: #21262d; /* Dark tag background */
    --tag-border-color: #30363d;
    --tag-text-color: #8b949e;
    --tag-active-bg-color: #bb86fc; /* Purple active */
    --tag-active-text-color: #0d1117; /* Dark text on active tag */
    --tag-hover-bg-color: #30363d;
    --tag-hover-border-color: #484f58;
    --form-input-bg: transparent;
    --form-input-border: #30363d;
    --form-input-focus-border: #bb86fc; /* Purple focus */
    --placeholder-color: #6e7681;
    --nav-bg-color: rgba(22, 27, 34, 0.9); /* Dark nav background */
    --nav-text-color: #c9d1d9;
    --nav-link-hover-color: #f0f6fc;
    --nav-shadow: 0 1px 3px rgba(0,0,0,0.4);
    --highlight-card-bg: #bb86fc; /* Purple background */
    --highlight-card-text: #0d1117; /* Dark text */
    --highlight-card-text-muted: rgba(13, 17, 23, 0.85);
    --highlight-experience-bg: #bb86fc; /* Purple highlight */
    --highlight-experience-text: #0d1117;
    --highlight-experience-text-muted: rgba(13, 17, 23, 0.85);
    --roadmap-line-color: #30363d;
    --roadmap-dot-color: #bb86fc;
    --roadmap-dot-border: #161b22;
    --roadmap-dot-shadow: 0 0 0 3px var(--roadmap-dot-color);
    --section-graphic-color: #bb86fc;
    --education-item-border-left: #bb86fc;
    --popup-bg: #161b22;
    --popup-border: #30363d;
    --highlight-text-bg: #21262d; /* Darker background for highlighted text */
    --highlight-text-color: #f0f6fc;
    --photo-shadow: 0 10px 30px rgba(0,0,0,0.3);
    --svg-path-color: #c9d1d9; /* Light grey for SVG paths */
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
    color-scheme: light dark; /* Indicate theme support */
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    overflow-x: hidden; /* Prevent horizontal scroll */
    position: relative; /* Needed for overlay/sidebar interaction */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utility class to prevent scrolling when sidebar/popup is open */
.body-no-scroll {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; line-height: 1.2; }
h2 { font-size: 2.5rem; line-height: 1.3; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; color: var(--secondary-color); }
a { color: var(--text-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
i { /* Basic icon styling */
    vertical-align: middle; /* Align icons better with text */
    display: inline-block;
}

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
}
.text-center { text-align: center; }
.section-header { margin-bottom: 3rem; position: relative; }
.section-header.text-center p.section-description { max-width: 600px; margin-left: auto; margin-right: auto; }
.subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 0; /* Sharp edges */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5; /* Ensure text is vertically centered */
}
.btn i { margin-left: 5px; font-size: 1.1em;} /* Style icons in buttons */

.btn-primary {
    background-color: var(--primary-color);
    color: var(--primary-btn-text-color);
    margin-right: 10px;
}
.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
    color: var(--primary-btn-text-color);
}

.btn-secondary {
    background-color: var(--secondary-btn-bg-color);
    color: var(--secondary-btn-text-color);
    border: 1px solid var(--secondary-btn-border-color);
    padding-left: 20px;
    padding-right: 20px;
}
.btn-secondary:hover {
    background-color: var(--secondary-btn-hover-bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color); /* Change text color on hover to primary */
}
.btn-secondary i { margin-left: 5px; }

.btn-dark { background-color: var(--heading-color); color: var(--bg-color); } /* Contrast button */
.btn-dark:hover { background-color: var(--secondary-color); color: var(--bg-color);}


/* --- Header / Hero Section --- */
.hero {
    padding: var(--nav-height) 15% 60px 15%;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 95vh;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    background-color: var(--nav-bg-color);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: var(--nav-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.main-nav .logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--heading-color); /* Ensure logo text uses heading color */
}

.main-nav .nav-links-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}
.main-nav .nav-links-container a {
    margin-left: 30px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--nav-text-color); /* Use nav text color */
}
.main-nav .nav-links-container .arrow {
    display: inline-block;
    margin-left: 2px;
    font-size: 0.8em;
    transition: transform 0.3s ease;
}
.main-nav .nav-links-container a:hover {
    color: var(--nav-link-hover-color); /* Use nav link hover color */
}
.main-nav .nav-links-container a:hover .arrow {
    transform: translate(3px, -3px);
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--secondary-color); /* Use secondary color for icon */
    font-size: 1.5rem; /* Adjust size as needed */
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    margin-left: 20px; /* Space from nav links */
    transition: color 0.3s ease;
    order: 3; /* Position after nav links container */
}
.theme-toggle-btn:hover {
    color: var(--primary-color); /* Use primary color on hover */
}
.theme-toggle-btn i {
    display: block; /* Ensure icon behaves like a block */
}

.nav-toggle-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color); /* Use primary color */
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    z-index: 1001;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: absolute;
    right: 15%;
    top: 50%;
    transform: translateY(-50%);
    order: 4; /* Position after theme toggle */
}

.nav-close-btn {
    display: none;
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--secondary-color);
    cursor: pointer;
    z-index: 1001;
    line-height: 1;
}
.nav-close-btn:hover {
    color: var(--primary-color);
}

.nav-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Keep dark overlay */
    z-index: 998;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0.4s;
    pointer-events: none;
    visibility: hidden;
}
.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0s;
}


.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
    padding: 0 0 50px 0;
    gap: 40px;
    width: 100%;
}

.hero-text { flex: 1 1 55%; position: relative; z-index: 2;}
.waving-hand { font-size: 2.5rem; display: inline-block; margin-bottom: 10px; animation: wave 2s infinite; }
.hero-text h1 { margin-bottom: 5px; }
.hero-text h2 {
    font-weight: 400;
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-bottom: 25px;
    position: relative;
    padding-left: 50px;
}
.hero-text h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}
.hero-text p { max-width: 500px; margin-bottom: 30px; }
.hero-checklist { margin-bottom: 30px; }
.hero-checklist li { margin-bottom: 10px; display: flex; align-items: flex-start; font-weight: 600; font-size: 0.95rem;}
.hero-checklist .check { color: var(--primary-color); font-weight: bold; margin-right: 10px; font-size: 1.2em; line-height: 1; flex-shrink: 0; margin-top: 3px;}
.hello-graphic { display: none; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 15px; }
.hero-buttons .download-icon { display: inline-block; font-weight: bold; margin-left: 5px; }


.hero-image-container {
    flex: 1 1 40%;
    max-width: 450px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-photo {
    max-width: 100%;
    border-radius: 0;
    z-index: 2;
    position: relative;
    box-shadow: var(--photo-shadow);
    /* Add subtle border in dark mode for definition */
    border: 1px solid transparent;
}
html.dark-mode .hero-photo {
    border: 0px solid var(--border-color);
}

.hero-gradient {
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    background: linear-gradient(45deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    filter: blur(90px);
    opacity: 0.5;
    border-radius: 0;
    z-index: 0;
    animation: blink 3s infinite ease-in-out alternate;
}
html.dark-mode .hero-gradient {
    opacity: 0.3; /* Tone down gradient in dark mode */
}

.hero-gradient-2 {
    position: absolute;
    top: 400px;
    left: 200px;
    width: 280px;
    height: 280px;
    background: linear-gradient(-45deg, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    filter: blur(90px);
    opacity: 0.4;
    border-radius: 0;
    z-index: 0;
     animation: blink 3.5s infinite ease-in-out alternate-reverse;
}
html.dark-mode .hero-gradient-2 {
    opacity: 0.25;
}

.hero-squiggle {
    position: absolute;
    bottom: 20px;
    right: 10px;
    width: 40px;
    height: 50px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 10 10 Q 30 50 10 90" stroke="{var(--svg-path-color)}" stroke-width="5" fill="none"/><path d="M 25 10 Q 45 50 25 90" stroke="{var(--svg-path-color)}" stroke-width="5" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    z-index: 3;
    transform: rotate(15deg);
    opacity: 0.7;
    /* Update SVG stroke color via CSS variable */
    stroke: var(--svg-path-color);
}
/* Re-declare with actual color for default */
.hero-squiggle {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 10 10 Q 30 50 10 90" stroke="black" stroke-width="5" fill="none"/><path d="M 25 10 Q 45 50 25 90" stroke="black" stroke-width="5" fill="none"/></svg>');
}
/* Re-declare with actual color for dark mode */
html.dark-mode .hero-squiggle {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 10 10 Q 30 50 10 90" stroke="%23c9d1d9" stroke-width="5" fill="none"/><path d="M 25 10 Q 45 50 25 90" stroke="%23c9d1d9" stroke-width="5" fill="none"/></svg>');
    opacity: 0.5;
}


.hero-tags-container {
    width: 100%;
    overflow: hidden;
    padding: 30px 0 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-top: 60px;
    position: relative;
}

.hero-tags-scroll-wrapper {
    display: flex;
    width: max-content;
    animation: scroll-marquee 20s linear infinite;
}

@keyframes scroll-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.hero-tags-scroll {
    display: flex;
    white-space: nowrap;
    padding: 0 1%;
}

.hero-tags-scroll span {
    margin-right: 40px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-tags-scroll span:last-child { margin-right: 1%; }
.hero-tags-scroll i { font-size: 1.1em; }


.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 25px 0 35px 0;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 15px;
    width: 100%;
    text-transform: uppercase;
}
.social-links a { color: var(--secondary-color); display: inline-flex; align-items: center; gap: 5px; }
.social-links a:hover { color: var(--primary-color); }
@media (min-width: 768px) {
    .social-links .email-link { margin-left: auto; }
}


/* --- Fade-in Animation Base Styles --- */
.js-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}
.js-fade-in.fade-in-active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Stagger animation --- */
.hero-text.js-fade-in.fade-in-active { transition-delay: 0.1s; }
.hero-image-container.js-fade-in.fade-in-active { transition-delay: 0.3s; }
.services-grid .service-card.js-fade-in.fade-in-active:nth-child(1) { transition-delay: 0.1s; }
.services-grid .service-card.js-fade-in.fade-in-active:nth-child(2) { transition-delay: 0.2s; }
.services-grid .service-card.js-fade-in.fade-in-active:nth-child(3) { transition-delay: 0.3s; }
.experience-list .roadmap-item.js-fade-in.fade-in-active:nth-child(1) { transition-delay: 0.1s; }
.experience-list .roadmap-item.js-fade-in.fade-in-active:nth-child(2) { transition-delay: 0.2s; }
.experience-list .roadmap-item.js-fade-in.fade-in-active:nth-child(3) { transition-delay: 0.3s; }
.experience-list .roadmap-item.js-fade-in.fade-in-active:nth-child(4) { transition-delay: 0.4s; }
.experience-list .roadmap-item.js-fade-in.fade-in-active:nth-child(5) { transition-delay: 0.5s; }
.education-grid .education-item.js-fade-in.fade-in-active:nth-child(1) { transition-delay: 0.1s; }
.education-grid .education-item.js-fade-in.fade-in-active:nth-child(2) { transition-delay: 0.2s; }
.education-grid .education-item.js-fade-in.fade-in-active:nth-child(3) { transition-delay: 0.3s; }
.portfolio-grid .project-preview.js-fade-in.fade-in-active:nth-child(1) { transition-delay: 0.1s; }
.portfolio-grid .project-preview.js-fade-in.fade-in-active:nth-child(2) { transition-delay: 0.2s; }
.portfolio-grid .project-preview.js-fade-in.fade-in-active:nth-child(3) { transition-delay: 0.3s; }


/* --- Services Section --- */
.services-section {
    padding: 80px 15%;
    background-color: var(--bg-secondary-color); /* Use secondary bg */
    position: relative;
}
.services-section .section-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    gap: 20px;
}
.services-section .section-header > div { flex-grow: 1; }
.services-section .section-header .section-description { margin-bottom: 0; }
.scroll-down-indicator {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%) rotate(270deg);
    transform-origin: left top;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 5;
}
.scroll-down-indicator .scroll-arrow {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: var(--primary-btn-text-color); /* Use button text color */
    border-radius: 0;
    margin-left: 15px;
    transform: rotate(90deg);
    font-weight: bold;
    font-size: 1.2rem;
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.service-card {
    background-color: var(--bg-color); /* Use base bg for cards */
    padding: 40px 30px;
    border: 1px solid var(--card-border-color); /* Use card border */
    border-radius: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}
html.dark-mode .service-card:hover {
     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.service-card.highlight-card {
    background-color: var(--highlight-card-bg);
    color: var(--highlight-card-text);
    border-color: var(--highlight-card-bg);
}
.service-card.highlight-card h3,
.service-card.highlight-card .read-more,
.service-card.highlight-card .service-icon {
    color: var(--highlight-card-text);
}
.service-card.highlight-card p {
    color: var(--highlight-card-text-muted);
}

.service-card h3 { font-size: 1.3rem; margin-top: 15px; margin-bottom: 15px; color: var(--heading-color);}
.service-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    color: var(--primary-color);
}
.service-card p {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    flex-grow: 1;
}
.read-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    transition: text-decoration 0.3s ease, color 0.3s ease;
}
.read-more:hover { text-decoration: underline; }
.read-more i { font-size: 1.1em; }


/* --- Experience Section --- */
.experience-section {
    padding: 80px 15%;
    background-color: var(--bg-color);
}
.section-graphic {
    width: 40px; height: 40px;
    border-radius: 0;
    background: radial-gradient(circle, var(--section-graphic-color) 30%, transparent 30%);
    background-size: 8px 8px; background-position: center;
    margin: 0 auto 1.5rem auto;
    opacity: 0.5;
}
.section-graphic-lines {
     width: 60px; height: 20px;
     background: repeating-linear-gradient(135deg, var(--section-graphic-color), var(--section-graphic-color) 3px, transparent 3px, transparent 6px);
      margin: 1.5rem auto 0 auto;
      opacity: 0.5;
}
.experience-list.roadmap-list {
    max-width: 900px;
    margin: 60px auto 0 auto;
    position: relative;
    padding: 30px 0;
}
.experience-list.roadmap-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    background-color: var(--roadmap-line-color);
    z-index: 0;
}
.experience-item.roadmap-item {
    position: relative;
    width: calc(50% - 40px);
    margin-bottom: 50px;
    padding: 25px 30px;
    background-color: var(--bg-secondary-color); /* Use secondary for contrast */
    border: 1px solid var(--border-color);
    border-radius: 0;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.3s ease;
    z-index: 1;
    display: flex;
}
.experience-item.roadmap-item:last-child { margin-bottom: 0; }
.experience-item.roadmap-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}
html.dark-mode .experience-item.roadmap-item:hover {
     box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.experience-item.roadmap-item::before {
    content: '';
    position: absolute;
    top: 30px;
    width: 15px;
    height: 15px;
    background-color: var(--roadmap-dot-color);
    border: 2px solid var(--roadmap-dot-border);
    border-radius: 50%;
    z-index: 2;
    box-shadow: var(--roadmap-dot-shadow);
}
.experience-item.roadmap-item:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}
.experience-item.roadmap-item:nth-child(odd)::before {
    left: calc(100% + 32.5px);
    transform: translateX(-50%);
}
.experience-item.roadmap-item:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
}
.experience-item.roadmap-item:nth-child(even)::before {
    right: calc(100% + 32.5px);
    transform: translateX(50%);
}
.experience-item.highlight-experience {
    background-color: var(--highlight-experience-bg);
    color: var(--highlight-experience-text);
    border-color: var(--highlight-experience-bg);
}
.experience-item.highlight-experience::before {
    background-color: var(--roadmap-dot-color); /* Keep dot consistent */
    box-shadow: var(--roadmap-dot-shadow);
     border-color: var(--highlight-experience-bg); /* Match bg */
}
.experience-item.highlight-experience h4,
.experience-item.highlight-experience .exp-details p {
    color: var(--highlight-experience-text);
}
.experience-item.highlight-experience .exp-desc,
.experience-item.highlight-experience .exp-duration {
    color: var(--highlight-experience-text-muted);
}

.exp-content { width: 100%; }
.exp-details { margin-bottom: 0; }
.exp-details h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: var(--heading-color);
}
.exp-details p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
}
.exp-desc {
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 0;
}
.exp-duration {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 15px;
    text-align: left;
}


/* --- Education Section --- */
.education-section {
    padding: 80px 15%;
    background-color: var(--bg-secondary-color); /* Use secondary */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.education-graphic {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.04); /* Keep subtle */
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.5rem auto;
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.7;
}
html.dark-mode .education-graphic {
     background-color: rgba(255, 255, 255, 0.06);
}
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}
.education-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background-color: var(--bg-color); /* Use base bg */
    padding: 30px;
    border: 1px solid var(--card-border-color);
    border-left: 4px solid var(--education-item-border-left);
    transition: box-shadow 0.3s ease, transform 0.3s ease, opacity 0.6s ease-out, transform 0.6s ease-out, background-color 0.3s ease, border-color 0.3s ease;
    border-radius: 0;
}
.education-item:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    transform: translateY(-3px);
    border-color: var(--primary-color);
     border-left-color: var(--primary-color);
}
html.dark-mode .education-item:hover {
     box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.education-icon-wrapper {
    flex-shrink: 0;
    padding-top: 5px;
}
.education-icon-wrapper i {
    font-size: 2.2rem;
    color: var(--primary-color);
    opacity: 0.8;
}
.education-content { flex-grow: 1; }
.education-dates {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 10px;
}
.education-degree {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: var(--heading-color);
    font-weight: 700;
}
.education-institution {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary-color);
}
.education-details {
    font-size: 0.9rem;
    color: var(--secondary-color);
    line-height: 1.6;
    margin-bottom: 0;
}


/* --- Portfolio Section --- */
.portfolio-section {
    padding: 80px 15%;
    background-color: var(--bg-color); /* Use base */
}
.section-dots-graphic {
     width: 60px; height: 60px; margin: 0 auto 1.5rem auto;
     background: radial-gradient(circle, var(--section-graphic-color) 1.5px, transparent 1.5px);
     background-size: 8px 8px;
     opacity: 0.4;
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin-top: 50px;
}
.project-preview {
    background-color: transparent;
    display: flex;
    flex-direction: column;
}
.project-image-container {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 0;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary-color); /* Use secondary for image bg */
}
.project-image-container img {
    transition: transform 0.4s ease;
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}
.project-preview:hover .project-image-container img { transform: scale(1.05); }
.project-info {
    padding-left: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.project-tag {
    display: inline-block;
    background-color: var(--primary-color); /* Consistent tag bg */
    color: var(--primary-btn-text-color); /* Use btn text color */
    padding: 5px 15px;
    border-radius: 0;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.project-info h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--heading-color);
}
.project-desc {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    flex-grow: 1;
}
.details-link {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    align-self: flex-start;
}
.details-link .arrow { display: inline-block; transition: transform 0.3s ease; font-size: 1em;}
.details-link:hover .arrow { transform: translate(4px, -4px); }


/* --- Testimonials Section --- */
.testimonials-section {
    padding: 80px 15%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-secondary-color); /* Use secondary */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.feedback-content { flex: 1 1 55%; min-width: 300px; z-index: 1;}
.feedback-header { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 30px;}
.feedback-header .subtitle { margin-bottom: 0;}
.feedback-graphic { font-size: 1.5rem; font-weight: bold; color: var(--secondary-color); opacity: 0.5; }
.feedback-content blockquote {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary-color);
    padding-left: 25px;
    font-style: normal;
    color: var(--heading-color);
    position: relative;
}
.client-info { position: relative; }
.client-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 2px; color: var(--heading-color); }
.client-role { font-size: 0.9rem; color: var(--secondary-color); margin-bottom: 20px; }
.client-squiggle {
     width: 100px; height: 10px; margin-bottom: 20px;
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10"><path d="M 0 5 Q 12.5 0 25 5 T 50 5 T 75 5 T 100 5" stroke="{var(--svg-path-color)}" stroke-width="2" fill="none"/></svg>');
     background-repeat: no-repeat; background-size: contain; opacity: 0.8;
}
/* Re-declare with actual color for default */
.client-squiggle {
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10"><path d="M 0 5 Q 12.5 0 25 5 T 50 5 T 75 5 T 100 5" stroke="black" stroke-width="2" fill="none"/></svg>');
}
/* Re-declare with actual color for dark mode */
html.dark-mode .client-squiggle {
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 10"><path d="M 0 5 Q 12.5 0 25 5 T 50 5 T 75 5 T 100 5" stroke="%238b949e" stroke-width="2" fill="none"/></svg>'); /* Using secondary color */
     opacity: 0.6;
}


/* --- Stats Section --- */
.stats-section {
    padding: 60px 15%;
    background-color: var(--bg-secondary-color); /* Use secondary */
    /* border-top: 1px solid var(--border-color); */ /* Remove top border if testimonial has bottom */
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    text-align: center;
}
.stat-item {
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.stat-icon {
    font-size: 2.5rem; margin-bottom: 10px; color: var(--primary-color);
    display: inline-flex; justify-content: center; align-items: center;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--heading-color);
    display: block;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
}


/* --- Contact Section --- */
.contact-section {
    padding: 80px 15%;
    text-align: center;
    position: relative;
    background-color: var(--bg-color); /* Use base */
}
.contact-section h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    line-height: 1.3;
}
.highlight-text {
    background-color: var(--highlight-text-bg);
    padding: 2px 10px;
    display: inline;
    line-height: 1.5;
    border-radius: 6px;
    color: var(--highlight-text-color);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.contact-subtitle { font-size: 1.1rem; margin-bottom: 30px; color: var(--secondary-color); max-width: 600px; margin-left: auto; margin-right: auto;}
.contact-arrow {
    width: 100px; height: 20px; margin: 0 auto 40px auto;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M 0 10 L 90 10 L 80 0 M 90 10 L 80 20" stroke="{var(--svg-path-color)}" stroke-width="3" fill="none"/></svg>');
     background-repeat: no-repeat; background-size: contain; opacity: 0.8;
}
/* Re-declare with actual color for default */
.contact-arrow {
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M 0 10 L 90 10 L 80 0 M 90 10 L 80 20" stroke="black" stroke-width="3" fill="none"/></svg>');
}
/* Re-declare with actual color for dark mode */
html.dark-mode .contact-arrow {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M 0 10 L 90 10 L 80 0 M 90 10 L 80 20" stroke="%238b949e" stroke-width="3" fill="none"/></svg>'); /* Use secondary color */
    opacity: 0.6;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}
.form-group { margin-bottom: 25px; }
.form-group-split { display: flex; flex-wrap: wrap; gap: 25px; }
.form-group-split > div { flex: 1 1 200px; }
.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color); /* Ensure label uses text color */
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 15px 5px;
    border: none;
    border-bottom: 1px solid var(--form-input-border);
    background-color: var(--form-input-bg);
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text-color);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
    border-radius: 0;
    appearance: none;
}
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-bottom-color: var(--form-input-focus-border);
}
.contact-form textarea {
    resize: vertical;
    min-height: 80px;
}
::placeholder { color: var(--placeholder-color); font-size: 0.95rem;}

/* UPDATED Tag Selection Styles with Theme */
.tag-selection {
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap to the next line */
    gap: 10px;       /* Default gap between buttons */
    margin-top: 10px;
}
.tag-btn {
    padding: 8px 18px; /* Default padding */
    border: 1px solid var(--tag-border-color);
    background-color: var(--tag-bg-color);
    color: var(--tag-text-color);
    border-radius: 0;
    cursor: pointer;
    font-size: 0.85rem; /* Default font size */
    font-weight: 500;
    transition: all 0.3s ease;
    /* Added for accessibility focus */
    outline-offset: 2px;
}
.tag-btn:hover,
.tag-btn:focus-visible { /* Added focus-visible for keyboard navigation */
    background-color: var(--tag-hover-bg-color); /* Subtle hover/focus */
    border-color: var(--tag-hover-border-color);
    outline: none; /* Remove default focus outline if you add custom */
}
.tag-btn.active {
    background-color: var(--tag-active-bg-color);
    color: var(--tag-active-text-color);
    border-color: var(--tag-active-bg-color);
}
.tag-btn.active:hover,
.tag-btn.active:focus-visible { /* Ensure hover/focus on active state is distinct or same */
     opacity: 0.9; /* Slightly dim active on hover */
     border-color: var(--tag-active-bg-color);
     outline: none; /* Remove default focus outline if you add custom */
}
/* End Updated Tag Selection Styles */

.submit-area { margin-top: 40px; text-align: center; position: relative; }
.btn-submit {
    padding: 15px 45px;
    position: relative;
    background-color: var(--primary-color);
    color: var(--primary-btn-text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 0;
}
.btn-submit:hover { background-color: var(--primary-hover-color); transform: translateY(-2px);}
.submit-arrow {
     position: absolute; top: 50%; right: -40px; transform: translateY(-50%);
     width: 30px; height: 30px;
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 70 30 Q 85 40 90 50 Q 85 60 70 70 M 85 50 L 10 50" stroke="{var(--svg-path-color)}" stroke-width="5" fill="none" stroke-linecap="round"/></svg>');
     background-size: contain; background-repeat: no-repeat;
     opacity: 0.8;
     transition: transform 0.3s ease;
}
/* Re-declare with actual color for default */
.submit-arrow {
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 70 30 Q 85 40 90 50 Q 85 60 70 70 M 85 50 L 10 50" stroke="black" stroke-width="5" fill="none" stroke-linecap="round"/></svg>');
}
/* Re-declare with actual color for dark mode */
html.dark-mode .submit-arrow {
      background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M 70 30 Q 85 40 90 50 Q 85 60 70 70 M 85 50 L 10 50" stroke="%23c9d1d9" stroke-width="5" fill="none" stroke-linecap="round"/></svg>'); /* Light grey arrow */
      opacity: 0.6;
}

.btn-submit:hover .submit-arrow { transform: translate(5px, -50%) rotate(5deg); }
.response-note {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* --- Footer --- */
.site-footer {
    padding: 30px 15%;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    background-color: var(--bg-secondary-color); /* Use secondary */
}
.footer-links { display: flex; flex-wrap: wrap; gap: 15px 25px; }
.footer-links a {
    font-weight: 600;
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.footer-links a:hover { color: var(--primary-color); }
.copyright { font-weight: 600; color: var(--heading-color); white-space: nowrap; margin-bottom: 0%;}

/* --- Back to Top Button --- */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--primary-btn-text-color);
    border: none;
    border-radius: 0;
    width: 45px;
    height: 45px;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out, background-color 0.3s ease, transform 0.3s ease-in-out;
    z-index: 990;
    pointer-events: none;
    transform: translateY(10px);
}
.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top-btn:hover { background-color: var(--primary-hover-color); }

/* --- Form Submission Popup Styles --- */
.form-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Darker overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100; /* Higher than nav */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    padding: 20px; /* Padding for smaller screens */
}

.form-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.form-popup {
    background-color: var(--popup-bg);
    padding: 35px 45px;
    border: 1px solid var(--popup-border);
    max-width: 480px;
    width: 100%; /* Responsive width */
    text-align: center;
    border-radius: 0; /* Match sharp edges */
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); /* Slightly stronger shadow */
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.form-popup-overlay.active .form-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.form-popup-message {
    font-size: 1.1rem;
    color: var(--text-color); /* Use standard text color */
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 500;
}

.form-popup-close-btn {
    margin-top: 0; /* Adjust if needed */
    min-width: 120px; /* Give it a minimum width */
    margin-right: 0; /* Reset margin inherited from .btn-primary potentially */
}

/* --- End Form Submission Popup Styles --- */

/* --- Animations --- */
@keyframes wave {
    0% { transform: rotate(0deg); } 10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); } 30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); } 100% { transform: rotate(0deg); }
}
:root {
  --blink-opacity-start-end: 0.5;
  --blink-opacity-mid: 1;
}

html.dark-mode {
  --blink-opacity-start-end: 0.3; /* Dimmed blink */
  --blink-opacity-mid: 0.6;
}

@keyframes blink {
  0%, 100% { opacity: var(--blink-opacity-start-end); }
  50% { opacity: var(--blink-opacity-mid); }
}

.gradient-text {
    background: linear-gradient(90deg, var(--gradient-text-start), var(--gradient-text-mid), var(--gradient-text-end));
    background-size: 300% 100%;
    background-repeat: repeat;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback */
    animation: moveGradient 3s linear infinite alternate;
    display: inline-block;
}
/* Consider adjusting gradient colors for dark mode if contrast is poor */
/* html.dark-mode .gradient-text { ... } */

@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}


/* --- Responsiveness --- */

/* Large Devices (Desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    :root { --container-width: 960px; }
    h1 { font-size: 3.2rem; }
    h2 { font-size: 2.2rem; }

    .hero { padding: var(--nav-height) 12% 60px 12%; }
    .main-nav { padding: 0 12%; }
    .nav-toggle-btn { right: 12%; }
    /* Adjust theme toggle position */
    .theme-toggle-btn { margin-left: 15px; }

    .hero-content { gap: 30px; }
    .hero-text { flex-basis: 60%;}
    .hero-image-container { flex-basis: 40%; }
    .hero-gradient-2 { left: -100px; }

    .services-section,
    .experience-section,
    .education-section,
    .portfolio-section,
    .testimonials-section,
    .contact-section { padding-left: 12%; padding-right: 12%; }
    .stats-section { padding-left: 12%; padding-right: 12%; }
    .site-footer { padding-left: 12%; padding-right: 12%; }

    .experience-list.roadmap-list { max-width: 800px; }
    .education-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* Medium Devices (Tablets, less than 992px) - Sidebar Trigger Point */
@media (max-width: 991.98px) {
    :root { --container-width: 720px; }
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2rem; }

    .hero { padding: var(--nav-height) 8% 50px 8%; }
    .main-nav { padding: 0 8%; }
    .nav-toggle-btn {
        display: block;
        right: 8%;
        order: 4; /* Ensure it's last */
    }
    /* Position theme toggle before mobile toggle */
    .theme-toggle-btn {
        order: 3;
        position: absolute;
        right: calc(8% + 50px); /* Position relative to mobile toggle */
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
    }


    .services-section,
    .experience-section,
    .education-section,
    .portfolio-section,
    .testimonials-section,
    .contact-section { padding: 60px 8%; }
    .stats-section { padding: 50px 8%; }
    .site-footer { padding: 25px 8%; }

    .hero-gradient-2 {
        top: 800px;
        left: -100px;
    }

    /* Mobile Navigation Sidebar Styles */
    .main-nav .nav-links-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        width: 280px;
        max-width: 80%;
        height: 100vh;
        background-color: var(--bg-color); /* Use theme bg */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.15);
        z-index: 999;
        padding: 80px 0 30px 0;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0.4s, background-color 0.3s ease;
        overflow-y: auto;
        border-radius: 0;
        visibility: hidden;
        will-change: transform;
        border-left: 1px solid var(--border-color); /* Add border */
    }
    .main-nav .nav-links-container a {
        margin-left: 0;
    }
    .nav-links-container.active {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), visibility 0s linear 0s, background-color 0.3s ease;
    }
    .nav-links-container.active .nav-close-btn { display: block; }
    .nav-links-container a {
        margin: 0px;
        padding: 15px 30px;
        font-size: 1rem;
        font-weight: 600;
        color: var(--heading-color); /* Use heading color */
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background-color 0.2s ease, color 0.2s ease, border-color 0.3s ease;
    }
    .nav-links-container a:last-child { border-bottom: none; }
    .nav-links-container a:hover {
        color: var(--primary-color);
        background-color: var(--bg-secondary-color); /* Use secondary bg for hover */
    }
    .nav-links-container a .arrow {
        font-size: 1em;
        transform: none !important;
        margin-left: 10px;
        color: var(--secondary-color);
        transition: transform 0.3s ease;
     }
     .nav-links-container a:hover .arrow { transform: translateX(3px); }
    .nav-links-container.active ~ .nav-toggle-btn {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Adjust other sections for mobile */
    .hero-content { flex-direction: column; text-align: center; padding-top: 40px;}
    .hero-text { order: 2; flex-basis: auto; margin-top: 40px; max-width: 600px; text-align: left;}
    .hero-image-container { order: 1; flex-basis: auto; max-width: 350px; margin: 0 auto; }
    .hero-gradient { width: 200px; height: 200px; filter: blur(60px); top: -40px; right: -40px;}
    .hero-text h2 { padding-left: 0; text-align: left; }
    .hero-text h2::before { display: none; }
    .hero-text p { max-width: 100%; text-align: left; }
    .hero-checklist { display: inline-block; text-align: left; }
    .hero-buttons { justify-content: flex-start; }
    .services-grid { grid-template-columns: 1fr; }
    .scroll-down-indicator { display: none; }

    /* Roadmap Tablet Adjustment */
    .experience-list.roadmap-list { max-width: 100%; padding: 30px 0 0 40px; margin: 60px 0 0 0; }
    .experience-list.roadmap-list::before { left: 20px; transform: none; }
    .experience-item.roadmap-item,
    .experience-item.roadmap-item:nth-child(odd),
    .experience-item.roadmap-item:nth-child(even) { width: 100%; margin-left: 0; margin-right: 0; text-align: left; margin-bottom: 35px; }
    .experience-item.roadmap-item::before,
    .experience-item.roadmap-item:nth-child(odd)::before,
    .experience-item.roadmap-item:nth-child(even)::before { left: -30px; top: 30px; transform: none; right: auto; }
    .education-grid { grid-template-columns: 1fr; }
    .education-item { padding: 25px; }
    .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;}
    .project-info h3 { font-size: 1.4rem; }
    .project-desc { font-size: 0.9rem; }
    .testimonials-section { gap: 40px; flex-direction: column; }
    .feedback-content { order: 2; flex-basis: 100%; text-align: center;}
    .feedback-content blockquote { font-size: 1.8rem; border-left: none; border-top: 4px solid var(--primary-color); padding-left: 0; padding-top: 20px; margin-left: auto; margin-right: auto; max-width: 550px; }
    .client-info { text-align: center; }
    .client-squiggle { margin: 0 auto 20px auto;}
    .contact-section h2 { font-size: 2.5rem; }
    .site-footer {  text-align: center;}
    .copyright { order: 2; margin-top: 0px; }
    .footer-links { order: 1; justify-content: center; }
    .back-to-top-btn { bottom: 20px; right: 20px; width: 40px; height: 40px; font-size: 1.2rem; }
}

/* Small Devices (Landscape Phones, less than 768px) */
@media (max-width: 767.98px) {
     :root { --container-width: 540px; }
     h1 { font-size: 2.5rem;}
     h2 { font-size: 1.6rem; }

     .hero { padding: var(--nav-height) 5% 40px 5%; }
     .main-nav { padding: 0 5%; }
     .nav-toggle-btn { right: 5%; }
     /* Adjust theme toggle position */
     .theme-toggle-btn { right: calc(5% + 50px); font-size: 1.4rem;}


    .services-section,
    .experience-section,
    .education-section,
    .portfolio-section,
    .testimonials-section,
    .contact-section { padding: 60px 5%; }
    .stats-section { padding: 40px 5%; }
    .site-footer { padding: 25px 5%; }

    .hero-image-container { max-width: 320px; }
    .hero-text { text-align: left;}
    .hero-buttons { justify-content: flex-start; width: 100%; }
    .social-links { justify-content: center; }
    .services-section .section-header { flex-direction: column; align-items: center; text-align: center; }
    .services-section .section-header .btn { margin-top: 20px;}

    /* Roadmap Mobile Small */
    .experience-list.roadmap-list { padding-left: 30px; }
    .experience-item.roadmap-item { padding: 20px 25px; }
    .experience-item.roadmap-item::before { left: -25px; width: 12px; height: 12px; border-width: 2px; box-shadow: 0 0 0 2px var(--roadmap-dot-color); }

    .education-graphic { width: 50px; height: 50px; font-size: 1.8rem;}
    .education-item { gap: 15px; padding: 20px; }
    .education-icon-wrapper i { font-size: 2rem; }
    .education-degree { font-size: 1.2rem; }
    .education-institution { font-size: 0.95rem; }
    .portfolio-grid { grid-template-columns: 1fr; gap: 30px;}
    .project-preview { max-width: 450px; margin: 0 auto; }
    .feedback-content blockquote { font-size: 1.5rem; }
    .stats-section { grid-template-columns: repeat(2, 1fr); }
    .contact-form { padding: 0; max-width: 100%;}
    .form-group-split { flex-direction: column; gap: 25px; }
    .form-group-split > div { flex-basis: auto; }
}

/* Extra Small Devices (Portrait Phones, less than 576px) */
@media (max-width: 575.98px) {
     h1 { font-size: 2.1rem; }
     h2 { font-size: 1.4rem; }
     .main-nav .logo { font-size: 1.3rem;}
     .nav-toggle-btn { font-size: 1.6rem; }
     /* Adjust theme toggle */
      .theme-toggle-btn { right: calc(5% + 45px); font-size: 1.3rem;}


     /* :root { --nav-height: 60px; } */ /* Optional: Reduce nav height */

     .services-section,
    .experience-section,
    .education-section,
    .portfolio-section,
    .testimonials-section,
    .contact-section { padding-top: 50px; padding-bottom: 50px;}
    .stats-section { padding-top: 30px; padding-bottom: 30px; }
    .site-footer { padding-top: 20px; padding-bottom: 20px;}

    .hero-text p { font-size: 0.95rem; }
    .btn { padding: 10px 25px; font-size: 0.85rem;}
    .hero-buttons { flex-direction: column; gap: 15px; }
    .hero-buttons .btn { margin-right: 0; width: auto; min-width: 200px; }
    .hero-image-container { max-width: 260px; }

    .services-grid { gap: 25px;}
    .service-card { padding: 30px 25px;}
    .service-card h3 { font-size: 1.2rem; }

    /* Roadmap Mobile Extra Small */
    .experience-list.roadmap-list { padding-left: 25px; margin-top: 40px; }
    .experience-item.roadmap-item::before { display: none; } /* Hide dot */
    .experience-list.roadmap-list::before { left: 10px; width: 2px; }
    .experience-item.roadmap-item { border-left: 3px solid var(--border-color); padding-left: 20px; border-top: 1px solid var(--border-color); border-right: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }
    .experience-item.highlight-experience { border-left-color: var(--highlight-experience-bg); } /* Use highlight bg for border */

    /* Education Extra Small */
    .education-section { padding-top: 40px; padding-bottom: 40px; }
    .education-item { flex-direction: column; gap: 15px; padding: 20px; border-left-width: 3px; }
    .education-icon-wrapper { padding-top: 0; align-self: flex-start;}
    .education-degree { font-size: 1.1rem; }
    .education-details { font-size: 0.85rem; }
    .project-info { padding-left: 0;}
    .project-info h3 { font-size: 1.3rem;}
    .project-desc { font-size: 0.9rem; }
    .details-link { font-size: 0.9rem;}
    .feedback-content blockquote { font-size: 1.3rem; }
    .stat-number { font-size: 1.8rem;}
    .stat-label { font-size: 0.8rem; }
    .stats-section { grid-template-columns: 1fr; gap: 25px; }
    .contact-section h2 { font-size: 2rem; }
    .highlight-text { padding: 1px 6px; }

    /* UPDATED Tag Selection Mobile Styles */
    .tag-selection {
        gap: 8px 6px;
    }
    .tag-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    /* End Updated Tag Selection Mobile Styles */

    .submit-arrow { display: none; }
    .btn-submit { padding: 12px 30px; width: 100%; max-width: 280px;}

    /* Popup mobile adjustments */
    .form-popup {
        padding: 25px 30px; /* Reduce padding */
    }
    .form-popup-message {
        font-size: 1rem; /* Slightly smaller text */
        margin-bottom: 25px;
    }
    .form-popup-close-btn {
        min-width: 100px;
        padding: 10px 25px; /* Match other small buttons */
    }


    .footer-links { gap: 10px 15px; }
    .back-to-top-btn { bottom: 15px; right: 15px; width: 35px; height: 35px; font-size: 1.1rem; }
}

/* --- Preloader Styles --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color); /* Use theme background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999; /* Ensure it's on top */
    opacity: 1;
    visibility: visible;
    /* Fade out the entire preloader after content loads & animations play */
    transition: opacity 0.6s ease-in-out 1s, visibility 0s linear 1.6s; /* Delay fade-out start (1s), hide after fade (1.6s) */
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent interaction after hiding */
}

.preloader-content {
    text-align: center;
}

.preloader-text {
    font-size: 2.5rem; /* Adjust size as needed */
    font-weight: 700;
    color: var(--heading-color); /* Use theme heading color */
    margin-bottom: 10px; /* Space between text and arrow */
    opacity: 0;
    transform: translateY(20px);
    animation: preloaderFadeUp 0.8s ease-out 0.1s forwards; /* Fade up, slight delay */
}

.preloader-arrow {
    width: 80px; /* Adjust size as needed */
    height: 16px;
    margin: 0 auto;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
    transform: translateX(-30px);
    animation: preloaderFadeRight 0.8s ease-out 0.3s forwards; /* Fade right, starts after text fade starts */

    /* Default SVG (Light Mode) - Horizontal Arrow similar to contact */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M 0 10 L 90 10 L 80 0 M 90 10 L 80 20" stroke="black" stroke-width="3" fill="none"/></svg>');
}

/* Dark Mode Preloader Arrow */
html.dark-mode .preloader-arrow {
     background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M 0 10 L 90 10 L 80 0 M 90 10 L 80 20" stroke="%238b949e" stroke-width="3" fill="none"/></svg>'); /* Use secondary color stroke */
}

/* Preloader Animations */
@keyframes preloaderFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes preloaderFadeRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Ensure content below preloader is not initially visible */
body > *:not(#preloader) {
    /* Add a small opacity transition to prevent flash */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

body.loaded > *:not(#preloader) {
    opacity: 1;
}

/* Adjust specific potentially conflicting styles if needed */
.hero {
     /* If hero had explicit opacity, override might be needed when body.loaded */
}


/* --- END Preloader Styles --- */