/* --- Global Styles & Variables --- */
:root {
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Lato', sans-serif;

    /* Light Mode Variables */
    --bg-color-light: #f8f9fa;
    --text-color-light: #212529;
    --primary-accent-light: #007bff;
    --secondary-accent-light: #6c757d;
    --card-bg-light: #ffffff;
    --border-color-light: #dee2e6;
    --input-bg-light: #fff;
    --input-border-light: #ced4da;
    --bg-overlay-light: rgba(248, 249, 250, 0.88);


    /* Dark Mode Variables */
    --bg-color-dark: #000000;
    --text-color-dark: #e9ecef;
    --primary-accent-dark: #58a6ff;
    --secondary-accent-dark: #adb5bd;
    --card-bg-dark: #2c3034;
    --border-color-dark: #495057;
    --input-bg-dark: #25292d;
    --input-border-dark: #495057;
    --bg-overlay-dark: rgba(26, 29, 32, 0.92);


    /* Current theme variables */
    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color-light);
    --primary-accent: var(--primary-accent-light);
    --secondary-accent: var(--secondary-accent-light);
    --card-bg: var(--card-bg-light);
    --border-color: var(--border-color-light);
    --input-bg: var(--input-bg-light);
    --input-border: var(--input-border-light);
    --bg-overlay: var(--bg-overlay-light);

    --section-padding: 80px 0;
    --container-width: 1140px;
    --border-radius: 8px;
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s ease;

}

/* Dark Mode Specific Overrides */
.dark-mode {
    --bg-color: var(--bg-color-dark);
    --text-color: var(--text-color-dark);
    --primary-accent: var(--primary-accent-dark);
    --secondary-accent: var(--secondary-accent-dark);
    --card-bg: var(--card-bg-dark);
    --border-color: var(--border-color-dark);
    --input-bg: var(--input-bg-dark);
    --input-border: var(--input-border-dark);
    --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --bg-overlay: rgba(26, 29, 32, 0.92);
}

.dark-mode #about {
    background: linear-gradient(135deg, var(--bg-color-dark) 0%, color-mix(in srgb, var(--bg-color-dark) 80%, var(--secondary-accent-dark)) 100%);
}

.dark-mode #contact {
    background: linear-gradient(135deg, var(--bg-color-dark) 0%, color-mix(in srgb, var(--bg-color-dark) 80%, var(--secondary-accent-dark)) 100%);
}

/* --- Base Styles --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-secondary);
    background: linear-gradient(135deg, var(--bg-color) 0%, color-mix(in srgb, var(--bg-color) 95%, black) 100%);
    color: var(--text-color);
    line-height: 1.7;
    transition: background var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}
.container { width: 90%; max-width: var(--container-width); margin: 0 auto; padding: 0 15px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-primary); color: var(--text-color); margin-bottom: 1rem; font-weight: 600; }
p { margin-bottom: 1rem; color: var(--text-color); }
a { text-decoration: none; color: var(--primary-accent); transition: color var(--transition-speed); }
img { max-width: 100%; height: auto; display: block; }
.section-padding { padding: var(--section-padding); position: relative; }

.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 60px; position: relative; font-weight: 700; }

.text-center { text-align: center; }
.subsection-title { text-align: center; font-size: 1.8rem; margin-bottom: 40px; font-weight: 600; color: var(--primary-accent); position: relative; }
.subsection-title::after { content: ''; display: block; width: 50px; height: 3px; background-color: var(--secondary-accent); margin: 8px auto 0; border-radius: 2px; opacity: 0.7; }


/* --- Buttons --- */
.btn { display: inline-block; padding: 12px 28px; border-radius: var(--border-radius); font-family: var(--font-primary); font-weight: 600; text-align: center; transition: all var(--transition-speed); border: 2px solid transparent; cursor: pointer; }
.btn-primary { background-color: var(--primary-accent); color: #000000; }
.btn-primary:hover { background-color: color-mix(in srgb, var(--primary-accent) 85%, black); color: #333; transform: translateY(-2px); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }
.btn-secondary { background-color: transparent; color: var(--primary-accent); border: 2px solid var(--primary-accent); }
.btn-secondary:hover { background-color: var(--primary-accent); color: #fff; transform: translateY(-2px); }
.btn-lg { padding: 15px 35px; font-size: 1.1rem; }

/* --- Navbar --- */
.navbar { background-color: var(--bg-color); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; transition: background-color var(--transition-speed); }
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.nav-left { display: flex; align-items: center; }
.nav-right { display: flex; align-items: center; }
.nav-logo { font-family: var(--font-primary); font-size: 1.5rem; font-weight: 700; color: var(--primary-accent); letter-spacing: -0.5px; margin-right: 30px; }

.nav-menu {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    display: flex; /* Default for desktop: items are inline */
    align-items: center;
}
.nav-item { margin-left: 25px; } /* Only applies to desktop inline items */
.nav-link {
    font-family: var(--font-primary);
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.05rem;
    padding: 8px 5px;
    position: relative;
    display: block;
}
.nav-link::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background-color: var(--primary-accent); transition: width 0.3s ease; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Desktop Social Links */
.nav-social-links {
    display: flex; /* Default for desktop */
    align-items: center;
    margin-right: 40px;
}
.nav-social-links a {
    color: var(--primary-accent);
    font-size: 1.3rem;
    margin-left: 18px;
    transition: color var(--transition-speed), transform var(--transition-speed);
    display: inline-flex;
    align-items: center;
}
.nav-social-links a:hover {
    color: var(--text-color);
    transform: scale(1.1);
}

/* Mobile Social Links (within .nav-menu) */
.mobile-social-links-container {
    display: none; /* Hidden on desktop, shown in mobile menu */
    /* Removed margin-top, padding-top, margin-bottom */
    border-top: 1px solid var(--border-color);
}
.mobile-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    margin-top: 20px; /* Added spacing from menu items above */
    margin-bottom: 20px; /* Added spacing below social icons */
}
.mobile-social-links a {
    color: var(--primary-accent);
    font-size: 1.8rem;
    margin: 0 15px;
    transition: color var(--transition-speed), transform var(--transition-speed);
    display: inline-flex;
    align-items: center;
}
.mobile-social-links a:hover {
    color: var(--text-color);
    transform: scale(1.1);
}


.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 40px;
    width: 40px;
}
.theme-toggle-btn i { transition: transform 0.3s ease-in-out; vertical-align: middle; }
.theme-toggle-btn:hover i { transform: rotate(15deg); }

.hamburger {
    display: none; /* THIS IS THE DEFAULT - HIDE ON DESKTOP */
    cursor: pointer;
    margin-left: 15px;
    padding: 8px;
    /* display: inline-flex;  Removed from here, set in mobile media query */
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
}
.bar {
    display: block;
    width: 25px;
    height: 3px;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
    border-radius: 2px;
}

/* --- Hero Section --- */
.hero { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; padding-top: 100px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--bg-color) 90%, var(--primary-accent)) 0%, var(--bg-color) 100%); }
.dark-mode .hero { background: linear-gradient(135deg, color-mix(in srgb, var(--bg-color) 90%, var(--primary-accent)) 0%, var(--bg-color) 100%); }

/* Apply Hero background to Skills, Portfolio, and System sections */
#skills, #portfolio, #system {
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-color) 90%, var(--primary-accent)) 0%, var(--bg-color) 100%);
}

.dark-mode #skills, .dark-mode #portfolio, .dark-mode #system {
    background: linear-gradient(135deg, color-mix(in srgb, var(--bg-color) 90%, var(--primary-accent)) 0%, var(--bg-color) 100%);
}

.hero-content { position: relative; z-index: 2; animation: fadeInHero 1s ease-out forwards; }
@keyframes fadeInHero { from { opacity: 0; } to { opacity: 1; } }
.hero-title { font-size: 3.5rem; font-weight: 700; margin-bottom: 0.5rem; animation: fadeInHero 0.8s ease-out 0.2s forwards; opacity: 0; }
.hero-title .highlight { color: var(--primary-accent); }
.hero-subtitle { font-size: 1.8rem; font-family: var(--font-primary); font-weight: 400; color: var(--secondary-accent); margin-bottom: 1.5rem; min-height: 2.2rem; animation: fadeInHero 0.8s ease-out 0.4s forwards; opacity: 0; }
.cursor { display: inline-block; background-color: var(--text-color); width: 2px; animation: blink 1s infinite; position: relative; top: 2px; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-description { font-size: 1.1rem; max-width: 600px; margin: 0 auto 2.5rem auto; color: color-mix(in srgb, var(--text-color) 70%, transparent); animation: fadeInHero 0.8s ease-out 0.6s forwards; opacity: 0; }
.hero-cta { animation: fadeInHero 0.8s ease-out 0.8s forwards; opacity: 0; }
.hero-cta .btn { margin: 0 10px; }
.hero-avatar { display: block; width: 238px; margin: -80px auto 20px auto; animation: fadeInHero 1s ease-out forwards; opacity: 0; } /* Increased width and adjusted margin-top */
.hero-scroll-down { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; animation: bounce 2s infinite; }
.hero-scroll-down a { font-size: 1.5rem; color: var(--primary-accent); }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); } 40% { transform: translateX(-50%) translateY(-10px); } 60% { transform: translateX(-50%) translateY(-5px); } }
@keyframes tada { /* Tada animation */
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}
.animated-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.animated-bg::before, .animated-bg::after { content: ''; position: absolute; background-color: color-mix(in srgb, var(--primary-accent) 10%, transparent); border-radius: 50%; opacity: 0.3; animation: float 20s infinite linear; }
.animated-bg::before { width: 150px; height: 150px; top: 10%; left: 15%; }
.animated-bg::after { width: 200px; height: 200px; bottom: 15%; right: 10%; animation-delay: -10s; }
@keyframes float { 0% { transform: translateY(0px) translateX(0px) rotate(0deg); } 25% { transform: translateY(-20px) translateX(15px) rotate(45deg); } 50% { transform: translateY(0px) translateX(-10px) rotate(90deg); } 75% { transform: translateY(15px) translateX(20px) rotate(135deg); } 100% { transform: translateY(0px) translateX(0px) rotate(180deg); } }
.bio-headline {
  font-size: 1.2rem; font-weight: 600; color: var(--primary-accent);
}
@keyframes textFocusIn { 
  0% { filter: blur(12px); opacity: 0; }
  100% { filter: blur(0px); opacity: 1; }
}
.text-focus-in-anim {
  opacity: 0; /* Initial state for entrance */
}
.text-focus-in-anim.is-visible {
  animation: textFocusIn 1.0s cubic-bezier(0.550, 0.085, 0.680, 0.530) forwards;

}
.tracking-expand-anim {
  opacity:0; /* Initial state for entrance */
}
.tracking-expand-anim.is-visible { 
  animation: trackingInExpand 2.5s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}
@keyframes trackingInExpand { 
  0% { letter-spacing: -0.5em; opacity: 0; }
  40% { opacity: 0.6; }
  100% { opacity: 1; }
}
@keyframes textGradientAnimate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.text-gradient-anim {
  background: linear-gradient(to right, var(--text-color), #e74c3c, #3498db, var(--text-color));
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: textGradientAnimate 5s linear infinite;
}
/* --- Section Background Image Styling --- */
.section-with-bg { position: relative; background-color: transparent; }
.section-with-bg::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center center; z-index: -2; transition: opacity var(--transition-speed); }

#about.section-with-bg::before {
    background: transparent; /* Remove the background image for the about section */
}

.section-with-bg .container { position: relative; z-index: 1; }

/* --- About Section --- */
#about {
    background: linear-gradient(135deg, var(--bg-color) 0%, color-mix(in srgb, var(--bg-color) 98%, var(--primary-accent)) 100%);
}

/* --- Contact Section Background --- */
#contact {
    background: linear-gradient(135deg, var(--bg-color) 0%, color-mix(in srgb, var(--bg-color) 98%, var(--primary-accent)) 100%);
}

.about-content { display: flex; align-items: center; gap: 40px; } /* Changed align-items to center */
.about-image { flex: 0 0 300px; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--box-shadow); position: relative; transition: box-shadow var(--transition-speed); } /* Added position: relative for pseudo-element */
.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.5) 100%); /* Consistent fading effect */
    z-index: 1; /* Ensure it's above the image */
    pointer-events: none; /* Allow clicks to pass through */
}
.about-image img { border-radius: var(--border-radius); transition: transform 0.5s ease; object-fit: cover; display: block; } /* Added display: block */
.about-image:hover img { transform: scale(1.05); } /* Subtle scale on hover */
.about-image:hover {
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-accent) 25%, transparent);
}

.about-text { flex: 1; }
.about-text .section-title { margin-bottom: 10px; }
.about-text .section-title-text {
    display: inline-block;
}
.about-text .section-title-text::after {
    content: '';
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--primary-accent);
    margin: 5px auto 0;
    border-radius: 2px;
}

/* --- Skills Section --- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.skill-card { background-color: var(--card-bg); padding: 25px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); text-align: center; border: 1px solid var(--border-color); transition: transform var(--transition-speed), box-shadow var(--transition-speed); }
.skill-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-accent) 15%, transparent); }
.skill-icon { font-size: 2.5rem; color: var(--primary-accent); margin-bottom: 15px; }
.skill-card h4 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text-color); }
.skill-card p { font-size: 0.95rem; color: color-mix(in srgb, var(--text-color) 85%, transparent); line-height: 1.6; }

/* --- Portfolio Section --- */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.portfolio-card { background-color: var(--card-bg); padding: 25px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); border: 1px solid var(--border-color); display: flex; flex-direction: column; transition: transform var(--transition-speed), box-shadow var(--transition-speed); }
.portfolio-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px color-mix(in srgb, var(--primary-accent) 15%, transparent); }
.portfolio-icon-placeholder { font-size: 2.5rem; color: var(--primary-accent); margin-bottom: 15px; text-align: center; height: 40px; line-height: 40px; }
.portfolio-card h3 { font-size: 1.4rem; margin-bottom: 10px; text-align: center; color: var(--text-color); }
.portfolio-card p { font-size: 0.9rem; color: color-mix(in srgb, var(--text-color) 80%, transparent); line-height: 1.6; flex-grow: 1; text-align: left; }

#portfolio::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, color-mix(in srgb, var(--primary-accent) 10%, transparent) 1px, transparent 1%);
    background-size: 20px 20px; /* Adjust size of bubbles and spacing */
    z-index: 0; /* Place above section background but below content */
    animation: subtle-bubbles 15s infinite linear; /* Subtle animation */
    pointer-events: none; /* Allow clicks to pass through */
}

@keyframes subtle-bubbles {
    0% { background-position: 0 0; }
    100% { background-position: 200px 200px; } /* Adjust distance for animation */
}

/* --- System Section --- */
.system-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.system-card { background-color: var(--card-bg); padding: 30px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); text-align: center; border: 1px solid var(--border-color); transition: transform var(--transition-speed), box-shadow var(--transition-speed); }
.system-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.system-icon { font-size: 3rem; color: var(--primary-accent); margin-bottom: 20px; }
.system-card h3 { font-size: 1.5rem; margin-bottom: 15px; }
.system-card p { font-size: 0.95rem; color: color-mix(in srgb, var(--text-color) 85%, transparent); line-height: 1.6; }
.system-card p:last-child { margin-bottom: 0; }

/* --- Contact Section --- */
.contact-subtitle { font-size: 1.1rem; max-width: 650px; margin: 0 auto 40px auto; color: color-mix(in srgb, var(--text-color) 80%, transparent); }
.contact-content { max-width: 700px; margin: 0 auto; }
.contact-form .form-group { margin-bottom: 20px; }
.contact-form label { display: block; margin-bottom: 8px; font-weight: 600; font-family: var(--font-primary); color: var(--text-color); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea { width: 100%; padding: 12px 15px; border-radius: var(--border-radius); border: 1px solid var(--input-border); background-color: var(--input-bg); color: var(--text-color); font-family: var(--font-secondary); font-size: 1rem; transition: border-color var(--transition-speed), box-shadow var(--transition-speed); }
.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-accent) 25%, transparent); }
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form .btn i { margin-left: 8px; }
.form-group-captcha { display: flex; align-items: center; }
.form-group-captcha input[type="checkbox"] { width: auto; margin-right: 10px; transform: scale(1.2); accent-color: var(--primary-accent); }
.human-check-label { font-weight: normal; font-size: 0.95rem; margin-bottom: 0; }
.contact-alternatives { margin-top: 40px; text-align: center; }
.contact-alternatives p { margin-bottom: 15px; font-style: italic; color: var(--secondary-accent); }
.contact-alternatives .btn { margin: 0 10px 10px; }
.form-status { margin-top: 20px; text-align: center; font-weight: 600; }
.form-status.success { color: #28a745; }
.form-status.error { color: #dc3545; }

/* --- Footer --- */
.footer { background-color: color-mix(in srgb, var(--bg-color) 95%, black); color: color-mix(in srgb, var(--text-color) 70%, transparent); padding: 30px 0; text-align: center; font-size: 0.9rem; }
.dark-mode .footer { background-color: #000000; }
.footer p { margin-bottom: 0.5rem; }

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

/* --- Responsive Design --- */
@media (min-width: 769px) { /* Desktop and larger tablets */
    .mobile-social-links-container { display: none; }
    /* Desktop nav-menu should be inline */
    .nav-menu {
        flex-direction: row; /* Explicitly row for desktop */
        position: static; /* Reset fixed positioning */
        width: auto;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        overflow-y: visible;
    }
    .nav-menu .nav-item {
        margin-left: 25px; /* Restore desktop spacing */
    }
    .nav-menu .nav-link {
        padding: 8px 5px; /* Restore desktop padding */
        border-bottom: none; /* No borders for desktop links */
        font-size: 1.05rem; /* Restore desktop font size */
    }
}

@media (max-width: 992px) { /* Larger tablets where desktop menu might still be shown partially */
    .section-title { font-size: 2.2rem; }
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.6rem; }

    .nav-logo { margin-right: 20px; }
    .nav-menu .nav-item { margin-left: 18px; }
    .nav-menu .nav-link { font-size: 0.95rem; }

    .nav-social-links { margin-right: 25px; }
    .nav-social-links a { font-size: 1.2rem; margin-left: 12px; }

    .about-content { flex-direction: column; align-items: center; text-align: center; }
    .about-image { margin-bottom: 30px; max-width: 280px; flex: 0 0 auto; }
    .about-text .section-title { text-align: center; }
    .about-text .section-title::after { margin: 5px auto 0; }
    .skills-grid, .system-info-grid, .portfolio-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}

/* === MOBILE MENU STYLES === */
@media (max-width: 768px) { /* Tablets and large phones */
    .nav-menu { /* This is the UL for the mobile dropdown */
        display: flex; /* This MUST be flex to enable active state visibility */
        position: fixed;
        left: -100%;
        top: 70px;
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        background-color: var(--bg-color);
        text-align: center;
        transition: left 0.3s ease-in-out;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 20px 0 0;
        overflow-y: auto;
        z-index: 999;
        /* Removed background image and opacity */
    }
    .nav-menu.active {
        left: 0;
    }
    .nav-menu .nav-item {
        margin-left: 0;
    }
    .nav-menu .nav-link {
        font-size: 1.2rem;
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
    }
     /* Ensure the last actual nav item before social links also gets a border if social links are next */
    .nav-menu .nav-item:not(.mobile-social-links-container) + .mobile-social-links-container .nav-item:first-child .nav-link,
    .nav-menu .nav-item:last-of-type:not(.mobile-social-links-container) .nav-link {
         border-bottom: 1px solid var(--border-color);
    }
    .nav-menu .mobile-social-links-container .nav-link {
        border-bottom: none;
        padding: 0;
    }
    .nav-menu .mobile-social-links-container {
        display: list-item;
    }
    .nav-menu .nav-link::after {
        display: none;
    }

    .nav-right .nav-social-links {
        display: none;
    }
    .theme-toggle-btn {
        margin-right: 10px;
    }

    .nav-left { margin-right: auto; }
    .hamburger {
        display: inline-flex; /* Make it visible on mobile */
    }
    .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); }

    .skill-icon,
    .portfolio-icon-placeholder {
        margin-top: 40px; /* Adjust as needed */
    }

    .hero-scroll-down {
        bottom: 10px; /* Adjust as needed */
    }
}

@media (max-width: 576px) { /* Smaller phones */
    .nav-logo { font-size: 1.3rem; margin-right: 10px; }
    .theme-toggle-btn { margin-right: 8px; font-size: 1.4rem; padding: 6px; height: 36px; width: 36px; }
    .hamburger { margin-left: 8px; padding: 6px; height: 36px; width: 36px;}
    .bar { width: 22px; height: 2.5px; }


    .nav-menu .nav-link { font-size: 1.1rem;}
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-cta .btn { display: block; width: 80%; margin: 10px auto; }
    .section-title { font-size: 1.8rem; margin-bottom: 40px; }
    .section-padding { padding: 60px 0; }
    .subsection-title { font-size: 1.5rem; }
    .bio-headline { font-size: 1.0rem;; }
    .skill-card, .system-card, .portfolio-card { padding: 20px; }
    .skill-card h4, .system-card h3, .portfolio-card h3 { font-size: 1.2rem; }
    .skill-card p, .system-card p, .portfolio-card p { font-size: 0.9rem; }
    .contact-alternatives .btn { width: 100%; }
}
