/* Spaceberries Design System */
:root {
    /* Deep Space Minimal Theme */
    --bg-dark: #000000;
    --text-main-dark: #ffffff;
    --text-muted-dark: #888888;
    --accent-primary: #ffffff;
    /* Crisp White */
    --accent-secondary: #333333;
    /* Dark Grey */
    --accent-glow: #00f0ff;
    /* Electric Blue - Sparse use */



    /* Glassmorphism - Dark */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: 24px;

    /* Spacing - Improved */
    --space-xs: 0.75rem;
    --space-sm: 1.25rem;
    --space-md: 2.5rem;
    --space-lg: 5rem;
    --space-xl: 8rem;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    text-align: center;
    color: var(--text-main-dark);
    background: linear-gradient(180deg, #0b0c1a 0%, #101828 55%, #132135 100%);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Projects Page - Aligned with Main Site */
.projects-page {
    background: transparent;
    /* Let the body gradient show through */
    color: #ffffff;
    position: relative;
    z-index: 1;
}

/* Remove the noise overlay - not used on main site */
.projects-page::before {
    display: none;
}

/* Background Layers */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

#bg-gradient {
    background: linear-gradient(180deg, #0b0c1a 0%, #101828 55%, #132135 100%);
    z-index: -10;
}

.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    z-index: -9;
    animation: float 20s ease-in-out infinite;
}

#blob-1 {
    top: 20vh;
    left: 10vw;
    width: 25rem;
    height: 25rem;
    background: var(--accent-primary);
    animation-delay: -2s;
}

#blob-2 {
    bottom: 15vh;
    right: 15vw;
    width: 30rem;
    height: 30rem;
    background: var(--accent-secondary);
    animation-delay: -5s;
}

.stars {
    background: url("https://grainy-gradients.vercel.app/noise.svg") repeat;
    background-size: 500px;
    opacity: 0.12;
    filter: blur(0.5px);
    z-index: -8;
    animation: drift 120s linear infinite;
}

.aurora {
    inset: -50%;
    background: conic-gradient(from 200deg at 50% 50%,
            transparent 0 15deg,
            rgba(0, 229, 255, 0.1) 15deg 25deg,
            transparent 25deg 40deg,
            rgba(162, 63, 255, 0.1) 40deg 55deg,
            transparent 55deg 100%);
    filter: blur(100px);
    opacity: 0.3;
    z-index: -7;
    animation: spin 80s linear infinite;
}

/* Hero Section - Full Width Desktop Layout */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
}

/* Projects Page Container */
.container {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 4vw, 4rem);
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
}

.logo-container {
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
    margin-bottom: var(--space-md);
}

.logo-container:hover {
    transform: scale(1.05);
}

.logo {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(88, 160, 255, 0.6));
    animation: pulse-glow 4s ease-in-out infinite;
}

h1 {
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-md);
}

.subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto var(--space-lg);
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.15rem 2.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-glow);
    box-shadow: 0 0 30px rgba(0, 223, 255, 0.3), 0 8px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-arrow {
    transition: transform 0.3s ease;
    font-size: 1.2em;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px) rotate(-45deg);
}

footer,
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    z-index: 50;
}

.footer-link {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--accent-glow);
    text-decoration: underline;
}

/* Animations */
@keyframes float {

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

    50% {
        transform: translate(-20px, 20px);
    }
}

@keyframes drift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 1000px 1000px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 15px rgba(88, 160, 255, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(88, 160, 255, 0.7));
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered Animation Delays */
.container>* {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.container> :nth-child(1) {
    animation-delay: 0.1s;
}

/* Logo */
.container> :nth-child(2) {
    animation-delay: 0.2s;
}

/* Header */
.container> :nth-child(3) {
    animation-delay: 0.3s;
}

/* Button */

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* --- Phase 2: Advanced Polish --- */

/* 3D Tilt Container */
.container {
    /* Existing styles preserved, adding transform-style */
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    /* Smooth tilt */
}

/* Holographic Logo Effect */
.logo-container {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    /* Assuming circular logo area or adjust as needed */
}

.logo-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 45%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 55%);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.5s;
    pointer-events: none;
}

.logo-container:hover::after {
    transform: rotate(45deg) translateY(100%);
    transition: transform 0.8s;
}

.logo {
    /* Enhance existing glow */
    transition: filter 0.3s;
}

.logo-container:hover .logo {
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.8)) hue-rotate(15deg);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: var(--space-md) var(--space-sm);
    }

    .logo {
        width: 140px;
    }
}

/* --- Projects Page Styles --- */
.projects-page {
    min-height: 100vh;
    width: 100%;
    /* Force full width */
    padding: 100px 0 150px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projects-container {
    width: 100%;
    max-width: none;
    /* Uncapped fluid width */
    margin: 0;
    padding: 0 clamp(2rem, 4vw, 4rem);
}

.projects-header {
    text-align: center;
    margin-bottom: clamp(3rem, 5vw, 5rem);
}

.projects-header h1 {
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -0.02em;
}

.projects-header .subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 300;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    padding-bottom: 4rem;
    /* Removed max-width constraint */
    margin: 0 auto;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 400px;
        /* Base height for bento cells */
    }

    /* Bento Spans */
    .span-2 {
        grid-column: span 2;
    }

    .span-1 {
        grid-column: span 1;
    }
}

@media (min-width: 1600px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 2200px) {
    .projects-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Bento Card Base - Glassmorphism aligned with main site */
.project-card {
    height: 100%;
    min-height: 400px;
    position: relative;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    isolation: isolate;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 223, 255, 0.2);
    border-color: var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
    z-index: 10;
}

/* Hero Card (3D Print) */
.card-hero .project-title {
    font-size: 3rem;
}

/* Tool Cards (Flow, Frame) */
.card-tool .project-title {
    font-size: 1.5rem;
}

.card-tool .card-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 100%);
    padding: 1.5rem;
}

/* Coming Soon Card */
.card-soon {
    opacity: 0.7;
    filter: grayscale(100%);
}

.card-soon:hover {
    opacity: 1;
    filter: grayscale(0%);
}

.card-soon .project-title::after {
    content: 'SOON';
    display: inline-block;
    font-size: 0.7rem;
    background: #333;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    transform: translateY(-2px);
}

.card-image-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    background: #000;
    z-index: 0;
    border: none;
    border-radius: 40px;
    /* Match parent radius */
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 40px;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
    filter: brightness(1.4) saturate(1.2) contrast(1.1);
    /* Much brighter for dark berry images */
}

.project-card:hover .project-image {
    transform: scale(1.05);
    filter: brightness(1.5) saturate(1.3) contrast(1.15);
}

/* Content Overlay */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 2.5rem;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.project-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.project-desc {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    font-weight: 400;
    max-width: 90%;
    opacity: 0.9;
}

/* Back Button */
.nav-back {
    position: fixed;
    top: var(--space-md);
    left: var(--space-md);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted-dark);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}



.nav-back:hover {
    color: var(--accent-glow);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 223, 255, 0.3);
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(0, 223, 255, 0.15);
}

.projects-page .nav-back:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Project Page Footer */
.project-footer {
    position: relative;
    padding: 2rem;
    margin-top: 4rem;
    background: transparent;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}