@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
    --transition-speed: 0.3s;
    --grid-size: 100px;
}

html[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent-primary: #ffffff;
    --accent-secondary: #e0e0e0;
    --border-color: #3a3a3a;
    --shadow-color: rgba(255, 255, 255, 0.1);
    --hover-shadow: rgba(255, 255, 255, 0.2);
    --grid-color: rgba(255, 255, 255, 0.15);
}

html[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f8ff;
    --bg-tertiary: #e8f0ff;
    --text-primary: #1a1a2e;
    --text-secondary: #2d3748;
    --text-muted: #64748b;
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --border-color: #dbeafe;
    --shadow-color: rgba(37, 99, 235, 0.1);
    --hover-shadow: rgba(37, 99, 235, 0.3);
    --grid-color: rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', sans-serif;
    background-image: 
        repeating-linear-gradient(to right, transparent 0 var(--grid-size), var(--grid-color) var(--grid-size) calc(var(--grid-size) + 1px)),
        repeating-linear-gradient(to bottom, transparent 0 var(--grid-size), var(--grid-color) var(--grid-size) calc(var(--grid-size) + 1px));
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 15px var(--shadow-color);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 8px 30px var(--hover-shadow);
    border-color: var(--accent-primary);
}

.theme-toggle:active {
    transform: scale(0.95) rotate(180deg);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    transition: all var(--transition-speed) ease;
    color: var(--text-primary);
}

html[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

html[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

html[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

html[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    transition: all var(--transition-speed) ease;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width var(--transition-speed) ease;
}

.section-title:hover::after {
    width: 150px;
}

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.slider {
    position: absolute;
    width: 200px;
    height: 250px;
    top: 10%;
    left: calc(50% - 100px);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    animation: autoRun 20s linear infinite;
    z-index: 2;
}

@keyframes autoRun {
    from {
        transform: perspective(1000px) rotateX(-16deg) rotateY(0deg);
    }
    to {
        transform: perspective(1000px) rotateX(-16deg) rotateY(360deg);
    }
}

.slider .item {
    position: absolute;
    inset: 0 0 0 0;
    transform: 
        rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg))
        translateZ(550px);
    transition: transform 0.5s ease;
}

.slider:hover .item {
    transform: 
        rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg))
        translateZ(600px);
}

.slider .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.20rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all var(--transition-speed) ease;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1400px, 100vw);
    height: max-content;
    padding-bottom: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.model {
    background-image: url(model.png);
    width: 100%;
    height: 75vh;
    position: absolute;
    bottom: 0;
    left: 0;
    background-size: auto 130%;
    background-repeat: no-repeat;
    background-position: top center;
    z-index: 1;
    pointer-events: none;
}

.hero-subtitle {
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    color: var(--text-muted);
    animation: fadeInUp 1s ease-out 0.3s both;
    transition: all var(--transition-speed) ease;
    position: relative;
    z-index: 2;
}

.hero-subtitle:hover {
    color: var(--text-secondary);
    transform: translateY(-5px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about {
    padding: 5rem 0;
    background: var(--bg-secondary);
    transition: background var(--transition-speed) ease;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.about-card {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    z-index: 0;
}

.about-card:hover::before {
    opacity: 0.1;
}

.about-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px var(--hover-shadow);
}

.about-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
    transition: color var(--transition-speed) ease;
}

.about-card:hover p {
    color: var(--text-primary);
}

.projects {
    padding: 5rem 0;
    background: var(--bg-primary);
    transition: background var(--transition-speed) ease;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 1.5rem;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.project-card::after {
    content: '→';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--accent-primary);
    opacity: 0;
    transform: translate(-20px, 0);
    transition: all var(--transition-speed) ease;
}

.project-card:hover::after {
    opacity: 1;
    transform: translate(0, 0);
}

.project-card:hover {
    transform: translateY(-15px) scale(1.03);
    border-color: var(--accent-primary);
    box-shadow: 0 25px 50px var(--hover-shadow);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.project-card:hover .project-image::after {
    opacity: 0.2;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .project-image img {
    transform: scale(1.15) rotate(2deg);
}

.project-content {
    padding: 1.5rem;
    transition: all var(--transition-speed) ease;
}

.project-card:hover .project-content {
    padding: 1.5rem 2rem;
}

.project-content h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.project-card:hover .project-content h3 {
    color: var(--accent-primary);
    transform: translateX(10px);
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.project-card:hover .project-content p {
    color: var(--text-secondary);
}

.languages {
    padding: 5rem 0;
    background: var(--bg-secondary);
    transition: background var(--transition-speed) ease;
}

.languages-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.language-item {
    font-family: 'Manrope', sans-serif;
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInScale 0.6s ease-out both;
    animation-delay: var(--delay, 0s);
    cursor: default;
}

.language-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 15px 40px var(--hover-shadow);
}

.language-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.language-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.language-percentage {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.language-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.language-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 5px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.language-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.footer {
    background: var(--bg-secondary);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

.footer p {
    font-family: 'Manrope', sans-serif;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
}

.footer:hover p {
    color: var(--text-primary);
    transform: scale(1.1);
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media screen and (max-width: 1023px) {
    .slider {
        width: 160px;
        height: 200px;
        left: calc(50% - 80px);
    }
    
    .slider .item {
        transform: 
            rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg))
            translateZ(300px);
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }

    .model {
        height: 60vh;
    }
}

@media screen and (max-width: 767px) {
    .slider {
        width: 100px;
        height: 150px;
        left: calc(50% - 50px);
    }
    
    .slider .item {
        transform: 
            rotateY(calc((var(--position) - 1) * (360 / var(--quantity)) * 1deg))
            translateZ(180px);
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
    }

    .model {
        height: 50vh;
    }

    .hero-content {
        padding-bottom: 50px;
    }
}

.custom-cursor {
    position: fixed;
    width: 10px;
    height: 10px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background 0.3s ease;
    mix-blend-mode: difference;
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: difference;
}

.custom-cursor.cursor-hover {
    width: 20px;
    height: 20px;
    background: var(--accent-secondary);
}

.cursor-follower.cursor-hover {
    width: 60px;
    height: 60px;
    border-color: var(--accent-secondary);
}

html {
    cursor: none;
}

* {
    cursor: none;
}

@media (max-width: 1023px) {
    .custom-cursor,
    .cursor-follower {
        display: none;
    }
    
    html, * {
        cursor: auto;
    }
}

.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.theme-modal.show {
    opacity: 1;
    pointer-events: all;
}

.theme-modal-content {
    text-align: center;
    padding: 3rem;
    background: var(--bg-secondary);
    border-radius: 2rem;
    border: 2px solid var(--border-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.5s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.theme-modal-content h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.theme-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 3rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Manrope', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-btn:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px var(--hover-shadow);
}

.theme-btn svg {
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.theme-btn:hover svg {
    color: var(--accent-primary);
    transform: rotate(180deg);
}

.light-btn:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
}

.dark-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.1));
}

@media (max-width: 767px) {
    .theme-modal-content {
        padding: 2rem;
        margin: 1rem;
    }
    
    .theme-modal-content h2 {
        font-size: 1.8rem;
    }
    
    .theme-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .theme-btn {
        padding: 1.5rem 2rem;
    }
}
