/* 
  Unique Portfolio Design System
  Fonts: Space Grotesk (Primary), JetBrains Mono (Terminal)
  Theme: Dark with Glassmorphism & Interactive Elements
*/

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Enhanced Color System */
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;

    /* Vibrant Accent Colors */
    --accent-primary: #8b5cf6;
    /* Purple */
    --accent-secondary: #06b6d4;
    /* Cyan */
    --accent-coral: #ff6b6b;
    /* Coral */
    --accent-turquoise: #4ecdc4;
    /* Turquoise */
    --accent-yellow: #ffe66d;
    /* Yellow */
    --accent-mint: #a8e6cf;
    /* Mint */

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    --gradient-warm: linear-gradient(135deg, #ff6b6b 0%, #ffe66d 100%);
    --gradient-cool: linear-gradient(135deg, #4ecdc4 0%, #8b5cf6 100%);
    --gradient-mesh: radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.2) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(255, 107, 107, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(168, 230, 207, 0.2) 0px, transparent 50%);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.5);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-primary);
    background-image: var(--gradient-mesh);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
    /* Custom cursor */
}

/* Custom Cursor */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: all 0.1s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.15s ease;
    transform: translate(-50%, -50%);
}

.cursor.active {
    transform: translate(-50%, -50%) scale(1.5);
    background: rgba(139, 92, 246, 0.2);
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }

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

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.8;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: all var(--transition-normal);
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.header.scrolled {
    padding: 1rem 0;
    background: rgba(10, 10, 10, 0.9);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width var(--transition-normal);
}

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

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu.active {
    right: 0;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.close-menu:hover {
    color: var(--accent-primary);
    transform: rotate(90deg);
}

.mobile-nav-links {
    text-align: center;
}

.mobile-nav-links li {
    margin: 2.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInMobile 0.5s forwards;
}

.mobile-nav-links li:nth-child(1) {
    animation-delay: 0.1s;
}

.mobile-nav-links li:nth-child(2) {
    animation-delay: 0.2s;
}

.mobile-nav-links li:nth-child(3) {
    animation-delay: 0.3s;
}

.mobile-nav-links li:nth-child(4) {
    animation-delay: 0.4s;
}

.mobile-nav-links li:nth-child(5) {
    animation-delay: 0.5s;
}

.mobile-nav-links a {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* Hero Section - Split Screen */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.terminal-section {
    position: relative;
    z-index: 1;
}

.terminal {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.terminal-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--glass-border);
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-button.red {
    background: #ff5f56;
}

.terminal-button.yellow {
    background: #ffbd2e;
}

.terminal-button.green {
    background: #27c93f;
}

.terminal-body {
    color: var(--accent-mint);
    font-size: 0.95rem;
    line-height: 1.8;
    min-height: 300px;
}

.terminal-line {
    margin-bottom: 0.5rem;
}

.terminal-prompt {
    color: var(--accent-primary);
    margin-right: 0.5rem;
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--accent-primary);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

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

.hero h1 {
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

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

.about-content p {
    font-size: 1.25rem;
    line-height: 2;
}

/* Skills Section - Interactive Orbs */
.skills {
    position: relative;
    min-height: 80vh;
}

.skills-container {
    position: relative;
    width: 100%;
    height: 600px;
    margin-top: 4rem;
}

.skill-orb {
    position: absolute;
    padding: 1.5rem 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    will-change: transform;
}

.skill-orb:hover {
    transform: scale(1.15) !important;
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--accent-primary);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.skill-orb i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

/* Projects Section - Bento Grid */
.projects {
    background: var(--bg-secondary);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 300px;
    gap: 1.5rem;
    margin-top: 4rem;
}

.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Bento Grid Sizes */
.project-card.large {
    grid-column: span 2;
    grid-row: span 2;
}

.project-card.wide {
    grid-column: span 2;
}

.project-card.tall {
    grid-row: span 2;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 0;
}

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

.project-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(-10px);
}

.project-info {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.project-info p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

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

.tags span {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.tags span:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Experience Section - Horizontal Scroll */
.experience {
    overflow: hidden;
}

.experience-scroll-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 2rem 0;
    margin-top: 3rem;
    -webkit-overflow-scrolling: touch;
}

.experience-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.experience-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.experience-scroll-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

.timeline-item {
    min-width: 400px;
    scroll-snap-align: start;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: all var(--transition-normal);
    position: relative;
}

.timeline-item:hover {
    transform: scale(1.05);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.timeline-date {
    color: var(--accent-primary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.timeline-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.timeline-content p {
    font-size: 1rem;
    line-height: 1.7;
}

/* Contact Section */
.contact {
    text-align: center;
}

.contact h2 {
    margin-bottom: 2rem;
}

.contact p {
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

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

.social-links a {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.social-links a:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--gradient-main);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

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

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

/* 3D Card Tilt Effect */
.tilt-card {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card.large {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 968px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 120px;
    }

    .terminal-section {
        order: 2;
    }

    .hero-content {
        order: 1;
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .timeline-item {
        min-width: 320px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        /* Changed from 250px to auto */
        gap: 1.5rem;
    }

    .project-card {
        min-height: auto;
        /* Allow cards to size based on content */
        padding: 1.5rem;
        /* Slightly reduce padding for mobile */
    }

    .project-card.large,
    .project-card.wide,
    .project-card.tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .project-info h3 {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .project-info p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .tags {
        margin-top: auto;
        /* Push tags to bottom */
    }

    .tags span {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .skills-container {
        height: auto;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .skill-orb {
        position: static !important;
        transform: none !important;
    }

    section {
        padding: var(--spacing-lg) 0;
    }

    /* Improve terminal on mobile */
    .terminal {
        font-size: 0.85rem;
    }

    .terminal-body {
        min-height: 200px;
    }

    /* Better spacing for hero on mobile */
    .hero {
        padding-top: 100px;
    }

    .hero p {
        font-size: 1.125rem;
    }
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .timeline-item {
        min-width: 280px;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}