/* ==========================================================================
   3D SPATIAL SHOWCASE STYLESHEET (ZymoWeb)
   ========================================================================== */

:root {
    --bg-deep: #06080d;
    --bg-card: rgba(15, 23, 42, 0.65);
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(6, 182, 212, 0.4);
    --accent-cyan: #06b6d4;
    --accent-purple: #a855f7;
    --accent-amber: #f59e0b;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --font-heading: 'Syne', 'Vazirmatn', sans-serif;
    --font-body: 'Outfit', 'Plus Jakarta Sans', 'Vazirmatn', sans-serif;
}

/* Reset & Global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-height: 500vh; /* Expansive scroll canvas */
    background: radial-gradient(circle at 50% 0%, #111827 0%, var(--bg-deep) 70%);
    position: relative;
    overflow-x: hidden;
}

/* RTL Support */
[dir="rtl"] {
    font-family: 'Vazirmatn', 'Outfit', sans-serif;
}
[dir="rtl"] .back-link i {
    transform: rotate(180deg);
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(6, 8, 13, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

.brand-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.logo-accent {
    color: var(--accent-cyan);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.scroll-progress-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    border: 1px solid var(--border-glass);
}

.scroll-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.progress-bar-wrap {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    transition: width 0.1s ease-out;
}

.scroll-percent {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-cyan);
    min-width: 32px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 10;
    pointer-events: none; /* Allows scrolling through */
    transition: opacity 0.5s ease;
}

.hero-content {
    max-width: 750px;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-title span {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.mouse-icon {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.8s infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; top: 6px; }
    100% { opacity: 0; top: 22px; }
}

/* 3D Spatial Viewport */
.spatial-viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    perspective: 1200px;
    perspective-origin: 50% 50%;
    z-index: 5;
    pointer-events: none;
    overflow: hidden;
}

.spatial-world {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

/* Spatial Card Component */
.spatial-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(320px, 75vw, 920px);
    height: clamp(380px, 60vh, 520px);
    margin-top: clamp(-190px, -30vh, -260px);
    margin-left: clamp(-160px, -37.5vw, -460px);
    
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    padding: 1.75rem;
    
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    transform-style: preserve-3d;
    opacity: 0;
    pointer-events: auto;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    will-change: transform, opacity;
}

.spatial-card:hover {
    border-color: var(--border-glow);
    box-shadow: 0 30px 70px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Card Visual Image Side */
.card-visual {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transform: translateZ(30px); /* 3D depth push */
}

.image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.spatial-card:hover .image-wrapper img {
    transform: scale(1.08);
}

.visual-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 60%, rgba(6, 8, 13, 0.8) 100%);
    pointer-events: none;
}

/* Card Info Side */
.card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: translateZ(50px); /* Deeper 3D push for text */
}

.card-tag {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    margin-bottom: 0.8rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3.5vw, 2.3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

.card-desc {
    font-size: clamp(0.88rem, 1.4vw, 1rem);
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.card-meta {
    display: flex;
    gap: 1.25rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.card-meta i {
    color: var(--accent-cyan);
    margin-right: 0.3rem;
}

[dir="rtl"] .card-meta i {
    margin-right: 0;
    margin-left: 0.3rem;
}

/* Outro Section */
.outro-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.outro-section.active {
    pointer-events: auto;
}

.outro-content {
    max-width: 650px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    padding: 3rem 2.5rem;
    border-radius: 28px;
    border: 1px solid var(--border-glass);
}

.outro-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.outro-content p {
    color: var(--text-sub);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.outro-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
    color: #fff;
    text-decoration: none;
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    padding: 0.9rem 1.8rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid var(--border-glass);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem 1.25rem;
    }
    
    .spatial-card {
        grid-template-columns: 1fr;
        grid-template-rows: 1.1fr 1fr;
        gap: 1rem;
        padding: 1.25rem;
        height: clamp(480px, 75vh, 600px);
        margin-top: clamp(-240px, -37.5vh, -300px);
    }
    
    .scroll-label {
        display: none;
    }
    
    .progress-bar-wrap {
        width: 50px;
    }
}
