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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #090614;
    background-image: radial-gradient(rgba(139, 92, 246, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    color: #ffffff;
    line-height: 1.6;
}

.bubble-nav {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translate(-50%, -120%);
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    z-index: 1000;
}

.bubble-nav.visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.nav-items {
    display: flex;
    list-style: none;
    gap: 8px;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.nav-items li {
    font-size: 8px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    position: relative;
    z-index: 2;
    padding: 6px 11px;
    border-radius: 20px;
    transition: color 0.4s ease;
}

.nav-items li.active {
    color: #ffffff;
}

.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    z-index: 0;
    pointer-events: none;
    transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tronDrive {
    0% { background-position: 0px 0px, 0px 0px; }
    100% { background-position: 0px 60px, 0px 60px; }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    background: #050508;
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.hero-grid-base {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: 60px 60px;
    /* 1. The Base Grid: Always visible, but dim and subtle */
    background-image: 
        linear-gradient(to right, rgba(139, 92, 246, 0.2) 2px, transparent 2px),
        linear-gradient(to bottom, rgba(139, 92, 246, 0.2) 2px, transparent 2px);
    z-index: 0;
    /* Scrolls sideways to match the running characters */
  
    display: block !important;
}

.hero-grid-spotlight {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: 60px 60px;
    /* 2. The Spotlight Grid: Super bright neon! */
    background-image: 
        linear-gradient(to right, rgba(139, 92, 246, 1) 2px, transparent 2px),
        linear-gradient(to bottom, rgba(139, 92, 246, 1) 2px, transparent 2px);
    z-index: 1;
   
    pointer-events: none;
    
    /* THE MAGIC TRICK: This hides the bright grid EVERYWHERE except inside a soft circle around your mouse! */
    -webkit-mask-image: radial-gradient(circle 250px at var(--mouse-x, 50vw) var(--mouse-y, 50vh), black 0%, transparent 100%);
    mask-image: radial-gradient(circle 250px at var(--mouse-x, 50vw) var(--mouse-y, 50vh), black 0%, transparent 100%);
    
    display: block !important;
}

/* The side-scrolling 2D animation */
@keyframes scrollGrid2D {
    0% { background-position: 0px 0px, 0px 0px; }
    /* -60px moves it leftwards so the characters look like they are moving right */
    100% { background-position: -60px 0px, -60px 0px; }
}

.hero::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, #0e0e0e);
    pointer-events: none;
    z-index: 3;
}

.hero-content {
    z-index: 5;
    position: relative;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.hero h1 { font-size: 3em; margin-bottom: 10px; }
.hero p { font-size: 1.2em; }

.typewriter-text {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
    letter-spacing: 1px;
    font-family: 'Courier New', Courier, monospace;
}

.typed-role { color: #8b5cf6; font-weight: bold; }
.cursor { display: inline-block; color: #8b5cf6; font-weight: bold; animation: blink 1s step-end infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.cta-button {
    margin-top: 30px;
    padding: 12px 32px;
    font-size: 1rem;
    color: #ffffff;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid #8b5cf6;
    border-radius: 30px;
    text-decoration: none;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.cta-button:hover {
    background: #8b5cf6;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.6);
    transform: translateY(-3px);
}

.about {
    padding: 100px 20px;
    display: flex;
    justify-content: center;
}

.about-container {
    display: flex;
    gap: 50px;
    max-width: 1000px;
    width: 100%;
    background-color: #121212;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.profile-card {
    flex: 1;
    position: relative;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    min-height: 400px;
    transform-style: preserve-3d;
}

.profile-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    background: radial-gradient(800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.1), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.profile-card:hover::before { opacity: 1; }

.rpg-card {
    justify-content: flex-start;
    align-items: stretch;
    padding: 40px 30px;
    font-family: 'Courier New', Courier, monospace;
    background: #15151a;
}

.rpg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.15);
    padding-bottom: 20px;
    margin-bottom: 30px;
    z-index: 2;
}

.rpg-title h3 {
    font-size: 2rem;
    color: #ffffff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.rpg-title p {
    color: #8b5cf6;
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.rpg-level {
    text-align: right;
    background: rgba(139, 92, 246, 0.15);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.rpg-level span {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
}

.rpg-level strong {
    font-size: 1.8rem;
    color: #ffffff;
    line-height: 1;
}

.rpg-stats { margin-bottom: 40px; z-index: 2; }
.stat-row { margin-bottom: 15px; }

.stat-label {
    display: block; font-size: 0.8rem; margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8); text-transform: uppercase;
}

.stat-bar-bg {
    width: 100%; height: 12px; background: rgba(0, 0, 0, 0.5);
    border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-bar { height: 100%; border-radius: 6px; box-shadow: inset 0 0 10px rgba(255,255,255,0.3); }
.fill-hp { background: linear-gradient(90deg, #ff4ecd, #ff0055); }
.fill-mp { background: linear-gradient(90deg, #4537db, #00bcd4); }

.rpg-skills { z-index: 2; }
.skills-title {
    font-size: 1.1rem; color: #ffffff; margin-bottom: 20px;
    text-transform: uppercase; letter-spacing: 2px;
}
.skill-row {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.skill-name { font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); }
.skill-dots { display: flex; gap: 6px; }
.s-dot {
    width: 12px; height: 12px; background: rgba(255, 255, 255, 0.1);
    border-radius: 2px; transform: rotate(45deg);
}
.s-dot.active { background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.6); }

.about-text {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-text h2 { font-size: 3.5rem; line-height: 1; margin-bottom: 10px; }
.about-text .subtitle { font-size: 1rem; letter-spacing: 2px; color: rgba(255, 255, 255, 0.5); margin-bottom: 30px; }
.about-text p { font-size: 1.1rem; color: rgba(255, 255, 255, 0.8); margin-bottom: 20px; line-height: 1.7; }

.works {
    padding: 100px 20px;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
}

.works-header { text-align: center; margin-bottom: 50px; }
.works-header h2 { font-size: 3.5rem; font-weight: bold; }

.works-carousel {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    overflow-x: auto;
    padding-bottom: 40px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    cursor: grab;
}

.works-carousel::-webkit-scrollbar { display: none; }

.design-card {
    flex: 0 0 calc(33.333% - 20px); 
    min-width: 320px; 
    height: 600px; 
    border-radius: 20px;
    position: relative;
    scroll-snap-align: start; 
    overflow: hidden;
    cursor: pointer;
    margin: 10px;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.design-card:hover {
    transform: translateY(-10px) translateZ(0); 
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-illustration {
    flex-grow: 1;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.card-text-content {
    padding: 0 30px 10px;
    z-index: 2;
    text-align: left;
}

.card-category { font-size: 0.75rem; letter-spacing: 2px; font-weight: 800; display: block; margin-bottom: 12px; text-transform: uppercase; }
.card-title { font-size: 1.8rem; color: #ffffff; line-height: 1.1; font-weight: bold; margin-bottom: 15px; }
.card-text-content p { color: rgba(255,255,255,0.7); font-size: 0.95rem; line-height: 1.5; margin-bottom: 15px; }
.card-footer { padding: 0 30px 30px; font-size: 0.8rem; font-weight: 600; opacity: 0.7; text-align: left; }

.carousel-dots { display: flex; justify-content: center; gap: 12px; margin-top: 20px; position: relative; }
.dot { width: 12px; height: 12px; border-radius: 50%; background-color: rgba(255, 255, 255, 0.2); cursor: pointer; transition: all 0.3s ease; }
.dot.active { background-color: #ffffff; transform: scale(1.2); box-shadow: 0 0 10px rgba(255, 255, 255, 0.4); }
.dot:hover { background-color: rgba(255, 255, 255, 0.5); }
.dot-indicator { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background-color: #ffffff; box-shadow: 0 0 10px rgba(255, 255, 255, 0.6); pointer-events: none; transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

.tech-stack-marquee { width: 100%; max-width: 1000px; margin-top: 60px; overflow: hidden; padding: 20px 0; -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); }
.tech-stack-track { display: flex; width: max-content; animation: scroll-tech 25s linear infinite; }
.tech-stack-track:hover { animation-play-state: paused; }
.tech-group { display: flex; gap: 60px; padding-right: 60px; }
.tech-icon { height: 40px; opacity: 0.7; filter: grayscale(20%); transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1); cursor: pointer; }
.tech-icon:hover { opacity: 1; filter: grayscale(0%); transform: scale(1.2); }
@keyframes scroll-tech { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.contact { padding: 100px 20px; background-color: transparent; display: flex; flex-direction: column; align-items: center; min-height: 60vh; }
.contact-header { text-align: center; margin-bottom: 60px; }
.contact-header h2 { font-size: 3rem; margin-bottom: 10px; }
.contact-header p { color: rgba(255, 255, 255, 0.5); font-size: 1.1rem; }

.contact-cards { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; max-width: 1000px; width: 100%; }
.contact-card { background: #151518; border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 16px; padding: 40px 30px; text-align: center; text-decoration: none; flex: 1; min-width: 250px; position: relative; overflow: hidden; transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.card-icon { font-size: 2.5rem; margin-bottom: 20px; display: inline-block; transition: transform 0.4s ease; }
.contact-card h3 { color: #ffffff; font-size: 1.5rem; margin-bottom: 10px; }
.contact-card p { color: rgba(255, 255, 255, 0.6); font-size: 1rem; transition: color 0.3s ease; }

.contact-card:hover { transform: translateY(-10px); border-color: #8b5cf6; box-shadow: 0 15px 30px rgba(139, 92, 246, 0.15); background: #1a1a24; }
.contact-card:hover .card-icon { transform: scale(1.1) translateY(-5px); }
.contact-card:hover p { color: #8b5cf6; }

.contact-card::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: #8b5cf6; transform: scaleX(0); transition: transform 0.4s ease; }
.contact-card:hover::after { transform: scaleX(1); }

@media (max-width: 1024px) {
    .design-card { flex: 0 0 calc(50% - 15px); }
}

@media (max-width: 850px) {
    .about-container { flex-direction: column; padding: 30px 20px; }
    .about-text h2 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .design-card { flex: 0 0 85%; scroll-snap-align: center; }
    .works-header h2 { font-size: 2.5rem; }
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
    opacity: 1; visibility: visible;
}

.modal-content {
    background: #121216;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    width: 90%; max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 50px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.8);
    transform: translateY(50px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute; top: 25px; right: 30px;
    background: none; border: none; color: #ffffff;
    font-size: 2.5rem; cursor: pointer; opacity: 0.5; transition: all 0.2s;
}

.modal-close:hover { opacity: 1; color: #8b5cf6; transform: rotate(90deg); }

.modal-category { color: #8b5cf6; font-size: 0.9rem; letter-spacing: 2px; text-transform: uppercase; font-weight: bold; }
.modal-title { font-size: 2.5rem; margin: 10px 0 20px; color: #ffffff; }

.modal-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.modal-tags span { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.4); padding: 6px 16px; border-radius: 20px; font-size: 0.8rem; color: #d8b4fe;}

.modal-description { color: rgba(255,255,255,0.8); line-height: 1.8; margin-bottom: 30px; font-size: 1.1rem; }

.modal-subheading { color: #ffffff; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;}

.modal-bullets { list-style: none; color: rgba(255,255,255,0.7); }
.modal-bullets li { margin-bottom: 12px; padding-left: 25px; position: relative; line-height: 1.6;}
.modal-bullets li::before { content: '▹'; position: absolute; left: 0; color: #8b5cf6; font-size: 1.2rem; top: -2px;}

.modal-content::-webkit-scrollbar { width: 8px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.5); border-radius: 10px; }

#modal-widget-container { margin-bottom: 30px; }

.widget-profiler { background: rgba(0,0,0,0.5); border: 1px solid #333; border-radius: 12px; padding: 20px; }
.profiler-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.profiler-title { color: #fff; font-size: 0.9rem; font-family: monospace; }
.profiler-fps { color: #ff4444; font-weight: bold; font-family: monospace; font-size: 1.2rem; transition: color 0.3s; }
.profiler-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; margin-bottom: 15px; }
.p-bar { flex: 1; background: #ff4444; border-radius: 2px 2px 0 0; transition: height 0.5s ease, background 0.5s ease; }
.profiler-toggle { background: #1a1a24; border: 1px solid #8b5cf6; color: #fff; padding: 8px 16px; border-radius: 6px; cursor: pointer; width: 100%; transition: all 0.3s; }
.profiler-toggle:hover { background: #8b5cf6; }

.widget-nodes { background: rgba(0,0,0,0.5); border: 1px solid #333; border-radius: 12px; padding: 30px 20px; position: relative; display: flex; justify-content: space-between; align-items: center; }
.node { width: 50px; height: 50px; background: #1a1a24; border: 2px solid #8b5cf6; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 2; font-size: 0.7rem; color: #fff; font-weight: bold; text-align: center; line-height: 1; }
.node-line { position: absolute; top: 50%; left: 40px; right: 40px; height: 2px; background: rgba(139, 92, 246, 0.3); z-index: 1; transform: translateY(-50%); }
.data-packet { position: absolute; top: 50%; left: 40px; width: 10px; height: 10px; background: #00bcd4; border-radius: 50%; transform: translateY(-50%); z-index: 3; opacity: 0; box-shadow: 0 0 10px #00bcd4; }
.node-btn { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: none; border: 1px solid #00bcd4; color: #00bcd4; padding: 4px 12px; font-size: 0.7rem; border-radius: 10px; cursor: pointer; }

.widget-physics { background: rgba(0,0,0,0.5); border: 1px solid #333; border-radius: 12px; padding: 20px; display: flex; gap: 20px; align-items: center; }
.physics-controls { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.physics-controls label { font-size: 0.8rem; color: #aaa; font-family: monospace; }
.physics-controls input { width: 100%; accent-color: #8b5cf6; }
.physics-controls button { margin-top: 10px; background: #8b5cf6; border: none; padding: 8px; color: white; border-radius: 6px; cursor: pointer; }
.physics-canvas { width: 150px; height: 150px; background: #050508; border: 1px solid #444; position: relative; overflow: hidden; border-radius: 8px; }
.physics-box { width: 30px; height: 30px; background: linear-gradient(135deg, #ff007f, #8b5cf6); position: absolute; top: 10px; left: 60px; border-radius: 4px; }

.widget-ai { background: rgba(0,0,0,0.5); border: 1px solid #333; border-radius: 12px; padding: 20px; text-align: center; }
.ai-camera { width: 100%; height: 160px; background: repeating-linear-gradient(0deg, #111, #111 2px, #000 2px, #000 4px); position: relative; border-radius: 8px; border: 1px solid #444; overflow: hidden; margin-bottom: 15px; }
.ai-target { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: rgba(255,255,255,0.2); font-size: 3rem; }
.yolo-box { position: absolute; top: 20%; left: 30%; width: 40%; height: 60%; border: 2px solid #00ffcc; background: rgba(0, 255, 204, 0.1); opacity: 0; transform: scale(1.2); transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1); display: flex; align-items: flex-start; }
.yolo-label { background: #00ffcc; color: #000; font-size: 0.6rem; font-weight: bold; padding: 2px 6px; font-family: monospace; }
.ai-scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: #00ffcc; box-shadow: 0 0 10px #00ffcc; opacity: 0; }

.widget-publish { background: rgba(0,0,0,0.5); border: 1px solid #333; border-radius: 12px; padding: 20px; }
.pub-terminal { background: #0a0a0f; border: 1px solid #222; height: 140px; border-radius: 6px; padding: 10px; font-family: monospace; font-size: 0.8rem; color: #a0a0a0; overflow-y: auto; text-align: left; margin-bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
.pub-line { opacity: 0; transform: translateX(-10px); }
.pub-success { color: #00e676; font-weight: bold; }

.sprite-character {
    position: absolute;
    height: 32px; 
    background-repeat: no-repeat;
    image-rendering: pixelated;
    z-index: 15;
    top: 0; 
    left: 0;
    opacity: 0;
    pointer-events: none; 
}

#runner-person {
    width: 32px; 
    background-image: url('assets/Run (32x32).png'); 
    animation: runCyclePerson .7s steps(8) infinite; 
}

#runner-wolf {
    width: 67px;
    height: 56px;
    background-image: url('assets/MassacreSpriteSheet-ezgif.com-crop.png');
    background-size: 335px 56px;
    animation: runCycleWolf .7s steps(5) infinite;
}

@keyframes runCyclePerson {
    from { background-position: 0px 0px; }
    to { background-position: -256px 0px; } 
}

@keyframes runCycleWolf {
    from { background-position: 0 0; }
    to   { background-position: -335px 0; }
}

.bounce-letter {
    display: inline-block;
    transform-origin: bottom center;
    will-change: transform;
}

#runner-bat {
    width: 44px;         
    height: 92px;         
    background-image: url('assets/fly.png');
    background-size: 308px 92px;
    animation: runCycleBat 0.6s steps(7) infinite;
}

@keyframes runCycleBat {
    from { background-position: 0 0; }
    to   { background-position: -308px 0; }
}

/* THE GIANT DEMON MATH */
#runner-demon {
    width: 432px;         
    height: 240px;        
    background-image: url('assets/Demon.png');
    background-size: 1728px 720px; 
    transform: scaleX(-1);
    animation: runCycleDemon 0.8s step-end infinite;
}

@keyframes runCycleDemon {
    0%      { background-position: 0px 0px; }
    8.33%   { background-position: -432px 0px; }
    16.66%  { background-position: -864px 0px; }
    25%     { background-position: -1296px 0px; }
    33.33%  { background-position: 0px -240px; }
    41.66%  { background-position: -432px -240px; }
    50%     { background-position: -864px -240px; }
    58.33%  { background-position: -1296px -240px; }
    66.66%  { background-position: 0px -480px; }
    75%     { background-position: -432px -480px; }
    83.33%  { background-position: -864px -480px; }
    91.66%  { background-position: -1296px -480px; }
    100%    { background-position: 0px 0px; }
}
/* Widget: Development Journey Timeline (Side-by-Side) */
.widget-timeline-wrapper { 
    display: flex; 
    gap: 40px; 
    background: rgba(0,0,0,0.5); 
    border: 1px solid #333; 
    border-radius: 12px; 
    padding: 30px; 
    align-items: center; 
}

.timeline-image-container {
    flex: 1;
    max-width: 45%;
}

.timeline-image-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.widget-timeline {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.timeline-step { 
    display: flex; 
    gap: 20px; 
    position: relative; 
    margin-bottom: 25px; 
}
.timeline-step:last-child { margin-bottom: 0; }

.t-icon { 
    width: 40px; 
    height: 40px; 
    background: #1a1a24; 
    border: 2px solid #8b5cf6; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1.2rem; 
    z-index: 2; 
    position: relative; 
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3); 
    flex-shrink: 0;
}

.t-content { flex: 1; padding-top: 5px; }
.t-content h5 { color: #fff; font-size: 1.1rem; margin-bottom: 8px; letter-spacing: 0.5px; }
.t-content p { color: rgba(255, 255, 255, 0.7); font-size: 0.95rem; line-height: 1.6; }

.t-line { 
    position: absolute; 
    top: 40px; 
    bottom: -25px; 
    left: 19px; 
    width: 2px; 
    background: rgba(139, 92, 246, 0.3); 
    z-index: 1; 
}
.timeline-step:last-child .t-line { display: none; }

/* Keep it looking good on mobile devices */
@media (max-width: 850px) {
    .widget-timeline-wrapper { flex-direction: column; }
    .timeline-image-container { max-width: 100%; margin-bottom: 20px; }
}

/* ===============================
   BENTO BOX PROJECT GALLERY
================================ */

.projects-bento-container {
    width: 100%;
    max-width: 1200px;
    margin: 80px 0 20px 0; /* Gives it breathing room below the carousel */
}

.bento-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: #ffffff;
    text-align: left;
}

.projects-bento {
    display: grid;
    /* 1.5fr makes the left column slightly wider, just like your image */
    grid-template-columns: 1.5fr 1fr;
    /* Forces 3 rows of exactly 250px height */
    grid-template-rows: repeat(3, 250px);
    gap: 20px;
}

.bento-item {
    position: relative;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.bento-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

/* The Glassmorphism Pills */
.bento-pill {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Grid Mapping to put images in their exact spots */
.bento-terra      { grid-column: 1; grid-row: 1 / span 2; } /* Spans two rows tall! */
.bento-sb         { grid-column: 2; grid-row: 1; }
.bento-isro       { grid-column: 2; grid-row: 2; }
.bento-playshifu  { grid-column: 1; grid-row: 3; }
.bento-detect     { grid-column: 2; grid-row: 3; }

/* Responsive Mobile Layout: Stacks everything into 1 column */
@media (max-width: 850px) {
    .projects-bento {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-auto-rows: 250px;
    }
    .bento-terra, .bento-sb, .bento-isro, .bento-playshifu, .bento-detect {
        grid-column: 1;
        grid-row: auto;
    }
    /* Let Terra stay tall even on mobile */
    .bento-terra { grid-row: span 2; } 
}

/* Import elegant serif font for editorial headings */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Import elegant serif font for editorial headings */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ===============================
   V4 EDITORIAL CASE STUDY MODAL
================================ */

.deep-dive-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Creates the subtle spotlight effect from the top center */
    background: radial-gradient(circle at 50% 0%, #15151c 0%, #050508 100%);
    z-index: 3000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.deep-dive-overlay.active { opacity: 1; visibility: visible; }

.v4-modal-content {
    max-width: 1400px;
    width: 92%;
    margin: 0 auto;
    padding: 80px 40px;
    position: relative;
}

.v4-close-btn {
    position: absolute;
    top: 30px; right: 40px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}
.v4-close-btn:hover { color: #fff; }

/* Typography Basics */
.v4-section-label {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #555;
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
}

.v4-serif-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-style: italic;
    font-weight: 400;
    color: #e0e0e0;
    margin-bottom: 30px;
}

/* 1. TOP HERO GRID */
.v4-top-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 120px;
    margin-bottom: 100px;
    align-items: start;
}

.v4-breadcrumbs {
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 30px;
    text-transform: uppercase;
}

.v4-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 400;
    color: #f5f5f5;
    margin-bottom: 30px;
}
.v4-title strong { font-family: Arial, sans-serif; font-weight: 800; font-size: 4rem; letter-spacing: -1px; }

.v4-desc {
    font-size: 1.05rem;
    color: #888;
    line-height: 1.7;
    max-width: 600px;
}

/* Hero Right: Stacked Info Boxes */
.v4-hero-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.v4-info-box {
    border: 1px solid rgba(255,255,255,0.03);
    background: #0a0a0e;
    border-radius: 8px;
    padding: 25px 30px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}
.v4-info-label {
    display: block;
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 10px;
}
.v4-info-value { font-size: 0.95rem; color: #ccc; }
.v4-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.v4-tags span {
    border: 1px solid rgba(255,255,255,0.1);
    color: #888; font-size: 0.7rem; padding: 4px 10px; border-radius: 4px; font-family: monospace;
}

/* 2. MIDDLE GRID (VIDEO & LIST) */
.v4-mid-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 100px;
    margin-bottom: 100px;
    padding-bottom: 100px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.v4-video-player {
    width: 100%;
    height: 350px;
    background: #111116;
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.v4-play-btn {
    width: 60px; height: 60px; background: rgba(0,0,0,0.5); border-radius: 50%; border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; transition: 0.2s;
}
.v4-play-btn:hover { transform: scale(1.1); background: rgba(0,0,0,0.8); border-color: rgba(255,255,255,0.3); }

.v4-video-thumbs { display: flex; gap: 10px; }
.v4-thumb { flex: 1; height: 40px; background: #0a0a0e; border-radius: 4px; cursor: pointer; border: 1px solid rgba(255,255,255,0.03); }
.v4-thumb.active { border: 1px solid #555; background: rgba(255,255,255,0.08); }

.v4-tabs {
    display: flex; gap: 30px; margin-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.v4-tab {
    font-family: monospace; font-size: 0.75rem; letter-spacing: 1px; color: #555;
    padding-bottom: 10px; cursor: pointer;
}
.v4-tab.active { color: #ccc; border-bottom: 2px solid #ccc; }

.v4-bullet-list { list-style: none; padding: 0; }
.v4-bullet-list li {
    position: relative; padding-left: 20px; margin-bottom: 25px;
    color: #777; font-size: 0.95rem; line-height: 1.6;
}
.v4-bullet-list li::before {
    content: "■"; position: absolute; left: 0; top: 0px; font-size: 0.5rem; color: #333;
}
.v4-bullet-list strong { color: #e0e0e0; font-weight: 600; }

/* 3. VERTICAL ALTERNATING FEATURE BREAKDOWN */
.v4-features-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: baseline; 
    margin-bottom: 60px; 
}

.v4-vertical-feature {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Text left, Image right */
    gap: 80px;
    margin-bottom: 120px;
    align-items: center;
}

.v4-vertical-feature.reverse {
    grid-template-columns: 1.2fr 1fr; /* Image left, Text right */
}

.v4-feat-number {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    color: rgba(255,255,255,0.05);
    line-height: 1;
    float: left;
    margin-right: 20px;
    margin-top: -10px;
    font-weight: 300;
}

.v4-feat-category {
    font-family: monospace; 
    font-size: 0.65rem; 
    letter-spacing: 2px; 
    color: #555;
    text-transform: uppercase;
    display: block; 
    margin-bottom: 10px;
}

.v4-feat-title { 
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem; 
    font-style: italic;
    font-weight: 400;
    color: #e0e0e0; 
    margin-bottom: 20px; 
    line-height: 1.2; 
    clear: none;
}

.v4-feature-text p { 
    color: #777; 
    font-size: 1rem; 
    line-height: 1.7; 
}

.v4-feature-img {
    width: 100%;
    height: 350px;
    background-color: #0a0a0e;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* 4. FOOTER NAV */
.v4-footer-nav {
    margin-top: 100px; padding-top: 60px; border-top: 1px solid rgba(255,255,255,0.05);
    display: flex; justify-content: space-between; align-items: flex-end;
}
.v4-footer-left h3 { font-family: 'Playfair Display', serif; font-size: 2rem; color: #ccc; margin-top: 10px; }
.v4-footer-left em { font-style: italic; color: #777; }

.v4-footer-right { display: flex; gap: 10px; }
.v4-footer-right button {
    background: #0a0a0e; border: 1px solid rgba(255,255,255,0.05); color: #888;
    padding: 12px 24px; border-radius: 4px; font-family: monospace; font-size: 0.7rem; letter-spacing: 1px; cursor: pointer; transition: 0.3s;
}
.v4-footer-right button:hover { border-color: #555; color: #ccc; background: #111116; }

/* Responsive adjustments for vertical layout */
@media (max-width: 900px) {
    .v4-top-grid, .v4-mid-grid, .v4-vertical-feature, .v4-vertical-feature.reverse { 
        grid-template-columns: 1fr; 
        gap: 40px; 
    }
    /* On mobile, stack text above image regardless of the reverse class */
    .v4-vertical-feature .v4-feature-img, 
    .v4-vertical-feature.reverse .v4-feature-img {
        order: 2;
    }
    .v4-vertical-feature .v4-feature-text, 
    .v4-vertical-feature.reverse .v4-feature-text {
        order: 1;
    }
    .v4-feat-number { font-size: 3rem; }
    .v4-footer-nav { flex-direction: column; align-items: flex-start; gap: 30px; }
}

/* ==========================================
   FLUID RESPONSIVE OVERRIDES
   (Adapts to screen size instead of fixed pixels)
========================================== */

/* 1. FLUID SECTION PADDING & WIDTHS */
.about, .works, .contact {
    /* Scales vertical padding based on screen height, and horizontal based on width */
    padding: clamp(60px, 10vh, 120px) clamp(20px, 5vw, 40px);
}

.about-container, 
.works-carousel, 
.projects-bento-container, 
.contact-cards, 
.tech-stack-marquee {
    /* Always uses 92% of the screen, up to a massive 1400px for ultrawide monitors */
    width: 92%;
    max-width: 1400px; 
}

/* 2. FLUID HEIGHTS FOR CARDS & BENTO */
.profile-card {
    /* Adapts to 40% of the screen height */
    min-height: clamp(350px, 40vh, 500px);
}

.design-card {
    /* Adapts to 65% of the screen height */
    height: clamp(450px, 65vh, 750px); 
}

.projects-bento {
    /* Makes the rows scale dynamically instead of locking to 250px */
    grid-template-rows: repeat(3, clamp(200px, 25vh, 320px));
}

@media (max-width: 850px) {
    .projects-bento {
        grid-auto-rows: clamp(200px, 25vh, 320px);
    }
}

/* 3. FLUID MODAL (CASE STUDY) SIZING */
.v4-modal-content {
    /* Scales the inner padding of the popup dynamically */
    padding: clamp(40px, 8vh, 100px) clamp(20px, 4vw, 60px);
}

.v4-top-grid {
    /* Shrinks the gap between the text and the stats box on smaller screens */
    gap: clamp(40px, 8vw, 120px);
}

.v4-mid-grid {
    gap: clamp(40px, 8vw, 100px);
}

.v4-video-player {
    /* Scales the video player height beautifully */
    height: clamp(250px, 40vh, 450px);
}

.v4-rail-img {
    /* Scales the 3 feature images on the horizontal rail */
    height: clamp(180px, 25vh, 260px);
}