/* RAAZ Design System | Core Blueprint v1.0 */

/* Yekan Bakh Font Family */
@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/Yekan Bakh FaNum 03 Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/Yekan Bakh FaNum 04 Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/Yekan Bakh FaNum 05 Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/Yekan Bakh FaNum 06 Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Yekan Bakh';
    src: url('../fonts/Yekan Bakh FaNum 07 Heavy.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Color Palette */
    --raaz-black: #000000;
    --graphite-dark: #232328;
    --cold-silver: #AFAFB9;
    --data-blue: #007FFF;
    --white: #FFFFFF;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 32px;
    --space-xl: 64px;
    --space-2xl: 128px;

    /* Grid */
    --grid-cols: 12;
    --grid-gap: var(--space-md);
    --container-width: 1440px;

    /* Typography - LTR (English) */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-persian: 'Yekan Bakh', system-ui, sans-serif;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-reveal: 1.5s;
    /* Slowed down for 'Latency of Truth' */
    --duration-hover: 0.4s;
}

/* RTL Theme (Farsi) */
html[dir="rtl"],
html[lang="fa"] {
    direction: rtl;
}

html[lang="fa"] body {
    font-family: var(--font-persian);
}

html[lang="fa"] h1,
html[lang="fa"] h2,
html[lang="fa"] h3,
html[lang="fa"] h4,
html[lang="fa"] h5,
html[lang="fa"] h6 {
    font-family: var(--font-persian);
    letter-spacing: 0;
}

html[lang="fa"] .nav-link,
html[lang="fa"] .btn,
html[lang="fa"] .text-xs,
html[lang="fa"] .text-sm {
    letter-spacing: 0;
}

html[lang="fa"] .site-header nav ul {
    flex-direction: row-reverse;
}

html[lang="fa"] .logo {
    font-family: var(--font-persian);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--raaz-black);
    color: var(--cold-silver);
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background-color: var(--raaz-black);
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-hover) ease;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--white);
    line-height: 1.1;
    text-transform: uppercase;
}

/* Hero Title Animation */
@keyframes heroReveal {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

h1 {
    font-size: clamp(48px, 6vw, 96px);
    margin-bottom: var(--space-lg);
    background: linear-gradient(to right, var(--white), var(--cold-silver));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: heroReveal 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards; /* Applied new animation */
}

/* Refined Intro Text */
.intro-text {
    font-size: clamp(1.25rem, 2vw, 2rem);
    color: var(--white);
    line-height: 1.6;
    font-weight: 300;
    max-width: 900px;
    margin: 0 auto;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); /* Added depth */
}

/* Elegant Shimmer Effect */
    font-size: clamp(28px, 3vw, 48px);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: 1.5rem;
    color: var(--white);
}

p {
    margin-bottom: var(--space-md);
    max-width: 65ch;
    font-weight: 300;
}

.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cold-silver);
    opacity: 0.8;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--data-blue);
    box-shadow: 0 0 10px var(--data-blue);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(175, 175, 185, 0.3);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--data-blue);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    gap: var(--grid-gap);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.section {
    padding: var(--space-2xl) 0;
    position: relative;
    overflow: hidden;
}

.fullscreen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section Background - Deep Black 3D Void */
.section.fullscreen {
    background-color: #000000;
    background-image: radial-gradient(circle at 50% 50%, #08080a 0%, #000000 100%);
    position: relative;
    overflow: hidden;
}

.section.fullscreen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    /* Subtle rotating fog with hint of blue */
    background: 
        conic-gradient(from 0deg at 50% 50%, transparent 0deg, rgba(0, 127, 255, 0.03) 45deg, transparent 90deg),
        radial-gradient(circle at center, rgba(0, 127, 255, 0.02) 0%, transparent 60%);
    animation: rotateBg 120s linear infinite; /* Slow, majestic rotation */
    z-index: 0;
    pointer-events: none;
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hero Logo Background - Subtle Pulse */
.hero-logo-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    height: 60vmin;
    max-width: 500px;
    max-height: 500px;
    opacity: 0.05; /* Reduced opacity for deep black feel */
    pointer-events: none;
    z-index: 0;
    filter: blur(2px); /* Soften edges */
    animation: heroLogoPulse 10s ease-in-out infinite;
}

.hero-logo-bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(1.5) grayscale(100%) opacity(0.5); /* Ghostly look */
}

@keyframes heroLogoPulse {
    0%, 100% { opacity: 0.03; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.08; transform: translate(-50%, -50%) scale(1.05); }
}

/* Backgrounds & Geometry - Minimalist Point Cloud */
.bg-grid-pattern {
    position: fixed; /* Fixed for 3D parallax feel */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Sparse dot pattern */
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    opacity: 0.2;
    mask-image: radial-gradient(circle at 50% 50%, black 0%, transparent 80%); /* Focus center */
    pointer-events: none;
}

.geometric-shape {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.03);
    z-index: 0;
    pointer-events: none;
}

.shape-circle {
    border-radius: 50%;
    border: 1px solid rgba(0, 127, 255, 0.05); /* Faint blue ring */
}

/* Glow Spot - The 5% Blue Element */
.glow-spot {
    position: absolute;
    width: 1000px; /* Larger, softer spread */
    height: 1000px;
    background: radial-gradient(circle, rgba(0, 127, 255, 0.03) 0%, transparent 70%); /* Deep faint blue */
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    transform: translate(-50%, -50%);
    transition: top 0.1s linear, left 0.1s linear;
    mix-blend-mode: screen;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid rgba(175, 175, 185, 0.3);
    color: var(--white);
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    transition: all var(--duration-hover) ease;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    cursor: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn:hover {
    border-color: var(--data-blue);
    color: var(--data-blue);
    box-shadow: 0 0 20px rgba(0, 127, 255, 0.1);
}

.btn:hover::before {
    left: 100%;
}

.nav-link {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    padding-bottom: 4px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--data-blue);
    transition: width var(--duration-hover) ease;
    box-shadow: 0 0 8px var(--data-blue);
}

.nav-link:hover {
    color: var(--white);
}

.nav-link:hover::after {
    width: 100%;
}

/* Cards & Glassmorphism */
.glass-card {
    background: rgba(35, 35, 40, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-lg);
    transition: transform var(--duration-hover) ease, border-color var(--duration-hover) ease, box-shadow var(--duration-hover) ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 127, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-card {
    display: block;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    border: 1px solid transparent;
}

.project-card:hover {
    transform: scale(1.02);
    border-color: var(--data-blue);
}

.project-card h3 {
    transition: transform 0.5s ease, color 0.3s ease;
}

.project-card:hover h3 {
    transform: translateX(10px);
    color: var(--data-blue);
}

.project-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    margin-bottom: var(--space-md);
    background: var(--graphite-dark);
}

.project-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0.6;
    transition: opacity 0.5s ease;
}

.project-card:hover .project-image-container::after {
    opacity: 0.3;
}

/* Animations - "Latency of Truth" */
@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

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

@keyframes revealIn {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
    }

    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes pulseWait {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

.reveal-text {
    opacity: 0;
    animation-fill-mode: forwards;
}

.reveal-text.visible {
    animation: revealUp var(--duration-reveal) var(--ease-out-expo) forwards;
}

.reveal-line {
    opacity: 0;
    width: 0;
    height: 1px;
    background: var(--data-blue);
    box-shadow: 0 0 10px var(--data-blue);
}

.reveal-line.visible {
    width: 100%;
    opacity: 1;
    transition: width 1.5s var(--ease-in-out-cubic), opacity 0.5s ease;
}

/* Delay Utilities */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-1000 {
    animation-delay: 1.0s;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-lg);
    z-index: 100;
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-header.scrolled {
    background-color: rgba(0, 0, 0, 0.8);
    padding: var(--space-md) var(--space-lg);
}

.logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--white);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: var(--space-lg);
    position: relative;
}

.form-input,
.form-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--graphite-dark);
    color: var(--white);
    padding: var(--space-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 0;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--data-blue);
    background: rgba(0, 127, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 127, 255, 0.1);
}

/* Footer */
.site-footer {
    padding: var(--space-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--raaz-black);
    position: relative;
}

/* Utility for text gradients and effects */
.text-gradient {
    background: linear-gradient(45deg, var(--white), var(--cold-silver));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-glow {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    background: linear-gradient(45deg, var(--data-blue), transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hover-glow:hover .border-glow {
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --space-lg: 24px;
        --space-xl: 48px;
        --space-2xl: 80px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .cursor-dot,
    .cursor-outline {
        display: none;
        /* Hide custom cursor on touch devices */
    }

    *,
    *::before,
    *::after {
        cursor: auto;
    }
}

/* --- Hero & Landing Enhancements --- */

/* Elegant Shimmer Effect */
.shimmer-text {
    background: linear-gradient(
        90deg,
        var(--cold-silver) 0%,
        var(--white) 50%,
        var(--cold-silver) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5; /* More subtle */
    animation: bounce 2s infinite;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-mouse {
    width: 24px;
    height: 40px;
    border: 1px solid var(--cold-silver); /* Thinner border */
    border-radius: 12px;
    position: relative;
    margin-bottom: 8px;
}

.scroll-wheel {
    width: 2px; /* Thinner wheel */
    height: 6px;
    background: var(--white);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 1.5s infinite;
}

.scroll-text {
    font-size: 0.6rem; /* Smaller text */
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--cold-silver);
    font-weight: 300;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-8px) translateX(-50%); } /* Reduced bounce */
    60% { transform: translateY(-4px) translateX(-50%); }
}

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

/* Scanline Overlay - Subtle Noise */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9998;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

/* --- Project Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1), visibility 0.4s step-end;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s cubic-bezier(0.19, 1, 0.22, 1), visibility 0s step-start;
}

.modal-content {
    background: rgba(20, 20, 25, 0.95);
    width: 100%;
    max-width: 1200px; /* Wider modal */
    max-height: 90vh;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px; /* Smooth corners */
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: translateY(40px) scale(0.98);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.7);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close:hover {
    background: var(--white);
    color: var(--black);
    transform: rotate(90deg);
}

.modal-header {
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
    font-size: 2.5rem; /* Slightly smaller for tighter spacing */
    margin-bottom: 2px;
    color: var(--white);
    letter-spacing: -0.02em;
}

.modal-subtitle {
    color: var(--data-blue);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-description {
    margin-bottom: var(--space-lg);
    line-height: 1.6;
    color: var(--cold-silver);
    max-width: 800px;
    font-size: 1rem;
}

.modal-description p {
    margin-bottom: var(--space-sm);
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); /* Larger images */
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.modal-gallery img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Consistent aspect ratio for uniform height */
    object-fit: cover; /* Fill the area without distortion */
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.modal-gallery img:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Button for Live Project */
.btn-view-live {
    margin-bottom: var(--space-lg);
    background: var(--white);
    color: var(--black);
    font-weight: 600;
}

.btn-view-live:hover {
    background: var(--data-blue);
    color: var(--white);
    border-color: var(--data-blue);
}

/* Scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--graphite-dark);
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        border-radius: 0;
    }
    
    .modal-header, .modal-body {
        padding: var(--space-md);
    }
    
    .modal-title {
        font-size: 2rem;
    }
    
    .modal-gallery {
        grid-template-columns: 1fr;
    }
}