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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --bg-dark: #0a0a0f;
    --bg-light: #1a1a2e;
    --text-light: #ffffff;
    --text-gray: #a0a0a0;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    cursor: none;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

/* Hide custom cursor on mobile */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    
    .cursor,
    .cursor-trail {
        display: none;
    }
}

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

.cursor-trail {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.3s ease;
    mix-blend-mode: difference;
}

.cursor.active {
    transform: scale(1.5);
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 50px;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    pointer-events: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    pointer-events: auto;
}

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 20px 80px;
    z-index: 10;
}

.hero-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text {
    z-index: 100;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    margin-bottom: 30px;
    line-height: 1.2;
}

.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title .line:nth-child(1) { animation-delay: 0.2s; }
.hero-title .line:nth-child(2) { animation-delay: 0.4s; }
.hero-title .line:nth-child(3) { animation-delay: 0.6s; }

.hero-title .highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.8;
    line-height: 1.8;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.8s forwards;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 1s forwards;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    border: 2px solid;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

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

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

/* Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    width: 300px;
    height: 600px;
    background: #1a1a1a;
    border: 8px solid #000;
    border-radius: 50px;
    padding: 8px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5),
                inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #000;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 42px;
    overflow: hidden;
}

.app-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.app-icon:nth-child(2) { animation-delay: 0.2s; }
.app-icon:nth-child(3) { animation-delay: 0.4s; }
.app-icon:nth-child(4) { animation-delay: 0.6s; }

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.6;
}

.scroll-arrow {
    font-size: 2rem;
    animation: bounce 2s infinite;
}

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

/* Sections */
section {
    padding: 100px 20px;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

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

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-intro {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 40px;
    opacity: 0.9;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 900px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    margin-top: 10px;
    opacity: 0.7;
}

.about-image {
    position: relative;
    height: 400px;
}

.floating-card {
    position: absolute;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    animation: floatCard 4s ease-in-out infinite;
}

.card-1 {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.card-2 {
    top: 50%;
    right: 0;
    animation-delay: 1s;
}

.card-3 {
    bottom: 0;
    left: 20%;
    animation-delay: 2s;
}

.card-4 {
    top: 20%;
    right: 20%;
    animation-delay: 3s;
}

@keyframes floatCard {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(20px, -20px) rotate(5deg); }
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-icon svg {
    width: 60px;
    height: 60px;
    fill: currentColor;
}

.skill-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.skill-card p {
    opacity: 0.7;
    margin-bottom: 20px;
}

.skill-level {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.skill-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0;
    transition: width 1s ease;
}

/* Projects Section */
.projects-section {
    background: var(--bg-light);
}

.projects-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    transform: translateY(-2px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    opacity: 1;
}

.project-card.hidden {
    display: none;
}

.project-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}

.project-badge.published {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.project-badge.development {
    background: rgba(255, 152, 0, 0.9);
    color: white;
}

.project-card:hover,
a.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    position: relative;
    overflow: hidden;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-btn {
    padding: 12px 30px;
    background: var(--primary);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.project-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.project-info {
    padding: 30px;
}

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

.project-info p {
    opacity: 0.7;
    margin-bottom: 20px;
}

.project-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid var(--primary);
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-info p {
    opacity: 0.8;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.contact-item:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateX(10px);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-form {
    pointer-events: auto;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.contact-form textarea {
    resize: vertical;
}

/* Footer */
.footer {
    background: var(--bg-light);
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

.social-links {
    display: flex;
    gap: 20px;
}

.social-link {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.social-link:hover {
    color: var(--primary);
}

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
}

button, a, .btn, .nav-link, .filter-btn, .project-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Smooth Animations */
.hero-title .line,
.hero-subtitle,
.hero-buttons,
.project-card,
.skill-card {
    will-change: transform;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .hero-content {
        gap: 40px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .nav {
        padding: 15px 20px;
    }
    
    .nav-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-links {
        gap: 10px;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
    
    .hero {
        padding: 100px 15px 60px;
        min-height: auto;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        padding: 14px 30px;
    }
    
    .phone-mockup {
        width: 220px;
        height: 440px;
        margin: 0 auto;
    }
    
    section {
        padding: 60px 15px;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        max-width: 100%;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.9rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .skill-card {
        padding: 25px;
    }
    
    .skill-icon svg {
        width: 50px;
        height: 50px;
    }
    
    .projects-filter {
        gap: 10px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .project-card {
        margin-bottom: 0;
    }
    
    .project-image {
        height: 200px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-info h3 {
        font-size: 1.3rem;
    }
    
    .contact-form input,
    .contact-form textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    .footer .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .floating-shapes {
        display: none; /* Hide on mobile for performance */
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .phone-mockup {
        width: 180px;
        height: 360px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .projects-filter {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .nav-links {
        gap: 8px;
        font-size: 0.8rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

/* iPad Specific */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .nav-link:hover,
    .filter-btn:hover,
    .project-card:hover,
    .skill-card:hover {
        transform: none;
    }
    
    .btn:active,
    .nav-link:active,
    .filter-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 44px;
    }
    
    .nav-link {
        padding: 10px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .filter-btn {
        min-height: 44px;
    }
    
    .project-btn {
        min-height: 44px;
        padding: 12px 25px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px 15px 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    section {
        padding: 40px 15px;
    }
}