:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --text-color: #ffffff;
    --bg-color: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Ensure body is visible on page restoration */
body.page-transition {
    opacity: 0.7;
}

/* Force visibility for bfcache restoration */
html.bfcache-restore,
body.bfcache-restore {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Custom Cursor */
#cursor {
    height: 20px;
    width: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    transition: transform 0.1s ease, background-color 0.3s ease, left 0.01s linear, top 0.01s linear;
}

#cursor-blur {
    height: 400px;
    width: 400px;
    background-color: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    position: fixed;
    filter: blur(80px);
    z-index: 9;
    pointer-events: none;
    transition: left 0.1s linear, top 0.1s linear;
}

/* Hide custom cursor on mobile devices */
@media screen and (max-width: 768px) {
    #cursor,
    #cursor-blur {
        display: none;
    }

    * {
        cursor: auto;
    }
}

/* Canvas Background */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-links a:hover::before,
.nav-links a.active::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* Mobile Menu Button */
.menu-btn {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 2;
}

.menu-btn__burger {
    width: 30px;
    height: 2px;
    background: var(--text-color);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: var(--transition);
}

.menu-btn__burger::before,
.menu-btn__burger::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: var(--text-color);
    transition: var(--transition);
}

.menu-btn__burger::before {
    transform: translateY(-8px);
}

.menu-btn__burger::after {
    transform: translateY(8px);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

/* Hero Section */
.hero-content {
    text-align: center;
    padding: 150px 0;
}

.profile-image-container {
    width: 300px;
    height: 300px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border-radius: 20px;
    padding: 5px;
}

.profile-image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    background: var(--card-bg);
}

.profile-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

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

.gradient-text {
    font-size: 4rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

/* Typewriter Effect */
.typewriter {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.typewriter .txt {
    display: inline-block;
}

.typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 40px;
    background: var(--primary-color);
    margin-left: 4px;
    animation: movingLine 0.8s ease-in-out infinite;
}

@keyframes movingLine {
    0% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    100% { transform: translateX(-5px); }
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 2rem;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-color);
    border-radius: 20px;
    position: relative;
    margin: 0 auto;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-color);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 15px); opacity: 0; }
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    margin: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.btn.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn:hover::before {
    opacity: 0.2;
}

/* About Section */
.about-section {
    padding: 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}

.about-image-container {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 20px;
    padding: 5px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    transition: transform 0.3s ease;
}

.about-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.profile-image-container {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 20px;
    padding: 5px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
    transition: transform 0.3s ease;
}

.profile-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.profile-image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    background: var(--card-bg);
}

.profile-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

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

.about-content {
    padding: 2rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-image-container {
        margin: 0 auto 2rem;
    }
}

/* Skills Section */
.skills-section {
    margin: 4rem 0;
}

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

.skill-card {
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 20px;
    margin: 0 auto;
    width: 100%;
    min-width: 280px;
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.skill-list {
    list-style: none;
    margin-top: 1.5rem;
}

.skill-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    position: relative;
}

.skill-list li::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: var(--skill-percent, 0%);
    height: 2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    transition: width 1s ease;
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
        margin-bottom: 2rem;
    }

    .skill-card {
        padding: 1.8rem;
        margin: 0 auto;
        width: 100%;
        max-width: 450px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        min-width: auto;
    }

    .skill-card h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .skill-icon {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }

    .skill-list {
        margin-top: 1.3rem;
    }

    .skill-list li {
        margin: 1rem 0;
        font-size: 0.95rem;
    }

    .skill-list li::after {
        height: 3px;
        bottom: -6px;
    }

    .skill-name {
        font-size: 0.95rem;
    }

    .skill-level {
        font-size: 0.9rem;
        opacity: 0.9;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        gap: 1.8rem;
        padding: 0 0.5rem;
    }

    .skill-card {
        padding: 1.5rem;
        max-width: 100%;
    }

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

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

    .skill-list li {
        margin: 0.8rem 0;
        font-size: 0.9rem;
    }

    .skill-name {
        font-size: 0.9rem;
    }

    .skill-level {
        font-size: 0.85rem;
    }
}

/* Interests Section */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.interest-card {
    text-align: center;
    padding: 2rem;
}

.interest-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.card {
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-10px);
}

.card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(99, 102, 241, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.card:hover .card-overlay {
    opacity: 1;
}

.btn-view {
    padding: 0.8rem 1.5rem;
    background: var(--text-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transform: translateY(20px);
    transition: var(--transition);
}

.card:hover .btn-view {
    transform: translateY(0);
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.card-description {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

.tag {
    padding: 0.3rem 0.8rem;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
        padding: 1rem 0;
    }
    
    .card-image {
        height: 200px;
    }
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

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

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin: 0.5rem 0;
}

.footer-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animations */
.fade-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Page Transition */
.page-transition {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(10, 10, 10, 0.95);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: var(--transition);
    }

    .nav-links.open {
        right: 0;
    }

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

    .gradient-text {
        font-size: 3rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }
}

/* Skill Percentages */
.skill-list li:nth-child(1)::after { --skill-percent: 95%; }
.skill-list li:nth-child(2)::after { --skill-percent: 90%; }
.skill-list li:nth-child(3)::after { --skill-percent: 85%; }
.skill-list li:nth-child(4)::after { --skill-percent: 80%; }

/* Common Section Title Styles */
.section-title {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 600;
    margin-bottom: 3.5rem;
    position: relative;
    display: inline-block;
    width: 100%;
    letter-spacing: -0.2px;
    line-height: 1.3;
    text-transform: capitalize;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    opacity: 0.9;
}

/* Common Section Spacing */
.skills-section,
.interests-section,
.projects-section,
.experience-section,
.contact-section {
    margin-top: 6rem;
    padding: 0 2rem;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .section-title {
        font-size: 3rem;
        font-weight: 600;
        margin-bottom: 3rem;
    }

    .section-title::after {
        width: 100px;
        height: 4px;
        bottom: -12px;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        font-weight: 600;
        margin-bottom: 2.5rem;
    }

    .section-title::after {
        width: 80px;
        height: 3px;
        bottom: -10px;
    }

    .skills-section,
    .interests-section,
    .projects-section,
    .experience-section,
    .contact-section {
        padding: 0 1rem;
        margin-top: 4rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2.2rem;
        font-weight: 600;
        margin-bottom: 2rem;
    }

    .section-title::after {
        width: 60px;
        height: 3px;
        bottom: -8px;
    }

    .skills-section,
    .interests-section,
    .projects-section,
    .experience-section,
    .contact-section {
        margin-top: 3rem;
    }
}
