/*
   Portfolio Modern Design System
   Author: Arun Kashyap (Generated by AI)
   Optimized for all devices: iPhones, Android, Macs, iPads, and Desktops
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Core Colors - Dark Mode Default (Modern Blue Theme) */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2332;
    --bg-glass: rgba(17, 24, 39, 0.85);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-primary: #06b6d4;
    --accent-secondary: #3b82f6;
    --accent-tertiary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
    --accent-glow: rgba(6, 182, 212, 0.15);
    --border-color: rgba(148, 163, 184, 0.08);
    --card-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
    --glow-color: rgba(6, 182, 212, 0.4);

    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Spacing */
    --container-width: 1200px;
    --header-height: 80px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Safe Area Insets for notched devices */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
}

/* Light Mode Theme */
body.light-mode,
html body.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-primary: #0891b2;
    --accent-secondary: #2563eb;
    --accent-tertiary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #0891b2 0%, #2563eb 50%, #7c3aed 100%);
    --accent-glow: rgba(8, 145, 178, 0.1);
    --border-color: rgba(148, 163, 184, 0.2);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --glow-color: rgba(8, 145, 178, 0.3);
}

/* Ensure light mode overrides work on all elements */
body.light-mode header {
    background: var(--bg-glass);
}

body.light-mode .card {
    background: var(--bg-secondary);
}

body.light-mode .timeline-content {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.light-mode .chat-input-area input {
    background: var(--bg-tertiary);
}

body.light-mode .project-expanded {
    background: rgba(8, 145, 178, 0.05);
}

body.light-mode .expanded-highlight {
    background: rgba(8, 145, 178, 0.08);
}

body.light-mode .hero-stats {
    background: var(--bg-tertiary);
}

body.light-mode .stat-item {
    border-color: var(--border-color);
}

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

html {
    scroll-behavior: smooth;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    width: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    padding-top: var(--safe-area-top);
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

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

ul {
    list-style: none;
}

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

/* Utility Classes */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.section-padding {
    padding: 5rem 0;
}

.bg-secondary {
    background: var(--bg-secondary);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 48px; /* Accessible touch target */
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
}

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

.btn-outline:hover,
.btn-outline:focus {
    background: rgba(59, 130, 246, 0.1);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    transition: all var(--transition-normal);
    padding-top: var(--safe-area-top);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    z-index: 1002;
}

nav ul {
    display: flex;
    gap: 2rem;
}

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

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

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

nav a:hover::after {
    width: 100%;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
    min-width: 48px;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
    min-width: 48px;
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding-top: var(--header-height);
    position: relative;
    overflow: hidden;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.hero-text .subtitle {
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-text p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid var(--accent-primary);
    box-shadow: var(--card-shadow), 0 0 0 8px rgba(59, 130, 246, 0.1);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hero-image img:hover {
    transform: scale(1.02);
    box-shadow: var(--card-shadow), 0 0 0 12px rgba(59, 130, 246, 0.15);
}

.hero-image::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.15;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.05); opacity: 0.1; }
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 0.5rem;
}

.section-header .subtitle {
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-secondary);
}

.about-content p {
    margin-bottom: 1.5rem;
}

.about-content strong {
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow);
    border-color: var(--accent-primary);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--border-color);
}

.timeline-item {
    margin-bottom: 3rem;
    width: 100%;
    position: relative;
}

.timeline-content {
    width: 45%;
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all var(--transition-normal);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 1.5rem;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 4px solid var(--bg-primary);
    z-index: 2;
}

.timeline-date {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

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

.timeline-list {
    list-style: disc;
    padding-left: 1.2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.timeline-list li {
    margin-bottom: 0.5rem;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

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

.skill-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    background: var(--accent-primary);
    color: white;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.project-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-links a {
    color: var(--text-secondary);
    padding: 0.25rem;
    display: inline-flex;
}

.project-links a:hover {
    color: var(--accent-primary);
}

.project-desc {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.95rem;
}

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

.project-tech span {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-expand-btn {
    margin-top: auto;
    width: 100%;
}

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

.contact-text {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

.contact-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    padding-bottom: var(--safe-area-bottom);
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
}

.chatbot-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    max-width: calc(100vw - 2rem);
    height: 450px;
    max-height: 60vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.chatbot-window.open {
    transform: scale(1);
    opacity: 1;
}

.chat-header {
    background: var(--accent-gradient);
    padding: 1rem;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

.chat-message {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    word-wrap: break-word;
}

.chat-message.bot {
    background: rgba(148, 163, 184, 0.1);
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

.chat-message.user {
    background: var(--accent-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 9999px;
    color: var(--text-primary);
    outline: none;
    font-size: 16px; /* Prevents iOS zoom on focus */
    -webkit-appearance: none;
    appearance: none;
}

.chat-input-area input:focus {
    border-color: var(--accent-primary);
}

.chat-input-area button {
    background: var(--accent-primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 2rem 0;
    padding-bottom: calc(2rem + var(--safe-area-bottom));
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* ============================================
   RESPONSIVE DESIGN - ALL DEVICES
   ============================================ */

/* Mobile devices (up to 768px) */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .container {
        padding: 0 1rem;
    }

    .section-padding {
        padding: 3.5rem 0;
    }

    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        height: 100dvh;
        background: var(--bg-secondary);
        padding: calc(var(--header-height) + 2rem) 2rem 2rem;
        padding-top: calc(var(--header-height) + var(--safe-area-top) + 2rem);
        transition: right var(--transition-normal);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 999;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    nav a {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
    }

    /* Hero Mobile */
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
        padding-top: 1rem;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
        margin: 0 auto;
    }

    .hero-image img {
        width: 200px;
        height: 200px;
    }

    .hero-image::before {
        width: 220px;
        height: 220px;
    }

    .hero-text p {
        margin: 0 auto 2rem;
    }

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

    /* Timeline Mobile */
    .timeline::before {
        left: 20px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-content {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .timeline-dot {
        left: 20px;
        transform: translateX(-50%);
    }

    /* Projects Mobile */
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Skills Mobile */
    .skills-grid {
        grid-template-columns: 1fr;
    }

    /* Contact Mobile */
    .contact-btns {
        flex-direction: column;
        align-items: center;
    }

    .contact-btns .btn {
        width: 100%;
        max-width: 300px;
    }

    /* Chatbot Mobile */
    .chatbot-widget {
        bottom: 1rem;
        right: 1rem;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 70vh;
        max-height: 70vh;
        border-radius: 1rem 1rem 0 0;
        transform-origin: bottom center;
    }
}

/* Extra small phones (up to 380px) */
@media (max-width: 380px) {
    .container {
        padding: 0 0.75rem;
    }

    .hero-image img {
        width: 160px;
        height: 160px;
    }

    .hero-image::before {
        width: 180px;
        height: 180px;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .card {
        padding: 1.25rem;
    }

    .timeline-content {
        padding: 1.25rem;
    }

    .project-header h3 {
        font-size: 1.1rem;
    }
}

/* Tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .hero-image::before {
        width: 270px;
        height: 270px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-content {
        width: 46%;
    }
}

/* iPad Pro Portrait */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: portrait) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-image {
        margin: 0 auto;
    }

    .hero-text p {
        margin: 0 auto 2rem;
    }

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

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Laptops & Small Desktops (1025px - 1440px) */
@media (min-width: 1025px) and (max-width: 1440px) {
    .container {
        max-width: 1100px;
        padding: 0 2rem;
    }

    .hero-image img {
        width: 280px;
        height: 280px;
    }

    .hero-image::before {
        width: 300px;
        height: 300px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Desktops (1441px+) */
@media (min-width: 1441px) {
    .container {
        max-width: 1400px;
    }

    .section-padding {
        padding: 6rem 0;
    }

    .hero-image img {
        width: 340px;
        height: 340px;
    }

    .hero-image::before {
        width: 360px;
        height: 360px;
    }

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

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ultra-Wide Screens (1920px+) */
@media (min-width: 1921px) {
    .container {
        max-width: 1600px;
    }

    .hero-text h1 {
        font-size: 5rem;
    }

    .hero-image img {
        width: 400px;
        height: 400px;
    }

    .hero-image::before {
        width: 420px;
        height: 420px;
    }
}

/* Landscape phones */
@media (orientation: landscape) and (max-height: 500px) {
    #hero {
        min-height: auto;
        padding: calc(var(--header-height) + 2rem) 0 2rem;
    }

    .hero-content {
        grid-template-columns: 1fr 1fr;
        text-align: left;
        gap: 2rem;
    }

    .hero-text {
        order: 1;
    }

    .hero-image {
        order: 2;
    }

    .hero-image img {
        width: 150px;
        height: 150px;
    }

    .hero-image::before {
        width: 170px;
        height: 170px;
    }

    .hero-btns {
        justify-content: flex-start;
    }

    .section-padding {
        padding: 2.5rem 0;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/*
   Note: We removed the @media (prefers-color-scheme: light) rule
   because it conflicts with the manual theme toggle.
   The theme is now controlled entirely via the .light-mode class on body.
   The JS handles system preference detection on initial load.
*/

/* Hover states only for devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: translateY(-5px);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
    }

    .chatbot-toggle:hover {
        transform: scale(1.1);
    }

    .skill-tag:hover {
        background: var(--accent-primary);
        color: white;
    }
}

/* Touch devices - no hover effects that could get stuck */
@media (hover: none) {
    .card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }

    .chatbot-toggle:hover {
        transform: none;
    }

    .skill-tag:hover {
        background: rgba(59, 130, 246, 0.1);
        color: var(--accent-primary);
    }
}

/* Active states for touch */
@media (hover: none) {
    .card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.95);
    }

    .chatbot-toggle:active {
        transform: scale(0.9);
    }
}

/* ============================================
   MODERN ANIMATIONS & EFFECTS
   ============================================ */

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.stagger-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Role - Static */
.hero-role {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Hero Tagline with Typing Effect */
.hero-tagline {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.5;
    max-width: 550px;
}

.typing-text {
    display: inline;
    color: var(--text-primary);
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
    font-weight: 300;
    margin-left: 2px;
}

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

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 99;
    -webkit-tap-highlight-color: transparent;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Enhanced Card Effects */
.card {
    position: relative;
    overflow: hidden;
}

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

.card:hover::before {
    left: 100%;
}

/* Project Card Enhancements */
.project-card {
    background: linear-gradient(145deg, var(--bg-secondary) 0%, rgba(59, 130, 246, 0.03) 100%);
}

.project-header h3 {
    transition: color 0.3s ease;
}

.project-card:hover .project-header h3 {
    color: var(--accent-primary);
}

/* Project Expanded Section */
.project-expanded {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0.75rem;
    border-left: 3px solid var(--accent-primary);
    animation: expandIn 0.3s ease-out;
}

.project-expanded.closing {
    animation: expandOut 0.3s ease-out forwards;
}

@keyframes expandIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

@keyframes expandOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.expanded-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.expanded-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    color: white;
}

.expanded-header h4 {
    color: var(--accent-primary);
    font-size: 1rem;
    margin: 0;
}

.project-expanded p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.expanded-highlight {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 0.5rem;
    margin-bottom: 0 !important;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
}

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

/* Chatbot Typing Indicator */
.chat-message.typing {
    display: flex;
    gap: 4px;
    padding: 1rem;
}

.chat-message.typing .dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.chat-message.typing .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-message.typing .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Nav Link Active State */
nav a.active {
    color: var(--accent-primary) !important;
}

nav a.active::after {
    width: 100%;
}

/* Skill Category Icons */
.skill-category h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category h3::before {
    content: '';
    width: 4px;
    height: 1.25rem;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Timeline Enhancements */
.timeline-content {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--card-shadow);
}

.timeline-dot {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* ============================================
   ENHANCED HERO SECTION
   ============================================ */

/* Hero Background Elements */
.hero-bg-elements {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-gradient);
    opacity: 0.1;
    filter: blur(60px);
    animation: floatShape 20s ease-in-out infinite;
}

.floating-shape.shape-1 {
    width: 400px;
    height: 400px;
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.floating-shape.shape-2 {
    width: 300px;
    height: 300px;
    top: 50%;
    right: -5%;
    animation-delay: -7s;
    background: linear-gradient(135deg, var(--accent-secondary) 0%, var(--accent-tertiary) 100%);
}

.floating-shape.shape-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 30%;
    animation-delay: -14s;
    background: linear-gradient(135deg, var(--accent-tertiary) 0%, var(--accent-primary) 100%);
}

@keyframes floatShape {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
    75% {
        transform: translate(20px, 10px) rotate(3deg);
    }
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(6, 182, 212, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 9999px;
    font-size: 0.875rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

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

/* Hero Visual Container */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-wrapper {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-wrapper img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid var(--accent-primary);
    position: relative;
    z-index: 3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image-wrapper img:hover {
    transform: scale(1.03);
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

/* Image Glow Effect */
.image-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    background: var(--accent-gradient);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
    z-index: 1;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.2;
    }
}

/* Animated Rings */
.image-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.2);
    z-index: 2;
}

.image-ring.ring-1 {
    width: 280px;
    height: 280px;
    animation: ringRotate 20s linear infinite;
}

.image-ring.ring-2 {
    width: 310px;
    height: 310px;
    border-style: dashed;
    animation: ringRotate 30s linear infinite reverse;
}

.image-ring.ring-3 {
    width: 340px;
    height: 340px;
    border-color: rgba(139, 92, 246, 0.15);
    animation: ringRotate 40s linear infinite;
}

@keyframes ringRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Tech Orbit */
.tech-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 4;
}

.orbit-item {
    position: absolute;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.orbit-item:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.orbit-item.orbit-1 {
    top: 10%;
    right: 5%;
    animation: orbitFloat 6s ease-in-out infinite;
}

.orbit-item.orbit-2 {
    bottom: 15%;
    right: 0;
    animation: orbitFloat 6s ease-in-out infinite;
    animation-delay: -2s;
}

.orbit-item.orbit-3 {
    bottom: 5%;
    left: 10%;
    animation: orbitFloat 6s ease-in-out infinite;
    animation-delay: -4s;
}

@keyframes orbitFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Icon Button Style */
.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* Hero Stats Section */
.hero-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    z-index: 5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 1rem;
    border-right: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-right: none;
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Nav Overlay */
body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    backdrop-filter: blur(2px);
}

/* Footer Enhancement */
footer {
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .hero-role {
        text-align: center;
    }

    .hero-tagline {
        text-align: center;
        margin: 0 auto 2rem;
    }

    .scroll-to-top {
        bottom: 5rem;
        left: 1rem;
        width: 44px;
        height: 44px;
    }

    #hero::before,
    #hero::after {
        display: none;
    }

    .timeline-content:hover {
        transform: none;
    }

    /* Enhanced Hero Mobile */
    .hero-badge {
        margin: 0 auto 1.5rem;
    }

    .hero-visual {
        order: 1;
        margin-bottom: 1rem;
    }

    .hero-image-wrapper {
        width: 260px;
        height: 260px;
    }

    .hero-image-wrapper img {
        width: 180px;
        height: 180px;
    }

    .image-glow {
        width: 200px;
        height: 200px;
    }

    .image-ring.ring-1 {
        width: 210px;
        height: 210px;
    }

    .image-ring.ring-2 {
        width: 235px;
        height: 235px;
    }

    .image-ring.ring-3 {
        width: 260px;
        height: 260px;
    }

    .orbit-item {
        width: 36px;
        height: 36px;
    }

    .orbit-item svg {
        width: 16px;
        height: 16px;
    }

    .floating-shape {
        opacity: 0.05;
    }

    .floating-shape.shape-1 {
        width: 200px;
        height: 200px;
    }

    .floating-shape.shape-2 {
        width: 150px;
        height: 150px;
    }

    .floating-shape.shape-3 {
        display: none;
    }

    /* Stats Grid Mobile */
    .hero-stats {
        padding: 1rem 0;
    }

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

    .stat-item {
        padding: 0.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .stat-item:nth-child(2n) {
        border-left: 1px solid var(--border-color);
    }

    .stat-item:nth-child(n+3) {
        border-bottom: none;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .hero-btns {
        gap: 0.75rem;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .hero-image-wrapper {
        width: 220px;
        height: 220px;
    }

    .hero-image-wrapper img {
        width: 150px;
        height: 150px;
    }

    .image-glow {
        width: 170px;
        height: 170px;
    }

    .image-ring.ring-1 {
        width: 180px;
        height: 180px;
    }

    .image-ring.ring-2 {
        width: 200px;
        height: 200px;
    }

    .image-ring.ring-3 {
        width: 220px;
        height: 220px;
    }

    .orbit-item {
        width: 32px;
        height: 32px;
    }

    .stats-grid {
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }
}
