/* ============================================
   CSS Custom Properties & Reset
   ============================================ */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --secondary: #f472b6;
    --accent: #34d399;
    --dark: #0f172a;
    --dark-lighter: #1e293b;
    --light: #f8fafc;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --card-bg: rgba(30, 41, 59, 0.8);
    --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

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

/* ============================================
   Main Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

section {
    padding: 6rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--transition), transform 0.8s var(--transition);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Navigation
   ============================================ */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    z-index: 100;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

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

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    transition: transform 0.3s var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

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

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

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

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

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero-content {
    max-width: 800px;
}

.greeting {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typing-container {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-muted);
    margin-bottom: 2rem;
    min-height: 2.5rem;
}

.typing-text {
    border-right: 3px solid var(--primary);
    padding-right: 5px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 50% { border-color: var(--primary); }
    51%, 100% { border-color: transparent; }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.6);
}

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

.btn-secondary:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* ============================================
   Scroll Indicator
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator svg {
    width: 30px;
    height: 30px;
    stroke: var(--text-muted);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ============================================
   Section Titles
   ============================================ */
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
    text-align: center;
}

.section-title span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Skills Section
   ============================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.skill-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    border: 1px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
    transition: all 0.4s var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.skill-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

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

.skill-card.clicked {
    animation: skillPop 0.6s ease;
}

@keyframes skillPop {
    0% { transform: scale(1); }
    30% { transform: scale(0.95); }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    transition: transform 0.4s var(--transition);
}

.skill-card:hover .skill-icon {
    transform: rotate(10deg) scale(1.1);
}

.skill-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.skill-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.skill-card p {
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.skill-particles {
    position: absolute;
    pointer-events: none;
}

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

.project-card {
    perspective: 1000px;
    height: 400px;
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s var(--transition);
    transform-style: preserve-3d;
    cursor: pointer;
}

.project-card:hover .project-card-inner {
    transform: rotateY(180deg);
}

.project-front,
.project-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.project-front {
    background: var(--card-bg);
    border: 1px solid rgba(99, 102, 241, 0.2);
    justify-content: space-between;
}

.project-back {
    background: var(--gradient);
    transform: rotateY(180deg);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.project-icon {
    width: 100px;
    height: 100px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.project-icon svg {
    width: 50px;
    height: 50px;
    stroke: var(--primary-light);
    fill: none;
    stroke-width: 1.5;
}

.project-front h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.project-front p {
    color: var(--text-muted);
    flex-grow: 1;
}

.project-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--primary-light);
}

.project-back h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-back p {
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.flip-hint {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flip-hint svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    animation: flipHint 2s ease infinite;
}

@keyframes flipHint {
    0%, 100% { transform: rotateY(0); }
    50% { transform: rotateY(180deg); }
}

/* ============================================
   Contact Section
   ============================================ */
.contact {
    text-align: center;
    padding-bottom: 4rem;
}

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

.contact p {
    color: var(--text-muted);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    border-radius: 50px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: all 0.3s var(--transition);
}

.contact-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.contact-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ============================================
   Footer
   ============================================ */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

footer span {
    color: var(--secondary);
}

/* ============================================
   Accessibility
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
