/* ============================================
   S.Roobin Portfolio — Premium Animated Design
   ============================================ */

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

:root {
    --primary: #00d4ff;
    --primary-dark: #0099cc;
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --gradient-primary: linear-gradient(135deg, #00d4ff, #7c3aed);
    --gradient-hero: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 40%, #0d1b2a 100%);
    --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --text-heading: #f1f5f9;
    --bg-primary: #0a0e27;
    --bg-section: #0f1535;
    --bg-section-alt: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 212, 255, 0.3);
    --navbar-bg: rgba(10, 14, 39, 0.85);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --text-color: #1e293b;
    --text-muted: #64748b;
    --text-heading: #0f172a;
    --bg-primary: #f8fafc;
    --bg-section: #ffffff;
    --bg-section-alt: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(0, 212, 255, 0.4);
    --navbar-bg: rgba(248, 250, 252, 0.9);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.1);
    --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 40%, #f1f5f9 100%);
    --gradient-card: linear-gradient(135deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
}

html {
    scroll-behavior: smooth;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-heading);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.section-title:hover::after {
    width: 100px;
}

/* ==================
   Gradient Text
   ================== */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================
   Navigation
   ================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.navbar.scroll-down {
    transform: translateY(-100%);
}

.navbar.scroll-up {
    transform: translateY(0);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 0.25rem 0;
}

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

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

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

/* Theme Toggle */
.theme-toggle-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: var(--transition);
}

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

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

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ==================
   Hero Section
   ================== */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    background: var(--gradient-hero);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Floating geometric shapes behind the hero */
.hero::before,
.hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: 0;
    animation: float 8s ease-in-out infinite;
}

.hero::before {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.hero::after {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -100px;
    left: -100px;
    animation-delay: -4s;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.03em;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero h1 .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .role-text {
    font-size: 1.6rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
    animation: fadeInUp 1s ease 0.4s both;
}

.typed-text {
    color: var(--primary);
    font-weight: 600;
}

.cursor-blink {
    display: inline-block;
    width: 3px;
    height: 1.4em;
    background: var(--primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 2rem;
    animation: fadeInUp 1s ease 0.6s both;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease 0.8s both;
}

.btn {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: none;
}

.btn.primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn.primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn.primary:hover::before {
    left: 100%;
}

.btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
}

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

.btn.secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
}

/* ==================
   Profile Image
   ================== */
.profile-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    animation: fadeInUp 1s ease both;
}

.profile-image::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: var(--gradient-primary);
    z-index: -1;
    animation: spin 4s linear infinite;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    transition: transform 0.5s ease;
}

.profile-image:hover img {
    transform: scale(1.08);
}

/* ==================
   About Section
   ================== */
.about {
    padding: 6rem 5%;
    background-color: var(--bg-section);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.stat h3 {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

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

/* ==================
   Skills Section
   ================== */
.skills {
    padding: 6rem 5%;
    background-color: var(--bg-section-alt);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
}

.skill-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.skill-category h3 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
}

.skill-category ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-category li {
    padding: 0.4rem 1rem;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    font-size: 0.88rem;
    color: var(--text-color);
    transition: var(--transition);
}

.skill-category li:hover {
    background: rgba(0, 212, 255, 0.18);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ==================
   Projects Section
   ================== */
.projects {
    padding: 6rem 5%;
    background-color: var(--bg-section);
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.project-image {
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.project-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(10, 14, 39, 0.6));
    pointer-events: none;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tech span {
    padding: 0.3rem 0.8rem;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--primary);
    transition: var(--transition);
}

.project-tech span:hover {
    background: rgba(0, 212, 255, 0.18);
}

/* ==================
   Experience / Timeline
   ================== */
.experience {
    padding: 6rem 5%;
    background-color: var(--bg-section-alt);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
    opacity: 0.4;
}

.timeline-item {
    position: relative;
    padding: 1.8rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -34px;
    top: 2rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

.timeline-item:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    transform: translateX(5px);
}

.timeline-date {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.timeline-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ==================
   Contact Section
   ================== */
.contact {
    padding: 6rem 5%;
    background-color: var(--bg-section);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
}

.contact-item:hover {
    border-color: var(--border-glow);
    transform: translateX(5px);
}

.contact-item i {
    font-size: 1.3rem;
    color: var(--primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

.contact-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

/* ==================
   Footer
   ================== */
.footer {
    background-color: var(--bg-section-alt);
    padding: 3rem 5%;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.4rem;
    transition: var(--transition);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.social-links a:hover {
    color: white;
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================
   Scroll Reveal Animations
   ================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay utilities */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ==================
   Keyframe Animations
   ================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(0, 212, 255, 0); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================
   Responsive Design
   ================== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--navbar-bg);
        backdrop-filter: blur(20px);
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links.active {
        display: flex;
        animation: fadeInUp 0.3s ease;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .hero .role-text {
        font-size: 1.2rem;
    }

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

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .stat {
        padding: 1.2rem 0.5rem;
    }

    .stat h3 {
        font-size: 1.8rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

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

    .timeline {
        padding-left: 30px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero::before,
    .hero::after {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 480px) {
    .about-stats {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.9rem;
    }

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

/* ==================
   Scrollbar Styling
   ================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--accent));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==================
   Selection Color
   ================== */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: white;
}