/* =============================================
   MALEESHA DEVINDI - UI/UX PORTFOLIO
   Modern Minimal Black-Themed Design
   ============================================= */

/* ========== 1. ROOT VARIABLES & RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-dark: #0a0e27;
    --bg-darker: #05070f;
    --text-primary: #ffffff;
    --text-secondary: #b4b7c3;
    --accent-primary: #7c3aed;
    --accent-secondary: #06b6d4;
    --border-color: #1f2937;
    
    /* Fonts */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Poppins', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

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

/* ========== 2. TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

p {
    color: var(--text-secondary);
    font-weight: 400;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-secondary);
}

/* ========== 3. CONTAINER & LAYOUT ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-md);
    }
}

/* ========== 4. NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link:hover {
    color: var(--text-primary);
    width: 100%;
}

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

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

@media (max-width: 768px) {
    .nav-menu {
        display: flex;
    }
    
    .nav-toggle {
        display: none;
    }
}

/* ========== 5. HERO SECTION ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    position: relative;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    scroll-margin-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(30px); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    line-height: 1.1;
    animation: slideUp 0.8s ease-out;
}

.hero-line {
    display: block;
    opacity: 0;
    animation: slideUp 0.8s ease-out forwards;
}

.hero-line:nth-child(1) { animation-delay: 0.1s; }
.hero-line:nth-child(2) { animation-delay: 0.2s; }
.hero-line:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.8s ease-out 0.4s both;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
    animation: slideUp 0.8s ease-out 0.5s both;
}

.hero-scroll {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: bounce 2s infinite;
}

.hero-scroll span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
}

.scroll-indicator::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 2px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 1px;
    transform: translateX(-50%);
    animation: scrollDot 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes scrollDot {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(12px); opacity: 0; }
}

/* ========== 6. BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    z-index: -1;
}

.btn:hover::before {
    left: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

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

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

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
}

/* ========== 7. PROJECTS SECTION ========== */
.projects {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-dark);
    position: relative;
    scroll-margin-top: 80px;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--spacing-md);
    animation: slideUp 0.8s ease-out;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    animation: slideUp 0.8s ease-out 0.1s both;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

.project-card {
    group background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2);
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--border-color);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.2));
    opacity: 0;
    transition: var(--transition);
}

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

.project-content {
    padding: var(--spacing-lg);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.project-role {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
}

.project-arrow {
    font-size: 1.5rem;
    transition: var(--transition);
    transform: translateX(0);
}

.project-card:hover .project-arrow {
    transform: translateX(5px);
}

.project-title {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ========== 8. ABOUT SECTION ========== */
.about {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    position: relative;
    scroll-margin-top: 80px;
    overflow: hidden;
}

/* Animated background elements */
.about::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    z-index: 1;
}

.about::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 10s ease-in-out infinite reverse;
    z-index: 1;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

.about-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 480px;
}

.about-image {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    clip-path: circle(50%);
}

.profile-photo {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
    border: 8px solid white;
    box-shadow: 
        0 20px 60px rgba(124, 58, 237, 0.3),
        inset 0 0 30px rgba(124, 58, 237, 0.1);
    animation: photoGlow 5s ease-in-out infinite;
    transform: none !important;
}

@keyframes photoGlow {
    0%, 100% { 
        box-shadow: 
            0 20px 60px rgba(124, 58, 237, 0.3),
            inset 0 0 30px rgba(124, 58, 237, 0.1);
    }
    50% { 
        box-shadow: 
            0 30px 80px rgba(124, 58, 237, 0.4),
            inset 0 0 40px rgba(6, 182, 212, 0.2);
    }
}

.profile-photo:hover {
    box-shadow: 
        0 40px 100px rgba(124, 58, 237, 0.5),
        inset 0 0 50px rgba(6, 182, 212, 0.2);
}

.photo-frame {
    position: absolute;
    inset: -12px;
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.15));
    z-index: 1;
    animation: rotatingFrame 40s linear infinite, float 12s ease-in-out infinite;
    box-shadow: 
        0 0 30px rgba(124, 58, 237, 0.3),
        inset 0 0 20px rgba(6, 182, 212, 0.1);
}

@keyframes rotatingFrame {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.about-text {
    animation: slideUp 0.8s ease-out 0.1s both;
    position: relative;
    z-index: 2;
}

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

.about-paragraph {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
    color: var(--text-secondary);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-2xl);
    border-top: 1px solid var(--border-color);
}

.stat h3 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.stat p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ========== 9. JOURNEY SECTION ========== */
.journey {
    padding: var(--spacing-2xl) 0;
    background: var(--bg-dark);
    scroll-margin-top: 80px;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

@media (max-width: 768px) {
    .timeline::before {
        left: 7px;
    }
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-2xl);
    margin-left: var(--spacing-2xl);
    animation: slideUp 0.8s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }

.timeline-dot {
    position: absolute;
    left: -43px;
    top: 8px;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 3px solid var(--accent-primary);
    border-radius: 50%;
    transition: var(--transition);
}

.timeline-item:hover .timeline-dot {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
    transform: scale(1.3);
}

.timeline-content {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    padding: var(--spacing-lg);
    border-radius: 12px;
    transition: var(--transition);
}

.timeline-item:hover .timeline-content {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.1);
}

.timeline-content h3 {
    margin-bottom: var(--spacing-sm);
    color: var(--accent-primary);
}

.timeline-content p {
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .timeline-item {
        margin-left: var(--spacing-lg);
    }
    
    .timeline-dot {
        left: -31px;
    }
}

/* ========== 10. CONTACT SECTION ========== */
.contact {
    padding: var(--spacing-2xl) 0;
    scroll-margin-top: 80px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.contact-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    animation: slideUp 0.8s ease-out;
}

.contact-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--spacing-md);
}

.contact-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
}

.contact-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.contact-method:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 58, 237, 0.1);
    transform: translateY(-3px);
}

.contact-icon {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 11. FOOTER ========== */
.footer {
    padding: var(--spacing-xl) 0;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
}

.footer p {
    font-size: 0.9rem;
    margin: 0;
}

/* ========== 12. SCROLL REVEAL ANIMATIONS ========== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition: var(--transition);
}

/* ========== 13. RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
        --spacing-2xl: 3rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-cta {
        flex-direction: column;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 14. UTILITIES ========== */
.text-center {
    text-align: center;
}

.mt-large {
    margin-top: var(--spacing-2xl);
}

.mb-large {
    margin-bottom: var(--spacing-2xl);
}

/* ========== 15. ANIMATIONS ========== */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Smooth page load */
body {
    animation: pageLoad 0.5s ease-out;
}

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