:root {
    --bg-dark: #000000;
    /* Pure black */
    --text-primary: #ffffff;
    --text-muted: #888888;

    /* Dynamic Image Glow Colors */
    --glow-burst: #53529f;
    /* Color Burst */
    --glow-treasure: #fedc3c;
    /* Treasure Madness */
    --glow-jelly: #56d125;
    /* Jelly 2048 */

    --card-w: 277px;
    --card-h: 551px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Custom Cursor Glow */
#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 1;
    mix-blend-mode: screen;
    transition: width 0.3s, height 0.3s, background 0.3s;
}

/* Film Grain / Noise Overlay for texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background: 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');
}

/* Navbar */
.glass-nav {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 100px;

    /* Complex Glassmorphism */
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.01), 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.logo-accent {
    color: var(--text-muted);
    font-weight: 300;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 1;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25vw;
    font-weight: 800;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.03);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    line-height: 1;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: -2px;
    perspective: 1000px;
}

.line-1,
.line-2 {
    display: block;
    transform: translateY(100px);
    opacity: 0;
    animation: slideUpFade 1s 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.line-2 {
    animation-delay: 0.4s;
}

.italic-serif {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    text-transform: none;
    color: var(--text-muted);
}

.subtitle {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 500px;
    font-weight: 300;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 1s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeIn 1s 1.5s forwards;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #fff;
    animation: scrollDrop 2s infinite cubic-bezier(0.65, 0, 0.35, 1);
}

.scroll-text {
    font-size: 0.7rem;
    letter-spacing: 4px;
    color: var(--text-muted);
}

@keyframes slideUpFade {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scrollDrop {
    0% {
        transform: translateY(-30px);
    }

    100% {
        transform: translateY(80px);
    }
}

/* Projects */
.project-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 10rem 5%;
    position: relative;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.project-content {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5rem;
}

.reverse .project-content {
    flex-direction: row-reverse;
}

.project-info {
    flex: 1;
    max-width: 480px;
    position: relative;
    z-index: 10;
}

/* Glass Badge */
.glass-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;

    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--glow-burst);
    box-shadow: 0 0 10px var(--glow-burst);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.dev-badge {
    border-left: 2px solid var(--glow-burst);
    color: var(--glow-burst);
}

.frozen-badge {
    border-left: 2px solid var(--glow-treasure);
    color: var(--glow-treasure);
}

.released-badge {
    border-left: 2px solid var(--glow-jelly);
    color: var(--glow-jelly);
}

.project-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2rem;
    background: linear-gradient(180deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glass Description Card */
.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    transform: translate(var(--mouse-x, 0), var(--mouse-y, 0));
}

.glass-card:hover::before {
    opacity: 1;
}

.description {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Glass Button */
.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;

    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-text {
    position: relative;
    z-index: 2;
    transition: color 0.3s;
}

.dev-btn {
    color: var(--glow-burst);
}

.released-btn {
    color: var(--glow-jelly);
}

.contact-btn {
    color: #fff;
}

.btn-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, background 0.4s ease;
    z-index: 1;
}

.dev-btn:hover .btn-flare {
    width: 300px;
    height: 300px;
    background: var(--glow-burst);
}

.dev-btn:hover .btn-text {
    color: #000;
}

.released-btn:hover .btn-flare {
    width: 300px;
    height: 300px;
    background: var(--glow-jelly);
}

.released-btn:hover .btn-text {
    color: #000;
}

.contact-btn:hover .btn-flare {
    width: 300px;
    height: 300px;
    background: #fff;
}

.contact-btn:hover .btn-text {
    color: #000;
}


/* Visual wrapper & glow */
.project-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    perspective: 1200px;
}

.visual-wrapper {
    position: relative;
    width: var(--card-w);
    height: var(--card-h);
    transform-style: preserve-3d;
}

.ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140%;
    height: 140%;
    transform: translate(-50%, -50%) translateZ(-100px);
    filter: blur(80px);
    z-index: -1;
    opacity: 0.4;
    transition: opacity 0.5s ease, filter 0.5s ease;
    border-radius: 50%;
}

.color-burst-glow {
    background: radial-gradient(circle, var(--glow-burst) 0%, transparent 60%);
}

.treasure-glow {
    background: radial-gradient(circle, var(--glow-treasure) 0%, transparent 60%);
}

.jelly-glow {
    background: radial-gradient(circle, var(--glow-jelly) 0%, transparent 60%);
}

.visual-wrapper:hover .ambient-glow {
    opacity: 0.8;
    filter: blur(60px);
}

.game-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform-origin: center center;
    transition: transform 0.1s linear;
    /* Fast response to js */
    transform: translateZ(50px);
}

/* Unique Scroll Animations Classes */
.js-reveal-left {
    opacity: 0;
    transform: translateX(-100px) rotateY(-10deg);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal-right {
    opacity: 0;
    transform: translateX(100px) rotateY(10deg);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-reveal-up {
    opacity: 0;
    transform: translateY(80px);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-revealed {
    opacity: 1;
    transform: translate(0) rotateY(0) rotateX(0) !important;
    /* Forces reset for structural elements, js keeps 3d for inner */
}

/* Footer */
.footer {
    padding: 10rem 5%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.footer-title {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 800;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {

    .project-content,
    .reverse .project-content {
        flex-direction: column;
        gap: 4rem;
        text-align: center;
    }

    .project-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .glass-card {
        text-align: left;
    }
}