/* ===== CSS Variables & Base Styles ===== */
:root {
    /* Light Theme Colors */
    --primary: #E30A17;
    --primary-light: #ff4757;
    --primary-dark: #c70010;
    --secondary: #1e3a8a;
    --secondary-light: #3b82f6;
    --accent: #f59e0b;
    --accent-light: #fbbf24;

    /* Light Background Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #ffffff;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #E30A17 0%, #ff6b6b 100%);
    --gradient-secondary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-fresh: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-sky: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 10px 30px rgba(227, 10, 23, 0.25);
    --shadow-secondary: 0 10px 30px rgba(30, 58, 138, 0.25);

    /* Borders */
    --border-light: 1px solid #e2e8f0;
    --border-medium: 1px solid #cbd5e1;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 28px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Spacing */
    --section-padding: 100px 0;
    --container-padding: 0 24px;
}

/* ===== News Ticker ===== */
.news-ticker {
    position: relative;
    width: 100%;
    height: 50px;
    background: #E30A17;
    display: flex;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.ticker-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    z-index: 2;
}

.ticker-icon {
    font-size: 1.2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.ticker-text {
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.ticker-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.ticker-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    animation: tickerScroll 60s linear infinite;
    will-change: transform;
}

.ticker-wrapper:hover {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 40px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

.ticker-dot {
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* Responsive News Ticker */
@media (max-width: 768px) {
    .news-ticker {
        height: 45px;
    }

    .ticker-label {
        padding: 0 16px;
    }

    .ticker-icon {
        font-size: 1rem;
    }

    .ticker-text {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }

    .ticker-item {
        font-size: 0.85rem;
        padding: 0 30px;
    }

    .ticker-wrapper {
        animation: tickerScroll 40s linear infinite;
    }
}

@media (max-width: 480px) {
    .ticker-label {
        padding: 0 12px;
        gap: 6px;
    }

    .ticker-text {
        display: none;
    }

    .ticker-item {
        font-size: 0.8rem;
        padding: 0 20px;
    }
}

/* ===== Image Slider ===== */
.slider-section {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: var(--text-primary);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
}

.slide.active {
    opacity: 1;
    visibility: visible;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenBurns 20s ease infinite;
}

.slide.active img {
    animation: kenBurns 20s ease infinite;
}

@keyframes kenBurns {
    0% {
        transform: scale(1) translateX(0);
    }

    50% {
        transform: scale(1.1) translateX(-2%);
    }

    100% {
        transform: scale(1) translateX(0);
    }
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(30, 58, 138, 0.7) 0%,
            rgba(227, 10, 23, 0.4) 100%);
    z-index: 1;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 80px;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.slide-tag {
    display: inline-block;
    padding: 8px 20px;
    background: var(--gradient-primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.slide-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: white;
    margin-bottom: 16px;
    line-height: 1.2;
    max-width: 700px;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.8s ease 0.3s forwards;
}

.slide.active .slide-title {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.8s ease 0.3s forwards;
}

.slide-description {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 550px;
    line-height: 1.7;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.8s ease 0.5s forwards;
}

.slide.active .slide-description {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.8s ease 0.5s forwards;
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slider Navigation Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-lg);
}

.slider-btn svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    transition: color var(--transition-medium);
}

.slider-btn:hover {
    background: var(--gradient-primary);
    transform: translateY(-50%) scale(1.1);
}

.slider-btn:hover svg {
    color: white;
}

.slider-prev {
    left: 30px;
}

.slider-next {
    right: 30px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-medium);
    padding: 0;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.dot.active {
    background: white;
    width: 40px;
    border-radius: 10px;
}

/* Slider Progress Bar */
.slider-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    transition: width 0.1s linear;
}

/* Responsive */
@media (max-width: 768px) {
    .slider-section {
        height: 500px;
    }

    .slide-content {
        padding: 40px 30px;
    }

    .slider-btn {
        width: 45px;
        height: 45px;
    }

    .slider-prev {
        left: 15px;
    }

    .slider-next {
        right: 15px;
    }

    .slider-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Hide particles on light theme */
#particles {
    display: none;
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all var(--transition-medium);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    padding: 12px 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== Animated Brand Logo ===== */
.animated-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    /* Adjusted for length */
    font-weight: 800;
    gap: 4px;
    /* Reduced gap to keep it together */
    letter-spacing: -0.5px;
    font-family: 'Poppins', sans-serif;
    /* Ensure a modern font */
    white-space: nowrap;
    /* Prevent wrapping */
}

.brand-tunisia,
.brand-humanity {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-4 {
    color: #E30A17;
    /* Distinct red color */
    font-size: 1.2em;
    /* Slightly larger */
    animation: bounce 2s infinite;
    display: inline-block;
}

.brand-ii {
    background: linear-gradient(135deg, #E30A17 0%, #ff4757 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
    margin-left: 2px;
}

.brand-by {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 4px;
    font-weight: 500;
    font-style: italic;
}

.brand-yooreed {
    background: linear-gradient(135deg, #E30A17 0%, #ff4757 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    position: relative;
}

/* Hover Effect for the Logo */
.animated-brand:hover .brand-yooreed {
    text-shadow: 0 0 10px rgba(227, 10, 23, 0.3);
}

.animated-brand:hover .brand-4 {
    transform: rotate(10deg) scale(1.1);
    transition: transform 0.3s ease;
}

/* Footer specific adjustments */
.footer-brand .animated-brand {
    justify-content: center;
    font-size: 1.8rem;
}

/* Bounce Animation */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

/* Mobile Adjustment for Long Title */
@media (max-width: 768px) {
    .animated-brand {
        font-size: 1rem;
        flex-wrap: wrap;
        /* Allow wrapping on very small screens if absolutely necessary, or scroll */
        justify-content: flex-start;
    }

    .brand-by {
        display: none;
        /* Hide 'by' to save space on mobile if needed */
    }
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-medium);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: transform var(--transition-medium);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-medium);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 120px 24px 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    overflow: hidden;
}

/* Animated Background Shapes */
.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, rgba(227, 10, 23, 0.1) 0%, rgba(255, 107, 107, 0.05) 100%);
    border-radius: 50%;
    animation: floatShape 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 50%;
    animation: floatShape 25s ease-in-out infinite reverse;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 30px) scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: white;
    border: var(--border-light);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    font-size: 1.3rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.title-line {
    display: block;
}

.title-highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.title-highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.4), rgba(251, 191, 36, 0.2));
    border-radius: 4px;
    z-index: -1;
    animation: expandWidth 1s ease 1s forwards;
    transform: scaleX(0);
    transform-origin: left;
}

@keyframes expandWidth {
    to {
        transform: scaleX(1);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-medium);
    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.3), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(227, 10, 23, 0.35);
}

.btn-primary-alt {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-secondary);
}

.btn-primary-alt:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(30, 58, 138, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
}

.btn-secondary:hover {
    background: var(--text-primary);
    color: white;
    transform: translateY(-3px);
}

/* Hero Visual Cards */
.hero-visual {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-card {
    position: absolute;
    padding: 16px 24px;
    background: white;
    border: var(--border-light);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 1.5rem;
}

.card-1 {
    top: 20%;
    left: 5%;
}

.card-2 {
    top: 35%;
    right: 5%;
}

.card-3 {
    bottom: 30%;
    left: 8%;
}

.card-4 {
    bottom: 20%;
    right: 8%;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {

    0%,
    100% {
        opacity: 1;
        top: 8px;
    }

    50% {
        opacity: 0;
        top: 20px;
    }
}

/* ===== Sections ===== */
.section {
    padding: var(--section-padding);
    position: relative;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    padding: 8px 24px;
    background: linear-gradient(135deg, rgba(227, 10, 23, 0.1), rgba(30, 58, 138, 0.1));
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 16px;
    color: var(--text-primary);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-alt {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Project Filters ===== */
.projects-section {
    background: var(--bg-secondary);
}

.project-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    padding: 12px 28px;
    background: white;
    border: var(--border-light);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-primary);
}

/* ===== Projects Grid ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    background: white;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-md);
    border: var(--border-light);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-card.featured {
    grid-column: span 2;
}

.project-card.featured .card-image {
    height: 300px;
}

.card-image {
    position: relative;
    height: 220px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}

/* Decorative Pattern */
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity var(--transition-medium);
    z-index: 2;
}

.project-card:hover .card-overlay {
    opacity: 1;
}

.play-btn {
    width: 70px;
    height: 70px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-lg);
}

.play-btn svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
    margin-left: 4px;
}

.play-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.no-video-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-video-icon svg {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.7);
}

.card-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    background: var(--gradient-accent);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #000;
    z-index: 3;
    box-shadow: var(--shadow-md);
}

.card-category {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    z-index: 3;
    box-shadow: var(--shadow-sm);
}

.category-icon {
    font-size: 1rem;
}

.card-content {
    padding: 28px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.action-btn svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.action-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateX(5px);
}

.action-btn:hover svg {
    color: white;
}

.info-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Laboratory Section ===== */
.lab-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    overflow: hidden;
    padding: 60px 0;
}

.lab-grid {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.lab-card {
    position: relative;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-medium);
    flex: 1;
    min-width: 0;
    max-width: 200px;
}

.lab-card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: var(--shadow-xl);
    z-index: 10;
}

.lab-image {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.lab-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.lab-card:hover .lab-image img {
    transform: scale(1.15);
}

.lab-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(227, 10, 23, 0.85) 0%, rgba(30, 58, 138, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.lab-card:hover .lab-overlay {
    opacity: 1;
}

.lab-icon {
    font-size: 2.5rem;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.lab-card:hover .lab-icon {
    transform: scale(1);
}

/* Responsive Laboratory Grid */
@media (max-width: 1024px) {
    .lab-card {
        max-width: 150px;
    }

    .lab-image {
        height: 120px;
    }

    .lab-icon {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .lab-grid {
        gap: 10px;
    }

    .lab-card {
        max-width: 120px;
    }

    .lab-image {
        height: 100px;
    }

    .lab-icon {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .lab-grid {
        gap: 8px;
        flex-wrap: wrap;
    }

    .lab-card {
        max-width: calc(50% - 4px);
    }

    .lab-image {
        height: 90px;
    }

    .lab-icon {
        font-size: 1.5rem;
    }
}

/* ===== About Sections ===== */
.yooreed-section {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-grid.reverse {
    direction: rtl;
}

.about-grid.reverse>* {
    direction: ltr;
}

.about-content .section-tag {
    margin-bottom: 16px;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 24px;
}

.about-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-item {
    text-align: center;
    padding: 28px 20px;
    background: white;
    border: var(--border-light);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-medium);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.about-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.visual-card {
    padding: 32px;
    background: white;
    border: var(--border-light);
    border-radius: var(--border-radius-xl);
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
}

.visual-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.visual-card:nth-child(1):hover {
    border-color: #E30A17;
}

.visual-card:nth-child(2):hover {
    border-color: #1e3a8a;
}

.visual-card:nth-child(3):hover {
    border-color: #f59e0b;
}

.visual-card:nth-child(4):hover {
    border-color: #10b981;
}

.visual-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.visual-card h4 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.visual-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* T4H Section */
.t4h-section {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.t4h-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.t4h-logo {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-medium);
}

.t4h-logo:hover {
    transform: scale(1.03) rotate(1deg);
}

.logo-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.15) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}

.feature-list {
    list-style: none;
    margin-bottom: 40px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 0;
    border-bottom: var(--border-light);
    font-size: 1.05rem;
    color: var(--text-secondary);
}

.feature-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

/* ===== Contact Section ===== */
.contact-section {
    background: var(--bg-secondary);
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-card {
    text-align: center;
    padding: 50px 35px;
    background: white;
    border: var(--border-light);
    border-radius: var(--border-radius-xl);
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
}

.contact-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.contact-icon {
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.contact-card h4 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Footer ===== */
.footer {
    padding: 50px 0;
    background: var(--text-primary);
    color: white;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.footer-brand .logo-yooreed,
.footer-brand .logo-t4h {
    -webkit-text-fill-color: white;
    background: none;
}

.footer-brand .logo-separator {
    color: rgba(255, 255, 255, 0.5);
}

.footer-text {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    transform: scale(0.9);
    transition: transform var(--transition-medium);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 48px;
    height: 48px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-md);
}

.modal-close svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

.modal-close:hover {
    background: var(--primary);
    transform: rotate(90deg);
}

.modal-close:hover svg {
    color: white;
}

.video-container {
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-xl);
}

.video-container video {
    width: 100%;
    display: block;
}

/* ===== Animations ===== */
.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* Scroll Reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .project-card.featured {
        grid-column: span 1;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .about-grid.reverse {
        direction: ltr;
    }

    .about-content .section-title {
        text-align: center;
    }

    .about-content {
        text-align: center;
    }

    .feature-list li {
        justify-content: center;
    }

    .hero-card {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        padding: 40px;
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-medium);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 16px;
        color: var(--text-primary);
    }

    .nav-toggle {
        display: flex;
    }

    .hero {
        padding: 100px 20px 40px;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .about-visual {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 70px 0;
    }

    .project-filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .card-content {
        padding: 22px;
    }

    .card-title {
        font-size: 1.15rem;
    }

    .stat-number {
        font-size: 2.2rem;
    }
}

/* Preloader Override for Light Theme */
.preloader {
    background: white !important;
}

.preloader-bar {
    background: var(--bg-tertiary) !important;
}

/* Custom Cursor Override */
.cursor-dot {
    background: var(--primary) !important;
}

.cursor-ring {
    border-color: rgba(227, 10, 23, 0.4) !important;
}

/* Scroll Progress Override */
.scroll-progress {
    background: var(--bg-tertiary) !important;
}

/* ===== Hero Video Section ===== */
.hero-video-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Align scroll indicator to bottom */
    background-color: #000;
    /* Fallback */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Ensure scroll indicator stays visible on top of video */
.hero-video-section .scroll-indicator {
    position: relative;
    z-index: 10;
    margin-bottom: 40px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Override mouse border for visibility on video */
.hero-video-section .mouse {
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-video-section .wheel {
    background: white;
}