/* ===== Variables ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: rgba(18, 18, 28, 0.7);
    --text: #e8e8ed;
    --text-muted: #8a8a9a;
    --accent-1: #7c3aed;
    --accent-2: #06b6d4;
    --accent-3: #f472b6;
    --glow: rgba(124, 58, 237, 0.4);
    --glow-2: rgba(6, 182, 212, 0.3);
    --border: rgba(255, 255, 255, 0.08);
    --font-display: 'Syne', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== Noise Overlay ===== */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: 1000;
}

/* ===== Animated Background Orbs ===== */
.gradient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
    z-index: 0;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-1);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-2);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-3);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -30px); }
    50% { transform: translate(-20px, 20px); }
    75% { transform: translate(20px, 20px); }
}

/* ===== Header & Nav ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 2rem;
    transition: background 0.3s ease;
}

.header.scrolled {
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
}

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

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.logo-bracket {
    color: var(--accent-1);
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

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

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-2);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-title .title-line {
    display: block;
}

.title-accent {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.75rem;
    background: linear-gradient(135deg, var(--accent-1), #5b21b6);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--glow);
}

/* ===== Animation Utilities ===== */
.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

.animate-slide-up {
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 0.8s ease forwards;
}

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

/* ===== Projects Section ===== */
.projects-section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.75em;
    color: var(--accent-1);
    font-weight: 400;
}

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

/* ===== Project Cards ===== */
.project-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    overflow: hidden;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(124, 58, 237, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

.project-card[data-project="2"]::before {
    background: linear-gradient(135deg, transparent 40%, rgba(6, 182, 212, 0.05) 100%);
}

.project-card[data-project="2"]:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.card-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--accent-1);
    filter: blur(80px);
    opacity: 0;
    top: -50px;
    right: -50px;
    transition: opacity 0.5s ease;
}

.project-card:hover .card-glow {
    opacity: 0.15;
}

.project-card[data-project="2"] .card-glow {
    background: var(--accent-2);
}

.card-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 100% 0%, var(--accent-1) 0%, transparent 70%);
    opacity: 0.1;
}

.project-card[data-project="2"] .card-pattern {
    background: radial-gradient(circle at 100% 0%, var(--accent-2) 0%, transparent 70%);
}

.card-content {
    position: relative;
    z-index: 1;
}

.project-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-1);
    opacity: 0.8;
    margin-bottom: 1rem;
}

.project-card[data-project="2"] .project-number {
    color: var(--accent-2);
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: var(--text-muted);
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: gap 0.3s ease, color 0.3s ease;
}

.project-link:hover {
    gap: 0.75rem;
    color: var(--accent-1);
}

/* ===== About Section ===== */
.about-section {
    padding: 6rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

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

.about-text {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* ===== Footer ===== */
.footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Scroll Animations (JS-driven) ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
}

.reveal.active {
    animation: revealUp 0.7s ease forwards;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 280px;
        height: 100vh;
        background: rgba(18, 18, 28, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s ease;
        border-left: 1px solid var(--border);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-toggle {
        display: flex;
        z-index: 101;
    }

    .hero {
        padding: 5rem 1.5rem 3rem;
    }

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

    .project-card {
        padding: 1.5rem;
    }

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

@media (max-width: 480px) {
    .header .nav {
        padding: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 1.25rem;
    }
}
