/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    /* Colors */
    --bg-color: #050507;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    
    /* Accents */
    --accent-cyan: #00f0ff;
    --accent-purple: #8a2be2;
    --accent-gradient: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Layout */
    --max-width: 1400px;
}

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

html {
    scroll-behavior: smooth;
    cursor: none; /* Custom cursor */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==========================================================================
   Custom Cursor
   ========================================================================== */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-cyan);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-purple);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover state for cursor */
body.cursor-hover .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(138, 43, 226, 0.1);
    border-color: var(--accent-cyan);
}

body.cursor-view .cursor-outline {
    width: 80px;
    height: 80px;
    background-color: rgba(0, 240, 255, 0.1);
    border-color: transparent;
}
body.cursor-view .cursor-outline::after {
    content: 'VIEW';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 2px;
}

/* ==========================================================================
   Background Effects
   ========================================================================== */
.bg-glow {
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
    animation: float 20s infinite alternate ease-in-out;
}

.bg-glow-1 {
    top: -20%;
    left: -10%;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
}

.bg-glow-2 {
    bottom: -20%;
    right: -10%;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* ==========================================================================
   Navigation
   ========================================================================== */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(5,5,7,0.8), transparent);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

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

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

/* ==========================================================================
   Hero Section
   ========================================================================== */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 5%;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding-top: 80px;
}

.hero-content {
    flex: 1;
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0;
}

.name {
    display: inline-block;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--accent-cyan);
    font-weight: 400;
    margin-bottom: 2rem;
}

.bio {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 3rem;
}

/* Buttons */
.cta-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    border-color: var(--accent-purple);
    background: rgba(138, 43, 226, 0.05);
}

/* Hero Image */
.hero-image-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--glass-shadow);
}

.image-card {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 4/5;
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    transform: translateZ(20px);
}

/* ==========================================================================
   Projects Section (Masonry)
   ========================================================================== */
.projects {
    padding: 8rem 0;
}

.section-header {
    margin-bottom: 4rem;
    text-align: center;
}

.section-header h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    grid-auto-flow: dense;
}

.project-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transform-style: preserve-3d;
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Creating masonry effect by making some items span more rows */
.project-item:nth-child(even) {
    grid-row: span 2;
}

.project-img-wrapper {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

.project-item:nth-child(even) .project-img-wrapper {
    min-height: 500px;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-item:hover .project-img-wrapper img {
    transform: scale(1.05);
}

.glass-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.project-item:hover .glass-overlay {
    transform: translateY(0);
    opacity: 1;
}

.glass-overlay h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.glass-overlay p {
    color: var(--accent-cyan);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about {
    padding: 4rem 0 8rem 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content .glass-card {
    padding: 3rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 5rem;
}

/* ==========================================================================
   Animations
   ========================================================================== */
.reveal-text, .reveal-item, .reveal-image {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-text.active, .reveal-item.active, .reveal-image.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .hero {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }
    
    .bio {
        margin: 0 auto 3rem auto;
    }
    
    .cta-group {
        justify-content: center;
    }
    
    .cursor-dot, .cursor-outline {
        display: none; /* Disable custom cursor on mobile/tablet */
    }
    
    html {
        cursor: auto;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }
    
    .masonry-grid {
        grid-template-columns: 1fr;
    }
    
    .project-item:nth-child(even) {
        grid-row: auto;
    }
    
    .project-item:nth-child(even) .project-img-wrapper {
        min-height: 300px;
    }
    
    .glass-overlay {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    }
}
