/* ==========================================================================
   ZymoWeb Redesign CSS
   Vibrant Cyberpunk / Glassmorphic dark theme with RTL support
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Vazirmatn:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #6366f1; /* Indigo */
    --primary-rgb: 99, 102, 241;
    --secondary: #06b6d4; /* Cyan */
    --secondary-rgb: 6, 182, 212;
    --accent: #ec4899; /* Pink */
    --accent-rgb: 236, 72, 153;
    
    --bg-dark: #09061a;
    --bg-card: rgba(26, 25, 62, 0.55);
    --bg-terminal: rgba(12, 11, 26, 0.88);
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    
    --border: rgba(255, 255, 255, 0.12);
    --border-glow: rgba(99, 102, 241, 0.35);
    
    --font-en: 'Poppins', sans-serif;
    --font-fa: 'Vazirmatn', sans-serif;
    
    --glow-indigo: 0 0 15px rgba(99, 102, 241, 0.5);
    --glow-cyan: 0 0 15px rgba(6, 182, 212, 0.5);
    --glow-pink: 0 0 15px rgba(236, 72, 153, 0.5);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
}

/* Dynamic Fonts based on language */
html[dir="ltr"] {
    font-family: var(--font-en);
}

html[dir="rtl"] {
    font-family: var(--font-fa);
}

body {
    color: var(--text-primary);
    background: linear-gradient(135deg, #070515 0%, #150f3d 40%, #0c0827 75%, #05030f 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Glowing background blobs */
.glow-orb {
    position: fixed;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -2;
    opacity: 0.3;
    pointer-events: none;
    animation: float-orb 24s infinite alternate ease-in-out;
}
.glow-orb-1 {
    top: -10%;
    left: -10%;
    background: var(--primary);
}
.glow-orb-2 {
    bottom: -10%;
    right: -10%;
    background: var(--secondary);
    animation-delay: -6s;
}
.glow-orb-3 {
    top: 40%;
    right: 15%;
    background: var(--accent);
    width: 350px;
    height: 350px;
    animation-delay: -12s;
    opacity: 0.18;
}
@keyframes float-orb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(60px, 40px) scale(1.15); }
    100% { transform: translate(-40px, 80px) scale(0.9); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 4px;
    border: 1px solid var(--border);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
    box-shadow: var(--glow-indigo);
}

/* Background Particle Overlay Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: auto;
}

/* Custom Magnetic Cursor */
.custom-cursor {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    box-shadow: var(--glow-cyan);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

.custom-cursor-outline {
    width: 32px;
    height: 32px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.08s ease-out, width 0.3s, height 0.3s, border-color 0.3s;
}

/* Cursor Hover states */
body.hovered-link .custom-cursor {
    background: var(--accent);
    width: 12px;
    height: 12px;
    box-shadow: var(--glow-pink);
}

body.hovered-link .custom-cursor-outline {
    width: 48px;
    height: 48px;
    border-color: var(--accent);
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(236, 72, 153, 0.05);
}

/* Typography & Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0 4rem 0;
    position: relative;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* Glowing Neon Borders */
.glow-border {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glow-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.15), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.glow-border:hover::before {
    transform: translateX(100%);
}

.glow-border:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.1);
}

/* Interactive Navigation */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(4, 4, 9, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: var(--transition-smooth);
}

.header.scrolled {
    background: rgba(4, 4, 9, 0.85);
    padding: 0.5rem 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    letter-spacing: -1px;
    direction: ltr !important;
}

.logo span {
    color: var(--secondary);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* RTL Menu Adjustments */
html[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

/* Language and Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switch {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-fast);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.lang-switch:hover {
    border-color: var(--primary);
    box-shadow: var(--glow-indigo);
    transform: translateY(-1px);
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 101;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    left: 0;
    transition: var(--transition-fast);
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 22px; }

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg);
    top: 11px;
}
.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg);
    top: 11px;
}

/* Modern Glowing Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5), var(--glow-cyan);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    transform: translateY(-3px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 120px;
    position: relative;
    overflow: hidden;
}

/* Cyberpunk Background Grid */
.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-100px);
    animation: grid-scroll 24s linear infinite;
    z-index: -2;
    pointer-events: none;
}

@keyframes grid-scroll {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    display: block;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1.5px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

/* Monospace Interactive Command Terminal */
.terminal-container {
    width: 100%;
    max-width: 500px;
    height: 380px;
    border-radius: 12px;
    background: var(--bg-terminal);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(99, 102, 241, 0.1);
    font-family: 'Courier New', Courier, monospace;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.terminal-body {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 0.9rem;
    color: #10b981; /* Retro Green */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.terminal-output {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-line {
    line-height: 1.4;
}

.terminal-line.command {
    color: var(--secondary);
}

.terminal-line.system {
    color: var(--text-muted);
}

.terminal-line.error {
    color: var(--accent);
}

.terminal-input-row {
    display: flex;
    align-items: center;
    color: var(--secondary);
}

.terminal-prompt {
    margin-right: 8px;
    font-weight: bold;
}

html[dir="rtl"] .terminal-prompt {
    margin-right: 0;
    margin-left: 8px;
}

.terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: #10b981;
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
}

/* Services Grid & Tilt Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: inset 0 0 15px rgba(99, 102, 241, 0.1);
    transform: translateZ(30px);
    transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: white;
    box-shadow: var(--glow-indigo);
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    transform: translateZ(25px);
}

.service-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    transform: translateZ(20px);
}

/* Portfolio Gallery styling */
.portfolio-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.filter-btn, .blog-filter-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active, .blog-filter-btn:hover, .blog-filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--glow-indigo);
}

.portfolio-grid, .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.portfolio-item, .blog-card {
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: var(--transition-smooth), border-color var(--transition-fast);
}

.portfolio-item:hover, .blog-card:hover {
    border-color: var(--secondary);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.15);
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.portfolio-item:hover .portfolio-image, .blog-card:hover .portfolio-image {
    transform: scale(1.1) rotate(1deg);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(4, 4, 9, 0.95) 10%, rgba(4, 4, 9, 0.3) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portfolio-item-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 9, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    position: relative;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-caption {
    background: rgba(13, 13, 27, 0.9);
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.lightbox-caption h3 {
    margin-bottom: 0.5rem;
}

.lightbox-caption p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.lightbox-close:hover {
    background: var(--accent);
    box-shadow: var(--glow-pink);
    border-color: var(--accent);
}

.about-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr 1fr;
    gap: 3rem;
    margin-bottom: 6rem;
    align-items: start;
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skill-wrapper {
    width: 100%;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.skill-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.skill-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
    box-shadow: var(--glow-indigo);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 4rem auto 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
    width: 50%;
    padding: 0 3rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--secondary);
    box-shadow: var(--glow-cyan);
    z-index: 1;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    display: inline-block;
    letter-spacing: 1px;
}

.timeline-card {
    padding: 2rem;
}

.timeline-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* RTL Timeline Adjustments */
html[dir="rtl"] .timeline-item:nth-child(odd) {
    left: auto;
    right: 0;
    text-align: right;
}
html[dir="rtl"] .timeline-item:nth-child(odd) .timeline-dot {
    left: -10px;
    right: auto;
}
html[dir="rtl"] .timeline-item:nth-child(even) {
    left: auto;
    right: 50%;
    text-align: right;
}
html[dir="rtl"] .timeline-item:nth-child(even) .timeline-dot {
    right: -10px;
    left: auto;
}

/* Contact Page Glow Form */
.contact-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
}

.contact-form {
    padding: 3rem;
}

.form-group {
    margin-bottom: 2rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: var(--transition-fast);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: var(--glow-indigo), inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.form-group:focus-within .form-label {
    color: var(--primary);
}

textarea.form-control {
    resize: none;
    height: 150px;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.contact-info-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.contact-info-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.1);
    flex-shrink: 0;
}

.contact-info-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.contact-info-text p, .contact-info-text a {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-decoration: none;
}

.contact-info-text a:hover {
    color: var(--secondary);
}

/* FAQ Accordion */
.faq-container {
    margin-top: 6rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 900px;
    margin: 3rem auto 0 auto;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    overflow: hidden;
    transition: var(--transition-fast);
}

.faq-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

html[dir="rtl"] .faq-trigger {
    text-align: right;
}

.faq-icon {
    font-size: 0.9rem;
    color: var(--secondary);
    transition: transform 0.3s ease;
}

.faq-item.active {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.05);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-content-inner {
    padding: 0 2rem 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid transparent;
}

.faq-item.active .faq-content-inner {
    border-color: rgba(255, 255, 255, 0.03);
}

/* Footer styling */
.footer {
    border-top: 1px solid var(--border);
    background: #030307;
    padding: 5rem 0 2rem 0;
    position: relative;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-about p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 1.5rem;
    max-width: 320px;
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link a {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-link a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

html[dir="rtl"] .footer-link a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-legal {
    display: flex;
    gap: 1.5rem;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-legal a:hover {
    color: var(--secondary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .terminal-container {
        margin: 0 auto;
    }
    
    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 2rem;
    }
    
    .timeline-item:nth-child(odd) {
        text-align: left;
    }
    
    html[dir="rtl"] .timeline-item:nth-child(odd) {
        text-align: right;
    }
    
    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 20px;
        right: auto;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-dark);
        border-top: 1px solid var(--border);
        flex-direction: column;
        padding: 3rem 2rem;
        align-items: flex-start;
        gap: 2rem;
        transition: var(--transition-smooth);
        overflow-y: auto;
    }
    
    .nav-menu.open {
        left: 0;
    }
    
    /* RTL Mobile menu adjustment */
    html[dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
    }
    
    html[dir="rtl"] .nav-menu.open {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        font-size: 1.2rem;
        display: block;
        width: 100%;
    }
    
    .nav-controls {
        margin-left: auto;
        margin-right: 1.5rem;
    }
    
    html[dir="rtl"] .nav-controls {
        margin-right: auto;
        margin-left: 1.5rem;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.3rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .portfolio-filters {
        flex-wrap: wrap;
    }
    
    .filter-btn {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Intro Preloader Animation Styles
   ========================================================================== */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #05040d;
    background-image: radial-gradient(circle at center, #110c30 0%, #05040d 100%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.0s cubic-bezier(0.77, 0, 0.175, 1), visibility 1.0s;
}

.intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Wireframe Browser SVG Styling */
.intro-svg {
    width: 320px;
    height: 240px;
    margin-bottom: 2rem;
}

.intro-svg path, 
.intro-svg rect, 
.intro-svg line {
    fill: none;
    stroke: var(--secondary);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: draw-wireframe 1.0s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.intro-svg circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 1.5;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: draw-wireframe 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Custom drawing delays to simulate web page construction */
.intro-svg .wireframe-bg {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-dashoffset: 0;
    animation: none;
}

.intro-svg .wireframe-browser {
    stroke: var(--primary);
    stroke-width: 2;
    animation-delay: 0s;
}

.intro-svg .wireframe-header {
    stroke: var(--secondary);
    animation-delay: 0.1s;
}

.intro-svg .wireframe-sidebar {
    stroke: var(--accent);
    animation-delay: 0.2s;
}

.intro-svg .wireframe-grid {
    stroke: var(--secondary);
    animation-delay: 0.4s;
}

.intro-svg .wireframe-dots circle {
    animation-delay: 0.4s;
}

.intro-svg .wireframe-content {
    stroke: var(--text-primary);
    animation-delay: 0.5s;
    stroke-width: 1;
}

@keyframes draw-wireframe {
    to {
        stroke-dashoffset: 0;
    }
}

/* Brand Text reveal */
.intro-brand {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(15px);
    animation: reveal-text 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.intro-brand span {
    color: var(--secondary);
    text-shadow: var(--glow-cyan);
}

.intro-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: reveal-text 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards 1.0s;
}

@keyframes reveal-text {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glassmorphic Skip button */
.intro-skip-btn {
    position: absolute;
    bottom: 3rem;
    right: 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.4rem;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-fast);
}

.intro-skip-btn:hover {
    border-color: var(--secondary);
    color: var(--text-primary);
    box-shadow: var(--glow-cyan);
    transform: translateY(-2px);
}

html[dir="rtl"] .intro-skip-btn {
    right: auto;
    left: 3rem;
}

/* ==========================================================================
   Hero 3D Canvas Background Styles
   ========================================================================== */
#hero-3d-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.65;
    overflow: hidden;
    /* Soft gradient mask to fade the WebGL canvas into the background color at the bottom */
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 75%, rgba(0, 0, 0, 0) 100%);
}

#hero-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Ensure hero content is positioned above the WebGL background */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-grid {
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   Blog Reader Modal Styles
   ========================================================================== */
.blog-reader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.blog-reader-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.blog-reader-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.005));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(255, 255, 255, 0.01);
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    transform: scale(0.95) translateY(15px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.blog-reader-modal.active .blog-reader-card {
    transform: scale(1) translateY(0);
}

/* Blog Reader Banner Cover Image */
.blog-reader-banner {
    width: 100%;
    height: 280px;
    border-radius: 12px;
    margin-bottom: 2rem;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Close Button */
.blog-reader-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.blog-reader-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--secondary);
    box-shadow: var(--glow-cyan);
    transform: rotate(90deg);
}

html[dir="rtl"] .blog-reader-close {
    right: auto;
    left: 1.5rem;
}

/* Reader Content Elements */
.blog-reader-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.blog-reader-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.blog-reader-time {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.blog-reader-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--text-primary), rgba(255, 255, 255, 0.6));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Rich Text Formatting */
.blog-reader-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

.blog-reader-body p {
    margin-bottom: 1.5rem;
}

.blog-reader-body h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.blog-reader-body ul, .blog-reader-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

html[dir="rtl"] .blog-reader-body ul, html[dir="rtl"] .blog-reader-body ol {
    padding-left: 0;
    padding-right: 1.5rem;
}

.blog-reader-body li {
    margin-bottom: 0.5rem;
}

/* Scrollbar Customization for Modal Card */
.blog-reader-card::-webkit-scrollbar {
    width: 6px;
}

.blog-reader-card::-webkit-scrollbar-track {
    background: transparent;
}

.blog-reader-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.blog-reader-card::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .blog-reader-card {
        padding: 2rem;
    }
    .blog-reader-title {
        font-size: 1.7rem;
    }
    .blog-reader-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}



