/* SPACEART LAB - Ultra Premium Stylesheet */

/* ========== Fonts ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@300;400;500;600&display=swap');

/* ========== Variables ========== */
:root {
    --bg-primary: #111111; /* [UPDATED] Deep Gray instead of Pure Black */
    --bg-secondary: #0a0a0a;
    --card-bg: rgba(30, 30, 30, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #fff;
    --accent-tech: #00f2ff; /* Cyan tech accent */
}

/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    scroll-behavior: smooth;
    font-size: 16px;
}
body { 
    /* background-color: var(--bg-primary); [REMOVED] */
    background: radial-gradient(circle at 50% 50%, #1a1b1e 0%, #000000 100%); /* Depth */
    position: relative;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
/* Grid Texture Overlay */
body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
    z-index: -1;
    pointer-events: none;
}

/* ========== Utility: Tech Background Grid ========== */
.tech-grid {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

/* ========== Navigation (Fixed) ========== */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    padding: 40px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: auto;
}
.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}
.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    background: none;
    border: none;
}
.nav-link:hover {
    color: var(--accent-tech);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}

#lang-switch {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 24px !important;
}

#lang-switch option {
    background: #111;
    color: #fff;
}

/* ========== Hero Section (Fixed) ========== */
#hero {
    position: fixed; /* [CHANGED] Fixed to background */
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0; /* Behind everything */
    pointer-events: none; /* Allow click-through */
}
#hero canvas {
    pointer-events: auto; /* Re-enable canvas interaction */
    z-index: 2; /* Particles above shapes/slogan */
}

/* ========== Slogans (Behind Particles) ========== */
#slogan-container {
    position: absolute;
    width: 90%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Behind Particles */
    pointer-events: none;
    mix-blend-mode: color-dodge; /* [NEW] Blending for vibrancy */
}
.slogan-spacer {
    width: 600px; 
    height: 100px;
}
.slogan-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px; /* Balanced size */
    font-weight: 500; /* Cleaner weight */
    letter-spacing: 4px; /* Premium spacing */
    background: linear-gradient(120deg, #ffffff 0%, #a2f9ff 100%); /* Soft Tech Gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 242, 255, 0.3); /* Soft Glow */
    opacity: 0; 
    transition: opacity 0.5s ease;
    white-space: nowrap;
}

/* ========== Ambient Shapes (Background) ========== */
.hero-shapes {
    position: absolute;
    width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
    opacity: 0.8; 
}
.shape {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.2); /* Thicker borders */
    animation: float-anim 20s infinite linear;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.1); 
}
/* ... shapes ... */
.shape-1 {
    width: 300px; height: 300px;
    top: 10%; left: 10%;
    animation-duration: 25s;
}
.shape-2 {
    width: 500px; height: 500px;
    bottom: -100px; right: -100px;
    border-radius: 0; /* Square */
    transform: rotate(45deg);
    animation-duration: 40s;
    animation-direction: reverse;
}
.shape-3 {
    width: 150px; height: 150px;
    top: 60%; right: 20%;
    border: 1px dashed rgba(0, 242, 255, 0.1);
    animation-duration: 15s;
}
.shape-4 {
    width: 20px; height: 20px;
    top: 20%; right: 40%;
    background: var(--accent-tech);
    opacity: 0.3;
    animation: float-anim 12s infinite ease-in-out;
}
@keyframes float-anim {
    0% { transform: rotate(0deg) translate(0, 0); }
    50% { transform: rotate(180deg) translate(20px, 20px); }
    100% { transform: rotate(360deg) translate(0, 0); }
}

/* ========== Scroll Spacer (Control Animation) ========== */
#scroll-spacer {
    height: 250vh; /* [EXTENDED] Longer scroll for dispersion */
    width: 100%;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* ========== Projects Section ========== */
#projects {
    position: relative;
    min-height: 100vh;
    padding: 160px 5%;
    background: var(--bg-secondary);
    z-index: 2; /* Scroll over hero */
    margin-top: -150vh; /* [UPDATED] Maximum overlap */
    box-shadow: 0 -50px 100px rgba(0,0,0,0.8); /* Shadow to blend */
}
.section-header {
    text-align: center;
    margin-bottom: 120px;
    position: relative;
    z-index: 2;
}
#loading {
    position: absolute;
    top: 50%; left: 50%; /* [RESTORED] Center horizontally/vertically */
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    z-index: 10;
}
.scroll-hint {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards;
}
.scroll-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--text-secondary), transparent);
    position: relative;
    overflow: hidden;
}
.scroll-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: #fff;
    animation: drop 2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes drop {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes trail-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes trail-spin-rev {
    from { transform: translate(-50%, -50%) rotate(360deg); }
    to { transform: translate(-50%, -50%) rotate(0deg); }
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}
.section-subtitle {
    display: block;
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    color: var(--accent-tech);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(20px);
}
.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 300;
    letter-spacing: -2px;
    line-height: 1;
    opacity: 0;
    transform: translateY(40px);
}
.section-title span {
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ========== Project Card (Glassmorphism + Tech) ========== */
.project-card {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 4px; /* Tech Sharpness */
    /* overflow: hidden; [REMOVED] Allow content to pop 3D */
    z-index: 2;
    opacity: 0;
    transform: translateY(60px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}
.project-card + .project-card {
    margin-top: 40px;
}

/* Tech Corner Accents */
.project-card::before, .project-card::after {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border: 1px solid var(--text-secondary);
    transition: all 0.4s ease;
    opacity: 0.5;
    pointer-events: none; /* [FIX] Prevent blocking interactions */
}
.project-card::before { top: 0; left: 0; border-right: none; border-bottom: none; }
.project-card::after { bottom: 0; right: 0; border-left: none; border-top: none; }

.project-card:hover { border-color: rgba(255,255,255,0.2); }
.project-card:hover::before, .project-card:hover::after {
    width: 100%; height: 100%;
    opacity: 0.1;
    border-color: var(--accent-tech);
}

.project-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    border-bottom: 1px solid var(--card-border);
}

.project-info {
    padding: 60px 40px;
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.badge-container { margin-bottom: 40px; }
.tech-badge {
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    padding: 6px 12px;
    border: 1px solid var(--accent-tech);
    color: var(--accent-tech);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-main h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 48px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -1px;
}
.info-main p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}
.description-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--accent-tech);
    color: var(--accent-tech);
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    background: var(--accent-tech);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::before {
    left: 100%;
}

.project-visuals {
    position: relative;
    height: 600px;
    /* overflow: hidden;  [REMOVED] Allow pop-out */
}

.trail-visual {
    position: relative;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0) 28%),
        radial-gradient(circle at 72% 30%, rgba(0, 242, 255, 0.25) 0, rgba(0, 242, 255, 0) 32%),
        linear-gradient(180deg, rgba(8, 18, 28, 0.92) 0%, rgba(0, 0, 0, 0.96) 100%);
    overflow: hidden;
}

.trail-ring {
    position: absolute;
    left: 50%;
    top: 56%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.42);
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 14px rgba(0, 242, 255, 0.22));
}

.trail-ring-a {
    width: 360px;
    height: 360px;
    animation: trail-spin 16s linear infinite;
}

.trail-ring-b {
    width: 220px;
    height: 220px;
    border-color: rgba(0, 242, 255, 0.55);
    animation: trail-spin-rev 11s linear infinite;
}

.trail-core {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00f2ff;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.85);
}

.trail-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.82);
}

.trail-dot-a {
    left: calc(50% + 179px);
    top: 56%;
    animation: twinkle 1.8s ease-in-out infinite;
}

.trail-dot-b {
    left: calc(50% - 111px);
    top: calc(56% - 95px);
    animation: twinkle 2.5s ease-in-out infinite;
}

.trail-dot-c {
    left: calc(50% + 64px);
    top: calc(56% + 104px);
    animation: twinkle 2.2s ease-in-out infinite;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* [UPDATED] 4 cols to fit 2x2 + 4 items */
    grid-template-rows: repeat(2, 1fr);
    height: 100%;
}
.gallery-item {
    position: relative;
    /* overflow: hidden; [REMOVED] Allow pop-out */
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg); /* Ensure background is solid/glassy when popping out */
    transition: z-index 0s; /* Instant z-index switch */
}
.gallery-item:nth-child(1) {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease, box-shadow 0.5s ease;
    filter: grayscale(30%) brightness(0.85);
}
.gallery-item:hover img {
    transform: scale(1.05);
    filter: grayscale(0%) brightness(1.1) contrast(1.05);
    box-shadow: 
        0 0 15px rgba(0, 242, 255, 0.3),
        0 0 40px rgba(0, 242, 255, 0.15),
        0 0 80px rgba(0, 242, 255, 0.05);
}
.gallery-overlay {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.overlay-text {
    font-family: 'Space Grotesk', monospace;
    font-size: 10px;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ========== Footer ========== */
footer {
    border-top: 1px solid var(--card-border);
    padding: 80px 5%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: #000;
}
.footer-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -1px;
}
.footer-links {
    display: flex;
    gap: 40px;
}
.footer-link {
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}
.footer-link:hover { color: var(--accent-tech); }

/* ========== Animations Classes ========== */
.reveal-active {
    opacity: 1 !important;
    transform: translateY(0); /* [FIX] Removed !important to allow JS tilt */
    transition-delay: 0.2s;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .project-content { grid-template-columns: 1fr; }
    .project-info { border-right: none; border-bottom: 1px solid var(--card-border); flex-direction: row; align-items: flex-start; }
    .project-visuals { height: auto; }
    .gallery-grid { grid-template-columns: 1fr 1fr; height: auto; }
    .gallery-item { height: 300px; }
    .gallery-item:nth-child(1) { grid-column: 1 / 3; height: 400px; }
}
@media (max-width: 768px) {
    .project-info { flex-direction: column; gap: 40px; }
    .section-title { font-size: 40px; }
    .gallery-grid { display: flex; flex-direction: column; }
    .gallery-item { height: 250px; width: 100%; }
}
