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

/* ============ THEME VARIABLES - PURPLE ============ */

/* Light Theme (Default) */
:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --bg: #fafafe;
    --bg-secondary: #f3e8ff;
    --bg-card: #ffffff;
    --text: #1e1b4b;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --accent: #8b5cf6;
    --border: #e9d5ff;
    --shadow: rgba(124, 58, 237, 0.1);
    --header-bg: rgba(250, 250, 254, 0.95);
    --hero-gradient: linear-gradient(180deg, #fafafe 0%, #ede9fe 100%);
    --project-img-bg: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
}

/* Dark Theme */
[data-theme="dark"] {
    --primary: #a78bfa;
    --primary-dark: #8b5cf6;
    --primary-light: #c4b5fd;
    --bg: #0f0a1a;
    --bg-secondary: #1a1033;
    --bg-card: #1e1433;
    --text: #f5f3ff;
    --text-light: #c4b5fd;
    --text-muted: #a78bfa;
    --accent: #c4b5fd;
    --border: #4c1d95;
    --shadow: rgba(0, 0, 0, 0.4);
    --header-bg: rgba(15, 10, 26, 0.95);
    --hero-gradient: linear-gradient(180deg, #1a1033 0%, #0f0a1a 100%);
    --project-img-bg: linear-gradient(135deg, #2d1f5c 0%, #1e1433 100%);
}

/* ============ BASE ============ */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* ============ HEADER ============ */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

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

.nav-links a {
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============ THEME TOGGLE ============ */

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.theme-icon {
    font-size: 1.1rem;
}

/* ============ HAMBURGER MENU ============ */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

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

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -5px);
}

/* ============ MOBILE MENU ============ */

.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu ul {
    padding: 0.5rem 0;
}

.mobile-menu li {
    text-align: center;
}

.mobile-menu a {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
}

.mobile-menu a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* ============ HERO ============ */

.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--hero-gradient);
    padding: 5rem 1.5rem 3rem;
}

.hero-content {
    max-width: 600px;
    width: 100%;
}

.greeting {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    margin-bottom: 0.75rem;
    color: var(--text);
}

.name {
    color: var(--primary);
}

.tagline {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.goal {
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

/* ============ SECTIONS ============ */

.section {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 2.5rem;
    color: var(--text);
}

/* ============ ABOUT ============ */

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

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

.about-info {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-light);
    font-weight: 500;
}

.info-value {
    color: var(--text);
    font-weight: 600;
}

/* ============ SKILLS ============ */

#skills {
    background: var(--bg-secondary);
    max-width: 100%;
}

#skills .section {
    max-width: 1200px;
}

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

.skill-card {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--primary-light);
}

.skill-icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.skill-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.skill-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.skill-card p {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ============ PROJECTS ============ */

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--primary-light);
}

.project-img {
    height: 220px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--project-img-bg);
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.25rem;
}

.project-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.project-content p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

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

.project-tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--bg-secondary);
    color: var(--primary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.project-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.project-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Touch device: hide hover lift, show content fully */
@media (hover: none) and (pointer: coarse) {
    .project-card {
        cursor: default;
    }

    .project-card:hover {
        transform: none;
        box-shadow: none;
        border-color: var(--border);
    }

    .project-link:active {
        transform: scale(0.95);
    }
}

/* ============ CONTACT ============ */

#contact {
    background: var(--bg-secondary);
    max-width: 100%;
}

#contact .section {
    max-width: 1200px;
}

.contact-content p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: center;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--shadow);
    border-color: var(--primary-light);
}

.contact-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============ FOOTER ============ */

.footer {
    background: var(--bg-card);
    color: var(--text-light);
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
}

/* ============ RESPONSIVE ============ */

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .nav {
        padding: 0.75rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .hero {
        padding: 4.5rem 1rem 2.5rem;
    }

    .section {
        padding: 3rem 1rem;
    }

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

    .skill-card {
        padding: 1.25rem;
    }

    .skill-icon {
        font-size: 1.75rem;
    }

    .contact-links {
        gap: 0.75rem;
    }

    .contact-item {
        padding: 0.625rem 1rem;
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .nav-links {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .nav {
        padding: 1rem 2rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .section {
        padding: 4rem 2rem;
    }

    .about-content {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 2.5rem;
    }

    .about-text p {
        text-align: left;
    }

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

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

    .project-img {
        height: 180px;
        font-size: 2.75rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }

    .menu-toggle {
        display: none;
    }

    .nav {
        padding: 1rem 2rem;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .section {
        padding: 5rem 2rem;
    }

    .about-content {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 3rem;
    }

    .about-text p {
        text-align: left;
    }

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

    .skill-card {
        padding: 1.25rem 1rem;
    }

    .skill-icon {
        font-size: 2rem;
    }

    .skill-icon img {
        width: 52px;
        height: 52px;
    }

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

    .project-img {
        height: 240px;
        font-size: 3rem;
    }
}

/* Large Desktop (1280px+) */
@media (min-width: 1280px) {
    .nav {
        max-width: 1400px;
        padding: 1rem 3rem;
    }

    .section {
        max-width: 1400px;
    }

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

    .skills-grid {
        gap: 2rem;
    }

    .skill-card {
        padding: 1.5rem 1rem;
    }

    .skill-icon {
        font-size: 2.25rem;
    }

    .skill-icon img {
        width: 56px;
        height: 56px;
    }
}

/* Small Mobile (< 400px) */
@media (max-width: 400px) {
    .nav {
        padding: 0.625rem 0.875rem;
    }

    .logo {
        font-size: 1rem;
    }

    .theme-toggle,
    .menu-toggle {
        width: 36px;
        height: 36px;
    }

    .hero {
        padding: 4rem 0.75rem 2rem;
    }

    .greeting {
        font-size: 1rem;
    }

    .btn {
        padding: 0.625rem 1.5rem;
    }

    .section {
        padding: 2.5rem 0.75rem;
    }

    .section-title {
        margin-bottom: 2rem;
    }

    .about-info {
        padding: 1.25rem;
    }

    .info-item {
        padding: 0.625rem 0;
    }

    .skill-card {
        padding: 1rem;
    }

    .skill-icon {
        font-size: 1.75rem;
    }

    .skill-card h3 {
        font-size: 0.9rem;
    }

    .skill-card p {
        font-size: 0.8rem;
    }

    .project-img {
        height: 180px;
        font-size: 2.25rem;
    }

    .contact-item {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }

    .footer {
        padding: 1.25rem;
    }
}

/* Fix for very short viewports */
@media (max-height: 600px) {
    .hero {
        min-height: auto;
        padding: 4rem 1.5rem 2rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .skill-card:active,
    .contact-item:active {
        transform: scale(0.98);
    }

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

/* Desktop: hover effects */
@media (hover: hover) and (pointer: fine) {
    .project-card {
        cursor: pointer;
    }
}

/* Prefers 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;
    }
}