:root {
    --bg-color: #08090d;
    --card-bg: rgba(22, 24, 36, 0.7);
    --accent-color: #00ffcc;
    --accent-glow: rgba(0, 255, 204, 0.5);
    --accent-secondary: #7928ca;
    /* VIP gold accents */
    --gold: #ffd54a;
    --gold-deep: #d4a017;
    --gold-glow: rgba(255, 213, 74, 0.5);
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --nav-bg: rgba(8, 9, 13, 0.85);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    overflow-x: hidden;
    cursor: default;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============ CINEMATIC PRELOADER ============ */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        radial-gradient(circle at 50% 40%, rgba(0, 255, 204, 0.06), transparent 55%),
        radial-gradient(circle at 50% 60%, rgba(255, 213, 74, 0.05), transparent 55%),
        #05060a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#preloader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    width: min(360px, 82vw);
}

.preloader-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 18px var(--accent-glow));
    animation: logoFlicker 2.4s infinite;
}

@keyframes logoFlicker {
    0%, 100% { opacity: 1; }
    47% { opacity: 1; }
    48% { opacity: 0.35; }
    49% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.5; }
    94% { opacity: 1; }
}

.preloader-bar-wrap {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
}

.preloader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--gold));
    box-shadow: 0 0 12px var(--accent-glow);
    transition: width 0.2s ease;
}

.preloader-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.preloader-boot {
    margin-left: 0.9rem;
    color: var(--accent-color);
    font-size: 0.72rem;
    letter-spacing: 2px;
}

/* ============ CURSOR SPOTLIGHT ============ */
#spotlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle,
        rgba(0, 255, 204, 0.10) 0%,
        rgba(255, 213, 74, 0.05) 35%,
        transparent 62%);
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    mix-blend-mode: screen;
}

@media (hover: hover) and (pointer: fine) {
    #spotlight.active { opacity: 1; }
}

/* ============ SCROLL PROGRESS ============ */
#scrollProgress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-color), var(--gold));
    box-shadow: 0 0 10px var(--accent-glow);
    z-index: 1100;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* ============ SOUND TOGGLE ============ */
.sound-toggle {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    z-index: 1200;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid rgba(255, 213, 74, 0.4);
    color: var(--gold);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 0 0 rgba(255, 213, 74, 0);
}

.sound-toggle:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 8px 22px var(--gold-glow);
    color: #000;
    background: var(--gold);
}

.sound-toggle.on {
    color: var(--accent-color);
    border-color: rgba(0, 255, 204, 0.5);
    box-shadow: 0 0 18px var(--accent-glow);
}

/* Navigation Bar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(0, 255, 204, 0.15);
}

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

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.4rem 0;
}

.nav-links a:hover {
    color: var(--accent-color);
    text-shadow: 0 0 12px var(--accent-glow);
}

.nav-links a.active {
    color: var(--gold);
    text-shadow: 0 0 12px var(--gold-glow);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-color);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Sections Styling */
section {
    min-height: 100vh;
    padding: 6rem 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.4rem;
    color: var(--accent-color);
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0.6rem auto 0;
    box-shadow: 0 0 10px var(--gold-glow);
}

/* Home Section */
#home {
    align-items: center;
    text-align: center;
}

.hacker-scene {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5rem;
}

.atom-wrap {
    position: relative;
    z-index: 3;
    width: 118px;
    height: 118px;
    margin-bottom: 90px;
}

.atom-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.atom-spin {
    transform-origin: 50px 50px;
    animation: atomOrbit 14s linear infinite;
}

@keyframes atomOrbit {
    to { transform: rotate(360deg); }
}

.atom-svg ellipse {
    fill: none;
    stroke: #00ff66;
    stroke-width: 1.4;
    opacity: 0.75;
    filter: drop-shadow(0 0 4px #00ff66);
}

.atom-svg .electron {
    fill: #ffffff;
    filter: drop-shadow(0 0 6px #00ff66);
}

.atom-svg .nucleus {
    fill: #00ff66;
    filter: drop-shadow(0 0 10px #00ff66);
    animation: nucleusPulse 1.8s ease-in-out infinite;
}

@keyframes nucleusPulse {
    0%, 100% { r: 6; }
    50% { r: 7.5; }
}

.hacker-mask-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.hacker-mask-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hacker-mask-container.center-mask {
    width: 112px;
    height: 112px;
}

.hacker-mask-container.side {
    width: 66px;
    height: 66px;
}

.hacker-mask-container.left-mask {
    transform: rotate(10deg);
}

.hacker-mask-container.right-mask {
    transform: rotate(-10deg);
}

.mask-matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.6s ease;
}

.mask-matrix.fade-out {
    opacity: 0;
}

.hacker-mask {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.hacker-mask .mask-face {
    fill: #000;
    fill-opacity: 0;
    animation: fillMask 0.01s linear 1.6s forwards;
}

.hacker-mask path {
    stroke: #00ff66;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    filter: drop-shadow(0 0 7px #00ff66);
    animation: drawMask 1.4s steps(18) forwards;
}

.hacker-mask path:nth-child(1) { animation-delay: 0.3s; }
.hacker-mask path:nth-child(2) { animation-delay: 1.2s; animation-duration: 0.4s; }
.hacker-mask path:nth-child(3) { animation-delay: 1.3s; animation-duration: 0.4s; }
.hacker-mask path:nth-child(4) { animation-delay: 1.4s; animation-duration: 0.4s; }
.hacker-mask path:nth-child(5) { animation-delay: 1.6s; animation-duration: 0.4s; }

@keyframes drawMask {
    to { stroke-dashoffset: 0; }
}

@keyframes fillMask {
    to { fill-opacity: 0.9; }
}

.welcome-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px var(--accent-glow);
}

.typewriter-container {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.6rem;
    font-weight: 900;
    letter-spacing: 6px;
    min-height: 95px;
    color: #fff;
    margin-bottom: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typewriter-text {
    color: #fff;
    text-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-color);
    border-right: 4px solid var(--gold);
    padding-right: 8px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* VIP Badge */
.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.4rem;
    margin-bottom: 1.8rem;
    border-radius: 999px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 0.85rem;
    color: var(--gold);
    background: linear-gradient(135deg, rgba(255, 213, 74, 0.10), rgba(0, 255, 204, 0.06));
    border: 1px solid rgba(255, 213, 74, 0.45);
    box-shadow: 0 0 18px rgba(255, 213, 74, 0.15), inset 0 0 12px rgba(255, 213, 74, 0.08);
}

.vip-badge i {
    animation: crownGlow 2.4s ease-in-out infinite;
}

@keyframes crownGlow {
    0%, 100% { filter: drop-shadow(0 0 4px var(--gold-glow)); }
    50% { filter: drop-shadow(0 0 12px var(--gold)); }
}

/* Centered Social Icons with Ultra Glow */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.8rem;
    margin-top: 0.4rem;
    width: 100%;
}

.social-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid rgba(0, 255, 204, 0.25);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
}

.social-icon:hover {
    color: #000;
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-8px) scale(1.1);
    box-shadow: 0 10px 25px var(--accent-glow);
}

/* Scroll hint */
.scroll-hint {
    margin-top: 2.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 3px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.scroll-hint i {
    animation: bob 1.6s ease-in-out infinite;
    color: var(--gold);
}

@keyframes bob {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* About Card */
.about-card {
    background: var(--card-bg);
    border: 1px solid rgba(0, 255, 204, 0.2);
    border-radius: 16px;
    padding: 3rem;
    line-height: 1.9;
    font-size: 1.25rem;
    color: var(--text-muted);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    text-align: center;
    backdrop-filter: blur(10px);
    max-width: 760px;
    margin: 0 auto;
}

.about-card span {
    color: var(--gold);
    font-weight: 700;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* Skills Cards */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.8rem;
}

.skill-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 2.2rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

.skill-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.skill-card i {
    font-size: 3.2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
    display: inline-block;
}

.skill-card:hover i {
    transform: scale(1.15) rotate(5deg);
    color: var(--gold);
}

.skill-card h3 {
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}

/* Skill progress bars */
.skill-bar {
    margin-top: 1rem;
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

.skill-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold));
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-card.in-view .skill-bar span {
    width: var(--level);
}

/* 3D Tilt cards */
.tilt-card {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(900px) rotateX(0) rotateY(0) translateZ(0);
    transition: transform 0.25s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    overflow: hidden;
}

.tilt-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%),
        rgba(255, 255, 255, 0.18), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.tilt-card:hover .tilt-glare {
    opacity: 1;
}

/* Single Game Display Section */
.single-game-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
}

.game-btn {
    width: 240px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 213, 74, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 140%;
}

.btn:hover {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
    border-color: var(--gold);
}

.btn i {
    font-size: 0.85em;
    position: relative;
    z-index: 1;
}

/* ============ SCROLL REVEAL ============ */
.reveal {
    opacity: 0;
    transform: translateY(38px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Responsiveness */
@media (max-width: 768px) {
    .nav-links {
        gap: 1.2rem;
    }
    .welcome-title {
        font-size: 1.1rem;
    }
    .hacker-mask-row {
        gap: 0.3rem;
    }
    .atom-wrap {
        width: 90px;
        height: 90px;
        margin-bottom: 66px;
    }
    .hacker-mask-container.center-mask {
        width: 88px;
        height: 88px;
    }
    .hacker-mask-container.side {
        width: 52px;
        height: 52px;
    }
    .typewriter-container {
        font-size: 2.3rem;
    }
    .social-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .single-game-container {
        flex-direction: column;
        align-items: center;
    }
    .game-btn {
        width: 220px;
    }
    #spotlight { display: none; }
    .preloader-boot { display: none; }
}
