/* =========================================
   1. LOCAL FONT DEFINITIONS
   ========================================= */

/* Define Vazirmatn (Persian) using the variable file */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900; /* This allows all weights (thin to black) from one file */
    font-style: normal;
    font-display: swap;   /* Ensures text is visible while font loads */
}

/* Define Inter (English/Numbers) using the variable file */
@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* =========================================
   2. GLOBAL STYLES
   ========================================= */

/* Apply custom fonts */
body {
    font-family: 'Vazirmatn', 'Inter', sans-serif;
    scroll-behavior: smooth;
    background-color: #1f2937; /* Dark steel base color */
    /* Add a subtle "shine" at the top */
    background-image: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 60%);
    background-repeat: no-repeat;
    color: #a0b3d1;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Animated Blueprint Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(to right, rgba(13, 148, 136, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(13, 148, 136, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: blueprint-scroll 10s linear infinite;
    z-index: -1;
    opacity: 0.5;
}

@keyframes blueprint-scroll {
    from { background-position: 0 0; }
    to { background-position: -40px -40px; }
}

/* Custom scrollbar for dark mode */
::-webkit-scrollbar {
    width: 8px;
    background-color: #1f2937; /* Updated to match new bg */
}
::-webkit-scrollbar-thumb {
    background-color: #0d9488;
    border-radius: 10px;
}

/* Page transition effect (Simplified for multi-page) */
.page-section {
    /* Removed display:none and active class */
    /* We just need the build-in animation */
    padding-top: 80px; /* Offset for fixed header */
    min-height: 100vh;
}

/* "Build-in" Animation (for Intersection Observer) */
.animate-build-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-build-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header glassmorphism */
.header-glass {
    background: rgba(31, 41, 55, 0.7); /* Updated to match new bg */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(13, 148, 136, 0.2);
}

/* 3D Canvas */
#hero-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.7;
    cursor: move; /* Add cursor grab */
}

/* =========================================
   3. PROJECT TIMELINE STYLES
   ========================================= */

.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}
/* The vertical line */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: #0d9488;
    top: 0;
    bottom: 0;
    right: 50%;
    margin-right: -1.5px;
    opacity: 0.3;
}
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}
/* The circle on the timeline */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: #1f2937; /* Updated to match new bg */
    border: 4px solid #0d9488;
    top: 30px;
    border-radius: 50%;
    z-index: 1;
    transition: all 0.3s ease;
}
/* Item placement */
.timeline-right {
    right: 0;
}
.timeline-left {
    left: 0;
    text-align: left;
    direction: ltr; /* For left-aligned Farsi text */
}
.timeline-left::after {
    left: -10px;
    right: auto;
}
.timeline-content {
    padding: 20px 30px;
    position: relative;
    border-radius: 8px;
    border: 1px solid rgba(13, 148, 136, 0.3);
    background: rgba(13, 148, 136, 0.05);
    transition: all 0.4s ease;
}
.timeline-item:hover .timeline-content {
    background: rgba(13, 148, 136, 0.1);
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(13, 148, 136, 0.3);
}
.timeline-item:hover::after {
    transform: scale(1.3);
    background-color: #0d9488;
}

.project-image-preview {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    width: 300px;
    height: 200px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: all 0.4s ease-out;
    pointer-events: none;
    z-index: 10;
    border: 2px solid #0d9488;
    box-shadow: 0 0 30px rgba(13, 148, 136, 0.5);
}

.timeline-right .project-image-preview { left: 110%; }
.timeline-left .project-image-preview { right: 110%; }

.timeline-item:hover .project-image-preview {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* =========================================
   4. COMPONENT STYLES
   ========================================= */

/* Stylish "Glass Blade" buttons for Hero */
.hero-blade-glass {
    background: rgba(13, 148, 136, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(13, 148, 136, 0.3);
    transition: all 0.3s ease;
}
.hero-blade-glass:hover {
    background: rgba(13, 148, 136, 0.15);
    border-color: rgba(13, 148, 136, 0.7);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.2);
}

/* Header Dropdown */
.dropdown-box {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 240px;
    background: #1f2937; /* Dark steel base */
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 100;
    overflow: hidden;
    /* Animation */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.dropdown:hover .dropdown-box {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.dropdown-link {
    display: block;
    padding: 10px 15px;
    color: #a0b3d1;
    transition: all 0.3s ease;
}
.dropdown-link:hover {
    background: rgba(13, 148, 136, 0.1);
    color: #14b8a6;
}