:root {
    --bg: #030303;
    --card-bg: rgba(22, 22, 22, 0.7);
    --text: #e0e0e0;
    --text-dim: #a0a0a0;
    --accent: #3b82f6;
    --glass: rgba(255, 255, 255, 0.03);
    --cube-size: 60px;
}

body.terminal-mode {
    --bg: #000000;
    --card-bg: rgba(5, 5, 5, 0.8);
    --text: #00ff41;
    --accent: #00ff41;
    --glass: rgba(0, 255, 65, 0.05);
}

* {
    box-sizing: border-box;
    cursor: none;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: "Inter", sans-serif;
    margin: 0;
    line-height: 1.6;
    padding-top: 60px;
    min-height: 150vh;
    overflow-x: hidden;
    transition: background 0.3s ease;
}

/* Background Layers */
.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(59, 130, 246, 0.12) 0%,
        transparent 50%
    );
    pointer-events: none;
}

body.terminal-mode .bg-glow {
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(0, 255, 65, 0.08) 0%,
        transparent 50%
    );
}

/* 3D Cube Decor */
#cube-viewport {
    position: fixed;
    bottom: 80px;
    right: 50px;
    width: var(--cube-size);
    height: var(--cube-size);
    perspective: 1000px;
    z-index: 100;
    pointer-events: none;
}
#cube-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(45deg);
    transition: transform 0.1s ease-out;
}
.cube-face {
    position: absolute;
    width: var(--cube-size);
    height: var(--cube-size);
    border: 2px solid var(--bg);
    opacity: 0.9;
}
.front {
    background: #b71234;
    transform: translateZ(calc(var(--cube-size) / 2));
}
.back {
    background: #ff5800;
    transform: rotateY(180deg) translateZ(calc(var(--cube-size) / 2));
}
.right {
    background: #0046ad;
    transform: rotateY(90deg) translateZ(calc(var(--cube-size) / 2));
}
.left {
    background: #009b48;
    transform: rotateY(-90deg) translateZ(calc(var(--cube-size) / 2));
}
.top {
    background: #ffffff;
    transform: rotateX(90deg) translateZ(calc(var(--cube-size) / 2));
}
.bottom {
    background: #ffd500;
    transform: rotateX(-90deg) translateZ(calc(var(--cube-size) / 2));
}

body.terminal-mode .cube-face {
    background: transparent !important;
    border: 1px solid var(--accent);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 30px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 1000;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 0;
}
.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}
.nav-links a:hover {
    color: var(--accent);
}

#terminal-toggle {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: "JetBrains Mono";
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 120px 20px;
}
h1 {
    font-size: 4.5rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -2px;
}
.accent {
    color: var(--accent);
}
.subtitle {
    color: var(--text-dim);
    font-size: 1.2rem;
    margin-top: 10px;
}

/* Projects Grid */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 120px;
}
.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2.5rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: translateY(-5px);
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 6px;
    margin: 4px;
    color: var(--text);
}
.tech-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Footer Pulse */
.footer-strip {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    padding: 12px 20px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 900;
}
#github-pulse {
    display: flex;
    align-items: center;
    gap: 10px;
}
.terminal-prompt {
    color: var(--accent);
}
.status-dot {
    width: 8px;
    height: 8px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 8px #34d399;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.9);
    }
}

/* Interactions */
#custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition:
        width 0.3s,
        height 0.3s;
}
#custom-cursor.hover {
    width: 45px;
    height: 45px;
    background: rgba(59, 130, 246, 0.1);
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
