:root {
    --bg: #030712;
    --bg-surface: #0f172a;
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.2);
    --secondary: #818cf8;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
    --white: #ffffff;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    --glass: rgba(15, 23, 42, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    color: var(--white);
    line-height: 1.1;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 4rem;
    text-align: left;
    position: relative;
    letter-spacing: -0.02em;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--white);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 70% 30%, var(--primary-glow) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 30%);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 5rem;
}

.hero-text h1 {
    font-size: 5rem;
    background: linear-gradient(to bottom right, #fff 50%, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.hero-text h2 {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-text p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 550px;
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 400px;
    height: 400px;
    border-radius: 30px;
    object-fit: cover;
    filter: grayscale(0.2) contrast(1.1);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.hero-image::after {
    content: '';
    position: absolute;
    inset: -10px;
    border: 1px solid var(--primary);
    border-radius: 40px;
    z-index: -1;
    opacity: 0.3;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 6rem;
    align-items: flex-start;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.about-stats {
    display: grid;
    gap: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.skills-category {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
}

.skills-category:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--primary-glow);
    transform: translateY(-5px);
}

.skills-category h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.skill-tag:hover {
    background: var(--primary-glow);
    color: var(--primary);
    border-color: var(--primary);
}

/* Projects Section */
.projects-grid {
    display: grid;
    gap: 6rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 5rem;
    align-items: center;
}

.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even) .project-info {
    direction: ltr;
}

.project-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.project-image img {
    width: 100%;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover .project-image img {
    transform: scale(1.02);
    border-color: var(--primary);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg);
    border: 4px solid var(--secondary);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
    text-align: right;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    transition: var(--transition);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timeline-content:hover {
    border-color: var(--secondary);
}

/* Contact */
.contact-container {
    max-width: 650px;
    margin: 0 auto;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    color: var(--white);
}

.btn {
    padding: 1.25rem 2.5rem;
    background: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text,
.hero-image,
.stat-card,
.skills-category,
.project-card,
.timeline-content {
    animation: fadeInUp 0.8s ease-out forwards;
}

.skills-category:nth-child(2) {
    animation-delay: 0.1s;
}

.skills-category:nth-child(3) {
    animation-delay: 0.2s;
}

.skills-category:nth-child(4) {
    animation-delay: 0.3s;
}

.skills-category:nth-child(5) {
    animation-delay: 0.4s;
}

.skills-category:nth-child(6) {
    animation-delay: 0.5s;
}

.skills-category:nth-child(7) {
    animation-delay: 0.6s;
}

.skills-category:nth-child(8) {
    animation-delay: 0.7s;
}

.btn:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(129, 140, 248, 0.3);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Movement Class */
.reveal {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: all 0.8s cubic-bezier(0.2, 1, 0.2, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
    background: transparent;
    border: none;
    padding: 0;
}

.menu-toggle .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text);
    transition: var(--transition);
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 75%;
        max-width: 300px;
        background: var(--bg-surface);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
        border-left: 1px solid var(--border);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 1.5rem;
    }

    .hero-text h1 {
        font-size: 3.5rem;
    }

    .hero-content,
    .about-grid,
    .project-card {
        grid-template-columns: 1fr !important;
        gap: 3rem;
        direction: ltr !important;
    }

    .hero-image img {
        width: 100%;
        height: auto;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }

    .left {
        text-align: left;
    }
}