@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Sora:wght@400;600;700;800&display=swap');

:root {
    /* Colors */
    --bg: #0a0a0b;
    --surface: #161618;
    --surface-hover: #1c1c1f;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #8b5cf6;
    --accent: #10b981;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(22, 22, 24, 0.7);
    
    /* Spacing & Sizing */
    --container-max: 1200px;
    --section-padding: 80px 20px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

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

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    mask-image: radial-gradient(circle at 50% 50%, black, transparent 80%);
}

.bg-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.bg-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    opacity: 0.2;
    animation: drift 20s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    right: -5%;
    animation-duration: 25s;
}

.blob-2 {
    background: var(--secondary);
    bottom: 10%;
    left: -5%;
    animation-delay: -5s;
}

.blob-3 {
    background: var(--accent);
    top: 40%;
    left: 40%;
    width: 300px;
    height: 300px;
    animation-duration: 30s;
    animation-delay: -10s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 50px) scale(1.1); }
}

h1, h2, h3, h4 {
    font-family: 'Sora', sans-serif;
    line-height: 1.2;
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--section-padding);
}

/* Glassmorphism Utility */
.glass {
    background: var(--glass);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Sora', sans-serif;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
    filter: brightness(1.1);
}

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

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--text-muted);
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
}

header.scrolled {
    padding: 10px 0;
    background: rgba(10, 10, 11, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Sora', sans-serif;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
    color: var(--text);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.lang-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.lang-btn:hover, .lang-btn.active {
    color: var(--primary);
}

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

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 1000px;
}

.hero-tag {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
    display: block;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.hero-title span.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 20px;
}

.bento-item {
    padding: 30px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.bento-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.05) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bento-item:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.5);
    background: var(--surface-hover);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px -5px var(--primary-glow);
}

.bento-item:hover::before {
    opacity: 1;
}

.project-link-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.bento-item:hover .project-link-icon {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(45deg);
    box-shadow: 0 0 20px var(--primary-glow);
}

.bento-1-1 { grid-column: span 1; grid-row: span 1; }
.bento-2-1 { grid-column: span 2; grid-row: span 1; }
.bento-2-2 { grid-column: span 2; grid-row: span 2; }
.bento-1-2 { grid-column: span 1; grid-row: span 2; }
.bento-4-2 { grid-column: span 4; grid-row: span 2; }

/* Sections titles */
.section-header {
    margin-bottom: 60px;
}

.section-tag {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: block;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Forms */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Footer & Contact */
.footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
}

.social-link {
    font-size: 1.5rem;
    color: var(--text-muted);
}

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

/* Responsive */
@media (max-width: 992px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links { 
        display: none; 
        position: fixed;
        top: 0;
        right: 0;
        width: 70%;
        height: 100vh;
        background: var(--surface);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        z-index: 1000;
        border-left: 1px solid var(--border);
        transition: transform 0.30s cubic-bezier(0.4, 0, 0.2, 1);
        transform: translateX(100%);
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    .menu-toggle { display: block; }
    .nav-btn { display: none; }
    .hero-title { font-size: 3rem; }
    .bento-grid { grid-template-columns: 1fr; }
    .bento-1-1, .bento-2-1, .bento-2-2, .bento-1-2, .bento-4-2 { grid-column: span 1; }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 90px; /* Changed to top to avoid header overlap */
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
    min-width: 300px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-success {
    border-left: 4px solid var(--accent);
}

.toast-success .toast-icon {
    color: var(--accent);
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Sora', sans-serif;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
}