:root {
    --primary: #8b5cf6;
    /* Electric Violet */
    --primary-glow: rgba(6, 182, 212, 0.5);
    --secondary: #06b6d4;
    /* Cyan */
    --secondary-glow: rgba(6, 182, 212, 0.5);
    --bg-dark: #0a0a0c;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-white: #ffffff;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.hero-content,
.about-section,
.project-card,
.contact-card {
    transform-style: preserve-3d;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background: rgba(10, 10, 12, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 50px;
    width: 50px;
    object-fit: cover;
    border-radius: 50%;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.nav-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--primary-glow);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}


.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(10, 10, 12, 0.4) 0%, rgba(10, 10, 12, 0.9) 100%);
    z-index: -1;
    pointer-events: none;
}

.side-img,
.card-img {
    transition: var(--transition);
    filter: brightness(0.8) contrast(1.1);
}

.side-img:hover,
.card-img:hover {
    filter: brightness(1) contrast(1.2);
}

.hero-content {
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.contact-card {
    padding: 4rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: center;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition);
}

.contact-item i {
    color: var(--secondary);
    font-size: 1.8rem;
}

.contact-item:hover {
    color: var(--secondary);
    transform: scale(1.05);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid var(--glass-border);
    margin-left: 1rem;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1), border-color 0.4s, box-shadow 0.4s;
    will-change: transform;
    transform: translateZ(0);
}

section {
    padding: 100px 0;
}

.detail-page-container {
    padding: 120px 2rem 100px;
}

@media (max-width: 768px) {
    .detail-page-container {
        padding: 100px 1rem 60px;
    }
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 4rem;
    text-align: center;
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.4));
    font-weight: 800;
    position: relative;
    z-index: 10;
    will-change: filter;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.shape {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse 10s infinite alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    left: -150px;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.2) translate(50px, 50px);
    }
}

.about-section {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
    min-height: 80vh;
}


.about-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(10, 10, 12, 1) 0%,
            rgba(10, 10, 12, 0) 20%,
            rgba(10, 10, 12, 0) 80%,
            rgba(10, 10, 12, 1) 100%);
    pointer-events: none;
    z-index: 1;
}


.about-text p {
    color: #333;
    font-weight: 500;
    transition: var(--transition);
    transform-origin: left center;
}

.racing-content p {
    transition: var(--transition);
    color: rgba(255, 255, 255, 0.8);
    transform-origin: left center;
}

.about-text p:hover,
.racing-content p:hover {
    color: var(--secondary);
    text-shadow:
        0 0 10px #00f2fe,
        0 0 20px #00f2fe,
        0 0 40px rgba(0, 242, 254, 0.8),
        0 0 60px rgba(0, 242, 254, 0.4);
    transform: scale(1.08);
    z-index: 10;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.skill-pill {
    padding: 0.8rem 2.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s, box-shadow 0.4s;
    cursor: default;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: oceanFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--pill-index, 0) * -1.5s);
    will-change: transform;
}

.skill-pill:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    transform: translateY(-12px) scale(1.25) rotate(3deg);
    /* Bigger on hover */
    box-shadow: 0 20px 40px var(--secondary-glow);
    border-color: transparent;
    color: white;
    z-index: 20;
}

@keyframes oceanFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(10px, -15px) rotate(2deg);
    }

    66% {
        transform: translate(-8px, -10px) rotate(-1deg);
    }
}

@keyframes slideFromLeft {
    from {
        transform: translateX(-100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideFromRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.tech-card {
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s, box-shadow 0.5s;
    opacity: 0;
    will-change: transform, opacity;
}

.tech-card.from-left {
    transform: translateX(-100px);
}

.tech-card.from-right {
    transform: translateX(100px);
}

.tech-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.tech-card.from-left.visible {
    animation: slideFromLeft 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tech-card.from-right.visible {
    animation: slideFromRight 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.racing-section {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
    min-height: 80vh;
}

#hero-video,
#about-video,
#racing-video,
#tech-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    z-index: -1;
    object-fit: cover;
    opacity: 1;
    background-color: var(--bg-dark);
}

.racing-content-wrapper {
    position: relative;
    z-index: 1;
}

.racing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.side-img {
    width: 100%;
    border-radius: 20px;
    transition: var(--transition);
}

.racing-content {
    padding: 3rem;
}

.tech-section {
    position: relative;
    padding: 120px 0;
    overflow: hidden;
    min-height: 100vh;
}


.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .tech-grid {
        grid-template-columns: 1fr;
    }
}

.tech-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tech-card {
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding: 0;
    transition: var(--transition);
}

.tech-card:hover {
    transform: translateY(-15px) scale(1.03) !important;
    box-shadow: 0 25px 50px var(--secondary-glow);
    border-color: var(--secondary);
    background: rgba(255, 255, 255, 0.08);
}

.tech-card:hover .card-img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.tech-card:hover h3 {
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-info {
    padding: 2rem;
}

.about-text {
    padding: 3rem;
}

.project-card,
.tech-card,
.racing-content {
    transform: perspective(1000px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    height: 400px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 2;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.links-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
}

#hero-video,
#about-video,
#racing-video,
#tech-video,
#links-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
    z-index: -1;
    object-fit: cover;
    opacity: 1;
    background-color: var(--bg-dark);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding-top: 2rem;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-decoration: none;
    color: var(--text-white);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s, box-shadow 0.5s, border-color 0.4s;
    will-change: transform, opacity;
    opacity: 0;
}

.social-card.from-left {
    transform: translateX(-50px);
}

.social-card.from-right {
    transform: translateX(50px);
}

.social-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.social-card.from-left.visible {
    animation: slideFromLeft 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.social-card.from-right.visible {
    animation: slideFromRight 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.social-card i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.social-card span {
    font-size: 1.1rem;
    font-weight: 600;
}

.social-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--secondary);
}

.social-card.github:hover i {
    color: #fff;
    text-shadow: 0 0 15px #fff;
}

.social-card.linkedin:hover i {
    color: #0077b5;
    text-shadow: 0 0 15px #0077b5;
}

.social-card.facebook:hover i {
    color: #1877f2;
    text-shadow: 0 0 15px #1877f2;
}

.social-card.instagram:hover i {
    color: #e1306c;
    text-shadow: 0 0 15px #e1306c;
}

.social-card.reddit:hover i {
    color: #ff4500;
    text-shadow: 0 0 15px #ff4500;
}

.social-card.codeforces:hover i {
    color: #1f8acb;
    text-shadow: 0 0 15px #1f8acb;
}

.social-card.codeberg:hover i {
    color: #2185d0;
    text-shadow: 0 0 15px #2185d0;
}

.social-card.youtube:hover i {
    color: #ff0000;
    text-shadow: 0 0 15px #ff0000;
}

.social-card.discord:hover i {
    color: #5865f2;
    text-shadow: 0 0 15px #5865f2;
}

.social-card.iseer:hover i {
    color: #8b5cf6;
    text-shadow: 0 0 15px #8b5cf6;
}

.social-card.legends:hover i {
    color: #ffd700;
    text-shadow: 0 0 15px #ffd700;
}

.social-card.cdx:hover i {
    color: #ff4500;
    text-shadow: 0 0 15px #ff4500;
}

.social-card.ufinditall:hover i {
    color: #10b981;
    text-shadow: 0 0 15px #10b981;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-socials a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: var(--transition);
}

.footer-socials a:hover {
    color: var(--secondary);
    transform: translateY(-5px);
}

footer {
    padding: 4rem 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    background: rgba(10, 10, 12, 0.9);
}

@media (max-width: 1024px) {
    .container { padding: 0 1.5rem; }
    .about-grid, .racing-grid { gap: 2rem; }
    .tech-grid { gap: 2rem; max-width: 900px; }
}

@media (max-width: 768px) {
    header { padding: 0.8rem 0; }
    nav { flex-direction: row; justify-content: space-between; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: 0.75rem; letter-spacing: 0.5px; }
    .nav-logo { height: 45px; width: 45px; }
    section { padding: 60px 0; overflow-x: hidden; }
    .hero-title { font-size: 3.2rem; }
    .hero-subtitle { font-size: 1rem; }
    .about-grid, .racing-grid { grid-template-columns: 1fr; text-align: center; }
    .about-image, .racing-image { max-width: 500px; margin: 0 auto; }
    .about-text, .racing-content { padding: 2.5rem 0; }
    .tech-grid { grid-template-columns: 1fr; max-width: 500px; margin: 0 auto; }
    .tech-card { height: auto; min-height: 400px; }
    .links-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}

@media (max-width: 480px) {
    header { padding: 0.5rem 0; }
    .container { padding: 0 1rem; }
    .nav-logo { height: 35px; width: 35px; }
    .nav-links { gap: 0.6rem; }
    .nav-links a { font-size: 0.6rem; font-weight: 700; }
    .hero-title { font-size: 2.0rem; letter-spacing: -1px; line-height: 1.2; text-align: center; width: 100%; }
    .hero-subtitle { font-size: 0.8rem; margin: 1rem auto 2rem auto; text-align: center; max-width: 280px; }
    .btn { padding: 0.7rem 1.1rem; font-size: 0.75rem; width: auto !important; display: inline-block; }
    .btn-secondary { margin-left: 0.2rem; }
    .section-title { font-size: 1.6rem; margin-bottom: 2rem; text-align: center; }
    .skill-pill { padding: 0.4rem 0.8rem; font-size: 0.7rem; margin: 0.2rem; }
    .glass { padding: 1rem !important; margin: 0 auto; width: 100%; max-width: 320px; }
    .glass h2, .glass h3 { font-size: 1.1rem; text-align: center; }
    .tech-grid { padding: 1rem 0; gap: 1.5rem; justify-items: center; }
    .tech-link { width: 100%; display: flex; justify-content: center; text-decoration: none; }
    .tech-card { width: 100%; max-width: 320px; margin: 0 auto; }
    .contact-item { font-size: 0.8rem; gap: 0.4rem; justify-content: center; }
    .contact-item i { font-size: 1.0rem; }
    .links-grid { grid-template-columns: 1fr 1fr; width: 100%; max-width: 320px; margin: 0 auto; }
    video { pointer-events: none; }
    
    .tech-card, .social-card { 
        transform: translateX(0) !important; 
        opacity: 1 !important; 
        transition: none !important;
        animation: none !important;
    }
}

@media (max-width: 340px) {
    .nav-links { gap: 0.3rem; }
    .nav-links a { font-size: 0.5rem; }
    .hero-title { font-size: 1.6rem; }
    .btn { padding: 0.6rem 0.9rem; font-size: 0.7rem; }
}