/* CSS Variables & Global Reset */
:root {
    --bg-color: #0d1117;
    --neon-green: #39FF14;
    --cyan: #00FFFF;
    --text-main: #FFFFFF;
    --text-muted: #8b949e;
    --font-mono: 'Fira Code', monospace;

    --card-bg: rgba(22, 27, 34, 0.4);
    --card-border: rgba(48, 54, 61, 0.5);

    --transition-speed: 0.2s;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Custom Neon Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--bg-color);
}

body::-webkit-scrollbar {
    width: 6px;
}

body::-webkit-scrollbar-track {
    background: var(--bg-color);
}

body::-webkit-scrollbar-thumb {
    background-color: var(--neon-green);
    border-radius: 10px;
    box-shadow: 0 0 5px var(--neon-green);
}

/* Hide scrollbar during boot */
body.loading {
    overflow: hidden;
}

/* =========================================
   Custom Cursor
   ========================================= */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid var(--neon-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
}

#custom-cursor::after {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--neon-green);
    font-size: 14px;
}

#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
}

/* =========================================
   Preloader Boot Sequence
   ========================================= */
#boot-screen {
    position: fixed;
    inset: 0;
    background-color: #000;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.boot-text {
    color: var(--neon-green);
    font-size: 1.2rem;
    text-shadow: 0 0 5px var(--neon-green);
}

/* Matrix */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in;
}

/* =========================================
   Layout & GitHub Side Panel
   ========================================= */
.main-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    opacity: 0;
    /* Fade in via JS */
    transition: opacity 1s ease-in;
}

.github-panel {
    width: 280px;
    padding: 2rem 1rem;
    border-right: 1px solid var(--card-border);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(5px);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--neon-green);
    border-bottom: 1px solid var(--neon-green);
    padding-bottom: 0.5rem;
}

.pulse-dot-small {
    width: 8px;
    height: 8px;
    background-color: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-green);
    animation: blink 1.5s infinite;
}

.panel-profile p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
}

.social-links-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 1rem;
}

.cyber-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s, text-shadow 0.2s;
}

.cyber-link:hover {
    color: var(--cyan);
    text-shadow: 0 0 8px var(--cyan);
}

.highlight-link {
    color: var(--neon-green);
    font-weight: bold;
}

.highlight-link:hover {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.contribution-graph {
    width: 100%;
    height: 80px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    overflow: hidden;
}

.repo-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.repo-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.repo-card:hover {
    transform: scale(1.02) translateX(4px);
    border-color: var(--neon-green);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.lang-dot.python {
    background-color: #3572A5;
}

.lang-dot.jupyter {
    background-color: #DA5B0B;
}

.lang-dot.html {
    background-color: #e34c26;
}

.lang-dot.markdown {
    background-color: #083fa1;
}

.arsenal-container {
    flex: 1;
    padding: 2rem 4rem;
}

/* =========================================
   Part 1: 3D Hero
   ========================================= */
.hero-section {
    position: relative;
    min-height: 500px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4rem;
}

#three-container {
    width: 100%;
    height: 400px;
    position: relative;
    animation: elasticDrop 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes elasticDrop {
    0% {
        transform: translateY(-200px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.tooltip {
    position: absolute;
    background: rgba(13, 17, 23, 0.9);
    border: 1px solid var(--neon-green);
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--neon-green);
    border-radius: 4px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    transform: translate(-50%, -100%);
    margin-top: -10px;
    white-space: pre-line;
}

.hidden {
    display: none !important;
}

#mobile-hero {
    display: flex;
    justify-content: center;
    width: 100%;
}

.fallback-avatar {
    max-width: 400px;
    max-height: 400px;
    width: 100%;
    object-fit: contain;
}

.hero-text {
    text-align: center;
    margin-top: -30px;
    z-index: 10;
}

.glitch-name {
    font-size: 3rem;
    color: #fff;
    text-align: center;
}

.role-subtitle {
    color: var(--cyan);
    margin-bottom: 1rem;
}

.avatar-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.avatar-controls button {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--card-border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: all var(--transition-speed);
}

.avatar-controls button:hover,
.avatar-controls button.active {
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

/* =========================================
   Typography & Headers LetGlitch
   ========================================= */
.section-header {
    margin-bottom: 3rem;
    position: relative;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.glitch-title {
    font-size: 2rem;
    color: var(--neon-green);
}

.glitch-anim {
    animation: skewGlitch 0.3s cubic-bezier(.25, .46, .45, .94) both alternate;
}

@keyframes skewGlitch {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-20deg);
        text-shadow: -2px 0 red, 2px 0 cyan;
    }

    40% {
        transform: skew(20deg);
        text-shadow: 2px 0 red, -2px 0 cyan;
    }

    60% {
        transform: skew(0deg);
        text-shadow: none;
    }

    80% {
        transform: skew(10deg);
        text-shadow: -1px 0 red, 1px 0 cyan;
    }

    100% {
        transform: skew(0deg);
    }
}

.uptime-counter {
    color: var(--cyan);
    font-size: 0.9rem;
}

.underline-grow {
    height: 2px;
    background: var(--neon-green);
    width: 0;
    margin-top: 10px;
    box-shadow: 0 0 5px var(--neon-green);
    transition: width 1s ease-out;
}

.category-section.in-view .underline-grow {
    width: 100%;
}

.category-section {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s;
}

.category-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.category-title {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: #fff;
}

/* =========================================
   Part 2.1: Circular SVG Progress
   ========================================= */
.svg-rings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 2rem;
    justify-items: center;
}

.svg-skill-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.svg-ring-container {
    width: 100px;
    height: 100px;
    position: relative;
}

.svg-ring-container svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    transition: transform 0.5s;
}

.svg-bg {
    fill: none;
    stroke: var(--card-border);
    stroke-width: 8;
}

.svg-progress {
    fill: none;
    stroke: var(--neon-green);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    /* 2*pi*45 */
    filter: drop-shadow(0 0 4px var(--neon-green));
    transition: stroke-dashoffset 1.5s ease-out;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    color: #fff;
    font-weight: bold;
}

.svg-skill-card:hover .svg-ring-container svg {
    transform: rotate(270deg);
}

.svg-skill-card .tooltip-hover {
    position: absolute;
    top: -30px;
    background: #fff;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    pointer-events: none;
}

.svg-skill-card:hover .tooltip-hover {
    opacity: 1;
}

/* =========================================
   Part 2.2: Isometric 3D Cubes
   ========================================= */
.iso-cubes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 40px;
    margin-top: 50px;
    justify-items: center;
}

.cube-container {
    width: 100px;
    height: 100px;
    perspective: 1000px;
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-section.in-view .cube-container {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger */
.cube-container:nth-child(2) {
    transition-delay: 0.1s;
}

.cube-container:nth-child(3) {
    transition-delay: 0.2s;
}

.cube-container:nth-child(4) {
    transition-delay: 0.3s;
}

.cube-container:nth-child(5) {
    transition-delay: 0.4s;
}

.cube-container:nth-child(6) {
    transition-delay: 0.5s;
}

.cube-container:nth-child(7) {
    transition-delay: 0.6s;
}

.cube-container:nth-child(8) {
    transition-delay: 0.7s;
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-30deg) rotateY(45deg);
    transition: transform 0.6s;
}

.cube:hover {
    transform: rotateX(-30deg) rotateY(225deg);
}

.cube-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--neon-green);
    background: rgba(22, 27, 34, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-align: center;
    padding: 10px;
    box-shadow: inset 0 0 15px rgba(57, 255, 20, 0.2);
}

.cube-front {
    transform: rotateY(0deg) translateZ(50px);
    color: var(--neon-green);
}

.cube-back {
    transform: rotateY(180deg) translateZ(50px);
    font-size: 0.65rem;
    color: #fff;
}

.cube-right {
    transform: rotateY(90deg) translateZ(50px);
}

.cube-left {
    transform: rotateY(-90deg) translateZ(50px);
}

.cube-top {
    transform: rotateX(90deg) translateZ(50px);
    background: rgba(57, 255, 20, 0.2);
    border-color: transparent;
}

.cube-bottom {
    transform: rotateX(-90deg) translateZ(50px);
}

/* =========================================
   Part 2.3: Terminal CLI
   ========================================= */
.terminal-window {
    background-color: #050505;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    position: relative;
}

.terminal-header {
    background-color: #1a1b26;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-buttons {
    display: flex;
    gap: 6px;
}

.btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn.close {
    background-color: #ff5f56;
}

.btn.minimize {
    background-color: #ffbd2e;
}

.btn.expand {
    background-color: #27c93f;
}

.terminal-title {
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.terminal-body {
    padding: 1.5rem;
    font-size: 0.9rem;
    color: #fff;
    min-height: 250px;
}

.cli-line {
    margin-bottom: 4px;
}

.cli-prompt {
    color: var(--neon-green);
    margin-right: 8px;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* =========================================
   Part 2.4: Candlestick Finance
   ========================================= */
.finance-bg {
    position: relative;
}

.ticker-tape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid #333;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 0;
}

.ticker-scroll {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    animation: scrollTicker 20s linear infinite;
}

@keyframes scrollTicker {
    0% {
        transform: translateX(100%);
    }

    100% {
        transform: translateX(-100%);
    }
}

.candlestick-chart {
    position: relative;
    height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding-bottom: 30px;
    padding-top: 50px;
    z-index: 1;
    border-left: 1px solid #333;
    border-bottom: 1px solid #333;
    margin-top: 40px;
}

.chart-axis-y {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: rotate(-90deg) translateX(50%);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chart-axis-x {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.candle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 40px;
    height: 100%;
    justify-content: flex-end;
}

.candle-wick {
    width: 2px;
    background: rgba(255, 255, 255, 0.2);
    position: absolute;
    bottom: 0;
    transition: height 1s ease;
}

.candle-body {
    width: 16px;
    background: var(--neon-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    z-index: 2;
    transition: height 1.5s ease;
    border-radius: 2px;
    position: relative;
}

.candle-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.65rem;
    color: #fff;
    transform: rotate(-45deg);
    white-space: nowrap;
}

.candle-data {
    position: absolute;
    top: -30px;
    background: #000;
    border: 1px solid var(--cyan);
    color: var(--cyan);
    padding: 4px;
    font-size: 0.65rem;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
}

.candle-wrapper:hover .candle-data {
    opacity: 1;
    z-index: 10;
}

.candle-wrapper:hover .candle-body {
    background: var(--cyan);
    box-shadow: 0 0 15px var(--cyan);
    scale: 1.1;
}

/* =========================================
   Part 3: Glassmorphism Achievements
   ========================================= */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.achievement-card:hover {
    border-color: var(--neon-green);
    box-shadow: 0 10px 30px rgba(57, 255, 20, 0.2);
    cursor: none;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-20deg);
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    100% {
        left: 200%;
    }
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transform: translateZ(30px);
}

.card-title {
    font-size: 1.1rem;
    color: var(--cyan);
    margin-bottom: 0.5rem;
    transform: translateZ(20px);
}

.card-body {
    font-size: 0.85rem;
    color: #ccc;
    margin-bottom: 1rem;
    transform: translateZ(10px);
}

.card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    transform: translateZ(15px);
}

.card-tags span {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    border: 1px solid #333;
}

.card-bottom {
    font-size: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    transform: translateZ(25px);
}

.unlocked-badge {
    background: rgba(57, 255, 20, 0.2);
    color: var(--neon-green);
    border: 1px solid var(--neon-green);
    animation: pulse Glow 2s infinite;
}

.counter-badge {
    background: rgba(0, 255, 255, 0.2);
    color: var(--cyan);
    border: 1px solid var(--cyan);
}

.link-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid #555;
}

.progress-badge {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    color: var(--neon-green);
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(57, 255, 20, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .main-wrapper {
        flex-direction: column;
    }

    .github-panel {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        padding: 1rem;
    }

    .repo-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .arsenal-container {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    #three-container {
        display: none;
    }

    #mobile-hero {
        display: flex;
        justify-content: center;
        margin-bottom: 2rem;
    }

    .fallback-avatar {
        width: 200px;
        height: 200px;
        border-radius: 50%;
        border: 2px solid var(--neon-green);
        animation: float 3s infinite;
    }

    @keyframes float {

        0%,
        100% {
            transform: translateY(0);
        }

        50% {
            transform: translateY(-10px);
        }
    }

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

    .repo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .svg-rings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}