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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:root {
    /* Updated theme using palette:
       #EAA239, #FFE4A1, #C3A5C1, #97332C, #8F9E25, #E59793 */
    --primary: #EAA239;
    --primary-dark: #97332C;
    --secondary: #E59793;

    --bg-light: #FFE4A1;
    --bg-dark: #1b0c0c;

    --text-light: #2b1b11;
    --text-dark: #fdf4e7;

    --card-light: #fff7e5;
    --card-dark: #2a1515;

    --border-light: #f1d7a4;
    --border-dark: #4a2424;

    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.18);

    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, #C3A5C1 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: var(--bg-light);
    transition: color 0.2s ease, background-color 0.2s ease;
    position: relative;
    overflow-x: hidden;
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.2;
    will-change: transform;
}

body.dark-mode .shape {
    opacity: 0.1;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: 10%;
    left: 10%;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    top: 50%;
    right: 10%;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--primary);
    bottom: 10%;
    left: 20%;
}

.shape-4 {
    width: 450px;
    height: 450px;
    background: var(--secondary);
    top: 30%;
    left: 50%;
}

/* Lightweight float only when motion is preferred (disabled on low-end mobile via media query) */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
    .shape {
        filter: blur(60px);
        animation: float 25s ease-in-out infinite;
    }
    .shape-2 { animation-delay: 5s; animation-duration: 28s; }
    .shape-3 { animation-delay: 10s; animation-duration: 32s; }
    .shape-4 { animation-delay: 15s; animation-duration: 35s; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -40px); }
}

/* Lightweight particle drift (desktop only; mobile skips animation) */
@keyframes floatParticle {
    0%, 100% { transform: translate(0, 0); opacity: 0.2; }
    50% { transform: translate(10px, -15px); opacity: 0.3; }
}

/* Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--card-light);
}

body.dark-mode ::-webkit-scrollbar-track {
    background: var(--card-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

body.dark-mode .navbar {
    background: rgba(10, 14, 26, 0.98);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

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

.nav-links a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.2s ease;
}

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

.resume-btn {
    padding: 0.6rem 1.5rem;
    background: var(--gradient);
    color: white !important;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
}

.resume-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.resume-btn::after {
    display: none;
}

.nav-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.icon-btn:hover {
    background: var(--card-light);
    color: var(--primary);
    transform: scale(1.05);
}

body.dark-mode .icon-btn:hover {
    background: var(--card-dark);
}

.menu-toggle {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
}

.hero-content {
    max-width: 1200px;
    text-align: center;
    animation: fadeInUp 1s ease;
}

.hero-image-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.hero-image-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    transition: transform 0.2s ease;
}

.hero-image-wrapper:hover {
    transform: scale(1.05);
}

.hero-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

body.dark-mode .hero-image {
    border-color: var(--card-dark);
}

.hero-image-border {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    background: var(--gradient);
    z-index: 1;
    opacity: 0.8;
}

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
    .hero-image-border {
        animation: pulse 2.5s ease-in-out infinite;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.03); opacity: 0.9; }
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
    min-height: 3rem;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

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

.btn-primary,
.btn-secondary {
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    font-size: 1rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px) scale(1.02);
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-light);
    color: var(--text-light);
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    font-size: 1.3rem;
}

body.dark-mode .social-btn {
    background: var(--card-dark);
    color: var(--text-dark);
}

.social-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--gradient);
    color: white;
}

/* Sections */
.section {
    padding: 5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.section-header p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 1.5rem auto 0;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: 2px solid var(--border-light);
}

body.dark-mode .stat-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.stat-card i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-card p {
    opacity: 0.85;
    font-weight: 500;
}

/* Experience Section - Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.8rem 2rem;
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: inherit;
}

body.dark-mode .tab-btn {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px) scale(1.02);
}

.tab-btn.active {
    background: var(--gradient) !important;
    color: white !important;
    border-color: transparent !important;
    transform: scale(1.05);
}

body.dark-mode .tab-btn.active {
    background: var(--gradient) !important;
    color: white !important;
    border-color: transparent !important;
}

.tab-content {
    min-height: 400px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-marker {
    position: absolute;
    left: 11px;
    top: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient);
    border: 4px solid var(--bg-light);
    z-index: 2;
    transition: transform 0.2s ease;
}

body.dark-mode .timeline-marker {
    border-color: var(--bg-dark);
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.3);
}

.timeline-content {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

body.dark-mode .timeline-content {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.timeline-content:hover {
    transform: translateX(4px);
    border-color: var(--primary);
}

.experience-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.experience-header.no-logo .experience-info {
    flex: 1;
}

.experience-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-light);
    transition: transform 0.3s ease;
}

body.dark-mode .experience-logo {
    border-color: var(--border-dark);
}

.experience-logo:hover {
    transform: scale(1.05);
}

.experience-info {
    flex: 1;
}

.timeline-header h3,
.experience-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.timeline-header .company,
.experience-info .company {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.85;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 1rem;
}

.achievement {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(234, 162, 57, 0.12);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Certificates Grid */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.certificate-card {
    background: var(--card-light);
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

body.dark-mode .certificate-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.certificate-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary);
}

.cert-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.certificate-card:hover .cert-image {
    transform: scale(1.05);
}

.certificate-card i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.certificate-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cert-date {
    display: block;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.btn-view-cert {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-view-cert:hover {
    transform: scale(1.02);
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: 2px solid var(--border-light);
}

body.dark-mode .skill-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.skill-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary);
}

.skill-card>i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.skill-card:hover>i {
    transform: scale(1.05);
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Tech Stack Icons */
.tech-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.tech-icons i {
    font-size: 3rem;
    transition: transform 0.2s ease;
}

.tech-icons i:hover {
    transform: scale(1.1) translateY(-2px);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.skill-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(234, 162, 57, 0.12);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.skill-tag:hover {
    background: var(--gradient);
    color: white;
    transform: scale(1.02);
}

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

.filter-btn {
    padding: 0.7rem 1.5rem;
    background: var(--card-light);
    border: 2px solid var(--border-light);
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: inherit;
}

body.dark-mode .filter-btn {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px) scale(1.02);
}

.filter-btn.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-light);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid var(--border-light);
    cursor: pointer;
}

body.dark-mode .project-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.project-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--primary);
}

.project-header {
    padding: 2rem;
    background: var(--gradient);
    color: white;
    transition: padding 0.2s ease;
}

.project-header i {
    font-size: 2rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.project-card:hover .project-header i {
    transform: scale(1.05);
}

.project-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-body {
    padding: 2rem;
}

.project-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.project-card:hover .project-thumbnail {
    transform: scale(1.02);
}

.project-thumbnail--empty {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    color: var(--primary);
    font-size: 3rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

body.dark-mode .project-thumbnail--empty {
    background: var(--border-dark);
}

.project-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-date,
.project-type {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: var(--card-light);
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    position: relative;
    animation: slideUp 0.25s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

body.dark-mode .modal-content {
    background: var(--card-dark);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    color: var(--text-light);
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

body.dark-mode .modal-close {
    color: var(--text-dark);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    transform: scale(1.1);
}

.modal-body {
    padding: 3rem;
}

.modal-body h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.modal-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    opacity: 0.8;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-screenshots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.modal-screenshots img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    transition: transform 0.2s ease;
    cursor: pointer;
}

body.dark-mode .modal-screenshots img {
    border-color: var(--border-dark);
}

.modal-screenshots img:hover {
    transform: scale(1.05);
}

.modal-body p {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.modal-tech span {
    padding: 0.4rem 1rem;
    background: rgba(234, 162, 57, 0.12);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-btn {
    padding: 0.8rem 2rem;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Certificate Modal */
.cert-modal-content {
    max-width: 1200px;
    background: var(--card-light);
    padding: 20px;
    border: 2px solid var(--border-light);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

body.dark-mode .cert-modal-content {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.cert-modal-content .modal-close {
    background: var(--card-light);
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    right: 16px;
    top: 16px;
    font-size: 28px;
    line-height: 1;
}

body.dark-mode .cert-modal-content .modal-close {
    background: var(--card-dark);
    color: var(--text-dark);
}

.cert-modal-content .modal-close:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cert-modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cert-modal-body img {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Photo Gallery Modal */
.gallery-modal-content {
    max-width: 900px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.gallery-modal-title {
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
    color: var(--primary);
    text-align: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    transition: transform 0.2s ease;
    cursor: pointer;
}

body.dark-mode .gallery-grid img {
    border-color: var(--border-dark);
}

.gallery-grid img:hover {
    transform: scale(1.03);
}

/* RHB timeline: View photo gallery button */
.btn-gallery {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(234, 162, 57, 0.15);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-gallery:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-form-wrapper,
.contact-info-wrapper {
    background: var(--card-light);
    padding: 2.5rem;
    border-radius: 16px;
    border: 2px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .contact-form-wrapper,
body.dark-mode .contact-info-wrapper {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.contact-form-wrapper:hover,
.contact-info-wrapper:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.contact-form-wrapper h3,
.contact-info-wrapper h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-light);
}

body.dark-mode .form-group label {
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--bg-light);
    color: var(--text-light);
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background: var(--bg-dark);
    color: var(--text-dark);
    border-color: var(--border-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(234, 162, 57, 0.2);
}

.btn-submit {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px) scale(1.01);
}

.btn-submit:active {
    transform: translateY(0);
}

.form-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 2px solid #16a34a;
    display: block;
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 2px solid #dc2626;
    display: block;
}

.contact-info-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-info-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-light);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.dark-mode .contact-info-card {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}

.contact-info-card:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: var(--primary);
}

.contact-info-card i {
    font-size: 2.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.contact-info-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.contact-info-card a {
    color: var(--primary);
    text-decoration: none;
    word-break: break-all;
    transition: all 0.3s ease;
}

.contact-info-card a:hover {
    text-decoration: underline;
}

/* Professional References */
.references-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.reference-card {
    position: relative;
    background: var(--bg-light);
    padding: 1.5rem 1.75rem;
    border-radius: 14px;
    border: 2px solid var(--border-light);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body.dark-mode .reference-card {
    background: var(--bg-dark);
    border-color: var(--border-dark);
}

.reference-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient);
}

.reference-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.reference-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.reference-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(234, 162, 57, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reference-icon i {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.4rem;
}

.reference-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    color: var(--primary);
}

.reference-role {
    font-weight: 600;
    font-size: 0.95rem;
}

.reference-organization {
    font-size: 0.9rem;
    opacity: 0.85;
}

.reference-body p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

.reference-body i {
    margin-right: 0.4rem;
    color: var(--primary);
}

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

.reference-body a:hover {
    text-decoration: underline;
}

.reference-note {
    margin-top: 0.4rem;
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Footer */
footer {
    background: var(--card-light);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid var(--border-light);
}

body.dark-mode footer {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 55px;
    height: 55px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section reveal: use only transform + opacity for cheap repaints */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .fade-in.visible {
        opacity: 1;
        transform: none;
    }
}

/* Responsive */
@media (max-width: 968px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
}

/* Backdrop blur only on larger screens (expensive on mobile) */
@media (min-width: 769px) {
    .navbar {
        backdrop-filter: blur(10px);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 70px);
        background: var(--bg-light);
        flex-direction: column;
        padding: 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    body.dark-mode .nav-links {
        background: var(--bg-dark);
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: block;
    }

    /* Mobile: no blur on shapes, lighter visuals */
    .shape {
        filter: none;
        animation: none;
    }

    .hero-image {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .projects-grid,
    .certificates-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3rem 1rem;
    }

    .hero {
        padding: 5rem 1rem 2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary,
    .btn-secondary {
        justify-content: center;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        justify-content: center;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 40px;
    }

    .timeline-marker {
        left: 1px;
    }

    .experience-header {
        flex-direction: column;
        text-align: center;
    }

    .experience-logo {
        width: 100px;
        height: 100px;
    }

    .scroll-top {
        width: 50px;
        height: 50px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .modal-body {
        padding: 2rem 1.5rem;
    }

    .modal-body h2 {
        font-size: 1.5rem;
    }

    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-screenshots {
        grid-template-columns: 1fr;
    }

    .modal-links {
        flex-direction: column;
    }

    .modal-btn {
        justify-content: center;
    }

    .project-filters {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}