:root {
    --bg: #030305;
    --surface: rgba(22, 27, 34, 0.5);
    --border: rgba(13, 202, 240, 0.3);
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --accent-cyan: #0dcaf0;
    --accent-blue: #0d6efd;
    --accent-glow: rgba(13, 202, 240, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
}

/* Cursor hidden ONLY on desktop to prevent mobile touch bugs */
@media (min-width: 992px) {
    * { cursor: none !important; }
}

.tech-font { font-family: 'Fira Code', monospace; }
.syne-font { font-family: 'Syne', sans-serif; }

/* --- BACKGROUND FX --- */
.cyber-grid {
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background-image: 
        linear-gradient(rgba(13, 202, 240, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 202, 240, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg) translateY(-100px);
    animation: gridMove 20s linear infinite;
    pointer-events: none;
}
@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    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));
    background-size: 100% 4px, 3px 100%;
    z-index: 99990;
    pointer-events: none;
    opacity: 0.4;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.45;
    z-index: -1;
    animation: floatOrb 12s infinite ease-in-out alternate;
    transition: transform 0.2s ease-out;
}
.orb-1 { width: 50vw; height: 50vw; background: var(--accent-blue); top: -20%; right: -10%; }
.orb-2 { width: 40vw; height: 40vw; background: var(--accent-cyan); bottom: -10%; left: -20%; animation-delay: -5s; }
.orb-3 { width: 30vw; height: 30vw; background: #7000ff; top: 40%; left: 30%; animation-delay: -2s; opacity: 0.2; }

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-80px, 80px) scale(1.3); }
}

/* --- CUSTOM CURSOR (Fixed start bug) --- */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0; /* Start hidden so it doesn't stuck at 0,0 */
    transition: opacity 0.3s ease-in-out;
}
.cursor-dot {
    width: 8px; height: 8px;
    background-color: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}
.cursor-outline {
    width: 40px; height: 40px;
    border: 2px solid rgba(13, 202, 240, 0.8);
    transition: opacity 0.3s, width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.87, 0, 0.13, 1);
}
.glitch-wrapper { position: relative; }
.glitch-text {
    font-size: clamp(1.5rem, 5vw, 4rem);
    color: var(--accent-cyan);
    text-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 2rem;
    position: relative;
    text-align: center;
}
.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}
.glitch-text::before {
    left: 2px; text-shadow: -2px 0 #ff00c1; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}
.glitch-text::after {
    left: -2px; text-shadow: -2px 0 #00fff9; clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
  0% { clip: rect(10px, 9999px, 86px, 0); }
  20% { clip: rect(62px, 9999px, 14px, 0); }
  40% { clip: rect(21px, 9999px, 98px, 0); }
  60% { clip: rect(89px, 9999px, 2px, 0); }
  80% { clip: rect(32px, 9999px, 55px, 0); }
  100% { clip: rect(74px, 9999px, 43px, 0); }
}
@keyframes glitch-anim2 {
  0% { clip: rect(65px, 9999px, 100px, 0); }
  20% { clip: rect(3px, 9999px, 54px, 0); }
  40% { clip: rect(89px, 9999px, 12px, 0); }
  60% { clip: rect(42px, 9999px, 78px, 0); }
  80% { clip: rect(15px, 9999px, 34px, 0); }
  100% { clip: rect(90px, 9999px, 23px, 0); }
}

.btn-execute {
    background: rgba(13, 202, 240, 0.1);
    border: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 15px 40px;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(13, 202, 240, 0.3);
}
.btn-execute:hover {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 30px var(--accent-cyan), inset 0 0 10px #fff;
    transform: scale(1.05);
}

/* --- HERO TEXT EFFECTS --- */
.pulse-glow { animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite; }
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(13, 202, 240, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(13, 202, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(13, 202, 240, 0); }
}
.animated-gradient-text {
    background: linear-gradient(270deg, var(--accent-cyan), #fff, var(--accent-blue));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}
@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 5vw;
    text-align: center;
}
.profile-wrapper {
    position: relative;
    width: clamp(150px, 20vw, 220px);
    height: clamp(150px, 20vw, 220px);
    margin: 0 auto 2rem;
    border-radius: 50%;
    padding: 6px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue), #ff00c1);
    background-size: 300% 300%;
    animation: spinBg 4s linear infinite;
}
@keyframes spinBg { 
    0% { background-position: 0% 50%; filter: hue-rotate(0deg); } 
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; filter: hue-rotate(360deg); } 
}
.profile-picture {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--bg);
}
.hero-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(13, 202, 240, 0.3));
}

/* --- GLASS PANELS & 3D TILT --- */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
}
.tilt-card { transition: border 0.3s, box-shadow 0.3s; }
.tilt-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 40px rgba(13, 202, 240, 0.2);
    z-index: 10;
}
.tilt-card > * { transform: translateZ(30px); }

/* Animated Border for Projects */
.project-card { overflow: hidden; }
.animated-border {
    position: absolute; inset: -50%;
    background: conic-gradient(from 0deg, transparent 70%, var(--accent-cyan) 80%, var(--accent-blue) 100%);
    animation: rotate-border 4s linear infinite;
    opacity: 0; transition: opacity 0.3s; z-index: -1;
}
.project-card:hover .animated-border { opacity: 1; }
@keyframes rotate-border { 100% { transform: rotate(360deg); } }
.project-card::after {
    content: ''; position: absolute; inset: 2px;
    background: var(--surface);
    border-radius: 18px; z-index: -1;
}

/* --- RESPONSIVE GRIDS --- */
.section-padding { padding: 5rem 5vw; } 
@media (min-width: 768px) { .section-padding { padding: 8rem 5vw; } }

.grid-3 {
    display: grid;
    /* Super responsive grid: 250px ensures mobile screens handle it well */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: clamp(1.5rem, 4vw, 2.5rem);
    margin-top: 3rem;
}

/* Detail Items & Badges */
.detail-item { text-align: center; margin-bottom: 2rem; }
.detail-item i { font-size: 2.5rem; color: var(--accent-cyan); margin-bottom: 1rem; display: block; }
.glow-link:hover { text-shadow: 0 0 10px var(--accent-cyan); }

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); text-shadow: 0 10px 15px var(--accent-glow); }
}
.glass-panel:hover .bounce-icon { animation: bounce-subtle 1s ease-in-out infinite; }

.tech-badges-container {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 2rem;
}
.tech-badge {
    background: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.4);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex; align-items: center; gap: 10px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}
.tech-badge:hover { 
    background: var(--accent-cyan); 
    color: #000 !important; 
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(13, 202, 240, 0.4);
}

/* Timeline */
.timeline-box { position: relative; padding-left: 2rem; border-left: 2px solid var(--accent-cyan); margin-bottom: 2.5rem;}
.timeline-box::before {
    content: ''; position: absolute; left: -9px; top: 0;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan);
    transition: 0.3s;
}
.timeline-box:hover::before { transform: scale(1.5); background: #fff; box-shadow: 0 0 20px #fff; }

/* Project Images */
.project-img-wrapper {
    width: 100%; height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}
.project-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), filter 0.5s;
    filter: grayscale(70%) contrast(120%);
}
.glass-panel:hover .project-img-wrapper img {
    transform: scale(1.15) rotate(2deg); 
    filter: grayscale(0%) contrast(100%);
}
.status-badge {
    position: absolute; top: 10px; right: 10px;
    background: rgba(0,0,0,0.85);
    padding: 5px 12px; border-radius: 20px;
    font-size: 0.8rem; border: 1px solid;
    backdrop-filter: blur(5px);
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.status-live { color: #00ff88; border-color: #00ff88; text-shadow: 0 0 8px #00ff88; }
.status-local { color: #aaaaaa; border-color: #aaaaaa; }
.status-pending { color: #ffaa00; border-color: #ffaa00; text-shadow: 0 0 8px #ffaa00; }

/* --- GODLY MODAL (Highly Responsive) --- */
#godlyModal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}
#godlyModal.active { opacity: 1; pointer-events: auto; }
.modal-content {
    width: 100%; max-width: 1200px; 
    height: 85vh; 
    background: var(--surface);
    border: 1px solid var(--accent-cyan);
    border-radius: 20px;
    display: flex; overflow: hidden;
    position: relative;
    transform: scale(0.8) translateY(50px) rotateX(-10deg); 
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), 0 0 50px rgba(13, 202, 240, 0.2);
}
#godlyModal.active .modal-content { 
    transform: scale(1) translateY(0) rotateX(0deg); 
    opacity: 1; 
}
.modal-close {
    position: absolute; top: 15px; right: 20px;
    background: rgba(0,0,0,0.5); border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan); font-size: 1.5rem; 
    width: 45px; height: 45px; border-radius: 50%;
    z-index: 50; transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--accent-cyan); color: #000; transform: rotate(90deg) scale(1.1); }

.modal-left { width: 55%; position: relative; background: #050505; }
.modal-right { 
    width: 45%; 
    padding: clamp(2rem, 4vw, 4rem); 
    overflow-y: auto; 
    background: linear-gradient(to right, rgba(0,0,0,0.8), transparent);
}

/* Vanilla Carousel */
.carousel-slide {
    position: absolute; inset: 0; opacity: 0; 
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    transform: scale(1.05);
}
.carousel-slide.active { opacity: 1; transform: scale(1); }
.carousel-slide img { width: 100%; height: 100%; object-fit: contain; }
.carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(13, 202, 240, 0.1); border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan); padding: 15px; border-radius: 50%; z-index: 5;
    transition: 0.3s; backdrop-filter: blur(5px);
}
.carousel-btn:hover { background: var(--accent-cyan); color: #000; transform: translateY(-50%) scale(1.1); box-shadow: 0 0 20px var(--accent-cyan); }
.carousel-prev { left: 20px; }
.carousel-next { right: 20px; }

.modal-right::-webkit-scrollbar { width: 8px; }
.modal-right::-webkit-scrollbar-track { background: rgba(0,0,0,0.5); }
.modal-right::-webkit-scrollbar-thumb { background: var(--accent-cyan); border-radius: 4px; }

/* --- MOBILE & TABLET RESPONSIVE OVERRIDES --- */
@media (max-width: 1024px) {
    /* Tablet Portrait & Small Laptops */
    .modal-left { width: 50%; }
    .modal-right { width: 50%; padding: 2rem; }
}

@media (max-width: 768px) {
    /* Mobile & Small Tablets */
    .cursor-dot, .cursor-outline { display: none !important; }
    
    .modal-content { flex-direction: column; height: 90vh; overflow-y: auto; }
    .modal-left { width: 100%; height: 40vh; flex-shrink: 0; }
    .modal-right { width: 100%; height: max-content; }
    
    /* Disable 3D tilt on mobile for better touch performance & screen fit */
    .tilt-card { transform: none !important; }
    .tilt-card > * { transform: none !important; }
}

@media (max-width: 480px) {
    /* Small Mobile */
    .section-padding { padding: 4rem 4vw; }
    .hero { padding: 5rem 4vw; }
    .btn-execute { padding: 12px 25px; font-size: 1rem; }
    .modal-close { top: 10px; right: 10px; width: 35px; height: 35px; font-size: 1.2rem; }
    .project-img-wrapper { height: 180px; } /* Slightly smaller images on small phones */
}
