@font-face {
    font-family: 'Co Headline';
    src: local('Co Headline Light'), url('../fonts/co-headline-light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Co Headline';
    src: local('Co Headline'), url('../fonts/co-headline-regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Co Headline';
    src: local('Co Headline Bold'), url('../fonts/co-headline-bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #5DCBCA;
    --secondary: #126C73;
    --dark: #07444E;
    --white: #FFFFFF;
    
    /* Layout */
    --container-width: 1200px;
    --section-pad: 100px;
    
    /* Transitions */
    --trans-speed: 0.3s;
    --trans-ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Dark Mode Theme (Default) */
.theme-dark {
    --bg-color: #07444E;
    --bg-gradient: radial-gradient(circle at center, #07444E 0%, #000000 100%);
    --text-color: #FFFFFF;
    --text-muted: #A3D5D5;
    --card-bg: rgba(0,0,0,0.2);
    --border-color: rgba(93, 203, 202, 0.2);
    --scrollbar-bg: #07444E;
}

/* Light Mode Theme */
.theme-light {
    --bg-color: #F0FAFA;
    --bg-gradient: radial-gradient(circle at center, #EFF9F9 0%, #FFFFFF 100%);
    --text-color: #07444E;
    --text-muted: #126C73;
    --card-bg: #FFFFFF;
    --border-color: rgba(18, 108, 115, 0.1);
    --scrollbar-bg: #EFF9F9;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Co Headline', sans-serif;
    background: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-color);
    transition: background var(--trans-speed) var(--trans-ease), color var(--trans-speed) var(--trans-ease);
    cursor: none; /* Custom Cursor */
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; cursor: none; }
button { font-family: inherit; cursor: none; border: none; outline: none; background: none; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 12px; height: 12px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    mix-blend-mode: difference;
}

#cursor-trail {
    position: fixed;
    top: 0; left: 0;
    width: 30px; height: 30px;
    border: 1px solid rgba(93, 203, 202, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-color 0.2s;
}

body.hovering #custom-cursor { width: 40px; height: 40px; background: rgba(93, 203, 202, 0.2); mix-blend-mode: normal; }
body.hovering #cursor-trail { border-color: transparent; }

/* Preloader */
#preloader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color);
    z-index: 10000;
    display: flex; justify-content: center; align-items: center;
}
#preloader svg { width: 150px; }
.stroke-primary {
    stroke: var(--primary);
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLogo 2s ease forwards;
}
@keyframes drawLogo { to { stroke-dashoffset: 0; } }

/* Floating Navbar */
.floating-nav {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.02); backdrop-filter: blur(15px);
    border: 1px solid rgba(93, 203, 202, 0.2);
    padding: 10px 30px; border-radius: 50px;
    z-index: 1000; width: 90%; max-width: 1000px;
    transition: all 0.3s;
}
.theme-light .floating-nav { background: rgba(0,0,0,0.03); border-color: rgba(18, 108, 115, 0.1); }
.nav-logo { font-size: 1.5rem; font-weight: 700; color: var(--primary); letter-spacing: 1px; display: flex; align-items: center; }
.nav-logo-img { height: 35px; width: auto; object-fit: contain; transition: 0.3s; animation: pulseGlow 4s infinite alternate; filter: grayscale(1); }

.theme-dark .nav-logo-img { filter: brightness(0) invert(1) drop-shadow(0 0 5px rgba(255,255,255,0)); animation: pulseGlowDark 3s infinite alternate; }
.theme-light .nav-logo-img { filter: none; animation: pulseGlowLight 3s infinite alternate; }

@keyframes pulseGlowDark {
    0% { transform: scale(1); filter: brightness(0) invert(1) drop-shadow(0 0 2px rgba(255,255,255,0.2)); }
    100% { transform: scale(1.05); filter: brightness(0) invert(1) drop-shadow(0 0 10px rgba(255,255,255,0.6)); }
}
@keyframes pulseGlowLight {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(18, 108, 115, 0.2)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(18, 108, 115, 0.6)); }
}
.nav-links { display: flex; gap: 30px; }
.nav-links a { font-size: 1.1rem; position: relative; color: var(--text-color); font-weight: 300; transition: 0.3s; }
.nav-links a::after {
    content: ''; position: absolute; bottom: -5px; left: 50%; width: 0; height: 2px;
    background: var(--primary); transition: 0.3s; transform: translateX(-50%);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }
.nav-controls { display: flex; gap: 10px; }
.nav-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.05); color: var(--text-color);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); font-weight: bold; transition: 0.3s;
}
.theme-light .nav-btn { background: rgba(0,0,0,0.05); }
.nav-btn:hover { background: var(--primary); color: #000; transform: scale(1.05); }
.nav-btn svg { width: 18px; height: 18px; }

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Sections */
section {
    padding: var(--section-pad) 0;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 160px 0 60px 0;
    overflow: hidden; position: relative;
}
#three-canvas-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none;
}
.hero-logo-container {
    perspective: 1000px;
    z-index: 2; margin-bottom: 30px;
    display: flex; justify-content: center; align-items: center;
}
.hero-main-logo {
    width: clamp(200px, 25vw, 350px);
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}
.theme-dark .hero-main-logo { animation: logoEntrance 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, majesticFloat 6s ease-in-out infinite 1.5s; }
.theme-light .hero-main-logo { animation: logoEntrance 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, majesticFloatLight 6s ease-in-out infinite 1.5s; }

@keyframes logoEntrance {
    0% { transform: scale(0) translateY(100px) rotate(-15deg); opacity: 0; filter: blur(20px); }
    60% { transform: scale(1.1) translateY(-10px) rotate(5deg); opacity: 1; filter: blur(0); }
    100% { transform: scale(1) translateY(0) rotate(-2deg); opacity: 1; filter: blur(0); }
}

@keyframes majesticFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); filter: brightness(0) invert(1) drop-shadow(0 15px 25px rgba(255,255,255,0.25)); }
    50% { transform: translateY(-20px) rotate(2deg) scale(1.05); filter: brightness(0) invert(1) drop-shadow(0 30px 45px rgba(255,255,255,0.4)); }
}
@keyframes majesticFloatLight {
    0%, 100% { transform: translateY(0) rotate(-2deg); filter: drop-shadow(0 15px 25px rgba(18, 108, 115, 0.2)); }
    50% { transform: translateY(-20px) rotate(2deg) scale(1.05); filter: drop-shadow(0 30px 45px rgba(18, 108, 115, 0.4)); }
}

.hero-content {
    max-width: 800px;
    z-index: 2;
    padding: 0 20px;
}
.hero-title {
    font-size: clamp(1.8rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.6;
    overflow: visible;
    padding-bottom: 10px;
}
.hero-title .en-word {
    font-family: inherit; /* Inherit Co Headline for NetPal */
}
.hero-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.4rem);
    font-weight: 300;
    color: var(--text-muted);
    margin-bottom: 40px;
    letter-spacing: 1px;
    max-width: 700px;
    line-height: 1.8;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
    width: 100%;
    margin-inline: auto;
}
.hero-subtitle-part {
    white-space: nowrap;
}
.hero-subtitle-separator {
    opacity: 0.55;
}
.hero-cta {
    display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
}
.btn {
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem; font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
    border: 2px solid var(--primary);
}
.btn-primary {
    background: var(--primary);
    color: #000;
}
.btn-primary:hover {
    box-shadow: 0 0 25px rgba(93, 203, 202, 0.6);
    transform: translateY(-5px) scale(1.05);
}
.btn-outline {
    background: transparent;
    color: var(--text-color);
}
.btn-outline:hover {
    background: rgba(93, 203, 202, 0.1);
    transform: translateY(-5px) scale(1.05);
}

.scroll-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    animation: bounce 2s infinite; opacity: 0.7;
}
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); } 40% { transform: translateY(-20px) translateX(-50%); } 60% { transform: translateY(-10px) translateX(-50%); } }

/* Section Titles */
.section-header { text-align: center; margin-bottom: 60px; }
.section-title { font-size: 3rem; font-weight: 700; color: var(--primary); margin-bottom: 15px; }

/* About Section */
.about-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.about-text { text-align: start; }
.about-text h3 { font-size: 2.5rem; margin-bottom: 25px; line-height: 1.3; }
.about-text p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 30px; line-height: 1.8; }
.about-features { list-style: none; padding: 0; text-align: start; }
.about-features li { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-bottom: 15px; font-size: 1.1rem; }
.about-features li::before { content: '•'; color: var(--primary); font-size: 1.5rem; }

.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.team-member {
    perspective: 1000px;
    height: 250px;
}
.team-card-inner {
    position: relative; width: 100%; height: 100%;
    text-align: center; transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}
.team-member:hover .team-card-inner { transform: rotateY(180deg); }
.team-member.is-flipped .team-card-inner { transform: rotateY(180deg); }
.team-front, .team-back {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.team-member:hover .team-front { border-color: var(--primary); box-shadow: 0 0 20px rgba(93,203,202,0.3); }
.team-back { transform: rotateY(180deg); background: linear-gradient(135deg, var(--dark), var(--secondary)); color: #fff; }
.theme-light .team-back { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #fff; }
.theme-light .team-back .team-name { color: #fff; }
.theme-light .team-back .skill-tag { color: #fff; }
.team-img-wrap { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; margin-bottom: 15px; border: 3px solid var(--primary); }
.team-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.team-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 5px; }
.team-role { color: var(--primary); font-size: 0.9rem; font-weight: 300; text-transform: uppercase; letter-spacing: 1px; }
.team-skills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.skill-tag { background: rgba(255,255,255,0.2); padding: 5px 12px; border-radius: 15px; font-size: 0.85rem; }

/* Portfolio Premium Redesign */
.portfolio-tabs {
    display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; flex-wrap: wrap;
}
.tab-btn {
    padding: 15px 35px; border-radius: 40px;
    background: transparent; border: 1px solid var(--border-color); color: var(--text-color);
    font-weight: 700; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); font-size: 1.1rem;
    position: relative; overflow: hidden;
}
.tab-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary); transform: scaleY(0); transition: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: -1; transform-origin: bottom;
}
.tab-btn.active, .tab-btn:hover { color: #000; border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 10px 20px rgba(93,203,202,0.2); }
.tab-btn.active::before, .tab-btn:hover::before { transform: scaleY(1); }

.portfolio-subcategories {
    display: flex; justify-content: center; gap: 30px; margin-bottom: 60px;
}
.sub-tab { font-size: 1.1rem; color: var(--text-muted); position: relative; padding: 5px 0; transition: 0.3s; font-weight: 300; letter-spacing: 1px; }
.sub-tab::after {
    content: ''; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px;
    background: var(--primary); transition: 0.3s; transform: translateX(-50%);
}
.sub-tab.active, .sub-tab:hover { color: var(--primary); font-weight: 700; }
.sub-tab.active::after, .sub-tab:hover::after { width: 100%; }
.subcat-wrap { display: none; }
.subcat-wrap.active { display: flex; }

.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px;
    align-items: start;
}
@media (max-width: 600px) { .projects-grid { grid-template-columns: 1fr; } }

.project-card {
    position: relative; border-radius: 20px; overflow: hidden;
    background: #000; cursor: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s;
    aspect-ratio: 16 / 9;
}
/* Reverted asymmetric logic to have all items identical 16:9 aspect */

.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); filter: brightness(0.8); }
.project-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 40px; color: #fff;
    opacity: 0; transition: opacity 0.4s;
}
html[dir="rtl"] .project-overlay { align-items: center; text-align: center; }
html[dir="ltr"] .project-overlay { align-items: center; text-align: center; }

.project-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 25px 50px rgba(93,203,202,0.25); z-index: 10; }
.project-card:hover img { transform: scale(1.1); filter: brightness(0.5); }
.project-card:hover .project-overlay { opacity: 1; }
.project-title { font-size: 2rem; font-weight: 700; transform: translateY(30px); transition: transform 0.5s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1); margin-bottom: 5px; color: var(--primary); }
.project-card:hover .project-title { transform: translateY(0); }
.project-cat { font-size: 1rem; letter-spacing: 2px; text-transform: uppercase; transform: translateY(30px); transition: transform 0.5s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); color: var(--white); opacity: 0.7; }
.project-card:hover .project-cat { transform: translateY(0); }

/* Hover Tag inside cursor globally */
body.project-hover #custom-cursor { width: 80px; height: 80px; background: var(--primary); mix-blend-mode: normal; color: #000; display: flex; align-items: center; justify-content: center; font-weight: bold; font-family: 'Co Headline', sans-serif; font-size: 14px; text-transform: uppercase; }
body.project-hover #custom-cursor::after { content: 'VIEW'; }
html[dir="rtl"] body.project-hover #custom-cursor::after { content: 'مشاهدة'; }
body.project-hover #cursor-trail { opacity: 0; }

.video-preview { position: absolute; top:0; left:0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: 0.5s; }
.project-card:hover .video-preview { opacity: 1; }

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 10000;
    display: flex; justify-content: center; padding: 40px 20px;
    opacity: 0; pointer-events: none; transition: opacity 0.4s;
    overflow-y: auto; backdrop-filter: blur(10px);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
    background: var(--bg-color);
    width: 100%; max-width: 1000px;
    border-radius: 20px; border: 1px solid var(--border-color);
    padding: 40px; position: relative;
    transform: scale(0.9); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-close {
    position: absolute; top: 20px; left: 20px; width: 40px; height: 40px;
    background: rgba(255,255,255,0.1); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; transition: 0.3s;
}
html[dir="rtl"] .modal-close { right: 20px; left: auto; }
html[dir="ltr"] .modal-close { left: 20px; right: auto; }
.modal-close:hover { background: var(--primary); color: #000; transform: rotate(90deg); }

.modal-header { margin-bottom: 30px; text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; }
.modal-title { font-size: 2.2rem; margin-bottom: 10px; color: var(--primary); }
.modal-meta { font-size: 1rem; color: var(--text-muted); }
.modal-desc { font-size: 1.15rem; line-height: 1.8; margin-bottom: 30px; text-align: justify; }

.modal-masonry {
    columns: 1; column-gap: 20px;
}
@media (min-width: 768px) { .modal-masonry { columns: 2; } }
.modal-masonry img { width: 100%; border-radius: 10px; margin-bottom: 20px; break-inside: avoid; border: 1px solid var(--border-color); }
.modal-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.modal-link { display: inline-block; margin-top: 20px; color: var(--primary); font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: 2px; }

/* Contact Premium 3D Tilt */
#portfolio {
    padding-bottom: 50px;
}
.contact-section { 
    position: relative; text-align: center; padding: 120px 0; overflow: hidden; margin-top: 100px; 
}
.contact-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: url('../images/netpal-logo-01.png') center/500px no-repeat; opacity: 0.05; z-index: -1; animation: floatLogo 10s ease-in-out infinite; }
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }

.contact-actions { display: flex; justify-content: center; gap: 50px; margin-top: 60px; flex-wrap: wrap; perspective: 1000px; }
.contact-btn {
    width: 300px; height: 260px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border-radius: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    font-size: 1.8rem; font-weight: 700; transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.4s, border-color 0.4s;
    position: relative; overflow: hidden;
}
.theme-light .contact-btn { background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.1); }
.contact-btn svg { width: 70px; height: 70px; color: var(--primary); transition: 0.4s; }
.contact-btn span { letter-spacing: 1px; }

.contact-btn:hover { border-color: var(--primary); box-shadow: 0 25px 60px rgba(93,203,202,0.15); }
.contact-btn:hover svg { color: var(--text-color); filter: drop-shadow(0 0 10px var(--primary)); }
.contact-btn::before {
    content:''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(93,203,202,0.2) 0%, transparent 60%);
    opacity: 0; transition: 0.5s; pointer-events: none; mix-blend-mode: screen;
}
.contact-btn:hover::before { opacity: 1; }

/* Footer Elegant */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 30px 0; position: relative; overflow: hidden;
    background: transparent;
    display: flex; justify-content: center; align-items: center;
}
.footer-content { 
    display: flex; flex-direction: row; justify-content: space-between; align-items: center; 
    width: 100%; gap: 20px; flex-wrap: wrap; 
}
.footer-logo { width: 80px; transition: 0.4s; }
.footer-logo:hover { transform: scale(1.1) rotate(5deg); filter: drop-shadow(0 0 10px var(--primary)); }
.footer-links { display: flex; gap: 30px; }
.footer-links a {
    font-size: 1rem; position: relative; color: var(--text-color); font-weight: 700; transition: 0.3s;
}
.footer-links a:hover { color: var(--primary); transform: translateY(-3px); display: inline-block; }
.footer-madeby { font-size: 0.9rem; color: var(--text-muted); opacity: 0.8; letter-spacing: 1px; font-weight: 300; }


/* Helpers */
.hidden { display: none !important; }

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}
.reveal-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   THEME FIXES
   ============================================ */
/* Light mode: ensure proper contrast on cards and sections */
.theme-light .project-card { box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.theme-light .project-card:hover { box-shadow: 0 20px 40px rgba(18, 108, 115, 0.2); }
.theme-light .section-title { color: var(--secondary); }
.theme-light .about-text h3 { color: var(--dark); }
.theme-light .team-front { box-shadow: 0 5px 20px rgba(0,0,0,0.08); }
.theme-light .skill-tag { background: rgba(18, 108, 115, 0.12); color: var(--dark); }
.theme-light .scroll-indicator svg { stroke: var(--secondary); }
.theme-light .contact-section .section-title { color: var(--secondary); }
.theme-light #preloader { background: #F0FAFA; }
.theme-light #preloader img { filter: none !important; animation: pulseLogoLight 1.5s infinite !important; }
@keyframes pulseLogoLight {
    0% { transform: scale(1); filter: drop-shadow(0 0 0px var(--secondary)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 20px var(--secondary)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0px var(--secondary)); }
}

/* Dark mode: ensure text is readable on backs of cards */
.theme-dark .team-back .team-name { color: #fff; }
.theme-dark .team-back .skill-tag { background: rgba(255,255,255,0.15); color: #fff; }

/* Footer theme fixes */
.theme-light .site-footer { border-top-color: rgba(18, 108, 115, 0.15); }
.theme-light .footer-madeby { color: var(--secondary); }
.theme-dark .footer-logo { filter: brightness(0) invert(1); }
.theme-light .footer-logo { filter: none; }

/* ============================================
   PROJECT DETAIL PAGE
   ============================================ */
.project-detail {
    padding-top: 120px;
    padding-bottom: 100px;
}
.project-detail-back {
    margin-bottom: 30px;
}
.back-to-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--card-bg);
}
.back-to-portfolio:hover { opacity: 0.8; transform: translateX(-5px); }
html[dir="rtl"] .back-to-portfolio:hover { transform: translateX(5px); }

.project-detail-cover-frame {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 40px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    overflow: hidden;
}
.project-detail-cover {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.project-detail-cover img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

.project-detail-info {
    max-width: 800px;
    margin: 0 auto 50px;
}
.project-detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.project-detail-cat,
.project-detail-subcat {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
}
.project-detail-sep { color: var(--primary); font-size: 1.2rem; }
.project-detail-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 20px;
}
.project-detail-desc {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-muted);
    margin-bottom: 25px;
}
.project-detail-tags {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 25px;
}
.project-detail-link { margin-bottom: 30px; }
.project-detail-full {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-color);
    margin-bottom: 0;
    padding: 25px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
}

.project-detail-gallery {
    max-width: 1100px;
    margin: 0 auto;
}
.gallery-title {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 30px;
}
.project-gallery-grid {
    column-count: 2;
    column-gap: 20px;
}
.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.15);
}
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.5s;
}
.gallery-item img:hover,
.gallery-item video:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}
@media (max-width: 700px) {
    .project-detail-cover-frame {
        border-radius: 14px;
    }
    .gallery-item img,
    .gallery-item video {
        width: 100%;
    }
    .project-gallery-grid {
        column-count: 1;
    }
}

/* ============================================
   SUBTLE POLISH - CONTACT SECTION ENHANCEMENTS
   ============================================ */
.contact-section .section-title {
    position: relative;
    display: inline-block;
}
.contact-actions .contact-btn {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s, border-color 0.4s;
}

/* About features - subtle left border accent */
.about-features li {
    transition: transform 0.3s, color 0.3s;
}
.about-features li:hover {
    transform: translateX(5px);
    color: var(--primary);
}
html[dir="rtl"] .about-features li:hover {
    transform: translateX(-5px);
}

/* Footer gentle hover glow */
.site-footer {
    transition: border-color 0.3s;
}

/* ============================================
   RESPONSIVE & DEPLOYMENT HARDENING
   ============================================ */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

img,
video {
    max-width: 100%;
}

body.cursor-disabled,
body.cursor-disabled a,
body.cursor-disabled button {
    cursor: auto;
}

body.cursor-disabled #custom-cursor,
body.cursor-disabled #cursor-trail {
    display: none;
}

.container {
    width: min(100%, calc(var(--container-width) + 40px));
}

.floating-nav {
    top: 16px;
    width: min(96%, 1100px);
    padding: 12px 22px;
    gap: 18px;
}

.nav-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex: 1;
}

.nav-links {
    gap: 24px;
}

.nav-links a {
    font-size: 1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-menu-toggle {
    display: none;
}

.nav-menu-icon,
.nav-menu-icon::before,
.nav-menu-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.3s ease;
    content: '';
}

.nav-menu-icon {
    position: relative;
}

.nav-menu-icon::before {
    position: absolute;
    top: -6px;
    left: 0;
}

.nav-menu-icon::after {
    position: absolute;
    top: 6px;
    left: 0;
}

.floating-nav.menu-open .nav-menu-icon {
    background: transparent;
}

.floating-nav.menu-open .nav-menu-icon::before {
    transform: translateY(6px) rotate(45deg);
}

.floating-nav.menu-open .nav-menu-icon::after {
    transform: translateY(-6px) rotate(-45deg);
}

.hero {
    min-height: 100svh;
    padding: 160px 0 72px;
}

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

.hero-title {
    line-height: 1.35;
}

.hero-subtitle {
    gap: 12px;
}

.about-grid {
    gap: 48px;
}

.team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.team-mobile-skills {
    display: none;
}

.portfolio-tabs {
    gap: 14px;
}

.portfolio-subcategories {
    gap: 20px;
    flex-wrap: wrap;
}

.projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 24px;
}

.project-overlay-meta {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.72);
}

.project-card-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--primary);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.contact-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

.contact-btn {
    width: 100%;
    max-width: none;
    min-height: 240px;
    height: 100%;
    padding: 28px;
}

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

.project-detail-meta {
    flex-wrap: wrap;
}

.project-detail-tags {
    align-items: center;
}

@media (max-width: 1100px) {
    .about-text h3 {
        font-size: 2.2rem;
    }

    .contact-btn {
        min-height: 220px;
    }
}

@media (max-width: 900px) {
    body {
        cursor: auto;
    }

    a,
    button {
        cursor: pointer;
    }

    .floating-nav {
        align-items: center;
        padding: 14px 18px;
        border-radius: 26px;
        display: grid;
        grid-template-columns: auto 1fr auto auto;
        gap: 10px;
    }

    .nav-logo {
        order: 4;
        justify-self: end;
    }

    .nav-controls-inline {
        order: 3;
        display: flex;
        align-items: center;
        justify-self: end;
        gap: 8px;
        margin-inline-start: 0;
        margin-inline-end: 0;
    }

    .nav-menu-toggle {
        order: 1;
        display: inline-flex;
        justify-self: start;
        margin-inline-start: 0;
        margin-inline-end: 0;
        flex-shrink: 0;
    }

    .nav-panel {
        position: absolute;
        top: calc(100% + 12px);
        inset-inline: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        border-radius: 24px;
        background: rgba(7, 68, 78, 0.96);
        border: 1px solid rgba(93, 203, 202, 0.16);
        box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(18px);
    }

    .theme-light .nav-panel {
        background: rgba(255, 255, 255, 0.97);
        border-color: rgba(18, 108, 115, 0.12);
    }

    .floating-nav.menu-open .nav-panel {
        display: flex;
    }

    .nav-links,
    .nav-controls {
        width: 100%;
        justify-content: center;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 14px 16px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.05);
        text-align: center;
    }

    .theme-light .nav-links a {
        background: rgba(0, 0, 0, 0.04);
    }

    .nav-links a::after {
        display: none;
    }

    .hero {
        padding-top: 150px;
        padding-bottom: 56px;
    }

    .hero-main-logo {
        width: min(72vw, 280px);
    }

    .hero-subtitle {
        max-width: 100%;
        gap: 10px;
    }

    .hero-subtitle-part {
        white-space: normal;
    }

    .hero-cta {
        width: 100%;
        gap: 14px;
    }

    .hero-cta .btn {
        width: min(100%, 320px);
    }

    .scroll-indicator {
        display: none;
    }

    .section-header {
        margin-bottom: 42px;
    }

    .section-title {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .about-grid {
        gap: 32px;
    }

    .about-text h3 {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
    }

    .about-text p {
        font-size: 1.02rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .team-member {
        height: 250px;
    }

    .team-member:hover .team-card-inner {
        transform: none;
    }

    .team-member.is-flipped .team-card-inner,
    .team-member.is-flipped:hover .team-card-inner {
        transform: rotateY(180deg) !important;
    }

    .team-front,
    .team-back {
        position: absolute;
        height: 100%;
        min-height: auto;
    }

    .team-front {
        padding: 24px 20px;
    }

    .team-back {
        display: flex;
    }

    .team-mobile-skills {
        display: none;
    }

    .portfolio-subcategories {
        margin-bottom: 34px;
    }

    .project-card {
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
    }

    .project-overlay {
        opacity: 1;
        justify-content: flex-end;
        align-items: flex-start;
        text-align: start;
        padding: 22px;
        background: linear-gradient(180deg, rgba(7, 68, 78, 0.08) 0%, rgba(0, 0, 0, 0.78) 100%);
    }

    html[dir="rtl"] .project-overlay,
    html[dir="ltr"] .project-overlay {
        align-items: flex-start;
        text-align: start;
    }

    .project-title,
    .project-card:hover .project-title {
        transform: none;
        margin-bottom: 8px;
        font-size: 1.45rem;
    }

    .project-cat,
    .project-card:hover .project-cat {
        transform: none;
    }

    .project-card:hover,
    .project-card:hover img {
        transform: none;
    }

    .contact-section {
        margin-top: 60px;
        padding: 96px 0;
    }

    .contact-actions {
        grid-template-columns: 1fr;
        margin-top: 38px;
    }

    .contact-btn {
        width: min(100%, 360px);
        min-height: 200px;
        margin-inline: auto;
        font-size: 1.45rem;
    }

    .contact-btn svg {
        width: 56px;
        height: 56px;
    }

    .footer-content {
        justify-content: center;
        text-align: center;
    }

    .project-detail {
        padding-top: 110px;
        padding-bottom: 72px;
    }

    .project-detail-desc,
    .project-detail-full {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .floating-nav {
        top: 12px;
        padding: 12px 14px;
        gap: 8px;
        width: min(98%, 372px);
        grid-template-columns: auto 1fr auto auto;
    }

    .nav-logo-img {
        height: 30px;
    }

    .nav-controls-inline {
        gap: 6px;
    }

    .hero {
        padding-top: 132px;
    }

    .hero-title {
        font-size: clamp(1.65rem, 9vw, 2.5rem);
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .tab-btn {
        width: 100%;
        padding: 14px 20px;
    }

    .portfolio-tabs {
        gap: 12px;
    }

    .portfolio-subcategories {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .portfolio-subcategories::-webkit-scrollbar {
        display: none;
    }

    .project-overlay {
        padding: 18px;
    }

    .project-card-hint {
        font-size: 0.72rem;
    }

    .contact-btn {
        width: 100%;
    }

    .project-detail-cover-frame,
    .project-detail-full,
    .gallery-item {
        border-radius: 14px;
    }

    .project-detail-full {
        padding: 18px;
    }
}

@media (hover: none), (pointer: coarse) {
    #custom-cursor,
    #cursor-trail {
        display: none !important;
    }

    body,
    a,
    button {
        cursor: auto !important;
    }

    .btn:hover,
    .btn-primary:hover,
    .btn-outline:hover,
    .tab-btn:hover,
    .project-card:hover,
    .contact-btn:hover,
    .nav-btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ============================================
   FINAL RESPONSIVE POLISH
   ============================================ */
.nav-controls-inline {
    flex-shrink: 0;
}

.hero {
    min-height: clamp(680px, 88svh, 920px);
    padding: 128px 0 88px;
}

.hero-logo-container {
    margin-bottom: 18px;
    transform: translateY(-24px);
}

.hero-content {
    margin-top: -12px;
}

.hero-title {
    margin-bottom: 16px;
    line-height: 1.42;
}

.hero-subtitle {
    margin-bottom: 30px;
}

#about {
    padding-top: 84px;
}

#portfolio {
    padding-top: 92px;
}

.contact-section {
    margin-top: 82px;
    padding: 112px 0 128px;
}

.contact-actions {
    margin-top: 44px;
}

.site-footer {
    padding: 38px 0 52px;
}

.theme-dark .team-front {
    background:
        linear-gradient(160deg, rgba(6, 34, 40, 0.96), rgba(7, 77, 84, 0.88));
    border-color: rgba(93, 203, 202, 0.34);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.theme-dark .team-back {
    background:
        linear-gradient(145deg, rgba(19, 112, 121, 0.98), rgba(7, 40, 47, 0.98));
    border-color: rgba(93, 203, 202, 0.4);
    color: #F5FFFF;
}

.theme-dark .team-front .team-name {
    color: #F7FFFF;
}

.theme-dark .team-role {
    color: #7FE5E4;
}

.team-img-wrap-placeholder {
    background: rgba(93, 203, 202, 0.08);
}

.theme-dark .team-placeholder-logo {
    filter: brightness(0) saturate(100%) invert(87%) sepia(27%) saturate(851%) hue-rotate(122deg) brightness(98%) contrast(95%);
    opacity: 0.96;
}

.theme-dark .team-back .team-name,
.theme-dark .team-back .skill-tag {
    color: #F5FFFF;
}

.theme-dark .skill-tag {
    background: rgba(93, 203, 202, 0.18);
    border: 1px solid rgba(93, 203, 202, 0.3);
}

.theme-dark .team-member:hover .team-front {
    border-color: rgba(93, 203, 202, 0.52);
    box-shadow: 0 0 0 1px rgba(93, 203, 202, 0.18), 0 22px 50px rgba(7, 173, 177, 0.18);
}

.project-detail {
    padding-top: 96px;
}

@media (max-width: 900px) {
    .nav-controls-inline {
        order: 3;
        display: flex;
        align-items: center;
        justify-self: end;
        gap: 8px;
        margin-inline-start: 0;
        margin-inline-end: 0;
    }

    .nav-logo {
        order: 4;
        justify-self: end;
    }

    .nav-menu-toggle {
        order: 1;
        justify-self: start;
        margin-inline-start: 0;
        margin-inline-end: 0;
        flex-shrink: 0;
    }

    .hero {
        min-height: auto;
        padding: 106px 0 38px;
    }

    .hero-logo-container {
        margin-bottom: 12px;
        transform: translateY(-14px);
    }

    .hero-content {
        margin-top: -8px;
    }

    .hero-title {
        margin-bottom: 14px;
    }

    .hero-subtitle {
        margin-bottom: 22px;
        font-size: clamp(0.96rem, 3.4vw, 1.12rem);
    }

    #about {
        padding-top: 58px;
    }

    #portfolio {
        padding-top: 66px;
    }

    .contact-section {
        margin-top: 54px;
        padding: 72px 0 94px;
    }

    .contact-actions {
        margin-top: 28px;
        gap: 18px;
    }

    .site-footer {
        padding: 28px 0 40px;
    }

    .project-detail {
        padding-top: 90px;
    }
}

@media (max-width: 640px) {
    .floating-nav {
        width: min(98%, 372px);
        padding: 12px 14px;
        gap: 8px;
        grid-template-columns: auto 1fr auto auto;
    }

    .nav-controls-inline .nav-btn,
    .nav-menu-toggle {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .hero {
        padding: 96px 0 28px;
    }

    .hero-main-logo {
        width: min(62vw, 220px);
    }

    .hero-logo-container {
        transform: translateY(-10px);
        margin-bottom: 10px;
    }

    .hero-content {
        padding: 0 12px;
        margin-top: -6px;
    }

    .hero-title {
        font-size: clamp(1.95rem, 10vw, 2.85rem);
        line-height: 1.38;
    }

    .hero-subtitle {
        gap: 6px;
        margin-bottom: 18px;
    }

    .section-header {
        margin-bottom: 28px;
    }

    .contact-section {
        padding: 62px 0 88px;
    }

    .contact-btn {
        min-height: 168px;
        padding: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
