:root {
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --primary-color: #10b981;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --font-sans: 'Geist', sans-serif;
    --font-mono: 'Space Mono', monospace;
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #0ea5e9 100%);
    --gradient-bg: radial-gradient(circle at top left, rgba(16, 185, 129, 0.1), transparent 40%),
                   radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.1), transparent 40%);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --shadow-default: rgba(0, 0, 0, 0.15);
    --shadow-hover: rgba(0, 0, 0, 0.25);
    --shadow-hero: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] {
    --bg-color: #020617;
    --surface-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #1e293b;
    --gradient-bg: radial-gradient(circle at top left, rgba(16, 185, 129, 0.15), transparent 40%),
                   radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.15), transparent 40%);
    --glass-bg: rgba(15, 23, 42, 0.4);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-default: rgba(255, 255, 255, 0.08);
    --shadow-hover: rgba(255, 255, 255, 0.15);
    --shadow-hero: rgba(255, 255, 255, 0.12);
}

/* Theme toggle styling */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}
.theme-toggle-btn:hover {
    background-color: var(--surface-color);
}
[data-theme="dark"] #moon-icon {
    display: block !important;
}
[data-theme="dark"] #sun-icon {
    display: none !important;
}


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

body {
    background-color: var(--bg-color);
    background-image: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: #022c22;
    padding: 8px 16px;
    z-index: 9999;
    font-weight: 700;
    border-bottom-right-radius: 4px;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* Header */
header {
    padding: 24px 0;
    border-bottom: 1px solid var(--glass-border);
    background-color: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 24px;
}

.links {
    display: flex;
    gap: 24px;
}

.links a {
    font-size: 16px;
}

/* Sections */
.hero-section, .projects-section, .experience-section, .services-section, .testimonials-section {
    padding: 120px 0;
}
.clients-section {
    padding: 60px 0;
}

.clients-logo {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.clients-logo:hover {
    opacity: 1;
}

.clients-logo img {
    width: 120px;
    height: 50px;
    object-fit: contain;
    filter: grayscale(100%) drop-shadow(0 4px 6px var(--shadow-default));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.clients-logo img:hover {
    filter: grayscale(0%) drop-shadow(0 8px 15px var(--shadow-hover));
    transform: scale(1.1);
}

/* Hero Section */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-wrapper {
    display: flex;
    flex-direction: column-reverse;
    gap: 3rem;
    align-items: center;
    padding-top: 2rem;
}

@media (min-width: 768px) {
    .hero-wrapper {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 4rem;
        padding-top: 0;
    }
}

.hero-image-container {
    text-align: center;
}

.hero-image {
    width: 100%;
    max-width: 320px;
    filter: grayscale(20%) drop-shadow(0 20px 20px var(--shadow-hero));
    transition: all 0.4s ease;
}

.hero-image:hover {
    filter: grayscale(0%) drop-shadow(0 30px 30px rgba(16, 185, 129, 0.4));
    transform: translateY(-10px);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 40px;
    letter-spacing: -0.04em;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 64px;
    }
}

.hero-subtitle {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 24px;
}

.hero-value {
    max-width: 600px;
    font-size: 18px;
    margin-bottom: 40px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #020617;
    border: none;
}

.btn-primary:hover {
    background-color: #0ea5e9;
    color: #020617;
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
}

/* Footer Section */
.footer-section {
    padding: 120px 0 60px;
    border-top: 1px solid var(--border-color);
    background-color: var(--surface-color);
}

.section-title {
    font-size: 32px;
    margin-bottom: 16px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 80px;
}

@media (min-width: 768px) {
    .contact-links {
        flex-direction: row;
        gap: 32px;
    }
}

.contact-item {
    display: flex;
    flex-direction: column;
}

.contact-item .label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 4px;
}

.contact-item .value {
    font-size: 18px;
    color: var(--text-primary);
}

.copyright {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

/* Project Filters */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.project-card.hide {
    display: none;
}

/* Projects Showcase */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 40px;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

@media (hover: hover) {
    .project-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(16, 185, 129, 0.15);
        border-color: rgba(16, 185, 129, 0.3);
    }
}

.project-image-placeholder {
    height: 200px;
    background-color: #1e293b;
    width: 100%;
    position: relative;
}

.project-client-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 40px;
}

.project-client-badge img {
    max-height: 20px;
    width: auto;
    object-fit: contain;
}

/* Dynamic Placeholder Gradients */
.bg-gradient-green { background: linear-gradient(135deg, #10b981 0%, #064e3b 100%); }
.bg-gradient-blue { background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%); }
.bg-gradient-purple { background: linear-gradient(135deg, #8b5cf6 0%, #4c1d95 100%); }
.bg-gradient-orange { background: linear-gradient(135deg, #f97316 0%, #7c2d12 100%); }
.bg-gradient-red { background: linear-gradient(135deg, #ef4444 0%, #7f1d1d 100%); }
.bg-gradient-cyan { background: linear-gradient(135deg, #0ea5e9 0%, #0c4a6e 100%); }

.project-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 24px;
    margin-bottom: 12px;
}

.project-description {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.tag {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-family: var(--font-mono);
}

.project-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: auto;
}

.project-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    line-height: 1.2;
}

.icon-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.icon-link:hover {
    color: var(--primary-color);
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
@media (min-width: 768px) {
    .services-grid { gap: 32px; }
}
.service-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px var(--shadow-default);
    border-color: rgba(16, 185, 129, 0.3);
}
.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    margin-bottom: 24px;
    transition: transform 0.3s ease, background 0.3s ease;
}
.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-5deg);
    background: var(--primary-color);
    color: #fff;
}
.service-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.service-desc {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Experience Timeline */
.timeline {
    position: relative;
    margin-top: 40px;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 48px;
    background-color: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: 0.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px; /* 24px padding + 1px half width - 6px half dot */
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid var(--bg-color);
}

.timeline-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.timeline-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.timeline-logo {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.timeline-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (min-width: 768px) {
    .timeline-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
    .timeline-header-main {
        margin-bottom: 0;
    }
}

.timeline-title {
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-company {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 600;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

@media (min-width: 768px) {
    .timeline-date {
        margin-top: 0;
    }
}

.timeline-points {
    list-style-type: disc;
    padding-left: 20px;
    color: var(--text-secondary);
}

.timeline-points li {
    margin-bottom: 8px;
    font-size: 16px;
}

/* Hamburger & Responsive Nav */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.hamburger span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(15, 23, 42, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 32px;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 100;
    }

    .links.active {
        transform: translateY(0);
    }

    .links a {
        font-size: 24px;
    }

    /* Hamburger animation */
    .hamburger.active span {
        background-color: #ffffff;
    }
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Reduce section padding on mobile by 50% */
    .hero-section, .projects-section, .experience-section {
        padding: 60px 0;
    }
    
    .footer-section {
        padding: 60px 0 30px;
    }

    /* Make hero section more compact */
    .hero-wrapper {
        gap: 1.5rem;
    }
    
    .hero-image {
        max-width: 220px;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .hero-subtitle {
        font-size: 20px;
        margin-bottom: 16px;
    }
    
    .hero-value {
        font-size: 16px;
        margin-bottom: 24px;
    }
    
    .badge {
        margin-bottom: 16px;
    }
}

/* Animations and Interactions */
@media (prefers-reduced-motion: no-preference) {
    /* Micro-animations for buttons */
    .btn {
        transition: all 0.3s ease-out;
    }
    
    .btn:hover {
        transform: scale(1.05);
        filter: brightness(1.1);
    }
    
    /* Project cards micro-animation (override existing) */
    .project-card {
        transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    }
    
    .project-card:hover {
        transform: translateY(-5px) !important;
        box-shadow: 0 16px 32px rgba(16, 185, 129, 0.25) !important;
    }
    
    /* Links underline animation */
    .links a, .icon-link, .contact-item .value {
        position: relative;
    }
    
    .links a::after, .icon-link::after, .contact-item .value::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: width 0.3s ease-out;
    }
    
    .links a:hover::after, .icon-link:hover::after, .contact-item:hover .value::after {
        width: 100%;
    }
    
    /* Scroll Reveal */
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    
    .reveal.active {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Case Study Modals */
.case-study-modal {
    margin: auto;
    padding: 32px;
    border: 1px solid var(--glass-border);
    border-radius: 0.5rem;
    background-color: var(--surface-color);
    color: var(--text-secondary);
    max-width: 600px;
    width: 90%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.case-study-modal::backdrop {
    background-color: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.case-study-modal h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 28px;
}

.case-study-modal h3 {
    color: var(--primary-color);
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 20px;
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal-btn:hover {
    color: var(--primary-color);
}

nav .links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav .links a:hover {
    color: var(--primary-color);
}

nav .links a.highlight-link {
    background: var(--primary-color);
    color: #022c22;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
}

nav .links a.highlight-link:hover {
    background: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

button:focus-visible, a:focus-visible {
    outline: 2px solid var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px var(--shadow-default);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--text-primary);
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}
