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

:root {
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #666666;
    --text-tertiary: #444444;
    --accent: #6366f1;
    --accent-secondary: #a855f7;
    --accent-tertiary: #ec4899;
    --card-bg: #0d0d0d;
    --border-color: #1a1a1a;
    --border-light: #252525;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none;
}

body.loading {
    overflow: hidden;
}

a, button, input, textarea {
    cursor: none;
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

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

.preloader-logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 2rem;
}

.preloader-logo span {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preloader-bar {
    width: 200px;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.preloader-progress {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    animation: preloaderProgress 1.5s ease forwards;
}

@keyframes preloaderProgress {
    to {
        width: 100%;
    }
}

/* Noise Texture */
.noise {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.02;
    background-repeat: repeat;
    background-size: 128px 128px;
}

/* Animated Background */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

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

.blob-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.2));
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.15));
    bottom: -150px;
    left: -150px;
    animation-delay: -7s;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.15));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-30px, 30px) scale(0.95);
    }
    75% {
        transform: translate(-50px, -30px) scale(1.05);
    }
}

/* Custom Cursor */
.cursor {
    width: 8px;
    height: 8px;
    background: var(--text-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.1s ease;
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.2s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
}

.cursor.hover {
    transform: scale(3);
}

.cursor-follower.hover {
    width: 60px;
    height: 60px;
    border-color: var(--accent);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 1rem 4rem;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
}

.logo-text {
    letter-spacing: -1px;
}

.logo-ampersand {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.nav-link:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

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

.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    background: rgba(255, 255, 255, 0.02);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

.hero-title {
    font-size: clamp(3.5rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.title-line:nth-child(1) {
    animation-delay: 0.4s;
}

.title-line:nth-child(2) {
    animation-delay: 0.6s;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: fadeInUp 0.8s ease 0.6s forwards, gradientShift 5s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-tertiary);
    font-weight: 400;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
    margin-bottom: 3rem;
}

.hero-cta {
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

.hero-scroll {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.2s forwards;
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-indicator span {
    width: 3px;
    height: 8px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-secondary));
    border-radius: 2px;
    animation: scrollPulse 2s ease infinite;
}

.scroll-text {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.section-number {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    font-family: monospace;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
}

/* Projects Section */
.projects-section {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    height: 400px;
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-8px);
}

.card-background {
    position: absolute;
    inset: 0;
}

.card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0.4;
    transform: scale(1);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
    filter: grayscale(30%);
}

.project-card:hover .card-image {
    opacity: 0.55;
    transform: scale(1.05);
    filter: grayscale(0%);
}

.card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
    transition: background 0.6s ease;
}

.project-card:hover .card-image-overlay {
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.75) 100%
    );
}

.card-gradient {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.project-card:hover .card-gradient {
    opacity: 1;
}

.card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.03) 45%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.03) 55%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.project-card:hover .card-shine {
    transform: translateX(100%);
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 1px;
    background: linear-gradient(135deg, var(--border-color), transparent 50%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.5s ease;
}

.project-card:hover::before {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary), transparent 70%);
}

.card-content {
    position: relative;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.card-number {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
    font-family: monospace;
    margin-bottom: auto;
}

.card-info {
    margin-bottom: 1.5rem;
}

.card-category {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.project-card:hover .card-title {
    color: var(--text-primary);
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-tags {
    display: flex;
    gap: 0.5rem;
}

.card-tags span {
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.card-arrow {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    transform: translate(-10px, 10px) rotate(-45deg);
}

.card-arrow svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.project-card:hover .card-arrow {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
}

/* Card color variations */
.project-card[data-project="1"] .card-gradient {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), transparent 70%);
}

.project-card[data-project="2"] .card-gradient {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), transparent 70%);
}

.project-card[data-project="3"] .card-gradient {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), transparent 70%);
}

.project-card[data-project="4"] .card-gradient {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), transparent 70%);
}

.project-card[data-project="5"] .card-gradient {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), transparent 70%);
}

.project-card[data-project="6"] .card-gradient {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), transparent 70%);
}

/* Contact Section */
.contact-section {
    padding: 8rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.contact-content {
    text-align: center;
    padding: 6rem 2rem;
}

.contact-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -2px;
    line-height: 1.1;
}

.contact-title span {
    display: block;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-primary);
    text-decoration: none;
    padding: 1.25rem 2.5rem;
    border: 1px solid var(--border-light);
    border-radius: 60px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    background: rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.contact-email::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.email-text, .email-icon {
    position: relative;
    z-index: 1;
}

.email-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.contact-email:hover {
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2);
}

.contact-email:hover::before {
    opacity: 1;
}

.contact-email:hover .email-icon svg {
    transform: translateX(4px);
}

/* Phone contact */
.contact-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.contact-phone:hover {
    color: var(--text-primary);
}

.phone-text {
    letter-spacing: 0.5px;
}

/* Footer */
.footer {
    padding: 2rem 4rem;
    border-top: 1px solid var(--border-color);
}

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

.footer-copy {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.footer-links span {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scrollPulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.3;
        transform: translateY(8px);
    }
}

/* Scroll animations */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 1s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.5rem;
    }

    .navbar.scrolled {
        padding: 0.75rem 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .hero-title {
        letter-spacing: -2px;
    }

    .projects-section,
    .contact-section {
        padding: 4rem 1.5rem;
    }

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

    .project-card {
        height: 350px;
    }

    .card-image {
        opacity: 0.35;
    }

    .project-card:hover .card-image {
        opacity: 0.45;
        transform: scale(1);
    }

    .contact-content {
        padding: 3rem 1rem;
    }

    .footer {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cursor,
    .cursor-follower {
        display: none;
    }

    body,
    a, button, input, textarea {
        cursor: auto;
    }

    .blob {
        opacity: 0.3;
    }

    .blob-1 {
        width: 300px;
        height: 300px;
    }

    .blob-2 {
        width: 250px;
        height: 250px;
    }

    .blob-3 {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-badge {
        font-size: 0.7rem;
        padding: 0.5rem 1rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

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

    .btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--text-primary);
}

/* Smooth page transitions */
.page-transition {
    animation: pageIn 0.6s ease forwards;
}

@keyframes pageIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
