/**
 * Education List Styles
 * Styled list items with left border accent and arrow indicators
 * Matches visual pattern of skills-grid items
 */
#education ul {
    padding-left: 0;
    list-style: none;
}
#education li {
    background: rgba(42, 93, 168, 0.1);
    border-radius: 1rem;
    border-left: 4px solid #2a5da8;
    padding: 0.8rem 1.5rem 0.8rem 2.8rem;
    font-size: 1.6rem;
    color: #eee;
    margin-bottom: 1.2rem;
    position: relative;
    display: block;
    line-height: 1.7;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/**
 * Arrow indicator positioned before education list items
 * Vertically aligned with text content
 */
#education li::before {
    content: '▶';
    position: absolute;
    left: 0.6rem;
    top: 0.9rem;
    width: 1.2em;
    text-align: center;
    color: #2a5da8;
}
#education li:hover {
    background: rgba(42, 93, 168, 0.2);
    transform: translateX(10px);
    transition: all 0.3s ease;
}

/**
 * Accessibility: Skip-to-content link
 * Hidden by default, visible on keyboard focus
 */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    padding: 0.8rem 1.2rem;
    background: #2a5da8;
    color: #fff;
    border-radius: .6rem;
    z-index: 2000;
}

/**
 * Reduced Motion Support
 * Disables animations for users who prefer reduced motion
 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .cursor-trail {
        display: none !important;
    }
}

/**
 * Keyboard Focus Indicator
 * Enhanced outline for keyboard navigation accessibility
 */
:focus-visible {
    outline: 3px solid #3f78d1;
    outline-offset: 3px;
}
html[data-theme='light'] :focus-visible {
    outline-color: #2a5da8;
}

/**
 * Custom Cursor Styling
 * Arrow pointer with SVG data URI for consistent cross-browser appearance
 */
body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='white' stroke='%233f78d1' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0, auto;
}

/**
 * Interactive Element Cursor
 * Pointer cursor applied to all clickable elements
 */
a,
button,
.filter-btn,
.project-card,
.theme-toggle,
.nav-link,
.lang-toggle,
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
select,
[role="button"],
[onclick] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='white' stroke='%233f78d1' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0, pointer !important;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

/* Ensure all children of clickable elements inherit pointer cursor */
a *, 
button *, 
.filter-btn *, 
.project-card *, 
.theme-toggle *, 
.nav-link *, 
.lang-toggle *,
[role="button"] *,
[onclick] * {
    cursor: inherit !important;
}

/**
 * Light Theme Cursor Variant
 * Darker stroke color for better visibility on light backgrounds
 */
html[data-theme='light'] body {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='white' stroke='%232a5da8' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0, auto;
}

html[data-theme='light'] a,
html[data-theme='light'] button,
html[data-theme='light'] .filter-btn,
html[data-theme='light'] .project-card,
html[data-theme='light'] .theme-toggle,
html[data-theme='light'] .nav-link,
html[data-theme='light'] .lang-toggle,
html[data-theme='light'] input[type="submit"],
html[data-theme='light'] input[type="button"],
html[data-theme='light'] input[type="reset"],
html[data-theme='light'] input[type="checkbox"],
html[data-theme='light'] input[type="radio"],
html[data-theme='light'] select,
html[data-theme='light'] [role="button"],
html[data-theme='light'] [onclick] {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='white' stroke='%232a5da8' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 0, pointer !important;
}

/**
 * Hover Interaction Feedback
 * Subtle scale transformation for tactile response
 */
a:hover,
button:hover,
.filter-btn:hover,
.theme-toggle:hover,
.lang-toggle:hover {
    transform: scale(1.02);
}

/**
 * Active State Styling
 * Pressed appearance when clicking interactive elements
 */
a:active,
button:active,
.filter-btn:active,
.theme-toggle:active,
.lang-toggle:active {
    transform: scale(0.98);
}

/* Text cursor for selectable text and inputs (Tailwind cursor-text) */
input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]),
textarea,
[contenteditable="true"] {
    cursor: text;
}

/* Text cursor for text content including headings */
p,
h1, h2, h3, h4, h5, h6,
span:not(button span):not(.social-links span):not(nav span):not(.hamburger span):not(.theme-toggle span):not(.lang-toggle span),
li,
dt, dd,
label:not(button label),
.hero-title,
.hero-desc,
.section-title,
.about-text p,
.about-description,
.contact-info p,
footer p,
footer span:not(.social-links *) {
    cursor: text;
    user-select: text;
}

/* Exception: UI component text should not be selectable */
button,
button *,
.hamburger,
.hamburger *,
.theme-toggle,
.theme-toggle *,
.lang-toggle,
.lang-toggle *,
.switch,
.switch *,
.social-links,
.social-links *,
.logo,
nav a,
nav span,
.filter-btn,
.filter-btn * {
    cursor: inherit !important;
    user-select: none;
}

/* Disabled cursor (Tailwind cursor-not-allowed) */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Cursor Trail Animation */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(63, 120, 209, 0.6), transparent);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    animation: trail-fade 0.6s ease-out forwards;
}

@keyframes trail-fade {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
}

/* Light theme cursor trail colors */
html[data-theme='light'] .cursor-trail {
    background: radial-gradient(circle, rgba(42, 93, 168, 0.6), transparent);
}

/* Disable cursor trail and scale effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-trail {
        display: none;
    }
    
    a:hover,
    button:hover,
    .filter-btn:hover,
    .theme-toggle:hover,
    .lang-toggle:hover {
        transform: none;
    }
}

/* Disable animations when reduced motion is preferred */
@media (prefers-reduced-motion: reduce) {
    .cursor-trail {
        display: none;
    }
    
    a,
    button,
    .filter-btn,
    .project-card,
    .theme-toggle,
    .nav-link,
    .lang-toggle {
        transition: none !important;
    }
    
    a:hover,
    button:hover,
    .filter-btn:hover,
    .theme-toggle:hover,
    .lang-toggle:hover,
    a:active,
    button:active,
    .filter-btn:active,
    .theme-toggle:active,
    .lang-toggle:active {
        transform: none !important;
    }
}

/* Base Reset and Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    /* scroll-padding-top is removed as JS will handle the offset */
}

/* Disable AOS animations when scrolling via nav link */
body.aos-disabled [data-aos],
body.aos-suppressed [data-aos] {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
    animation: none !important;
}

body {
    background:
        radial-gradient(circle at 12% 18%, rgba(63, 120, 209, 0.18), transparent 58%),
        radial-gradient(circle at 88% 10%, rgba(79, 70, 229, 0.12), transparent 52%),
        linear-gradient(135deg, #121a2f 0%, #16233d 45%, #0f172a 100%);
    color: #fff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography scale (consistent across breakpoints) */
:root {
    --fs-base: 1.6rem; /* 16px at 62.5% html */
    --fs-body: clamp(1.55rem, 1.5rem + 0.2vw, 1.6rem);
    --fs-body-lg: clamp(1.7rem, 1.6rem + 0.4vw, 1.9rem);
    --fs-h1: clamp(3.2rem, 2rem + 3vw, 5rem);
    --fs-h2: clamp(2.4rem, 1.6rem + 1.8vw, 3.2rem);
    --fs-h3: clamp(2rem, 1.2rem + 1.2vw, 2.4rem);
    --fs-subtitle: clamp(1.8rem, 1.6rem + 0.8vw, 2.2rem);
    --fs-nav: 1.6rem;
    --fs-logo: clamp(2.4rem, 2rem + 1vw, 2.8rem);
    /* Smaller so long names fit without clipping */
    --fs-hero-title: clamp(2.4rem, 1.7rem + 2.0vw, 3.8rem);
    --fs-small: clamp(1.4rem, 1.3rem + 0.2vw, 1.5rem);
}

@property --orb-x {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --orb-y {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@property --orb-scale {
    syntax: '<number>';
    inherits: false;
    initial-value: 1;
}

body { font-size: var(--fs-body); }

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p, li { font-size: var(--fs-body); }

/* Light mode overrides */
html[data-theme='light'] body {
    background: linear-gradient(135deg, #f8fafc 0%, #eaeef5 100%);
    color: #111827;
}

html[data-theme='light'] header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(42, 93, 168, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html[data-theme='light'] header.scrolled {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    border-bottom-color: rgba(42, 93, 168, 0.12);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
}

html[data-theme='light'] nav a { color: #0f172a; }

html[data-theme='light'] nav a:hover,
html[data-theme='light'] nav a.active {
    color: #2a5da8;
}

html[data-theme='light'] .hamburger-line {
    background: #2a5da8;
}

html[data-theme='light'] .hamburger-menu:hover {
    background: rgba(42, 93, 168, 0.1);
}

html[data-theme='dark'] .hamburger-line {
    background: #e2e8f0;
}

html[data-theme='dark'] .hamburger-menu:hover {
    background: rgba(226, 232, 240, 0.1);
}

html[data-theme='dark'] .hamburger-menu:focus,
html[data-theme='dark'] .hamburger-menu:focus-visible {
    outline-color: #e2e8f0;
}

html[data-theme='light'] .home { background: transparent; box-shadow: none; }

html[data-theme='light'] .home::before { content: none; }

html[data-theme='light'] .hero-title {
    /* Darker gradient for better contrast on light bg */
    background: linear-gradient(135deg, #1e293b 0%, #2a5da8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap; /* keep single line in light mode as well */
}

html[data-theme='light'] .hero-desc {
    color: #334155;
}

html[data-theme='light'] .typing-label {
    color: #0f172a;
}

html[data-theme='light'] .btn.tertiary {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme='light'] section {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

html[data-theme='light'] section p,
html[data-theme='light'] section ul {
    color: #334155;
}

html[data-theme='light'] .skills-grid > div,
html[data-theme='light'] .job,
html[data-theme='light'] .project {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 248, 252, 0.95) 100%);
    border-color: rgba(42, 93, 168, 0.25);
}

html[data-theme='light'] .job:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(240, 245, 255, 1) 100%);
    box-shadow: 0 25px 50px rgba(42, 93, 168, 0.15), 
                0 0 30px rgba(42, 93, 168, 0.08);
}

html[data-theme='light'] .job::after {
    border-color: rgba(255, 255, 255, 0.95);
}

html[data-theme='light'] .job span {
    color: #64748b;
    background: rgba(42, 93, 168, 0.08);
    border-color: rgba(42, 93, 168, 0.2);
}

html[data-theme='light'] .job:hover span {
    background: rgba(42, 93, 168, 0.15);
    border-color: rgba(42, 93, 168, 0.3);
    color: #475569;
}

html[data-theme='light'] .experience-list::before {
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(42, 93, 168, 0.2) 10%, 
        rgba(42, 93, 168, 0.4) 50%, 
        rgba(42, 93, 168, 0.2) 90%, 
        transparent 100%);
}

html[data-theme='light'] .skills-grid h3,
html[data-theme='light'] .project h3,
html[data-theme='light'] .job h3 {
    color: #2a5da8;
}

html[data-theme='light'] .job:hover h3 {
    color: #1e4a8f;
}

html[data-theme='light'] .skills-grid li,
html[data-theme='light'] #education li {
    background: rgba(42, 93, 168, 0.08);
}

html[data-theme='light'] section li::before,
html[data-theme='light'] .skills-grid li::before,
html[data-theme='light'] #education li::before,
html[data-theme='light'] .job-modal__body li::before {
    color: #2a5da8;
}

/* Ensure text inside chips and lists is dark enough in light mode */
html[data-theme='light'] .skills-grid li,
html[data-theme='light'] .job-modal__body li,
html[data-theme='light'] #education li {
    color: #1e293b;
}

html[data-theme='light'] .job-modal__body li:hover {
    color: #0f172a;
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 7%;
    background: rgba(17, 24, 39, 0.9);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.32);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid rgba(42, 93, 168, 0.2);
    transition: all 0.3s ease;
    min-height: 6rem;
}

nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

/* Compact, translucent header when scrolled */
header.scrolled {
    padding: 0.8rem 7%;
    background: rgba(17, 24, 39, 0.32);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
    border-bottom-color: rgba(42, 93, 168, 0.18);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
}
header.scrolled .logo { font-size: calc(var(--fs-logo) * 0.9); }
header.scrolled nav a { margin-left: 2.2rem; }

.logo {
    font-size: var(--fs-logo);
    color: #2a5da8;
    font-weight: 900;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    color: #fff;
    text-shadow: 0 0 20px #2a5da8;
    transform: scale(1.05);
}

nav a {
    font-size: var(--fs-nav);
    color: #fff;
    margin-left: 3rem;
    font-weight: 500;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease;
    position: relative;
}

/* Animated underline for nav links */
nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2a5da8, transparent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme nav link color */
html[data-theme='light'] nav a {
    color: #0f172a;
}

/* Dark theme underline gradient */
html[data-theme='dark'] nav a::after {
    background: linear-gradient(90deg, transparent, #6a9ef6, transparent);
}

/* Theme switch container inside nav */
.nav-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: 2rem;
}

.switch-label {
    font-size: var(--fs-nav);
    color: #e5e7eb;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
html[data-theme='light'] .switch-label { color: #0f172a; }

/* Add moon icon globally so it appears on desktop and mobile */
.switch-label::before {
    content: '🌙';
    display: inline-block;
    width: 1.2em; /* Reserve consistent space */
    text-align: center;
    opacity: 0.9;
    margin-right: 0.6rem; /* Space after icon so it doesn't feel cramped */
}

/* iOS-like switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}
.switch input { display: none; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.25);
    transition: .3s;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.slider:before {
    position: absolute;
    content: '';
    height: 18px; width: 18px;
    left: 2px; top: 50%; transform: translateY(-50%);
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
/* checked state (dark mode on) */
html[data-theme='dark'] .switch .slider { background: rgba(42,93,168,0.5); border-color: rgba(42,93,168,0.6); }
.switch input:checked + .slider { background: rgba(42, 93, 168, 0.7); border-color: rgba(42,93,168,0.9); }
.switch input:checked + .slider:before { transform: translate(20px, -50%); }

/* Full-screen theme transition overlay */
.theme-transition {
    position: fixed;
    inset: 0;
    z-index: 1600;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 0.38s ease, transform 0.7s cubic-bezier(.4, 0, .2, 1);
}

.theme-transition.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.theme-transition:not(.is-active) .theme-transition__sun,
.theme-transition:not(.is-active) .theme-transition__moon {
    --orb-x: 0;
    --orb-y: 0;
}

.theme-transition__sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f6f3d6 0%, #a5dcff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation-fill-mode: forwards;
}

.theme-transition.to-dark .theme-transition__sky {
    animation: sky-day-to-night 1.6s cubic-bezier(.37, .01, .25, 1) forwards;
}

.theme-transition.to-light .theme-transition__sky {
    animation: sky-night-to-day 1.6s cubic-bezier(.37, .01, .25, 1) forwards;
}

.theme-transition__sun,
.theme-transition__moon {
    position: absolute;
    width: clamp(9rem, 14vw, 16rem);
    height: clamp(9rem, 14vw, 16rem);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    --orb-x: 0;
    --orb-y: 0;
    --orb-scale: 1;
    transform-origin: center;
    transform: translate(-50%, -50%) translate(calc(var(--orb-x) * 1vw), calc(var(--orb-y) * 1vh)) scale(var(--orb-scale));
    opacity: 0;
    will-change: transform, opacity;
}

.theme-transition__sun {
    --orb-x: -18;
    --orb-y: -6;
    --orb-scale: 1;
}

.theme-transition__moon {
    --orb-x: -6;
    --orb-y: -14;
    --orb-scale: 1.02;
}

.theme-transition__sun {
    background: radial-gradient(circle at 30% 30%, #fff6a1 0%, #fdb813 55%, #f57f17 100%);
    box-shadow: 0 0 30px rgba(253, 184, 19, 0.45), 0 0 60px rgba(245, 127, 23, 0.25);
}

.theme-transition__sun::before {
    content: '';
    position: absolute;
    inset: -35%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 70%);
    filter: blur(2px);
    opacity: 0.8;
}

.theme-transition__moon {
    background: radial-gradient(circle at 30% 30%, #f4f6ff 0%, #d2d5e5 55%, #aeb2c5 100%);
    box-shadow: 0 0 20px rgba(173, 178, 195, 0.3);
}

.theme-transition__moon::before {
    content: '';
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0.65;
    filter: blur(1px);
}

.theme-transition__crater {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, rgba(133, 136, 155, 0.9) 95%);
    opacity: 0.85;
}

.theme-transition__crater.crater-1 {
    width: 24%;
    height: 24%;
    top: 26%;
    left: 22%;
}

.theme-transition__crater.crater-2 {
    width: 16%;
    height: 16%;
    top: 48%;
    right: 18%;
}

.theme-transition__crater.crater-3 {
    width: 14%;
    height: 14%;
    bottom: 18%;
    left: 36%;
}

.theme-transition__stars {
    position: absolute;
    inset: 0;
}

.theme-transition__stars .star {
    position: absolute;
    width: clamp(0.5rem, 0.4rem + 0.3vw, 0.9rem);
    height: clamp(0.5rem, 0.4rem + 0.3vw, 0.9rem);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    opacity: 0;
    transform: scale(0.35);
    will-change: transform, opacity;
}

.theme-transition__stars .star-1 { top: 22%; left: 32%; }
.theme-transition__stars .star-2 { top: 18%; right: 20%; }
.theme-transition__stars .star-3 { bottom: 28%; left: 18%; }
.theme-transition__stars .star-4 { bottom: 18%; right: 30%; }
.theme-transition__stars .star-5 { top: 45%; right: 12%; }

.theme-transition.is-active.to-dark .theme-transition__sun {
    animation: sun-set 2s cubic-bezier(.35, .01, .26, 1) forwards;
}

.theme-transition.is-active.to-dark .theme-transition__moon {
    animation: moon-rise 2.1s cubic-bezier(.28, .82, .35, 1) forwards 0.08s;
}

.theme-transition.is-active.to-light .theme-transition__sun {
    animation: sun-rise 2s cubic-bezier(.35, .01, .26, 1) forwards;
}

.theme-transition.is-active.to-light .theme-transition__moon {
    animation: moon-set 2.1s cubic-bezier(.28, .82, .35, 1) forwards;
}

.theme-transition.is-active.to-dark .theme-transition__stars .star {
    animation: star-twinkle 1.8s cubic-bezier(.4, 0, .2, 1) forwards;
}

.theme-transition.is-active.to-dark .theme-transition__stars .star-2 { animation-delay: 0.16s; }
.theme-transition.is-active.to-dark .theme-transition__stars .star-3 { animation-delay: 0.32s; }
.theme-transition.is-active.to-dark .theme-transition__stars .star-4 { animation-delay: 0.48s; }
.theme-transition.is-active.to-dark .theme-transition__stars .star-5 { animation-delay: 0.64s; }

.theme-transition.is-active.to-light .theme-transition__stars .star {
    animation: star-fade 1.1s cubic-bezier(.18, .67, .6, 1) forwards;
}

@keyframes sun-set {
    0% {
        --orb-x: 0;
        --orb-y: 0;
        --orb-scale: 1;
        opacity: 1;
    }
    38% {
        --orb-x: 18;
        --orb-y: 10;
        --orb-scale: 1.04;
        opacity: 0.88;
    }
    100% {
        --orb-x: 52;
        --orb-y: 38;
        --orb-scale: 0.68;
        opacity: 0;
    }
}

@keyframes moon-rise {
    0% {
        --orb-x: -56;
        --orb-y: 38;
        --orb-scale: 0.62;
        opacity: 0;
    }
    40% {
        --orb-x: -22;
        --orb-y: 14;
        --orb-scale: 0.92;
        opacity: 0.68;
    }
    100% {
        --orb-x: 0;
        --orb-y: 0;
        --orb-scale: 1.02;
        opacity: 1;
    }
}

@keyframes sun-rise {
    0% {
        --orb-x: 52;
        --orb-y: 38;
        --orb-scale: 0.68;
        opacity: 0;
    }
    38% {
        --orb-x: 18;
        --orb-y: 10;
        --orb-scale: 1.04;
        opacity: 0.88;
    }
    100% {
        --orb-x: 0;
        --orb-y: 0;
        --orb-scale: 1;
        opacity: 1;
    }
}

@keyframes moon-set {
    0% {
        --orb-x: 0;
        --orb-y: 0;
        --orb-scale: 1.02;
        opacity: 1;
    }
    40% {
        --orb-x: -22;
        --orb-y: 14;
        --orb-scale: 0.92;
        opacity: 0.68;
    }
    100% {
        --orb-x: -56;
        --orb-y: 38;
        --orb-scale: 0.62;
        opacity: 0;
    }
}

@keyframes sky-day-to-night {
    0% { background: linear-gradient(135deg, #f6f3d6 0%, #a5dcff 100%); }
    30% { background: linear-gradient(145deg, #ffe2a6 0%, #b8e4ff 80%); }
    60% { background: linear-gradient(150deg, #ffb37a 0%, #7d95e6 80%); }
    100% { background: linear-gradient(160deg, #070f21 0%, #1e3060 85%); }
}

@keyframes sky-night-to-day {
    0% { background: linear-gradient(160deg, #070f21 0%, #1e3060 85%); }
    32% { background: linear-gradient(155deg, #0d1730 0%, #253f73 82%); }
    64% { background: linear-gradient(148deg, #ffb37a 0%, #7d95e6 80%); }
    100% { background: linear-gradient(135deg, #f6f3d6 0%, #a5dcff 100%); }
}

@keyframes star-twinkle {
    0% { opacity: 0; transform: scale(0.35); }
    40% { opacity: 1; transform: scale(1.05); }
    70% { opacity: 0.9; transform: scale(0.85); }
    100% { opacity: 0.75; transform: scale(0.8); }
}

@keyframes star-fade {
    0% { opacity: 0.75; transform: scale(0.8); }
    60% { opacity: 0.3; transform: scale(0.4); }
    100% { opacity: 0; transform: scale(0.2); }
}

@media (prefers-reduced-motion: reduce) {
    .theme-transition { display: none !important; }
}

/* Light mode colors */
html[data-theme='light'] .slider { background: rgba(15, 23, 42, 0.1); border-color: rgba(15,23,42,0.15); }
html[data-theme='light'] .slider:before { background: #fff; }

/* Accessibility */
.switch input:focus + .slider { box-shadow: 0 0 0 4px rgba(63,120,209,0.35); }

/* Responsive nav items to prevent wrapping */
@media (max-width: 1200px) {
    nav a {
        margin-left: 2rem;
        font-size: calc(var(--fs-nav) * 0.9);
    }
    
    .nav-theme-toggle {
        margin-left: 1.5rem;
        gap: 0.6rem;
    }
    
    .switch-label {
        font-size: calc(var(--fs-nav) * 0.85);
    }
    
    .lang-dropdown {
        margin-left: 1rem;
    }
    
    .lang-current {
        font-size: calc(var(--fs-nav) * 0.8);
        padding: 0.3rem 0.6rem;
        min-width: 60px;
    }
}

@media (max-width: 1000px) {
    nav a {
        margin-left: 1.5rem;
        font-size: calc(var(--fs-nav) * 0.85);
    }
    
    .switch-label {
        font-size: calc(var(--fs-nav) * 0.8); /* Make label smaller but keep it visible */
    }
    
    .nav-theme-toggle {
        margin-left: 1rem;
        gap: 0.4rem; /* Keep some gap for the label */
    }
    
    .lang-current {
        min-width: 50px;
    }
}

/* Hover state - expand underline */
nav a:hover::after {
    width: 100%;
}

/* Active/current state - full underline + color change */
nav a.active,
nav a[aria-current="page"] {
    color: #2a5da8;
}

nav a.active::after,
nav a[aria-current="page"]::after {
    width: 100%;
}

/* Light theme active color */
html[data-theme='light'] nav a:hover,
html[data-theme='light'] nav a.active,
html[data-theme='light'] nav a[aria-current="page"] {
    color: #2a5da8;
}

/* Dark theme active color - brighter for visibility */
html[data-theme='dark'] nav a:hover,
html[data-theme='dark'] nav a.active,
html[data-theme='dark'] nav a[aria-current="page"] {
    color: #6a9ef6;
}

/* Hamburger Menu */

/* Language dropdown */
.lang-dropdown {
    position: relative;
    display: inline-flex;
    margin-left: 1.2rem;
}

.lang-current {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.6rem;
    padding: 0.4rem 0.8rem;
    color: #e5e7eb;
    font-size: calc(var(--fs-nav) * 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.lang-current:hover {
    background: rgba(42, 93, 168, 0.2);
    border-color: rgba(42, 93, 168, 0.5);
}

.flag-icon {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

.lang-text {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-current i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.lang-dropdown[aria-expanded="true"] .lang-current i {
    transform: rotate(180deg);
}

.lang-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(42, 93, 168, 0.3);
    border-radius: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.lang-dropdown.active .lang-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    padding: 0.8rem 1.2rem;
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.lang-option:hover {
    background: rgba(42, 93, 168, 0.2);
    color: #2a5da8;
}

.lang-option.active {
    color: #2a5da8;
    font-weight: 600;
}

.lang-option:first-child {
    border-top-left-radius: 0.8rem;
    border-top-right-radius: 0.8rem;
}

.lang-option:last-child {
    border-bottom-left-radius: 0.8rem;
    border-bottom-right-radius: 0.8rem;
}

/* Light mode styles */
html[data-theme='light'] .lang-current {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.2);
    color: #0f172a;
}

html[data-theme='light'] .lang-current:hover {
    background: rgba(42, 93, 168, 0.1);
    border-color: rgba(42, 93, 168, 0.3);
}

html[data-theme='light'] .lang-options {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(15, 23, 42, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

html[data-theme='light'] .lang-option {
    color: #0f172a;
}

html[data-theme='light'] .lang-option:hover {
    background: rgba(42, 93, 168, 0.1);
    color: #2a5da8;
}
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
    border-radius: 6px;
    min-width: 44px; /* Touch-friendly minimum size */
    min-height: 44px;
    position: relative;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: rgba(42, 93, 168, 0.1);
    transform: scale(1.05);
}

.hamburger-menu:focus {
    outline: 2px solid #2a5da8;
    outline-offset: 2px;
}

.hamburger-menu:focus:not(:focus-visible) {
    outline: none;
}

.hamburger-menu:focus-visible {
    outline: 2px solid #2a5da8;
    outline-offset: 2px;
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background: #2a5da8;
    margin: 2px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
    display: block;
    transform-origin: center;
}

/* Active state - modern X animation */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero Section */
.home {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6rem;
    background: transparent;
    min-height: 0;
    margin-top: 8rem;
    padding: 7rem 7% 7rem 7%;
    border-radius: 0;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.home::before { content: none; }

.home-img {
    position: relative;
    z-index: 2;
    border-radius: 50%;
    overflow: hidden;
    width: 280px;
    height: 280px;
    box-shadow: 
        0 0 0 8px rgba(42, 93, 168, 0.3),
        0 0 0 16px rgba(42, 93, 168, 0.1),
        0 20px 40px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
    /* Looping aura using animated outer ring on the element's own shadow (not clipped by overflow) */
    animation: aura-ring 2.8s ease-out infinite;
    will-change: box-shadow;
}

/* Animated outer ring: DARK (default) */
@keyframes aura-ring {
    0% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.30),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.5),
            0 0 0 0 rgba(63, 120, 209, 0.40);
    }
    60% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.30),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.5),
            0 0 0 22px rgba(63, 120, 209, 0.16);
    }
    100% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.30),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.5),
            0 0 0 38px rgba(63, 120, 209, 0.00);
    }
}

/* LIGHT theme variant: slightly subtler ring color */
@keyframes aura-ring-light {
    0% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.28),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.12),
            0 0 0 0 rgba(42, 93, 168, 0.35);
    }
    60% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.28),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.10),
            0 0 0 22px rgba(42, 93, 168, 0.14);
    }
    100% {
        box-shadow:
            0 0 0 8px rgba(42, 93, 168, 0.28),
            0 0 0 16px rgba(42, 93, 168, 0.10),
            0 20px 40px rgba(0, 0, 0, 0.08),
            0 0 0 38px rgba(42, 93, 168, 0.00);
    }
}

/* Switch to light variant when needed */
html[data-theme='light'] .home-img { animation-name: aura-ring-light; }

/* Slightly faster pulse on hover */
.home-img:hover { animation-duration: 2.4s; }

.home-img:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 
        0 0 0 8px rgba(42, 93, 168, 0.5),
        0 0 0 16px rgba(42, 93, 168, 0.2),
        0 30px 60px rgba(0, 0, 0, 0.7);
}

.home-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.home-img:hover img {
    transform: scale(1.1);
}

.home-content {
    flex: 1;
    min-width: 350px;
    max-width: 600px;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: var(--fs-hero-title);
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    white-space: nowrap; /* keep the full name on one line */
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #2a5da8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Removed nowrap to avoid clipping on some widths */

.typing-hero {
    font-size: var(--fs-subtitle);
    font-weight: 700;
    margin-bottom: 2rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.typing-label {
    color: #fff;
    margin-right: 1rem;
}

.typing-dynamic {
    color: #2a5da8;
    border-right: 3px solid #2a5da8;
    padding-right: 8px;
    animation: blink-cursor 1s infinite;
}

@keyframes blink-cursor {
    0%, 50% { border-color: #2a5da8; }
    51%, 100% { border-color: transparent; }
}

.hero-desc {
    font-size: var(--fs-body-lg);
    color: #ddd;
    line-height: 1.8;
    margin-bottom: 3rem;
    text-align: justify;
}

.cta-buttons {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 1.2rem 2.5rem;
    font-size: var(--fs-body);
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.btn::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;
}

.btn:hover::before {
    left: 100%;
}

.btn.primary {
    background: linear-gradient(135deg, #2a5da8 0%, #3f78d1 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(42, 93, 168, 0.4);
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(42, 93, 168, 0.6);
}

.btn.secondary {
    background: transparent;
    color: #2a5da8;
    border: 2px solid #2a5da8;
}

.btn.secondary:hover {
    background: #2a5da8;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(42, 93, 168, 0.4);
}

.btn.tertiary {
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.btn.tertiary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #2a5da8;
    color: #2a5da8;
    transform: translateY(-3px);
}

/* Dark mode button styles for better contrast */
html[data-theme='dark'] .btn.primary {
    background: linear-gradient(135deg, #3f78d1 0%, #5a8ee6 100%);
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(63, 120, 209, 0.5);
}

html[data-theme='dark'] .btn.primary:hover {
    background: linear-gradient(135deg, #4f88e0 0%, #6a9ef6 100%);
    box-shadow: 0 15px 35px rgba(63, 120, 209, 0.7);
}

html[data-theme='dark'] .btn.secondary {
    background: transparent;
    color: #6a9ef6;
    border: 2px solid #3f78d1;
}

html[data-theme='dark'] .btn.secondary:hover {
    background: #3f78d1;
    color: #ffffff;
    border-color: #3f78d1;
    box-shadow: 0 15px 35px rgba(63, 120, 209, 0.5);
}

html[data-theme='dark'] .btn.tertiary {
    background: rgba(63, 120, 209, 0.15);
    color: #e5e7eb;
    border: 2px solid rgba(63, 120, 209, 0.3);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}

html[data-theme='dark'] .btn.tertiary:hover {
    background: rgba(63, 120, 209, 0.25);
    border-color: #3f78d1;
    color: #6a9ef6;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

/* Sections - Universal Styling */
section {
    padding: 6rem 7% 5rem 7%;
    margin: 3rem auto 0; /* unified flow, less boxy spacing */
    max-width: 1200px;
    background: transparent;   /* remove card background */
    border-radius: 0;          /* no rounded corners */
    scroll-margin-top: 10rem;
    box-shadow: none;          /* remove card shadow */
    border: none;              /* remove card border */
    position: relative;
    overflow: visible;
}

/* remove decorative overlay to keep clean unified look */
section::before { content: none; }

/* seamless sections: no visible divider, keep spacing only */
section + section {
    border-top: none;
    padding-top: 4rem;
}

section h2 {
    font-size: 3.5rem;
    color: #2a5da8;
    margin-bottom: 3rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    position: relative;
    z-index: 2;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

html[data-theme='dark'] section h2 {
    color: #dbeafe;
    background: linear-gradient(135deg, #c2e7ff 0%, #a5b4fc 45%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 16px 42px rgba(15, 23, 42, 0.55),
        0 0 18px rgba(56, 189, 248, 0.35);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 8rem;
    height: 4px;
    background: linear-gradient(90deg, transparent, #2a5da8, transparent);
    border-radius: 2px;
}

html[data-theme='dark'] section h2::after {
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.9), transparent);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

section p {
    font-size: 1.8rem;
    color: #e2e8f0;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: justify;
    z-index: 2;
    position: relative;
}

section ul {
    font-size: 1.8rem;
    color: #e2e8f0;
    line-height: 1.8;
    margin-bottom: 2rem;
    z-index: 2;
    position: relative;
    list-style: none;
    padding-left: 0;
}

section li {
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-wrap: nowrap;
    column-gap: 0.7em;
    min-width: 0;
}

section li strong, section li span {
    word-break: break-word;
    min-width: 0;
}

section li::before {
    content: '▶';
    display: inline-block;
    width: 1.2em;
    flex: 0 0 1.2em;
    color: #2a5da8;
    font-size: 1em;
    text-align: center;
    line-height: 1;
    padding-top: 0.35em;
}

html[data-theme='dark'] section {
    background: transparent;
}

html[data-theme='dark'] section + section {
    padding-top: 4rem;
}

html[data-theme='dark'] .home { background: transparent; }

html[data-theme='dark'] #about { background: transparent; }

#about .about-layout {
    margin-top: 2.4rem;
    display: flex;
    gap: clamp(3.2rem, 3vw + 1.6rem, 5.6rem);
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

#about .about-badge {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#about .about-badge a {
    display: block;
    line-height: 0;
    position: relative;
    -webkit-mask-image: url('../images/microsoft-office-specialist-excel-expert-microsoft-365-apps.png');
    mask-image: url('../images/microsoft-office-specialist-excel-expert-microsoft-365-apps.png');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

#about .about-badge a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 100%);
    width: 50%;
    transform: translateX(-120%) skewX(-15deg);
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 1;
    mix-blend-mode: screen;
    z-index: 1;
}

#about .about-badge a:hover::before {
    transform: translateX(320%) skewX(-15deg);
}

#about .about-badge img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 200px;
    transition: filter 0.3s ease;
}

/* #about .about-badge:hover img {
    filter: drop-shadow(0 8px 16px rgba(42, 93, 168, 0.4));
} */

#about .about-text {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    max-width: 720px;
}

#about .about-text p {
    line-height: 1.8;
    font-size: clamp(1.6rem, 1.5rem + 0.3vw, 1.8rem);
}

@media (max-width: 900px) {
    #about .about-layout {
        flex-direction: column;
        align-items: center;
        gap: 3.2rem;
    }

    #about .about-text {
        text-align: center;
    }

    #about .about-badge {
        flex: 0 0 auto;
    }
}

@media (max-width: 480px) {
    #about .about-badge {
        padding: 1.6rem;
    }
}

html[data-theme='dark'] #experience { background: transparent; }

html[data-theme='dark'] #portfolio { background: transparent; }

html[data-theme='dark'] #skills { background: transparent; }

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    z-index: 2;
    position: relative;
}

.skills-grid > div {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9) 0%, rgba(17, 27, 46, 0.9) 100%);
    border-radius: 2rem;
    padding: 3rem 2.5rem;
    border: 1px solid rgba(102, 126, 234, 0.22);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.skills-grid > div::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(42, 93, 168, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.skills-grid > div:hover::before {
    opacity: 1;
}

.skills-grid > div:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(42, 93, 168, 0.2);
    border-color: rgba(42, 93, 168, 0.5);
}

.skills-grid h3 {
    font-size: 2.2rem;
    color: #2a5da8;
    margin-bottom: 2rem;
    font-weight: 700;
    text-align: center;
    z-index: 2;
    position: relative;
}

.skills-grid ul {
    list-style: none;
    z-index: 2;
    position: relative;
}

.skills-grid li {
    font-size: 1.6rem;
    color: #eee;
    margin-bottom: 1rem;
    padding: 0.8rem 1.5rem 0.8rem 2rem;
    background: rgba(42, 93, 168, 0.1);
    border-radius: 1rem;
    border-left: 4px solid #2a5da8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    column-gap: 0.7em;
    width: fit-content;
    max-width: 100%;
}

.skills-grid li::before {
    content: '▶';
    color: #2a5da8;
    display: inline-block;
    width: 1.2em;
    flex: 0 0 1.2em;
    text-align: center;
    line-height: 1;
    font-size: 1em;
    padding-top: 0.35em;
}

/* When list has icons, remove arrow and align icons */
.skills-grid li.has-icon::before {
    content: '';
    width: 0.6em;
    flex: 0 0 0.6em;
}
.skills-grid li.has-icon i {
    font-size: 1.4rem;
    color: #2a5da8;
    opacity: 0.9;
}
html[data-theme='light'] .skills-grid li.has-icon i {
    color: #2a5da8;
}

/* Simple inline SVG badges */
.si { display: inline-flex; align-items: center; justify-content: center; margin-right: 0.6rem; }
.si-icon { width: 18px; height: 18px; }
.si-bg { fill: rgba(42, 93, 168, 0.15); }
.si-text { fill: #2a5da8; font-family: inherit; font-size: 9px; font-weight: 700; letter-spacing: .5px; }
html[data-theme='light'] .si-bg { fill: rgba(42, 93, 168, 0.12); }
html[data-theme='light'] .si-text { fill: #2a5da8; }

/* Official brand icons (as <img>): unify to monochrome for consistency */
.si-img {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    width: 20px;
    height: 20px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    /* Dark mode: make icons white so they match text */
    filter: brightness(0) invert(1) opacity(0.9);
}
/* Light mode: tint icons to primary blue (#2a5da8) using CSS filter approximation */
html[data-theme='light'] .si-img {
    /* Show original brand colors in light mode */
    filter: none;
}

/* Fine-tune Power BI size parity across themes */
.si-powerbi[data-variant="dark"] {
    transform: scale(1.12);
    transform-origin: center;
}

.skills-grid li:hover {
    background: rgba(42, 93, 168, 0.2);
    transform: translateX(10px);
}

/* Metrics Summary */
.metrics-section {
    text-align: center;
}

.metrics-subtitle {
    font-size: 1.8rem;
    color: #cbd5f5;
    max-width: 62ch;
    margin: 0 auto 3rem auto;
    line-height: 1.7;
    text-align: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2.8rem;
    align-items: stretch;
    margin-top: 2rem;
}

.metric-card {
    position: relative;
    padding: 3.2rem 2.6rem;
    border-radius: 2.2rem;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.96) 0%, rgba(17, 27, 46, 0.96) 100%);
    border: 1px solid rgba(76, 106, 191, 0.35);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.45);
    overflow: hidden;
    transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    align-items: center;
    height: 100%;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(63, 120, 209, 0.35), transparent 60%);
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 1;
}

.metric-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(63, 120, 209, 0.15) 45%, transparent 90%);
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.45s ease;
    z-index: 1;
}

.metric-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 32px 68px rgba(42, 93, 168, 0.24);
    border-color: rgba(96, 165, 250, 0.6);
}

.metric-card:hover::before,
.metric-card:hover::after {
    opacity: 1;
}

.metric-value {
    font-size: clamp(3.4rem, 2.2rem + 2.4vw, 5.2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #dbeafe;
    text-shadow: 0 12px 32px rgba(15, 23, 42, 0.45);
    z-index: 2;
}

.metric-label {
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3c6;
    z-index: 2;
}

.metric-desc {
    font-size: 1.5rem;
    color: #cbd5f5;
    line-height: 1.75;
    margin: 0;
    z-index: 2;
    text-align: center;
}

html[data-theme='light'] .metrics-subtitle {
    color: #475569;
}

html[data-theme='light'] .metric-card {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.96) 0%, rgba(238, 244, 255, 0.96) 100%);
    border-color: rgba(42, 93, 168, 0.25);
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.12);
}

html[data-theme='light'] .metric-card::before {
    background: radial-gradient(circle at top right, rgba(63, 120, 209, 0.25), transparent 60%);
}

html[data-theme='light'] .metric-value {
    color: #1e3a8a;
    text-shadow: none;
}

html[data-theme='light'] .metric-label {
    color: #334155;
}

html[data-theme='light'] .metric-desc {
    color: #475569;
}

@media (max-width: 900px) {
    .metrics-grid {
        gap: 2.4rem;
    }
}

.experience-layout {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 4rem;
    align-items: stretch; /* stretch children to same row height */
    margin-top: 3.5rem;
    position: relative;
}

.experience-roadmap {
    position: relative;
    width: 100%;
    height: 100%; /* fill the full section height */
    min-height: 520px;
    pointer-events: none;
    filter: drop-shadow(0 25px 40px rgba(15, 23, 42, 0.4));
    z-index: 1;
}

.experience-roadmap__svg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.9;
}

.experience-roadmap {
    --roadmap-path: path('M60 40 C 170 110 40 200 150 280 S 30 430 150 520 S 60 680 160 760');
}

.experience-roadmap__path {
    animation: roadmap-dash 16s linear infinite;
}

/* Hide roadmap year stamps (nodes) per request */
.experience-roadmap .roadmap-node {
    display: none !important;
}

.roadmap-traveler {
    position: absolute;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: radial-gradient(circle, #f8fafc 0%, #60a5fa 45%, rgba(59, 130, 246, 0.15) 90%);
    border: 3px solid rgba(96, 165, 250, 0.6);
    box-shadow: 0 0 24px rgba(96, 165, 250, 0.65);
    offset-path: var(--roadmap-path);
    animation: roadmap-travel 18s ease-in-out infinite alternate;
}

.roadmap-node {
    position: absolute;
    offset-path: var(--roadmap-path);
    offset-distance: var(--distance, 0%);
    transform: translate(-50%, -50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(96, 165, 250, 0.32);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.35);
    border-radius: 1.2rem;
    padding: 0.9rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    align-items: center;
    color: #e2e8f0;
    font-size: 1.2rem;
    min-width: 110px;
    text-align: center;
}

.roadmap-node__year {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.roadmap-node__tag {
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.78;
}

.roadmap-node::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.28);
    border: 3px solid rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(100% + 12px));
}

.roadmap-node.node-1 { --distance: 6%; }
.roadmap-node.node-2 { --distance: 32%; }
.roadmap-node.node-3 { --distance: 52%; }
.roadmap-node.node-4 { --distance: 73%; }
.roadmap-node.node-5 { --distance: 94%; }

html[data-theme='light'] .experience-roadmap {
    filter: drop-shadow(0 25px 40px rgba(30, 58, 138, 0.25));
}

html[data-theme='light'] .roadmap-node {
    background: rgba(248, 250, 252, 0.92);
    border-color: rgba(37, 99, 235, 0.2);
    color: #1e293b;
    box-shadow: 0 18px 28px rgba(15, 23, 42, 0.18);
}

html[data-theme='light'] .roadmap-node__tag {
    color: #475569;
    opacity: 0.85;
}

@keyframes roadmap-dash {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -420; }
}

@keyframes roadmap-travel {
    0% { offset-distance: 0%; }
    50% { offset-distance: 50%; }
    100% { offset-distance: 100%; }
}

/* Experience List - Interactive Timeline */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 0;
    z-index: 2;
    position: relative;
    padding-left: 0;
    max-width: 720px;
}

/* Vertical Timeline Line */
.experience-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(42, 93, 168, 0.3) 10%, 
        rgba(42, 93, 168, 0.6) 50%, 
        rgba(42, 93, 168, 0.3) 90%, 
        transparent 100%);
    border-radius: 2px;
    display: none;
}

.job {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.95) 0%, rgba(17, 27, 46, 0.95) 100%);
    border-radius: 2rem;
    padding: 2.6rem 2.8rem;
    border: 1px solid rgba(102, 126, 234, 0.22);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

/* Timeline Dot */
.job::after {
    content: none;
}

/* Animated gradient overlay */
.job::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(42, 93, 168, 0.1) 50%, 
        transparent 100%);
    transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.job:hover::before {
    left: 100%;
}


@media (min-width: 901px) {
    .experience-list {
        margin-top: 0;
        padding-left: 0;
    }

    .experience-list::before,
    .experience-list::after {
        content: none;
    }
}
.job:hover::after {
    background: #3f78d1;
    transform: scale(1.3);
    box-shadow: 0 0 0 8px rgba(42, 93, 168, 0.2);
}

.job:hover {
    transform: translateX(10px);
    box-shadow: 0 25px 50px rgba(42, 93, 168, 0.2), 
                0 0 30px rgba(42, 93, 168, 0.1);
    border-color: rgba(42, 93, 168, 0.5);
    background: linear-gradient(160deg, rgba(30, 41, 59, 1) 0%, rgba(20, 30, 50, 1) 100%);
}

.job-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    background: rgba(59, 130, 246, 0.12);
    color: #dbeafe;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    position: relative;
    z-index: 2;
}

.job-detail-btn::after {
    content: '↗';
    font-size: 1.2rem;
    opacity: 0.7;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.job-detail-btn:hover,
.job-detail-btn:focus-visible {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(96, 165, 250, 0.6);
    color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 18px 32px rgba(30, 64, 175, 0.25);
}

.job-detail-btn:hover::after,
.job-detail-btn:focus-visible::after {
    transform: translateX(3px) rotate(8deg);
    opacity: 1;
}

html[data-theme='light'] .job-detail-btn {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(30, 64, 175, 0.12);
}

html[data-theme='light'] .job-detail-btn:hover,
html[data-theme='light'] .job-detail-btn:focus-visible {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(37, 99, 235, 0.4);
    color: #1e3a8a;
}

/* Icon-only compact variant */
.job-detail-btn.icon-only {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 8px;
    justify-content: center;
}
.job-detail-btn.icon-only::before {
    content: '›';
    font-size: 1.6rem;
    line-height: 1;
    transform: translateX(1px);
}
.job-detail-btn.icon-only::after { content: none; }

.job .job-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.job h3 {
    font-size: 2rem;
    color: #3f78d1;
    margin-bottom: 0.8rem;
    font-weight: 700;
    z-index: 2;
    position: relative;
    width: fit-content;
    max-width: 100%;
    transition: color 0.3s ease, transform 0.3s ease;
    display: block;
    line-height: 1.4;
}

.job .job-period {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    color: #94a3b8;
    font-style: normal;
    font-weight: 500;
    z-index: 2;
    position: relative;
    padding: 0.5rem 1.1rem;
    background: rgba(42, 93, 168, 0.12);
    border-radius: 0.6rem;
    border: 1px solid rgba(42, 93, 168, 0.25);
    width: fit-content;
    transition: all 0.3s ease;
}
.job .job-period::before {
    content: '📅';
    font-size: 1.4rem;
}
.job:hover .job-period {
    background: rgba(42, 93, 168, 0.2);
    border-color: rgba(42, 93, 168, 0.4);
    color: #cbd5e1;
    transform: translateX(3px);
}

.job-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2.4rem;
}

.job-modal.is-open {
    display: flex;
}

.job-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.74);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.job-modal__dialog {
    position: relative;
    width: min(560px, 92vw);
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(160deg, rgba(15, 23, 42, 0.98) 0%, rgba(12, 20, 34, 0.97) 100%);
    border-radius: 2.2rem;
    padding: 3rem 3.4rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 35px 85px rgba(15, 23, 42, 0.45);
    z-index: 1;
    color: #e2e8f0;
}

.job-modal__header {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 2.2rem;
}

.job-modal__title {
    font-size: 2.1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #93c5fd;
}

.job-modal__period {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.35rem;
    font-weight: 500;
    color: #cbd5f5;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 0.8rem;
    padding: 0.6rem 1.3rem;
    width: fit-content;
}

.job-modal__period::before {
    content: '📅';
    font-size: 1.4rem;
}

.job-modal__body {
    font-size: 1.55rem;
    color: #e2e8f0;
}

.job-modal__close {
    position: absolute;
    top: 1.6rem;
    right: 1.6rem;
    border: none;
    background: rgba(15, 23, 42, 0.6);
    color: #e2e8f0;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

.job-modal__close:hover,
.job-modal__close:focus-visible {
    background: rgba(59, 130, 246, 0.4);
    transform: rotate(12deg);
}

html[data-theme='light'] .job-modal__dialog {
    background: linear-gradient(160deg, rgba(248, 250, 252, 0.98) 0%, rgba(226, 232, 240, 0.95) 100%);
    color: #0f172a;
    border-color: rgba(37, 99, 235, 0.18);
    box-shadow: 0 28px 65px rgba(15, 23, 42, 0.2);
}

html[data-theme='light'] .job-modal__title {
    color: #1d4ed8;
}

html[data-theme='light'] .job-modal__period {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.28);
    color: #1e3a8a;
}

html[data-theme='light'] .job-modal__body {
    color: #1e293b;
}

html[data-theme='light'] .job-modal__close {
    background: rgba(59, 130, 246, 0.18);
    color: #1e3a8a;
}

html[data-theme='light'] .job-modal__close:hover,
html[data-theme='light'] .job-modal__close:focus-visible {
    background: rgba(59, 130, 246, 0.28);
}

.job-modal__dialog::-webkit-scrollbar {
    width: 8px;
}

.job-modal__dialog::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
    border-radius: 999px;
}

.job-modal__dialog::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 999px;
}

html[data-theme='light'] .job-modal__dialog::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.3);
}

html[data-theme='light'] .job-modal__dialog::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.6);
}

.job-modal__body ul {
    margin-top: 1.2rem;
}

.job-modal__body li:last-child {
    margin-bottom: 0;
}

body.modal-open {
    overflow: hidden;
}

.job:hover span {
    background: rgba(42, 93, 168, 0.2);
    border-color: rgba(42, 93, 168, 0.4);
    color: #cbd5e1;
    transform: translateX(3px);
}

.job-detail-content {
    display: none;
}

.job-modal__body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.job-modal__body li {
    font-size: 1.6rem;
    color: inherit;
    margin-bottom: 1.2rem;
    padding-left: 2.8rem;
    position: relative;
    transition: color 0.3s ease, transform 0.3s ease;
    line-height: 1.6;
}

.job-modal__body li::before {
    content: '▸';
    position: absolute;
    left: 0.4rem;
    color: #60a5fa;
    font-weight: 600;
    font-size: 1.6rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.job-modal__body li:hover {
    color: inherit;
    transform: translateX(4px);
}

.job-modal__body li:hover::before {
    color: #93c5fd;
    transform: translateX(2px);
}

/* Portfolio List */
.portfolio-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    z-index: 2;
    position: relative;
}

.project {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.9) 0%, rgba(17, 27, 46, 0.9) 100%);
    border-radius: 2rem;
    padding: 3rem;
    border: 1px solid rgba(102, 126, 234, 0.22);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(42, 93, 168, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project:hover::before {
    opacity: 1;
}

.project:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 60px rgba(42, 93, 168, 0.2);
    border-color: rgba(42, 93, 168, 0.5);
}

.project h3 {
    font-size: 2rem;
    color: #2a5da8;
    margin-bottom: 1.5rem;
    font-weight: 700;
    z-index: 2;
    position: relative;
}

.project p {
    font-size: 1.6rem;
    color: #e2e8f0;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    z-index: 2;
    position: relative;
}

.project .btn {
    margin-top: 2rem;
    z-index: 2;
    position: relative;
}

/* Footer */

.site-footer {
    background: linear-gradient(155deg, rgba(20, 31, 50, 0.92) 0%, rgba(12, 21, 38, 0.95) 100%);
    color: #d4dcff;
    padding: 3rem 7%; /* Reduced top/bottom padding */
    text-align: center;
    border-top: 1px solid rgba(102, 126, 234, 0.18);
    margin-top: 5rem;
}

.footer-bottom {
    width: 100%;
    text-align: center;
    padding: 1.2rem 7% 2rem 7%;
    color: #94a3c6;
    font-size: 1.4rem;
}
html[data-theme='light'] .footer-bottom { color: #64748b; }

.footer-content h3 {
    font-size: 2.4rem;
    color: #2a5da8;
    margin-bottom: 1rem;
    font-weight: 700;
}

.footer-content p {
    margin: 0 auto 2rem;
    font-size: 1.6rem;
    color: #c5d3f4;
    max-width: 60ch;
    line-height: 1.7;
}

.footer-contact {
    display: flex;
    flex-direction: row; /* Changed from column to row */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center; /* Center the items */
    align-items: center;
    gap: 2.5rem; /* Increased gap for horizontal layout */
    margin-bottom: 2.5rem;
}

.footer-link {
    color: #e2e8f0;
    font-size: 1.6rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #2a5da8;
}

.footer-link i {
    font-size: 1.8rem;
    color: #2a5da8;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.footer-socials a {
    color: #c5d3f4;
    font-size: 3rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-socials a:hover {
    color: #2a5da8;
    transform: scale(1.2) translateY(-2px);
}

/* Light mode footer */
html[data-theme='light'] .site-footer {
    background: #f8fafc;
    border-top-color: rgba(42, 93, 168, 0.1);
}

html[data-theme='light'] .footer-content h3 {
    color: #2a5da8;
}

html[data-theme='light'] .footer-content p {
    color: #475569;
}

html[data-theme='light'] .footer-link {
    color: #334155;
}

html[data-theme='light'] .footer-link:hover {
    color: #2a5da8;
}

html[data-theme='light'] .footer-socials a {
    color: #475569;
}

html[data-theme='light'] .footer-socials a:hover {
    color: #2a5da8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    section {
        padding: 3rem 5% 2rem 5%;
        margin: 2rem auto;
    }
    
    .home {
        gap: 4rem;
        padding: 3rem 5% 2rem 5%;
       }
}

@media (max-width: 900px) {
    .hamburger-menu {
        display: flex;
        /* Enhanced mobile touch interactions */
        -webkit-tap-highlight-color: rgba(42, 93, 168, 0.2);
        touch-action: manipulation; /* Improves touch responsiveness */
        user-select: none; /* Prevents text selection on touch */
    }
    
    .hamburger-menu:active {
        transform: scale(0.95);
        background: rgba(42, 93, 168, 0.15);
    }
    
    header {
        padding: 1.5rem 5%;
        /* Mobile layout: logo left, hamburger right (like desktop) */
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 1rem;
        min-height: 70px;
    }
    
    .logo {
        /* Position logo at the start (left) */
        order: 1;
        grid-column: 1;
        justify-self: flex-start;
        text-align: left;
    }
    
    .hamburger-menu {
        /* Position hamburger at the end (right) */
        order: 2;
        grid-column: 3;
        justify-self: flex-end;
    }
    
    nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        
        /* Modern glassmorphism design */
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        
        /* Modern shadow with depth */
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.4),
            0 2px 8px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        
        /* Subtle gradient border */
        border-top: 1px solid rgba(63, 120, 209, 0.3);
        border-bottom: 1px solid rgba(0, 0, 0, 0.2);
        
        flex-direction: column;
        align-items: stretch;

        /* Animation: Hidden state */
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
        overflow: hidden;
        pointer-events: none;
        padding: 0;
        
        /* Smooth transitions */
        transition: 
            max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            overflow 0s 0.4s; /* Delay overflow change when collapsing */
    }

    nav.active {
        /* Animation: Visible state */
        max-height: 800px; /* Increased to accommodate dropdown */
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        padding: 0rem 0;
        overflow: visible; /* Allow dropdown to be visible outside nav bounds */
    }
    
    /* Light theme adjustments */
    html[data-theme='light'] nav {
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            0 2px 8px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
        border-top: 1px solid rgba(42, 93, 168, 0.2);
    }

    nav a {
        /* Reset and base styles */
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 1.2rem 6% !important;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        position: relative;
        
        /* Typography */
        font-size: 1.7rem !important;
        font-weight: 500;
        text-align: left;
        letter-spacing: 0.3px;
        
        /* Modern design */
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        background: transparent;
        
        /* Smooth transitions */
        transition: 
            background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        
        /* Better touch target */
        min-height: 56px;
        
        /* Prevent text selection on touch */
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Active indicator bar */
    nav a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 0;
        background: linear-gradient(180deg, #3f78d1 0%, #2a5da8 100%);
        border-radius: 0 4px 4px 0;
        transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Override header.scrolled styles for mobile nav items */
    header.scrolled nav a {
        margin: 0 !important;
        margin-left: 0 !important;
        padding: 1.2rem 6% !important;
        font-size: 1.7rem !important;
    }
    
    /* Hover state - modern highlight */
    nav a:hover {
        background: linear-gradient(
            90deg,
            rgba(63, 120, 209, 0.12) 0%,
            rgba(63, 120, 209, 0.05) 100%
        );
        padding-left: 8% !important;
        color: #6a9ef6;
    }
    
    nav a:hover::before {
        height: 60%;
    }
    
    /* Active state - stronger visual feedback */
    nav a.active,
    nav a[aria-current="page"] {
        background: linear-gradient(
            90deg,
            rgba(63, 120, 209, 0.18) 0%,
            rgba(63, 120, 209, 0.08) 100%
        );
        color: #6a9ef6;
        font-weight: 600;
        padding-left: 8% !important;
    }
    
    nav a.active::before,
    nav a[aria-current="page"]::before {
        height: 80%;
    }
    
    /* Active state pressed effect */
    nav a:active {
        transform: scale(0.98);
        background: rgba(63, 120, 209, 0.25);
    }
    
    /* Light theme adjustments */
    html[data-theme='light'] nav a {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    html[data-theme='light'] nav a:hover {
        background: linear-gradient(
            90deg,
            rgba(42, 93, 168, 0.08) 0%,
            rgba(42, 93, 168, 0.03) 100%
        );
        color: #2a5da8;
    }
    
    html[data-theme='light'] nav a.active,
    html[data-theme='light'] nav a[aria-current="page"] {
        background: linear-gradient(
            90deg,
            rgba(42, 93, 168, 0.12) 0%,
            rgba(42, 93, 168, 0.05) 100%
        );
        color: #2a5da8;
    }

    /* Place theme switch at the bottom of mobile menu - modern design */
    .nav-theme-toggle {
        order: 99;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        padding: 1.2rem 6% !important;
        margin: 0 !important;
        width: 100%;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        gap: 1rem;
        min-height: 56px;
        background: transparent;
        transition: 
            background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        user-select: none;
    }
    
    .nav-theme-toggle:hover {
        background: linear-gradient(
            90deg,
            rgba(63, 120, 209, 0.12) 0%,
            rgba(63, 120, 209, 0.05) 100%
        );
        padding-left: 8% !important;
    }
    
    .nav-theme-toggle .switch-label {
        font-size: 1.7rem;
        font-weight: 500;
        color: inherit;
        letter-spacing: 0.3px;
    }
    
    /* Light theme for theme toggle */
    html[data-theme='light'] .nav-theme-toggle {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    html[data-theme='light'] .nav-theme-toggle:hover {
        background: linear-gradient(
            90deg,
            rgba(42, 93, 168, 0.08) 0%,
            rgba(42, 93, 168, 0.03) 100%
        );
    }
    
    /* Enable dropdown functionality on mobile - modern design */
    .lang-current {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        font-size: 1.7rem;
        font-weight: 500;
        padding: 1.2rem 6% !important;
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        cursor: pointer;
        width: 100%;
        color: inherit;
        text-align: left;
        margin: 0;
        min-height: 56px;
        letter-spacing: 0.3px;
        transition: 
            background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        transform: none !important;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .lang-current:hover {
        background: linear-gradient(
            90deg,
            rgba(63, 120, 209, 0.12) 0%,
            rgba(63, 120, 209, 0.05) 100%
        );
        padding-left: 8% !important;
    }
    
    .lang-current:active {
        transform: scale(0.98) !important;
    }
    
    /* Light theme for language dropdown */
    html[data-theme='light'] .lang-current {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    html[data-theme='light'] .lang-current:hover {
        background: linear-gradient(
            90deg,
            rgba(42, 93, 168, 0.08) 0%,
            rgba(42, 93, 168, 0.03) 100%
        );
    }
    
    .lang-options {
        position: absolute;
        top: 100%;
        left: 6%;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        margin-top: 0.8rem;
        
        /* Modern glassmorphism */
        background: rgba(15, 15, 15, 0.98);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        
        border-radius: 12px;
        border: 1px solid rgba(63, 120, 209, 0.2);
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.4),
            0 2px 6px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        
        display: flex;
        flex-direction: column;
        overflow: hidden;
        z-index: 1002; /* Above navigation and lang-dropdown */
        min-width: 180px;
        
        transition: 
            opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .lang-dropdown.active .lang-options {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .lang-option {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        font-size: 1.6rem;
        font-weight: 500;
        padding: 1rem 1.4rem;
        background: transparent;
        border: none;
        margin: 0;
        cursor: pointer;
        color: inherit;
        letter-spacing: 0.3px;
        transition: 
            background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
            color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .lang-option:not(:last-child) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .lang-option:hover {
        background: rgba(63, 120, 209, 0.15);
        color: #6a9ef6;
    }
    
    .lang-option:active {
        transform: scale(0.96);
    }
    
    .lang-option.active {
        background: rgba(63, 120, 209, 0.22);
        color: #6a9ef6;
        font-weight: 600;
    }
    
    .lang-option .flag-icon {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    }
    
    /* Light mode colors for mobile language dropdown */
    html[data-theme='light'] .lang-options {
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(42, 93, 168, 0.15);
        box-shadow: 
            0 8px 24px rgba(0, 0, 0, 0.1),
            0 2px 6px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    
    html[data-theme='light'] .lang-option:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    html[data-theme='light'] .lang-option:hover {
        background: rgba(42, 93, 168, 0.1);
        color: #2a5da8;
    }
    
    html[data-theme='light'] .lang-option.active {
        background: rgba(42, 93, 168, 0.15);
        color: #2a5da8;
    }

    /* Language dropdown for mobile - positioned after theme toggle */
    .lang-dropdown {
        order: 100;
        display: flex;
        justify-content: flex-start; /* Left align */
        align-items: center;
        padding: 1rem 0 1rem 0; /* Match navigation padding */
        margin: 0.5rem 0; /* Match nav item margin */
        margin-left: 0;
        gap: 0.8rem;
        border-top: 1px solid rgba(42, 93, 168, 0.1);
        border-bottom: 1px solid rgba(42, 93, 168, 0.1); /* Match nav separator */
        width: 100%; /* Full width without calc */
        box-sizing: border-box;
        position: relative; /* Enable absolute positioning for dropdown options */
        z-index: 1001; /* Above navigation background */
    }
    .switch-label { 
        font-size: 1.6rem; /* Same as nav items */
        font-weight: 500; /* Match nav font weight */
        color: inherit; /* Inherit text color */
        text-align: left; /* Left align label */
        line-height: 1.2;
        display: inline-flex;
        align-items: center;
        gap: 0.6rem;
    }

    /* Icon pseudo-element now defined globally above */
    
    .lang-option .flag-icon {
        width: 20px;
        height: 14px;
    }
    
    .lang-option span {
        font-weight: 600;
        font-size: 1.4rem;
    }

    html[data-theme='light'] nav a {
        color: #0f172a;
        border-bottom-color: rgba(15, 23, 42, 0.06);
    }
    
    nav a:hover,
    nav a.active,
    nav a[aria-current="page"] {
        background: rgba(42, 93, 168, 0.2);
        color: #2a5da8;
        /* No border changes - keep position stable like lang-current */
    }

    html[data-theme='light'] nav a:hover,
    html[data-theme='light'] nav a.active,
    html[data-theme='light'] nav a[aria-current="page"] {
        background: rgba(42, 93, 168, 0.1);
        color: #2a5da8;
        /* No border changes - keep position stable like lang-current */
    }
    
    section {
        padding: 5rem 5% 4rem 5%;
        margin: 4rem auto;
        border-radius: 2rem;
        scroll-margin-top: 10rem;
    }
    
    .home {
        flex-direction: column;
        gap: 4rem;
        min-height: 0;
        margin-top: 10rem;
        text-align: center;
        padding: 5rem 5% 4rem 5%;
    }
    
    .home-img {
        width: 220px;
        height: 220px;
        order: -1;
    }
    
    .hero-title { margin-bottom: 2rem; font-size: clamp(2.2rem, 1.6rem + 2.2vw, 3.2rem); letter-spacing: 0.4px; }
    
    .typing-hero {
        font-size: 2.2rem;
        margin-bottom: 3rem;
    }
    
    .hero-desc {
        font-size: 1.6rem;
        text-align: justify;
        margin-bottom: 3rem;
        line-height: 1.8;
    }
    
    .cta-buttons {
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    .portfolio-list {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    section h2 { margin-bottom: 3rem; }
    
    /* Add more breathing space to content */
    section p { margin-bottom: 2.5rem; line-height: 1.8; text-align: justify; }
    
    
    section li { line-height: 1.7; }
    
}

@media (max-width: 600px) {
    
    header {
        padding: 1.5rem 4%;
    }
    
    section {
        padding: 5rem 4% 4rem 4%;
        margin: 4rem auto;
        border-radius: 2rem;
        scroll-margin-top: 12rem;
    }
    
    .home {
        margin-top: 12rem;
        padding: 4rem 4% 4.5rem 4%;
        gap: 3rem;
        min-height: 0;
    }
    
    .home-img {
        width: 180px;
        height: 180px;
    }
    
    .hero-title { line-height: 1.2; margin-bottom: 2.5rem; font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem); letter-spacing: 0.3px; }
    
    .typing-hero { margin-bottom: 2.5rem; }
    
    .hero-desc { line-height: 1.7; margin-bottom: 3rem; text-align: justify; }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 2.2rem;
    }

    .metric-card {
        padding: 2.8rem 2.2rem;
    }

    .metric-value {
        font-size: clamp(3rem, 2rem + 2vw, 4.4rem);
    }

    .metric-label {
        font-size: 1.4rem;
    }

    .metric-desc {
        font-size: 1.4rem;
    }
    
    /* Mobile Timeline Adjustments */
    .experience-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .experience-roadmap {
        display: none;
    }

    .experience-list {
        padding-left: 2.4rem;
        gap: 2.6rem;
    }

    .experience-list::before {
        display: block;
        width: 2px;
        left: 0.6rem;
    }

    .job {
        padding: 2.6rem 2.2rem 2.6rem 3.6rem;
        gap: 1.4rem;
    }

    .job::after {
        content: '';
        position: absolute;
        top: 2.6rem;
        left: 0;
        transform: translateX(-2.6rem);
        width: 1.1rem;
        height: 1.1rem;
        background: #2a5da8;
        border: 3px solid rgba(10, 10, 10, 0.9);
        border-radius: 50%;
        box-shadow: 0 0 0 0 rgba(42, 93, 168, 0.4);
    }

    .job:hover {
        transform: translateX(5px);
    }

    .job h3 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 0.4rem;
    }

    .job .job-period {
        font-size: 1.2rem;
        padding: 0.5rem 0.9rem;
    }

    .job .job-period::before {
        font-size: 1.3rem;
    }

    .job-detail-btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn {
        padding: 1.5rem 3rem;
        font-size: 1.5rem;
        width: 100%;
        max-width: 320px;
        text-align: center;
    }
    
    section h2 {
        font-size: 3rem;
        margin-bottom: 3rem;
        text-align: center;
    }
    
    /* Add more breathing space */
    section p {
        margin-bottom: 2.5rem;
        line-height: 1.8;
        text-align: justify;
    }
    
    section ul {
        font-size: 1.6rem;
    }
    
    section li {
        font-size: 1.6rem;
        line-height: 1.7;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .skill-item {
        padding: 2.5rem 2rem;
        margin-bottom: 1.5rem;
    }
    
    .skill-item h3 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .portfolio-list {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .project {
        padding: 3rem 2.5rem;
        margin-bottom: 1.5rem;
    }
    
    .project h3 {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    
    .project p {
        font-size: 1.6rem;
        line-height: 1.7;
    }
    
    .skills-grid li {
        font-size: 1.5rem;
    }
    
    .job-modal__body li {
        font-size: 1.6rem;
        line-height: 1.7;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 50%;
    }
    
    header {
        padding: 1.5rem 3%;
    }
    
    .home {
        padding: 4rem 3%;
        gap: 3rem;
        margin-top: 10rem;
    }
    
    .home-img {
        width: 160px;
        height: 160px;
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.2;
        margin-bottom: 2.5rem;
    }
    
    .typing-hero {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }
    
    .hero-desc {
        font-size: 1.6rem;
        line-height: 1.7;
        margin-bottom: 3rem;
        text-align: justify;
    }
    
    section {
        padding: 4rem 3% 3rem 3%;
        margin: 3rem auto;
        scroll-margin-top: 12rem;
    }
    
    section h2 {
        font-size: 2.8rem;
        margin-bottom: 3rem;
    }
    
    section p {
        font-size: 1.6rem;
        line-height: 1.8;
        margin-bottom: 2.5rem;
        text-align: justify;
    }
    
    .btn {
        padding: 1.2rem 2.5rem;
        font-size: 1.5rem;
        max-width: 280px;
    }
    
    .skill-item {
        padding: 2.5rem 2rem;
    }
    
    .skill-item h3 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .project {
        padding: 2.5rem 2rem;
    }
    
    .project h3 {
        font-size: 2.2rem;
        margin-bottom: 2rem;
    }
    
    /* Extra mobile optimizations */
    .cta-buttons {
        gap: 1.2rem;
        flex-direction: column;
    }
    
    .btn {
        padding: 1.2rem 2.5rem;
        font-size: 1.5rem;
        max-width: 280px;
    }
    
    /* Improve readability for lists and job descriptions */
    section ul {
        font-size: 1.6rem;
    }
    
    section li {
        font-size: 1.6rem;
        margin-bottom: 1.2rem;
        line-height: 1.7;
    }
    
    .skills-grid li {
        font-size: 1.5rem;
        padding: 1rem 1.5rem;
    }
    
    .job {
        padding: 2.5rem 2rem;
    }
    
    .job h3 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .job .company {
        font-size: 1.6rem;
    }
    
    .job .period {
        font-size: 1.4rem;
    }
    
    .job-modal__body li {
        font-size: 1.5rem;
        line-height: 1.6;
    }
    
    /* Add more space between sections */
    section + section {
        margin-top: 4rem;
    }
}

/* Additional optimization for content-based height */
section:not(.home) {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Desktop layout override - restore original flex layout */
@media (min-width: 901px) {
    header {
        display: flex !important;
        grid-template-columns: unset !important;
        justify-content: space-between;
        gap: unset !important;
    }
    
    .hamburger-menu {
        order: unset !important;
        grid-column: unset !important;
    }
    
    .logo {
        order: unset !important;
        grid-column: unset !important;
        justify-self: unset !important;
        text-align: unset !important;
    }
    
    nav {
        padding: unset !important;
        text-align: unset !important;
    }
    
    nav a {
        text-align: unset !important;
        padding: unset !important;
    }
    
    nav a:hover,
    nav a.active {
        padding-left: unset !important;
        transform: unset !important;
    }
}

/* Minimize empty space at bottom */
section:last-of-type {
    margin-bottom: 2rem;
}

body {
    padding-bottom: 0;
}

/* Tech Stack chips (new) */
.stack-grid {
    display: flex;              /* variable-width chips */
    flex-wrap: wrap;            /* wrap into multiple rows */
    gap: 1.2rem;                /* consistent spaces between chips */
    margin-top: 2.4rem;
    align-items: flex-start;
    justify-content: center;    /* center chips across each row */
}

.stack-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1.2rem 1.6rem; /* slightly larger for clarity */
    border-radius: 12px;
    background: rgba(42, 93, 168, 0.12);
    border: 1px solid rgba(42, 93, 168, 0.25);
    color: #e5e7eb;
    font-weight: 600;
    font-size: clamp(1.6rem, 1.55rem + 0.25vw, 1.85rem);
    letter-spacing: 0.2px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
    position: relative;
    overflow: hidden; /* contain hover particles */
}

.stack-chip:hover {
    transform: translateY(-3px);
    /* Neutralize base hover colors; theme-specific rules will set bg/border */
    box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

.stack-chip .stack-icon { width: 26px; height: 26px; flex: 0 0 26px; }
/* Make inline fallback badges match icon size */
.stack-chip .si { margin-right: 0.6rem; }
.stack-chip .si-icon { width: 26px; height: 26px; }

/* Light theme for chips */
html[data-theme='light'] .stack-chip {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15,23,42,0.12);
    color: #0f172a;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
html[data-theme='light'] .stack-chip:hover,
html[data-theme='light'] .stack-chip:focus-visible {
    /* Subtle neutral tint to avoid clashing on light surfaces */
    background: rgba(15, 23, 42, 0.08); /* slate-900 ~8% */
    border-color: rgba(15, 23, 42, 0.18);
    box-shadow: 0 10px 26px rgba(15,23,42,0.12);
}

/* Dark-mode hover: white background so colored logos don't clash */
html[data-theme='dark'] .stack-chip:hover,
html[data-theme='dark'] .stack-chip:focus-visible {
    /* Soft off-white blue to avoid clashing */
    background: #f3f6fb;
    border-color: #d6dfef;
    box-shadow: 0 10px 26px rgba(0,0,0,0.35);
    /* Switch text to dark for proper contrast on light hover bg */
    color: #0f172a;
}

/* Snow-like particle effect on hover (subtle, performant) */
.stack-chip::before,
.stack-chip::after {
    content: '';
    position: absolute;
    inset: -10%; /* extend slightly so particles enter smoothly */
    pointer-events: none;
    opacity: 0; /* revealed on hover */
    transition: opacity .2s ease;
    will-change: background-position;
}

/* Foreground small flakes */
.stack-chip::after {
    background-image: radial-gradient(var(--chip-snow-color, rgba(255,255,255,0.55)) 1.6px, transparent 1.8px);
    background-size: 16px 16px; /* grid size */
    background-position: 0 0;
    animation: chip-snow-fall-fg 2.2s linear infinite; /* loop length matches grid size */
    animation-play-state: paused; /* run only on hover */
}
/* Background larger, sparser flakes for depth */
.stack-chip::before {
    background-image: radial-gradient(var(--chip-snow-color-2, rgba(255,255,255,0.32)) 2.0px, transparent 2.2px);
    background-size: 24px 24px; /* grid size */
    background-position: 0 0;
    animation: chip-snow-fall-bg 3.6s linear infinite; /* slower, deeper layer */
    animation-play-state: paused;
}

.stack-chip:hover::before,
.stack-chip:hover::after,
.stack-chip:focus-visible::before,
.stack-chip:focus-visible::after {
    opacity: .8; /* more visible, especially in dark */
    animation-play-state: running;
}

/* Theme-aware flake colors */
html[data-theme='dark'] .stack-chip {
    /* Default (non-hover) flake hues for dark background - brighter to show up */
    --chip-snow-color: rgba(255, 255, 255, 0.5);
    --chip-snow-color-2: rgba(255, 255, 255, 0.3);
}
/* On dark hover we switch chip bg to light; ensure flakes remain subtle */
html[data-theme='dark'] .stack-chip:hover,
html[data-theme='dark'] .stack-chip:focus-visible {
    --chip-snow-color: rgba(42, 93, 168, 0.30);
    --chip-snow-color-2: rgba(42, 93, 168, 0.20);
}

html[data-theme='light'] .stack-chip {
        --chip-snow-color: rgba(15, 23, 42, 0.2);   /* slate-900 tint, slightly stronger */
        --chip-snow-color-2: rgba(15, 23, 42, 0.12);
}
html[data-theme='light'] .stack-chip:hover,
html[data-theme='light'] .stack-chip:focus-visible {
        --chip-snow-color: rgba(42, 93, 168, 0.22);
        --chip-snow-color-2: rgba(42, 93, 168, 0.14);
}

/* Blend modes tuned per theme */
html[data-theme='light'] .stack-chip::before,
html[data-theme='light'] .stack-chip::after { mix-blend-mode: soft-light; }
html[data-theme='dark'] .stack-chip::before,
html[data-theme='dark'] .stack-chip::after { mix-blend-mode: normal; }

@keyframes chip-snow-fall-fg {
    0% { background-position: 0 0; }
    100% { background-position: 16px 16px; } /* move exactly one tile for seamless loop */
}
@keyframes chip-snow-fall-bg {
    0% { background-position: 0 0; }
    100% { background-position: 24px 24px; } /* move exactly one tile for seamless loop */
}

/* Stagger phases slightly for more natural look */
.stack-grid .stack-chip:nth-child(3n+1)::after { animation-delay: -0.3s; }
.stack-grid .stack-chip:nth-child(3n+2)::after { animation-delay: -0.6s; }
.stack-grid .stack-chip:nth-child(3n+3)::after { animation-delay: -0.9s; }
.stack-grid .stack-chip:nth-child(3n+1)::before { animation-delay: -0.5s; }
.stack-grid .stack-chip:nth-child(3n+2)::before { animation-delay: -0.8s; }
.stack-grid .stack-chip:nth-child(3n+3)::before { animation-delay: -1.1s; }

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .stack-chip::before,
    .stack-chip::after {
        animation: none !important;
        opacity: 0 !important;
    }
}
/* Reveal original brand colors for images on dark hover */
/* Reveal light-variant image for brand icons on dark hover */
html[data-theme='dark'] .stack-chip:hover .si-img,
html[data-theme='dark'] .stack-chip:focus-visible .si-img { filter: none; }
/* Intensify inline badge on dark hover */
html[data-theme='dark'] .stack-chip:hover .si-bg,
html[data-theme='dark'] .stack-chip:focus-visible .si-bg { fill: rgba(42,93,168,0.95); }
html[data-theme='dark'] .stack-chip:hover .si-text,
html[data-theme='dark'] .stack-chip:focus-visible .si-text { fill: #ffffff; }

/* Exception: keep certain brand icons colored even in dark (no inversion) */
html[data-theme='dark'] img.no-dark-filter { filter: none !important; }

/* Responsive sizing so chips don't get too small */
@media (max-width: 900px) {
  .stack-chip { padding: 1rem 1.3rem; }
}

@media (max-width: 600px) {
    .stack-grid { gap: 1rem; }
  .stack-chip { justify-content: center; }
}
/* On extra small screens, allow natural wrapping without forced columns */

/* Hide Scrollbar Completely */
/* For Webkit browsers (Chrome, Safari, Edge) */

/* Ensure scrolling still works */
html, body {
  overflow-y: auto;
  overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 7px;
}

::-webkit-scrollbar-track {
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background: rgba(42, 93, 168, 0.6); 
    border-radius: 3px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 93, 168, 0.9);
}