:root {
    --bg-color: #ffffff;
    --card-bg: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #0066ff;
    --accent-glow: 0 0 20px rgba(0, 102, 255, 0.3);
    --border-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --overlay-bg: rgba(255, 255, 255, 0.7);
    --btn-sec-bg: rgba(0, 0, 0, 0.05);
    --btn-sec-hover: rgba(0, 0, 0, 0.1);
    
    --font-main: 'Montserrat', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    
    --transition: all 0.3s ease, background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

body.dark-theme {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #00f0ff;
    --accent-glow: 0 0 20px rgba(0, 240, 255, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(15, 23, 42, 0.95);
    --overlay-bg: rgba(15, 23, 42, 0.8);
    --btn-sec-bg: rgba(255, 255, 255, 0.05);
    --btn-sec-hover: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Reusables */
.accent {
    color: var(--accent-color);
}

.accent-glow {
    color: var(--accent-color);
    text-shadow: var(--accent-glow);
}

.btn-primary, .btn-secondary, .btn-outline, .btn-huge, .btn-play {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: var(--accent-glow);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.8);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: var(--btn-sec-hover);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-outline:hover {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: var(--accent-glow);
}

.btn-huge {
    font-size: 1.2rem;
    padding: 1.2rem 3rem;
    background: var(--accent-color);
    color: #ffffff;
    border-radius: 12px;
    font-weight: 900;
}

.btn-huge:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.7);
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 5%;
    transition: var(--transition);
}

#navbar.scrolled {
    background: var(--navbar-bg);
    backdrop-filter: blur(15px);
    padding: 1rem 5%;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links li a {
    font-size: 1rem;
    font-weight: 500;
}

.nav-links li a:not(.btn-outline):hover {
    color: var(--accent-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: var(--transition);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding-top: 80px;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.subtitle {
    color: var(--accent-color);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.avatar-container-3d {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.avatar-spinner {
    width: 100%;
    height: 100%;
    position: relative;
    animation: floating 4s ease-in-out infinite;
    display: flex;
    justify-content: center;
    align-items: center;
}

.avatar-spinner canvas {
    outline: none;
    border: none;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5)) drop-shadow(0 0 15px var(--accent-color));
}

/* Add a spinning animation for the 2D fallback image */
.avatar-img-3d {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5)) drop-shadow(0 0 15px var(--accent-color));
    transform: translateZ(20px);
    animation: spin3d 10s linear infinite, floating 4s ease-in-out infinite;
}

@keyframes spin3d {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes floating {
    0% { top: 0px; }
    50% { top: -20px; }
    100% { top: 0px; }
}

.pulse-ring {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    opacity: 0.1;
    animation: pulse 4s infinite alternate;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.1; }
    100% { transform: scale(1.5); opacity: 0.2; }
}

/* Projects Section */
#projects {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.project-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.btn-play {
    background: var(--accent-color);
    color: #ffffff;
    border-radius: 30px;
    transform: translateY(20px);
    transition: var(--transition);
}

.project-card:hover .btn-play {
    transform: translateY(0);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-stack span {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: var(--font-mono);
}

/* About Section */
#about {
    padding: 100px 5%;
    background: var(--card-bg);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat h4 {
    font-size: 2rem;
    color: var(--accent-color);
}

.stat p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.about-skills {
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.about-skills h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.skills-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.skills-list li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.skills-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Contact Section */
#contact {
    padding: 120px 5%;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-box {
    background: var(--card-bg);
    padding: 4rem 2rem;
    border-radius: 24px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.contact-box h2 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.contact-box p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.social-links-contact {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-note {
    margin-top: 1.5rem !important;
    font-size: 0.9rem !important;
    color: #64748b !important;
    margin-bottom: 0 !important;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 5%;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.socials {
    display: flex;
    gap: 1.5rem;
}

.socials a:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 900px) {
    #hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }
    
    .hero-content {
        margin-bottom: 3rem;
    }
    
    .title {
        font-size: 3rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .about-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--card-bg);
        flex-direction: column;
        padding: 2rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .contact-box h2 {
        font-size: 2rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Systems Section */
.systems-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.system-card {
    display: flex;
    align-items: center;
    gap: 3rem;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.system-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.system-card.reverse {
    flex-direction: row-reverse;
}

.system-video {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.system-video video {
    width: 100%;
    height: auto;
    display: block;
}

.system-info {
    flex: 1;
}

.system-info h3 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.system-info p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .system-card, .system-card.reverse {
        flex-direction: column;
        padding: 1.5rem;
    }
}

/* Custom Cursor styles */
@media (pointer: fine) {
    body {
        cursor: none;
    }
    a, button, .theme-toggle-btn, .hamburger, .btn-primary, .btn-secondary, .btn-outline, .btn-huge, .btn-play {
        cursor: none;
    }
}

.custom-cursor-dot, .custom-cursor-ring {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.3s;
    display: none;
}

.custom-cursor-ring {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 2px solid var(--accent-color);
    transition: transform 0.1s ease-out, width 0.2s, height 0.2s, border-color 0.3s, background-color 0.2s;
}

@media (pointer: fine) {
    .custom-cursor-dot, .custom-cursor-ring {
        display: block;
    }
}

.custom-cursor-ring.hovering {
    width: 50px;
    height: 50px;
    background: rgba(0, 102, 255, 0.1);
    border-color: var(--accent-color);
}

body.dark-theme .custom-cursor-ring.hovering {
    background: rgba(0, 240, 255, 0.1);
}

/* Theme Toggle styles */
.theme-toggle-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--btn-sec-bg);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
    margin-left: 1rem;
}

.theme-toggle-btn:hover {
    background: var(--btn-sec-hover);
    transform: scale(1.1) rotate(20deg);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Coming Soon & Work in Progress badge */
.badge-wip {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--accent-color);
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 5;
    box-shadow: var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Skills list SVG styling & glow effects */
.skills-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.skills-list li::before {
    display: none !important; /* Hide old list dot */
}

.skills-list li:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: var(--accent-glow);
    color: var(--text-primary);
}

.skills-list li svg {
    width: 20px;
    height: 20px;
    fill: var(--accent-color);
    transition: var(--transition);
}

.skills-list li:hover svg {
    filter: drop-shadow(0 0 5px var(--accent-color));
}

/* Reveal scroll animations */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animations for list / grid elements */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.active > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.active > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.active > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.active > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.active > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.active > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.active > *:nth-child(6) { transition-delay: 0.6s; }

body.dark-theme .theme-toggle-btn .sun-icon { display: none; }
body.dark-theme .theme-toggle-btn .moon-icon { display: block; }
body:not(.dark-theme) .theme-toggle-btn .sun-icon { display: block; }
body:not(.dark-theme) .theme-toggle-btn .moon-icon { display: none; }

/* Mobile scaling improvements (portrait & landscape) */
@media (max-width: 480px) {
    #navbar {
        padding: 1rem 5%;
    }
    .logo-text {
        font-size: 1.5rem;
    }
    #hero {
        padding-top: 100px;
        padding-bottom: 2rem;
    }
    .title {
        font-size: 2.4rem;
        word-break: break-word;
    }
    .description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.8rem;
    }
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
    .avatar-container-3d {
        height: 320px;
    }
    .pulse-ring {
        width: 220px;
        height: 220px;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .section-header h2 {
        font-size: 2rem;
    }
    .about-container {
        gap: 2rem;
    }
    .about-text h2 {
        font-size: 2rem;
    }
    .stats {
        gap: 0.8rem;
    }
    .stat h4 {
        font-size: 1.6rem;
    }
    .contact-box {
        padding: 2.5rem 1.5rem;
    }
    .contact-box h2 {
        font-size: 2.2rem;
    }
    .theme-toggle-btn {
        margin-left: 0;
        margin-top: 1rem;
    }
    .skills-list {
        grid-template-columns: 1fr;
    }
}

/* Mobile Landscape adjustments */
@media (max-height: 550px) and (max-width: 950px) {
    #hero {
        min-height: auto;
        padding-top: 90px;
        padding-bottom: 3rem;
    }
    .avatar-container-3d {
        height: 280px;
    }
    .nav-links.active {
        padding: 1rem 0;
        overflow-y: auto;
        max-height: 280px;
    }
}
