/* ============================================================
   🌌 GENERATIVE AI — Celestial Deep-Space Nebula Design
   Robot center-stage, glassmorphism cards, neon glow UI
   ============================================================ */

/* === RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === ROOT DESIGN TOKENS === */
:root {
    /* Nebula Palette */
    --deep-midnight: #120321;
    --electric-violet: #7b2ff7;
    --deep-space-blue: #0a1628;
    --cosmic-magenta: #e040a0;
    --neon-cyan: #00ffff;
    --neon-teal: #00e5cc;
    --soft-purple: #a882e8;
    --star-white: #f0eaff;

    /* Glassmorphism */
    --glass-bg: rgba(18, 3, 33, 0.25);
    --glass-bg-hover: rgba(18, 3, 33, 0.35);
    --glass-blur: 20px;
    --glass-border: linear-gradient(135deg, rgba(0, 255, 255, 0.4), rgba(123, 47, 247, 0.4));

    /* Neon Glow */
    --glow-cyan: rgba(0, 255, 255, 0.3);
    --glow-purple: rgba(123, 47, 247, 0.3);
    --glow-magenta: rgba(224, 64, 160, 0.25);
    --glow-strong-cyan: rgba(0, 255, 255, 0.5);
    --glow-strong-purple: rgba(123, 47, 247, 0.5);

    /* Typography */
    --font-heading: 'Orbitron', system-ui, sans-serif;
    --font-body: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font-body);
    background: #060012;
    color: #ffffff;
}

/* === 3D ROBOT SCENE (Full viewport) === */
.robot-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
}

.robot-scene canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* === LARGE BACKGROUND BRAND TEXT === */
.bg-brand-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: clamp(8rem, 18vw, 20rem);
    font-weight: 900;
    letter-spacing: 0.08em;
    color: transparent;
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.08), rgba(0, 255, 255, 0.06));
    -webkit-background-clip: text;
    background-clip: text;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 1;
    user-select: none;
    white-space: nowrap;
}

/* === HOME BUTTON === */
.home-btn {
    position: fixed;
    top: 28px;
    left: 32px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 50px;
    text-decoration: none;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px var(--glow-cyan),
        inset 0 0 15px rgba(0, 255, 255, 0.03);
}

.home-btn:hover {
    background: var(--glass-bg-hover);
    box-shadow: 0 4px 25px var(--glow-strong-cyan),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
    transform: translateY(-1px);
    border-color: rgba(0, 255, 255, 0.4);
    color: var(--neon-cyan);
}

.home-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.home-btn:hover .home-icon {
    transform: translateX(-3px);
}

/* === STATUS BAR (Robot Online) === */
.status-bar {
    position: fixed;
    top: 28px;
    right: 32px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 50px;
    box-shadow: 0 0 15px var(--glow-cyan),
        inset 0 0 10px rgba(0, 255, 255, 0.03);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan), 0 0 16px var(--glow-cyan);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px var(--neon-cyan), 0 0 16px var(--glow-cyan);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.3);
        box-shadow: 0 0 12px var(--neon-cyan), 0 0 24px var(--glow-cyan);
    }
}

.status-text {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--neon-cyan);
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--glow-cyan);
}

/* === SPEECH BUBBLE === */
.speech-bubble {
    position: fixed;
    top: 18%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.95);
    z-index: 15;
    max-width: 380px;
    padding: 16px 24px;
    background: rgba(18, 3, 33, 0.6);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(0, 255, 255, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.08),
        0 0 20px rgba(123, 47, 247, 0.05);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.speech-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

.speech-content {
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.5;
    text-align: center;
}

.speech-tail {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(18, 3, 33, 0.6);
    border-right: 1px solid rgba(0, 255, 255, 0.15);
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
}

/* === PAGE TITLE OVERLAY === */
.page-title-overlay {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    text-align: center;
    pointer-events: none;
}

.page-eyebrow {
    font-family: var(--font-heading);
    font-size: 0.55rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(0, 255, 255, 0.4);
    margin-bottom: 6px;
    text-shadow: 0 0 10px var(--glow-cyan);
}

.page-heading {
    font-family: var(--font-heading);
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: 0 0 20px var(--glow-purple);
}

/* === CONTROLS BAR === */
.controls-bar {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 20;
    display: flex;
    gap: 10px;
}

.ctrl-btn {
    padding: 10px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(123, 47, 247, 0.25);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px var(--glow-purple);
}

.ctrl-btn:hover {
    background: var(--glass-bg-hover);
    box-shadow: 0 4px 25px var(--glow-strong-purple),
        0 0 15px var(--glow-purple);
    transform: translateY(-2px);
    border-color: rgba(123, 47, 247, 0.5);
    color: var(--soft-purple);
}

.ctrl-btn:active {
    transform: scale(0.95);
}

/* ============================================================
   📋 PROJECT CARDS — Glassmorphism with Gradient Borders
   ============================================================ */

.project-card {
    position: fixed;
    z-index: 10;
    width: 300px;
    padding: 24px 22px;
    /* Glassmorphism surface — 20-30% opacity */
    background: rgba(12, 2, 22, 0.3);
    backdrop-filter: blur(22px) saturate(1.3);
    -webkit-backdrop-filter: blur(22px) saturate(1.3);
    border: none;
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(0, 255, 255, 0.06),
        0 0 1px rgba(0, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    /* Snappy spring easing */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease-out,
        z-index 0s;
    cursor: pointer;
    overflow: visible;
}

/* Gradient border via pseudo-element (works with border-radius) */
.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.4), rgba(123, 47, 247, 0.4));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.4s ease;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.04);
    z-index: 100;
    box-shadow:
        0 16px 48px rgba(0, 255, 255, 0.2),
        0 0 30px rgba(0, 255, 255, 0.1),
        0 0 60px rgba(123, 47, 247, 0.08);
}

.project-card:hover::before {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.7), rgba(123, 47, 247, 0.7));
}

/* Accent variant cards */
.project-card.card-accent::before {
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.4), rgba(224, 64, 160, 0.4));
}

.project-card.card-accent:hover::before {
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.7), rgba(224, 64, 160, 0.7));
}

.project-card.card-accent:hover {
    box-shadow:
        0 12px 40px rgba(123, 47, 247, 0.15),
        0 0 25px rgba(224, 64, 160, 0.08),
        0 0 50px rgba(123, 47, 247, 0.05);
}

/* Glow effect on hover */
.card-border-glow {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -2;
}

.project-card:hover .card-border-glow {
    opacity: 1;
    background: radial-gradient(circle at 50% 0%, rgba(0, 255, 255, 0.12), transparent 70%);
    box-shadow: 0 0 30px var(--glow-cyan);
}

.project-card.card-accent:hover .card-border-glow {
    background: radial-gradient(circle at 50% 0%, rgba(123, 47, 247, 0.12), transparent 70%);
    box-shadow: 0 0 30px var(--glow-purple);
}

/* Card number (top-right) */
.card-number {
    position: absolute;
    top: 12px;
    right: 16px;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: rgba(0, 255, 255, 0.35);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

.card-accent .card-number {
    color: rgba(123, 47, 247, 0.45);
    text-shadow: 0 0 8px rgba(123, 47, 247, 0.2);
}

/* Card content */
.card-title {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
    margin-bottom: 12px;
    font-weight: 300;
}

/* === TAGS (pill-shaped) === */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag {
    font-family: var(--font-heading);
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(123, 47, 247, 0.1);
    border: 1px solid rgba(123, 47, 247, 0.25);
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.tag-primary {
    background: rgba(0, 255, 255, 0.08);
    border-color: rgba(0, 255, 255, 0.25);
    color: var(--neon-cyan);
    text-shadow: 0 0 6px var(--glow-cyan);
}

.tag-accent {
    background: rgba(224, 64, 160, 0.08);
    border-color: rgba(224, 64, 160, 0.25);
    color: var(--cosmic-magenta);
    text-shadow: 0 0 6px rgba(224, 64, 160, 0.3);
}

.card-stack {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    font-weight: 300;
}

/* === VIEW CODE BUTTON — Pill-shaped with neon glow === */
.card-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.05em;
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 255, 255, 0.06);
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.15);
}

.card-link:hover {
    background: rgba(0, 255, 255, 0.12);
    border-color: rgba(0, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3),
        0 0 40px rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--glow-cyan);
    transform: translateY(-1px);
}

.card-accent .card-link {
    border-color: rgba(123, 47, 247, 0.3);
    background: rgba(123, 47, 247, 0.06);
    box-shadow: 0 0 12px rgba(123, 47, 247, 0.15);
}

.card-accent .card-link:hover {
    background: rgba(123, 47, 247, 0.12);
    border-color: rgba(123, 47, 247, 0.6);
    box-shadow: 0 0 20px rgba(123, 47, 247, 0.3),
        0 0 40px rgba(123, 47, 247, 0.1);
    color: var(--soft-purple);
    text-shadow: 0 0 8px var(--glow-purple);
}

/* ============================================================
   📐 CARD POSITIONS — 4 cards: top-left, left, right, bottom-center
   ============================================================ */

/* Top-left card — asymmetric placement */
.card-pos-top-left {
    top: 6%;
    left: 4.5%;
    transform: translateY(0);
}

.card-pos-top-left:hover {
    transform: translateY(-6px) scale(1.04);
}

/* Top-right card — asymmetric placement */
.card-pos-top-right {
    top: 14%;
    right: 2%;
    transform: translateY(0);
}

.card-pos-top-right:hover {
    transform: translateY(-6px) scale(1.04);
}

/* Left card — vertically centered */
.card-pos-left {
    top: 56%;
    left: 1.5%;
    transform: translateY(-50%);
}

.card-pos-left:hover {
    transform: translateY(calc(-50% - 6px)) scale(1.04);
}

/* Right card — vertically centered */
.card-pos-right {
    top: 47%;
    right: 4.5%;
    transform: translateY(-50%);
}

.card-pos-right:hover {
    transform: translateY(calc(-50% - 6px)) scale(1.04);
}

/* Bottom-left card */
.card-pos-bottom-left {
    bottom: 5%;
    left: 20%;
    transform: translateX(-50%);
}

.card-pos-bottom-left:hover {
    transform: translateX(-50%) translateY(-8px) scale(1.04);
}

/* Bottom-right card */
.card-pos-bottom-right {
    bottom: 5%;
    right: 20%;
    transform: translateX(50%);
}

.card-pos-bottom-right:hover {
    transform: translateX(50%) translateY(-8px) scale(1.04);
}

/* ============================================================
   🎥 ENTRANCE ANIMATIONS
   ============================================================ */

.project-card {
    opacity: 0;
    animation: card-float-in 0.8s ease forwards;
}

.card-pos-top-left {
    animation-name: card-float-in-top-left;
    animation-delay: 0.2s;
}

.card-pos-top-right {
    animation-name: card-float-in-top-right;
    animation-delay: 0.3s;
}

.card-pos-left {
    animation-name: card-float-in-left;
    animation-delay: 0.4s;
}

.card-pos-right {
    animation-name: card-float-in-right;
    animation-delay: 0.6s;
}

.card-pos-bottom-left {
    animation-name: card-float-in-bottom-left;
    animation-delay: 0.8s;
}

.card-pos-bottom-right {
    animation-name: card-float-in-bottom-right;
    animation-delay: 0.9s;
}

@keyframes card-float-in {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-top-left {
    0% {
        opacity: 0;
        transform: translateY(-30px) translateX(-20px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-top-right {
    0% {
        opacity: 0;
        transform: translateY(-30px) translateX(20px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-left {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-30px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(-50%) translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-right {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(30px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateY(-50%) translateX(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-bottom-left {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(30px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes card-float-in-bottom-right {
    0% {
        opacity: 0;
        transform: translateX(50%) translateY(30px) scale(0.92);
        filter: blur(4px);
    }

    100% {
        opacity: 1;
        transform: translateX(50%) translateY(0) scale(1);
        filter: blur(0);
    }
}

/* === Subtle floating idle animation for cards === */
.card-pos-top-left {
    animation: card-float-in-top-left 0.8s ease forwards, card-idle-float-top-left 6s ease-in-out 0.9s infinite;
}

.card-pos-top-right {
    animation: card-float-in-top-right 0.8s ease forwards, card-idle-float-top-left 6s ease-in-out 1.0s infinite;
}

.card-pos-left {
    animation: card-float-in-left 0.8s ease forwards, card-idle-float-left 6s ease-in-out 1.1s infinite;
}

.card-pos-right {
    animation: card-float-in-right 0.8s ease forwards, card-idle-float-right 6s ease-in-out 1.3s infinite;
}

.card-pos-bottom-left {
    animation: card-float-in-bottom-left 0.8s ease forwards, card-idle-float-bottom-left 6s ease-in-out 1.5s infinite;
}

.card-pos-bottom-right {
    animation: card-float-in-bottom-right 0.8s ease forwards, card-idle-float-bottom-right 6s ease-in-out 1.7s infinite;
}

@keyframes card-idle-float-top-left {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

@keyframes card-idle-float-left {

    0%,
    100% {
        transform: translateY(-50%);
    }

    50% {
        transform: translateY(calc(-50% - 4px));
    }
}

@keyframes card-idle-float-right {

    0%,
    100% {
        transform: translateY(-50%);
    }

    50% {
        transform: translateY(calc(-50% - 4px));
    }
}

@keyframes card-idle-float-bottom-left {

    0%,
    100% {
        transform: translateX(-50%);
    }

    50% {
        transform: translateX(-50%) translateY(-4px);
    }
}

@keyframes card-idle-float-bottom-right {

    0%,
    100% {
        transform: translateX(50%);
    }

    50% {
        transform: translateX(50%) translateY(-4px);
    }
}

/* ============================================================
   📱 RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .project-card {
        width: 260px;
        padding: 18px 16px;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .card-desc {
        font-size: 0.7rem;
    }
}

@media (max-width: 900px) {

    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    .robot-scene {
        position: relative;
        width: 100%;
        height: 60vh;
        min-height: 400px;
    }

    .bg-brand-text {
        position: absolute;
        font-size: 4rem;
    }

    .project-card {
        position: relative;
        width: 100%;
        max-width: 400px;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 12px auto;
        transform: none !important;
        opacity: 1;
        animation: none;
    }

    .project-card:hover {
        transform: translateY(-4px) !important;
    }

    .page-title-overlay {
        position: relative;
        padding: 30px 20px;
    }

    .controls-bar {
        position: relative;
        justify-content: center;
        padding: 20px;
        bottom: auto;
        right: auto;
    }
}

@media (max-width: 480px) {

    .home-btn,
    .status-bar {
        padding: 8px 14px;
        font-size: 0.7rem;
    }

    .bg-brand-text {
        font-size: 2.5rem;
    }
}