:root {
    --bg-color: #050505;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent: #00f2fe;
    --accent2: #4facfe;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(255, 255, 255, 0.04);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
    cursor: none;
    min-height: 100vh;
    /* Anti-Theft: Disable Text Selection */
    user-select: none;
    -webkit-user-select: none;
}

/* Anti-Theft: Disable Image Dragging */
img {
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, width 0.2s ease, height 0.2s ease;
    mix-blend-mode: difference;
    will-change: transform;
}
.cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: all 0.15s ease-out;
    will-change: transform, width, height, border-color;
    backdrop-filter: invert(1);
}
.cursor-ring.hovering {
    width: 65px;
    height: 65px;
    border-color: var(--accent);
    border-width: 1.5px;
    backdrop-filter: invert(0);
    background: rgba(0, 242, 254, 0.08);
}
.cursor-ring.clicking {
    width: 25px;
    height: 25px;
    border-color: #fff;
    border-width: 3px;
    transition: all 0.08s ease-out;
}

.dynamic-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}
.dynamic-bg-image {
    width: 100%;
    height: 150%;
    background-image: url('Ankitimage.jpg');
    background-size: cover;
    background-position: center top;
    opacity: 0.10;
    filter: grayscale(100%);
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

#threeCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
    opacity: 0.65;
}

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

.glow {
    position: fixed;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 242, 254, 0.10) 0%, rgba(0, 0, 0, 0) 70%);
    top: -20vh;
    left: -20vw;
    z-index: -2;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}
.glow:nth-child(2) {
    top: 50vh;
    left: 50vw;
    background: radial-gradient(circle, rgba(79, 172, 254, 0.07) 0%, rgba(0, 0, 0, 0) 70%);
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9997;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    z-index: 9996;
    border-radius: 0 3px 3px 0;
    transition: width 0.1s linear;
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.5);
}

header {
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: padding 0.3s ease, background 0.3s ease;
}
header.scrolled {
    padding: 1rem 5%;
    background: rgba(5, 5, 5, 0.85);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    position: relative;
    transition: color 0.3s;
}
.logo span {
    color: var(--accent);
}
.logo:hover {
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
nav a {
    color: var(--text-main);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.3s;
    position: relative;
    padding: 0.4rem 0;
}
nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.35s var(--ease-out-expo);
}
nav a:hover::after,
nav a.active::after {
    width: 100%;
}
nav a:hover,
nav a.active {
    color: var(--accent);
}

section {
    min-height: 100vh;
    padding: 8rem 5% 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.9s var(--ease-out-expo), transform 0.9s var(--ease-out-expo);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.48s; opacity: 1; transform: translateY(0); }

.hero-content {
    z-index: 1;
    position: relative;
}
.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}
.glitch-text {
    position: relative;
    display: inline-block;
}
.glitch-text.glitching {
    animation: glitchSkew 0.35s ease-in-out;
}
@keyframes glitchSkew {
    0%, 100% { transform: translate(0); }
    15% { transform: translate(-6px, 3px) skew(-3deg); }
    30% { transform: translate(5px, -2px) skew(2deg); }
    45% { transform: translate(-3px, -4px) skew(-1deg); }
    60% { transform: translate(4px, 1px) skew(3deg); }
    75% { transform: translate(-2px, -3px) skew(-2deg); }
    90% { transform: translate(1px, 2px) skew(1deg); }
}
.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.glitch-text.glitching::before {
    opacity: 0.6;
    color: #ff0055;
    animation: glitchClip1 0.35s ease-in-out;
    clip-path: inset(20% 0 60% 0);
}
.glitch-text.glitching::after {
    opacity: 0.6;
    color: #00f2fe;
    animation: glitchClip2 0.35s ease-in-out;
    clip-path: inset(60% 0 20% 0);
}
@keyframes glitchClip1 {
    0%, 100% { transform: translate(0); }
    50% { transform: translate(-8px, 0); }
}
@keyframes glitchClip2 {
    0%, 100% { transform: translate(0); }
    50% { transform: translate(8px, 0); }
}

.hero-content .typewriter-wrap {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    min-height: 2.2rem;
    display: flex;
    align-items: center;
    gap: 4px;
}
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1.5rem;
    background: var(--accent);
    animation: cursorBlink 0.8s infinite;
    border-radius: 2px;
    margin-left: 2px;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-content p {
    max-width: 600px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.stats-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.stat-item {
    text-align: center;
    min-width: 80px;
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    display: block;
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.3rem;
}

.social-hub-card {
    margin-top: 1.5rem;
    max-width: 100%;
}
.social-hub-title {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.social-hub-title i {
    color: var(--accent);
}
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}
.hub-group h4 {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.contact-links {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.x-logo-text {
    font-style: normal;
    font-weight: 800;
    font-family: sans-serif;
    font-size: 1.1rem !important;
}

.expand-btn {
    display: inline-flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    padding: 0;
    text-decoration: none;
    color: var(--text-main);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    position: relative;
    will-change: transform;
}
.expand-btn i, .expand-btn .x-logo-text {
    min-width: 48px;
    text-align: center;
    font-size: 1.2rem;
    line-height: 48px;
    z-index: 2;
    transition: color 0.3s;
}
.expand-btn .btn-text {
    font-weight: 600;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding-right: 20px;
    z-index: 2;
}
.expand-btn:hover,
.expand-btn:focus {
    max-width: 280px;
    border-color: var(--accent);
    background: rgba(0, 242, 254, 0.1);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}
.expand-btn:hover .btn-text,
.expand-btn:focus .btn-text {
    opacity: 1;
    transition-delay: 0.08s;
}
.expand-btn:hover i.fa-instagram { color: #E1306C; }
.expand-btn:hover i.fa-youtube { color: #FF0000; }
.expand-btn:hover i.fa-linkedin { color: #0A66C2; }
.expand-btn:hover i.fa-facebook-f { color: #1877F2; }
.expand-btn:hover .x-logo-text { color: #ffffff !important; }
.expand-btn:hover i.fa-envelope { color: var(--accent); }

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    transition: transform 0.15s ease-out, box-shadow 0.4s ease, border-color 0.4s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 242, 254, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}
.glass-card:hover::before {
    opacity: 1;
}
.glass-card:hover {
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 242, 254, 0.08);
}
.glass-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--accent);
    position: relative;
    z-index: 1;
}
.glass-card p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}
.glass-card .card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

.skills-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* ========== IMAGE SHOWCASE ========== */
#image-showcase {
    padding-top: 6rem;
}
.particle-recon-card {
    max-width: 600px;
    margin: 2rem auto;
    text-align: center;
}
.image-aspect-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
}
#particleImageCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.final-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
    pointer-events: none;
    border-radius: 12px;
}
.final-image-overlay.show {
    opacity: 1;
}

/* Quote Section */
#quote {
    min-height: auto;
    padding: 2rem 5% 4rem;
}
.quote-box {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}
.quote-icon {
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.4;
    margin-bottom: 1.5rem;
}
.quote-text {
    font-size: 1.8rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    color: var(--text-main);
}
.quote-author {
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.back-to-top {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: visible;
}
.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.back-to-top:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}
.back-to-top svg {
    position: absolute;
    top: -6px;
    left: -6px;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    transform: rotate(-90deg);
}
.back-to-top svg circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transition: stroke-dashoffset 0.15s linear;
}
.back-to-top i {
    font-size: 1.2rem;
    z-index: 2;
    color: #fff;
    transition: color 0.3s;
}
.back-to-top:hover i {
    color: var(--accent);
}

.ripple-effect {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9995;
    border: 1px solid rgba(255, 255, 255, 0.4);
    animation: rippleExpand 0.9s ease-out forwards;
}
@keyframes rippleExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    body { cursor: auto; }
    .cursor-dot, .cursor-ring { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content .typewriter-wrap { font-size: 1.1rem; min-height: 1.6rem; }
    .stats-row { gap: 1.2rem; }
    .stat-number { font-size: 1.8rem; }
    .hub-grid { grid-template-columns: 1fr; }
    .skills-grid, .projects-grid { grid-template-columns: 1fr; }
    .quote-text { font-size: 1.3rem; }
    nav a { margin-left: 0.8rem; font-size: 0.8rem; }
    header { padding: 1rem 4%; }
    .back-to-top { bottom: 1.5rem; right: 1.5rem; width: 44px; height: 44px; }
    .expand-btn { height: 42px; min-width: 42px; max-width: 42px; }
    .expand-btn i, .expand-btn .x-logo-text { min-width: 42px; line-height: 42px; font-size: 1rem !important; }
    .expand-btn:hover, .expand-btn:focus { max-width: 220px; }
    .expand-btn .btn-text { font-size: 0.75rem; }
}
