:root {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-primary: #0284c7;
    --color-primary-hover: #0369a1;
    --color-secondary: #e2e8f0;
    --color-secondary-text: #0f172a;
    --color-border: #e2e8f0;
    
    --gradient-brand: linear-gradient(135deg, #0ea5e9, #3b82f6);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --font-sans: 'DM Sans', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-primary: #38bdf8;
    --color-primary-hover: #7dd3fc;
    --color-secondary: #334155;
    --color-secondary-text: #f8fafc;
    --color-border: #334155;
    
    --gradient-brand: linear-gradient(135deg, #38bdf8, #818cf8);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
}

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

body.preload * {
    transition: none !important;
}

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.grid .card:nth-child(1) { transition-delay: 0.1s; }
.grid .card:nth-child(2) { transition-delay: 0.2s; }
.grid .card:nth-child(3) { transition-delay: 0.3s; }

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

main.page-loaded {
    opacity: 1;
}

main.page-exit {
    opacity: 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navbar */
.navbar {
    background-color: transparent;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-text);
}

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

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

.nav-links a {
    color: var(--color-text);
    font-weight: 600;
    opacity: 0.8;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#theme-toggle:hover {
    background-color: var(--color-secondary);
}

#lang-toggle {
    background: none;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

#lang-toggle:hover {
    background: var(--gradient-brand);
    border-color: transparent;
    color: #fff;
    transform: translateY(-1px);
}

#lang-toggle #lang-label {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#lang-toggle:hover #lang-label {
    background: none;
    -webkit-text-fill-color: #fff;
    color: #fff;
}


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

.aurora-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.8;
    animation: aurora-drift 15s infinite alternate ease-in-out;
}

.aurora-1 {
    top: -10%; left: -10%;
    width: 600px; height: 600px;
    background: rgba(14, 165, 233, 0.2);
    animation-delay: 0s;
}

.aurora-2 {
    bottom: -20%; right: -10%;
    width: 500px; height: 500px;
    background: rgba(59, 130, 246, 0.2);
    animation-delay: -5s;
    animation-direction: alternate-reverse;
}

.aurora-3 {
    top: 30%; left: 50%;
    width: 400px; height: 400px;
    background: rgba(99, 102, 241, 0.15);
    animation-delay: -10s;
}

[data-theme="dark"] .aurora-blob { opacity: 0.45; }
[data-theme="dark"] .aurora-1 { background: rgba(56, 189, 248, 0.3); }
[data-theme="dark"] .aurora-2 { background: rgba(99, 102, 241, 0.3); }
[data-theme="dark"] .aurora-3 { background: rgba(139, 92, 246, 0.2); }

@keyframes aurora-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 15%) scale(1.1); }
}

.hero-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw + 1rem, 4.2rem);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    color: var(--color-text-muted);
    margin: 0 auto 40px auto;
    max-width: 800px;
}

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

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}

[data-theme="dark"] .status-badge {
    background-color: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    backdrop-filter: blur(8px);
}

.status-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--color-secondary);
    color: var(--color-secondary-text);
}

.btn-secondary:hover {
    background: var(--color-border);
    transform: translateY(-2px);
    color: var(--color-secondary-text);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    text-align: center;
}

/* Grid & Cards */
.grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.interest-card {
    text-align: center;
}

.interest-card h3 {
    margin-bottom: 14px;
}

.card-icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--color-secondary);
    color: var(--color-primary);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.interest-card:hover .card-icon-box {
    transform: scale(1.1) rotate(-5deg);
    background: var(--gradient-brand);
    color: #fff;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-icon-box {
    background: rgba(56, 189, 248, 0.1);
}

/* Forms */
.contact-card {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input, 
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form .btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-text);
    border: 1px solid #10b981;
}

.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-text);
    border: 1px solid #ef4444;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Projects specific */
.page-title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.page-description {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin-bottom: 60px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.badge-commercial {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.badge-public {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.tag {
    background-color: var(--color-secondary);
    color: var(--color-secondary-text);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.card-title {
    margin-bottom: 10px;
}

.card-summary {
    color: var(--color-text-muted);
}

.btn-link {
    font-weight: 600;
    display: inline-block;
    margin-top: 10px;
}

/* Footer */
.footer {
    padding: 40px 0;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-text-muted);
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: var(--color-text-muted);
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        margin: 0 auto 30px auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-surface);
        padding: 20px;
        flex-direction: column;
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-md);
        text-align: center;
        gap: 15px;
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block !important;
    }
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

/* Tech Stack Marquee */
.tech-section {
    padding: 0 0 80px 0;
    overflow: hidden;
}

.tech-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

@keyframes antigravity-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.tech-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: default;
    animation: antigravity-float 4s ease-in-out infinite;
}

.tech-pill:nth-child(3n+1) { animation-delay: 0s; animation-duration: 4.2s; }
.tech-pill:nth-child(3n+2) { animation-delay: 1.2s; animation-duration: 3.8s; }
.tech-pill:nth-child(3n) { animation-delay: 2.5s; animation-duration: 4.5s; }

.tech-pill:hover {
    animation-play-state: paused;
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
    transform: translateY(-5px) scale(1.05);
}

.tech-pill:hover span {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .tech-pill {
    background-color: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(5px);
}

/* Tooltips */
[data-tooltip] {
    position: relative;
    cursor: default;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: var(--color-surface);
    color: var(--color-text);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    z-index: 10;
    pointer-events: none;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

[data-theme="dark"] [data-tooltip]::after {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
}
