/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=PP+Neue+Montreal:wght@300;400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@300;400;500;600&display=swap');

/* Root Variables */
:root {
    --primary-bg: #fafafa;
    --secondary-bg: #f5f5f5;
    --accent: #0047ff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b6b;
    --text-muted: #a0a0a0;
    --border: #e8e8e8;
    --gradient-1: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    --gradient-2: linear-gradient(135deg, rgba(240, 147, 251, 0.08) 0%, rgba(245, 87, 108, 0.08) 100%);
    --gradient-3: linear-gradient(135deg, rgba(79, 172, 254, 0.08) 0%, rgba(0, 242, 254, 0.08) 100%);
}

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

body {
    font-family: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    font-weight: 400;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #0a0a0a;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.2s cubic-bezier(0.86, 0, 0.07, 1);
}

.preloader.hidden {
    transform: translateY(-100%);
}

.preloader-content {
    text-align: center;
}

.preloader-text {
    font-family: 'Clash Display', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    overflow: hidden;
    display: flex;
    justify-content: center;
    gap: 0.05em;
    color: #f0f0f0;
}

.preloader-text span {
    display: inline-block;
    transform: translateY(120px);
    opacity: 0;
    animation: floatUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: calc(var(--i) * 0.04s);
}

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

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 2rem 4rem;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 1.5rem 4rem;
    background: rgba(250, 250, 250, 0.98);
}

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

.nav-logo {
    font-family: 'Clash Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 3rem;
    list-style: none;
}

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

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

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

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 4rem;
}

.floating-gradients {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.gradient-1 {
    width: 800px;
    height: 800px;
    background: var(--gradient-1);
    top: -400px;
    left: -400px;
}

.gradient-2 {
    width: 700px;
    height: 700px;
    background: var(--gradient-2);
    bottom: -350px;
    right: -350px;
    animation-delay: -8s;
}

.gradient-3 {
    width: 600px;
    height: 600px;
    background: var(--gradient-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -16s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    25% {
        transform: translate(50px, -30px) rotate(90deg) scale(1.1);
    }
    50% {
        transform: translate(-30px, 50px) rotate(180deg) scale(0.95);
    }
    75% {
        transform: translate(30px, 30px) rotate(270deg) scale(1.05);
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    opacity: 0;
    animation: fadeInUp 1.5s ease forwards;
    animation-delay: 2.5s;
}

.hero-content.no-delay {
    animation-delay: 0.3s;
}

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

.hero-title {
    font-family: 'Clash Display', serif;
    font-size: clamp(3.5rem, 12vw, 10rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 0.85;
    margin-bottom: 2rem;
    overflow: visible;
    position: relative;
    color: var(--text-primary);
}

.hero-title .line {
    display: block;
    overflow: hidden;
    position: relative;
}

.hero-title .line span {
    display: inline-block;
    color: var(--text-primary);
    transform: translateY(120%) rotateX(-80deg);
    transform-origin: bottom;
    animation: revealLine3D 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
    animation-delay: calc(2.8s + var(--line-delay));
    position: relative;
}

.hero-content.no-delay .hero-title .line span {
    animation-delay: calc(0.3s + var(--line-delay));
}

@keyframes revealLine3D {
    to {
        transform: translateY(0) rotateX(0);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 3.5s;
}

.hero-content.no-delay .hero-subtitle {
    animation-delay: 0.8s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hero-cta {
    display: inline-flex;
    gap: 2rem;
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 3.8s;
}

.hero-content.no-delay .hero-cta {
    animation-delay: 1s;
}

.btn {
    padding: 1rem 2.5rem;
    border: 1px solid var(--text-primary);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 50px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--text-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

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

.btn:hover::before {
    left: 0;
}

/* Sections */
section {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-title {
    font-family: 'Clash Display', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 4rem;
    color: var(--text-primary);
}

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

.project-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    background: var(--primary-bg);
}

.project-title {
    font-family: 'Clash Display', serif;
    font-size: 1.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Project links */
.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--primary-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--accent);
    color: var(--primary-bg);
    transform: translateY(-2px);
}

.project-link svg {
    width: 16px;
    height: 16px;
}

.project-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--primary-bg);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.project-card:hover .tech-tag {
    border-color: var(--text-secondary);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
}

.about-content.visible {
    animation: fadeInUp 1s ease forwards;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.about-image img:hover {
    filter: grayscale(0%);
}

.about-text h3 {
    font-family: 'Clash Display', serif;
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Stats */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.stat-item {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

.stat-item.visible {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

.stat-number {
    font-family: 'Clash Display', serif;
    font-size: 3.5rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    letter-spacing: 0.1em;
}

/* Why Choose Me Section */
.why-choose {
    padding: 8rem 4rem;
    background: var(--secondary-bg);
}

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

.why-card {
    background: var(--primary-bg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.why-card.visible {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: calc(var(--i) * 0.1s);
}

.why-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.why-card h3 {
    font-family: 'Clash Display', serif;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.why-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Skills Section */
.skills-container {
    background: var(--secondary-bg);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(30px);
}

.skills-container.visible {
    animation: fadeInUp 0.8s ease forwards;
}

.skills-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.skill-column {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.skill-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-label {
    font-family: 'Clash Display', serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
    position: relative;
}

.skill-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent);
    opacity: 0.5;
}

.skill-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.skill-list span {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.4;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
    padding-left: 12px;
}

.skill-list span::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: var(--accent);
}

.skill-list span:hover {
    color: var(--text-primary);
    padding-left: 20px;
}

.skill-list span:hover::before {
    opacity: 1;
}

@media (max-width: 968px) {
    .skills-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .skill-column:last-child {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-around;
    }
}

@media (max-width: 768px) {
    .skills-container {
        padding: 2rem;
    }
    
    .skills-columns {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .skill-column {
        gap: 2rem;
    }
    
    .skill-column:last-child {
        grid-column: 1;
        flex-direction: column;
    }
    
    .skill-label {
        font-size: 1rem;
    }
    
    .skill-list span {
        font-size: 0.9rem;
    }
}

/* Contact Section */
#contact {
    text-align: center;
    padding: 10rem 4rem;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.contact-email {
    font-family: 'Clash Display', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 3rem;
    transition: all 0.3s ease;
    position: relative;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.contact-email:hover {
    color: var(--accent);
}

.contact-email:hover::after {
    width: 100%;
}

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

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

.social-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s ease;
}

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

.social-links a:hover::after {
    width: 100%;
}

/* Footer */
footer {
    padding: 4rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--secondary-bg);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

/* All Projects View */
.all-projects {
    display: none;
    padding: 8rem 4rem 4rem;
    min-height: 100vh;
}

.all-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.back-btn {
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 25px;
}

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

.all-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* View All Button */
.view-all-container {
    text-align: center;
    margin-top: 4rem;
}

.view-all-btn {
    padding: 1rem 2.5rem;
    border: 1px solid var(--text-primary);
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50px;
}

.view-all-btn:hover {
    background: var(--text-primary);
    color: var(--primary-bg);
    transform: translateY(-2px);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        padding: 1.5rem 2rem;
    }

    .nav-links {
        display: none;
    }

    section {
        padding: 4rem 2rem;
    }

    .hero {
        padding: 2rem;
    }

    .hero-title {
        font-size: clamp(2.5rem, 8vw, 5rem);
    }

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

    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        max-width: 400px;
        margin: 0 auto;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .why-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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