:root {
    --pixel-size: 4px;
    --pac-blue: #2563eb;
    --pac-dark: #020617;
    --pac-accent: #38bdf8;
    --crt-green: #00ff41;
}

/* ============================================
   CURSOR TRAIL
   ============================================ */
.cursor-trail-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    mix-blend-mode: screen;
    transition: transform 0.1s ease;
}

/* ============================================
   MATRIX CODE RAIN
   ============================================ */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.07;
    pointer-events: none;
}

/* ============================================
   GLITCH TEXT EFFECT
   ============================================ */
.glitch-heading {
    position: relative;
    display: inline-block;
}

.glitch-heading::before,
.glitch-heading::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.glitch-heading::before {
    left: 3px;
    text-shadow: -3px 0 #ff00ff;
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    animation: glitch-clip-1 4s infinite;
    opacity: 0;
}

.glitch-heading::after {
    left: -3px;
    text-shadow: 3px 0 #00ffff;
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    animation: glitch-clip-2 4s infinite;
    opacity: 0;
}

.glitch-heading:hover::before,
.glitch-heading:hover::after {
    opacity: 1;
}

@keyframes glitch-clip-1 {
    0%, 90%, 100% { transform: translate(0); opacity: 0; }
    92% { transform: translate(-4px, 2px); opacity: 1; }
    94% { transform: translate(4px, -2px); opacity: 1; }
    96% { transform: translate(-2px, 0); opacity: 1; }
    98% { transform: translate(0); opacity: 0; }
}

@keyframes glitch-clip-2 {
    0%, 90%, 100% { transform: translate(0); opacity: 0; }
    93% { transform: translate(4px, -2px); opacity: 1; }
    95% { transform: translate(-4px, 2px); opacity: 1; }
    97% { transform: translate(2px, 0); opacity: 1; }
    99% { transform: translate(0); opacity: 0; }
}

/* Continuous glitch on hero title */
.hero-glitch {
    animation: hero-glitch-anim 6s infinite;
}

@keyframes hero-glitch-anim {
    0%, 85%, 100% { 
        text-shadow: 4px 4px 0px #2563eb;
        filter: none;
    }
    87% { 
        text-shadow: -4px 0 #ff00ff, 4px 4px 0px #2563eb;
        filter: hue-rotate(90deg);
        transform: skewX(-2deg);
    }
    89% { 
        text-shadow: 4px 0 #00ffff, -4px 4px 0px #2563eb;
        filter: hue-rotate(-90deg);
        transform: skewX(2deg);
    }
    91% { 
        text-shadow: -2px 2px #ff0080, 4px 4px 0px #2563eb;
        filter: none;
        transform: skewX(0deg);
    }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.stat-counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    transition: all 0.1s;
}

.counter-container {
    text-align: center;
    padding: 20px;
    border: 1px solid rgba(56,189,248,0.2);
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.counter-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), transparent);
    opacity: 0;
    transition: opacity 0.5s;
}

.counter-container:hover::before {
    opacity: 1;
}

.counter-container:hover {
    border-color: var(--pac-accent);
    box-shadow: 0 0 30px rgba(56,189,248,0.15);
    transform: translateY(-3px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.counter-value {
    font-size: 3.5rem;
    font-weight: 900;
    font-family: 'DotGothic16', sans-serif;
    background: linear-gradient(135deg, #fff 0%, var(--pac-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    line-height: 1;
}

.counter-label {
    font-size: 0.75rem;
    font-family: 'DotGothic16', sans-serif;
    color: rgba(148,163,184,0.8);
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ============================================
   FLOATING ORBS
   ============================================ */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: orb-float 8s ease-in-out infinite;
    opacity: 0.15;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, #2563eb, transparent);
    top: 10%;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #7c3aed, transparent);
    bottom: 20%;
    left: -50px;
    animation-delay: 3s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, #0891b2, transparent);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -40px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ============================================
   NEON BORDER PULSE
   ============================================ */
.neon-border-pulse {
    position: relative;
}

.neon-border-pulse::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #0891b2, #2563eb);
    background-size: 300% 100%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: neon-rotate 3s linear infinite;
    transition: opacity 0.4s;
}

.neon-border-pulse:hover::before {
    opacity: 1;
}

@keyframes neon-rotate {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ============================================
   SECTION ENTRANCE ANIMATIONS
   ============================================ */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-rotate {
    opacity: 0;
    transform: rotateY(30deg) scale(0.9);
    transition: all 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal-left.active,
.reveal-right.active,
.reveal-scale.active,
.reveal-rotate.active {
    opacity: 1;
    transform: none;
}

/* ============================================
   HERO PARTICLES RING
   ============================================ */
.particle-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orbit-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--pac-accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--pac-accent);
}

/* ============================================
   TYPING EFFECT ENHANCED
   ============================================ */
.terminal-text::after {
    content: '█';
    animation: cursor-blink 0.7s step-end infinite;
    color: var(--pac-accent);
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   STATS SECTION
   ============================================ */
#stats-section {
    background: linear-gradient(180deg, #020617 0%, #0a1628 50%, #020617 100%);
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #38bdf8);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(56,189,248,0.5);
}

/* ============================================
   NAV BAR
   ============================================ */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 500;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
}

#main-nav.scrolled {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(37,99,235,0.3);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    padding: 10px 24px;
}

.nav-link {
    font-family: 'DotGothic16', sans-serif;
    font-size: 12px;
    color: rgba(148,163,184,0.8);
    text-decoration: none;
    padding: 6px 12px;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--pac-accent);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: white;
}

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

/* Mobile Nav Button */
#mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 600;
}

@media (max-width: 768px) {
    #mobile-menu-toggle {
        display: flex;
    }
    .nav-links-desktop {
        display: none;
    }
}

#mobile-menu-toggle div {
    width: 28px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
#mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,0.97);
    z-index: 550;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
}

.mobile-nav-link {
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.2rem;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border: 1px solid rgba(37,99,235,0.3);
    transition: all 0.3s;
}

.mobile-nav-link:hover {
    background: rgba(37,99,235,0.2);
    border-color: var(--pac-accent);
    box-shadow: 0 0 20px rgba(37,99,235,0.3);
}

/* ============================================
   FLOATING WORDS ANIMATION
   ============================================ */
.float-word {
    position: absolute;
    font-family: 'DotGothic16', sans-serif;
    font-size: 11px;
    color: rgba(56, 189, 248, 0.15);
    pointer-events: none;
    white-space: nowrap;
    animation: float-up 15s linear infinite;
    user-select: none;
}

@keyframes float-up {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ============================================
   HOLOGRAM CARD EFFECT
   ============================================ */
.hologram-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(56,189,248,0.03) 50%,
        transparent 100%
    );
    background-size: 200% 200%;
    animation: hologram-shift 4s ease infinite;
    pointer-events: none;
    z-index: 5;
}

@keyframes hologram-shift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* ============================================
   POWER LEVEL BAR (replaces boring bars)
   ============================================ */
.power-bar-container {
    position: relative;
    height: 8px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(56,189,248,0.2);
    overflow: hidden;
}

.power-bar-fill {
    height: 100%;
    position: relative;
    transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.power-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: white;
    filter: blur(4px);
    animation: bar-glow 2s ease-in-out infinite;
}

@keyframes bar-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Global Reset & Layout Fixes */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    position: relative;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background-color: var(--pac-dark);
    color: white;
    cursor: none;
    image-rendering: pixelated;
}

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
    #cursor {
        display: none !important;
    }
}

/* Custom Cursor */
#cursor {
    width: 20px;
    height: 20px;
    background: white;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    image-rendering: pixelated;
    transition: transform 0.1s ease-out;
}

.pixel-font {
    font-family: 'DotGothic16', 'IBM Plex Sans Arabic', sans-serif;
}

/* Lenis Smooth Scroll CSS */
html.lenis, html.lenis body {
    height: auto;
}
.lenis-smooth {
    scroll-behavior: auto !important;
}
.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}
.lenis-stopped {
    overflow: hidden;
}
.lenis-scrolling iframe {
    pointer-events: none;
}

/* Backgrounds */
#nebula-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(circle at center, #020617 0%, #000 100%);
}

.pixel-grid {
    background-image: 
        linear-gradient(to right, rgba(56, 189, 248, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(56, 189, 248, 0.02) 1px, transparent 1px);
    background-size: 24px 24px;
}

@media (min-width: 768px) {
    .pixel-grid {
        background-image: 
            linear-gradient(to right, rgba(56, 189, 248, 0.03) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
        background-size: 32px 32px;
    }
}

/* Advanced CRT Effects */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 1000;
}

.crt-screen {
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.98; }
    50% { opacity: 1; }
    100% { opacity: 0.99; }
}

.crt-curve {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 1001;
}

.scanline-bar {
    width: 100%;
    height: 100px;
    z-index: 1002;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.1;
    position: fixed;
    bottom: 100%;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { bottom: 100%; }
    100% { bottom: -100px; }
}

/* UI Elements */
.retro-title {
    display: inline-flex;
    align-items: baseline;
    line-height: 1.2;
    padding: 0.2em 0;
    background: linear-gradient(to bottom, #fff 0%, #fff 52%, #94a3b8 52%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(4px 4px 0px #2563eb);
    margin: 0;
    position: relative;
}

@media (min-width: 768px) {
    .retro-title {
        filter: drop-shadow(6px 6px 0px #2563eb);
    }
}

.t-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    border: 1px solid white;
    border-radius: 50%;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.25em; /* Smaller as requested */
    margin-left: -0.1em;
    transform: translateY(-1.1em); /* Adjusted to keep it in place at the top */
    image-rendering: pixelated;
    color: white;
    background: var(--pac-dark);
    -webkit-text-fill-color: white;
    box-shadow: 1.5px 1.5px 0px #2563eb;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .t-circle {
        font-size: 0.22em;
        margin-left: -0.08em;
        transform: translateY(-1em);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Boot Screen */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--crt-green);
    font-family: monospace;
    padding: 20px;
    transition: opacity 0.5s ease;
}

/* System Log */
#system-log {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 200px;
    height: 100px;
    background: rgba(0,0,0,0.8);
    border: 2px solid var(--pac-blue);
    padding: 8px;
    font-size: 8px;
    font-family: monospace;
    color: var(--crt-green);
    overflow: hidden;
    z-index: 500;
    pointer-events: none;
    display: flex;
    flex-direction: column-reverse;
}

@media (min-width: 768px) {
    #system-log {
        bottom: 20px;
        right: 20px;
        width: 300px;
        height: 150px;
        font-size: 10px;
        padding: 10px;
    }
}

.log-entry {
    margin-bottom: 4px;
    border-right: 2px solid var(--crt-green);
    padding-right: 5px;
    animation: log-fade 2s forwards;
}

@keyframes log-fade {
    from { opacity: 1; transform: translateX(10px); }
    to { opacity: 0.5; transform: translateX(0); }
}

/* Footer Enhancements */
.cyber-grid-footer {
    background-image: 
        linear-gradient(to right, rgba(37, 99, 235, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

.footer-scanline {
    animation: scanline-move 4s linear infinite;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.8);
}

@keyframes scanline-move {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.footer-card {
    position: relative;
    overflow: hidden;
}

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

.footer-card:hover::before {
    left: 100%;
}

.footer-card:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.15);
    transform: translateY(-5px);
}

/* Social Icon Buttons */
.social-icon-btn {
    width: 48px; /* Larger button */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(37, 99, 235, 0.5);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.social-icon-btn img {
    width: 32px; /* Much larger icon */
    height: 32px;
    object-fit: contain;
    /* Removed filter to show original colors */
    opacity: 1; /* Full opacity */
    transition: all 0.3s ease;
}

.social-icon-btn:hover img {
    transform: scale(1.1);
}

/* Pixel Syria Flag (Revolution Flag) */
.pixel-flag {
    width: 24px;
    height: 15px;
    display: inline-block;
    position: relative;
    background: #fff; /* White middle */
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.1),
        /* Green stripe (top) - positive Y moves down from top edge */
        0 5px 0 #007A3D inset,
        /* Black stripe (bottom) - negative Y moves up from bottom edge */
        0 -5px 0 #000 inset;
}

.pixel-flag::before {
    /* Three red stars in the white middle stripe */
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    width: 2px;
    height: 2px;
    background: #CE1126;
    transform: translateY(-50%);
    box-shadow: 6px 0 0 #CE1126, 12px 0 0 #CE1126;
}

/* Story Section */
.story-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 80px;
    padding-bottom: 100px;
}

@media (min-width: 768px) {
    .story-container {
        gap: 150px;
        padding-bottom: 200px;
    }
}

.story-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 30px;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
}

@media (min-width: 768px) {
    .story-card {
        padding: 60px;
    }
}

.story-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--pac-blue), transparent, var(--pac-accent));
    z-index: -1;
    opacity: 0.3;
}

.story-year {
    position: absolute;
    top: -20px;
    right: 20px;
    background: var(--pac-blue);
    padding: 5px 15px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.2rem;
    z-index: 10;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
    .story-year {
        top: -30px;
        right: -30px;
        padding: 10px 20px;
        font-size: 1.5rem;
    }
}

.story-visual-hint {
    position: absolute;
    font-size: 8rem;
    opacity: 0.03;
    font-family: 'DotGothic16', sans-serif;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

@media (min-width: 768px) {
    .story-visual-hint {
        font-size: 15rem;
    }
}

.rpg-stat-container {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.05);
}

.glass-pixel {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Projects Section */
.category-btn {
    background: rgba(30, 41, 59, 0.5);
    border: 2px solid #334155;
    padding: 8px 16px;
    font-family: 'DotGothic16', sans-serif;
    transition: all 0.3s;
    cursor: pointer;
    color: #94a3b8;
}
.category-btn.active {
    background: var(--pac-blue);
    border-color: var(--pac-accent);
    box-shadow: 0 0 15px var(--pac-blue), 4px 4px 0px rgba(0,0,0,0.5);
    transform: translate(-2px, -2px);
    color: white;
}

/* Projects Section - Ultra Wow Redesign */
.pixel-card-container {
    perspective: 2000px;
}

.pixel-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.2);
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: visible; /* Changed to visible for floating elements */
    height: 100%;
    backdrop-filter: blur(10px);
}

.pixel-card:hover {
    border-color: var(--pac-accent);
    box-shadow: 
        0 0 40px rgba(37, 99, 235, 0.3),
        inset 0 0 20px rgba(56, 189, 248, 0.1);
}

/* Corner Brackets */
.pixel-card::before,
.pixel-card::after,
.card-corners::before,
.card-corners::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--pac-blue);
    z-index: 20;
    transition: all 0.4s ease;
    pointer-events: none;
    opacity: 0.5;
}

/* Top Left */
.pixel-card::before {
    top: -5px;
    left: -5px;
    border-right: none;
    border-bottom: none;
}

/* Top Right */
.pixel-card::after {
    top: -5px;
    right: -5px;
    border-left: none;
    border-bottom: none;
}

/* Bottom Left */
.card-corners::before {
    bottom: -5px;
    left: -5px;
    border-right: none;
    border-top: none;
}

/* Bottom Right */
.card-corners::after {
    bottom: -5px;
    right: -5px;
    border-left: none;
    border-top: none;
}

.pixel-card:hover::before,
.pixel-card:hover::after,
.pixel-card:hover .card-corners::before,
.pixel-card:hover .card-corners::after {
    width: 40px;
    height: 40px;
    opacity: 1;
    border-color: var(--pac-accent);
    filter: drop-shadow(0 0 5px var(--pac-accent));
}

/* Digital Scanner Line */
.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--pac-accent), transparent);
    z-index: 15;
    opacity: 0;
    pointer-events: none;
}

.pixel-card:hover .scanner-line {
    opacity: 1;
    animation: scan-move 2s linear infinite;
}

@keyframes scan-move {
    0% { top: 0%; }
    100% { top: 100%; }
}

/* 3D Layers */
.card-content-3d {
    transform-style: preserve-3d;
    height: 100%;
}

.layer-bg {
    transform: translateZ(20px);
}

.layer-icon {
    transform: translateZ(80px);
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.pixel-card:hover .layer-icon {
    transform: translateZ(120px) scale(1.1);
}

.layer-text {
    transform: translateZ(50px);
}

/* Cyber Title Glitch */
.cyber-title {
    position: relative;
    display: inline-block;
}

.pixel-card:hover .cyber-title {
    animation: cyber-glitch 0.3s infinite;
    color: var(--pac-accent);
    text-shadow: 2px 2px var(--pac-blue), -2px -2px #ff00ff;
}

@keyframes cyber-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(-2px, -1px); }
    60% { transform: translate(2px, 1px); }
    80% { transform: translate(2px, -1px); }
    100% { transform: translate(0); }
}

/* Status Pulse Badge */
.status-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 4px 10px;
    font-size: 10px;
    font-family: 'DotGothic16', sans-serif;
    text-transform: uppercase;
    z-index: 30;
    transform: translateZ(60px);
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--pac-blue);
    color: var(--pac-accent);
}

.pixel-card:hover .status-badge {
    border-color: var(--pac-accent);
    box-shadow: 0 0 10px var(--pac-accent);
}

/* Waiting Pulse Fix */
@keyframes heartbeat {
    0% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 0px rgba(239, 68, 68, 0); }
    50% { transform: scale(1.02); opacity: 1; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
    100% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 0px rgba(239, 68, 68, 0); }
}

.waiting-pulse {
    animation: heartbeat 3s infinite ease-in-out;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

.waiting-label {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    font-size: 10px;
    font-family: 'DotGothic16', sans-serif;
    box-shadow: 0 0 10px #ef4444;
}


.particle {
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    image-rendering: pixelated;
}

/* Projects Section - Noise & Glow */
#projects {
    position: relative;
}

#projects::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

#projects-grid {
    position: relative;
    z-index: 2;
}

.section-highlight {
    position: relative;
}

.section-highlight::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 0;
    height: 4px;
    background: var(--pac-blue);
    transition: width 0.5s ease;
}

.section-highlight:hover::after {
    width: 100%;
}

#back-to-top {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-nav-link {
    transition: all 0.3s ease;
}

/* Project Showcase Modal */
#project-modal {
    perspective: 2000px;
}

#modal-content {
    transform-style: preserve-3d;
    box-shadow: 0 0 100px rgba(0,0,0,0.8), 0 0 30px rgba(37, 99, 235, 0.4);
}

#modal-image-container div {
    flex: 0 0 100%;
}

/* Animations */
@keyframes modal-glitch {
    0% { clip-path: inset(0 0 0 0); }
    5% { clip-path: inset(10% -6px 80% 0); }
    10% { clip-path: inset(0 0 0 0); }
    /* Add more steps for a real glitch effect */
}

.modal-glitch-active {
    animation: modal-glitch 0.2s steps(1);
}

/* Improved Quiet B&W Transition */
#crt-transition {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 5000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#crt-transition.active {
    opacity: 1;
    pointer-events: all;
}

.static-noise {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.15;
    filter: grayscale(100%) contrast(150%);
    mix-blend-mode: screen;
}

.glitch-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.05), transparent);
    background-size: 100% 200%;
    animation: scan-slow 2s linear infinite;
    pointer-events: none;
}

@keyframes scan-slow {
    0% { background-position: 0% 0%; }
    100% { background-position: 0% 100%; }
}

.glitch-active .glitch-overlay {
    background: white;
    opacity: 0.1;
    animation: flash-in-out 0.6s ease-in-out;
}

@keyframes flash-in-out {
    0% { opacity: 0; transform: scaleY(0); }
    50% { opacity: 0.2; transform: scaleY(1); }
    100% { opacity: 0; transform: scaleY(0); }
}

/* TV Slider Styles */
.tv-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Wrapper that holds the TV image and the screen overlay */
.tv-frame-wrapper {
    position: relative;
    width: 100%;
}

.tv-frame {
    position: relative;
    z-index: 10;
    pointer-events: none;
    width: 100%;
    height: auto;
    display: block;
    flex-shrink: 0;
}

/* Updated screen dimensions to match the larger TV scale */
.tv-screen-content {
    position: absolute;
    top: 10.8% !important; /* Force position */
    left: 25.8% !important;
    width: 50.5% !important;
    height: 65.5% !important;
    z-index: 5;
    overflow: hidden;
    border-radius: 50px;
}

/* Layer 1: Image Slider (Clean, No noise here) */
.tv-image-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.tv-screen-content .slide-item {
    min-width: 100%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-screen-content img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
    padding: 15px; /* Added padding to make the image smaller inside the frame */
    box-sizing: border-box; /* Ensure padding doesn't affect dimensions */
}

/* Layer 2: Visual Effects (Separate overlay) */
.tv-effects-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    height: 80%;
    width: 80%;
    right: 10%;
}

/* Realistic TV Static/Switch effect - Strictly inside its own layer */
.tv-static {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    z-index: 25;
    pointer-events: none;
}

.tv-static.active {
    animation: tv-switch 0.4s steps(4) forwards;
    opacity: 1;
}

@keyframes tv-switch {
    0% { 
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        filter: brightness(2) contrast(2);
        transform: scale(1);
    }
    50% { 
        background-color: #000;
        background-image: none;
        transform: scaleY(0.01) scaleX(1);
    }
    100% { 
        background-color: transparent;
        transform: scaleY(0) scaleX(0);
        opacity: 0;
    }
}

.tv-scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    ), linear-gradient(
        90deg, 
        rgba(255, 0, 0, 0.06), 
        rgba(0, 255, 0, 0.02), 
        rgba(0, 0, 255, 0.06)
    );
    background-size: 100% 3px, 3px 100%;
    z-index: 12;
    pointer-events: none;
}

/* TV Remote Control */
/* Increase Remote size slightly to match larger TV */
.tv-remote {
    position: relative;
    display: block;
    margin: 0 auto;
    margin-top: 0;
    width: 260px;
    height: 75px;
    background: #2c2c2c;
    border-radius: 18px;
    border: 4px solid #1a1a1a;
    box-shadow: 0 12px 0 #111, 0 20px 30px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px;
    z-index: 20;
    transition: box-shadow 0.2s;
}

/* Wire wrapper — sits between TV bottom and remote top */
.tv-wire-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    position: relative;
    z-index: 15;
}

.tv-wire-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Electric active state on remote */
.tv-remote.electric-active {
    box-shadow: 
        0 12px 0 #111,
        0 20px 30px rgba(0,0,0,0.6),
        0 0 20px rgba(56,189,248,0.8),
        0 0 40px rgba(56,189,248,0.4),
        inset 0 0 15px rgba(56,189,248,0.2);
    border-color: #38bdf8;
}

/* Electric glow overlay inside remote */
.remote-electric-glow {
    position: absolute;
    inset: -4px;
    border-radius: 20px;
    background: transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    z-index: 30;
}

.remote-electric-glow.active {
    opacity: 1;
    background: radial-gradient(ellipse at center, rgba(56,189,248,0.25) 0%, transparent 70%);
    animation: electric-pulse-glow 0.5s ease-out forwards;
}

@keyframes electric-pulse-glow {
    0%   { opacity: 1; transform: scale(0.95); }
    30%  { opacity: 0.9; transform: scale(1.05); }
    60%  { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0; transform: scale(1); }
}

/* Spark flash on top of TV at wire connection point */
.wire-spark-flash {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 15px 8px rgba(56,189,248,0.8), 0 0 30px 15px rgba(56,189,248,0.4);
    pointer-events: none;
    z-index: 50;
    animation: spark-burst 0.35s ease-out forwards;
}

@keyframes spark-burst {
    0%   { opacity: 1; transform: translateX(-50%) scale(0.5); }
    40%  { opacity: 0.9; transform: translateX(-50%) scale(1.5); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.2); }
}

.remote-btn {
    width: 50px;
    height: 50px;
    background: #444;
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 0 #222;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
    user-select: none;
}

.remote-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #222;
}

.remote-btn.prev-btn { background: #555; }
.remote-btn.next-btn { background: #555; }
.remote-btn.power-btn { 
    background: #c0392b; 
    width: 45px;
    height: 45px;
    border-radius: 50%;
}

@media (max-width: 1024px) {
    .tv-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .tv-container {
        width: 100% !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        left: 0 !important;
        transform: none !important;
        margin-top: 10px !important;
        margin-bottom: 20px !important;
    }

    .tv-screen-content {
        top: -0.8% !important;
        left: 25.8% !important;
        width: 50.5% !important;
        height: 65.5% !important;
        border-radius: 10px !important;
    }

    .tv-remote {
        width: 200px;
        height: 60px;
        margin-top: 25px;
        padding: 0 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    .remote-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .remote-btn.power-btn {
        width: 32px;
        height: 32px;
    }

    #p-title {
        font-size: 2.5rem;
    }

    #p-desc {
        font-size: 1.1rem;
        padding: 15px;
        border-right: 3px solid #2563eb;
    }
    
    .tv-btn {
        width: 30px;
        height: 30px;
    }
}

.remote-sensor {
    width: 10px;
    height: 10px;
    background: #900;
    border-radius: 50%;
    box-shadow: 0 0 5px #f00;
}

.tv-btn {
    position: absolute;
    z-index: 20;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.tv-btn-next {
    right: 15%;
    top: 35%;
}

.tv-btn-prev {
    right: 15%;
    top: 48%;
}

/* Enhanced Project Link Button */
#p-link {
    position: relative;
    padding: 20px 60px;
    background: #2563eb;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 0 0 4px #2563eb, 0 10px 20px rgba(0,0,0,0.4);
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

#p-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

#p-link:hover {
    transform: scale(1.05) translateY(-5px);
    background: #1d4ed8;
    box-shadow: 0 0 0 6px #1d4ed8, 0 20px 40px rgba(0,0,0,0.5);
}

#p-link:hover::before {
    left: 100%;
}

#p-link:active {
    transform: scale(0.98) translateY(0);
}

/* Story-like description styling */
#p-desc {
    font-size: 1.4rem;
    line-height: 1.8;
    color: #cbd5e1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    padding: 20px;
    background: rgba(15, 23, 42, 0.3);
    border-right: 4px solid #2563eb;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .tv-container {
        width: 100%;
        max-width: 90%;
        margin: 0 auto;
        left: 0;
        transform: none;
    }

    .tv-screen-content {
        top: 10.8%;
        left: 25.8%;
        width: 50.5%;
        height: 65.5%;
        border-radius: 8px;
    }

    .tv-remote {
        width: 200px;
        height: 60px;
        margin-top: 30px;
        left: 50%;
        transform: translateX(-50%);
    }



    .remote-btn.power-btn {
        width: 32px;
        height: 32px;
    }
}


/* ============================================
   PIXEL BUTTON
   ============================================ */
.pixel-button {
    display: inline-block;
    padding: 10px 24px;
    background: transparent;
    border: 2px solid var(--pac-blue);
    color: var(--pac-accent);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    text-decoration: none;
}

.pixel-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pac-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: -1;
}

.pixel-button:hover {
    color: white;
    box-shadow: 0 0 20px rgba(37,99,235,0.5), 4px 4px 0 rgba(0,0,0,0.5);
    transform: translate(-2px, -2px);
}

.pixel-button:hover::before {
    transform: scaleX(1);
}

/* Chapter title style */
.chapter-title {
    display: block;
    color: rgba(56,189,248,0.7);
    font-size: 0.7rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Full name style */
.full-name {
    color: rgba(148,163,184,0.5);
}

/* ============================================================
   THE GREAT SAGA — CINEMATIC TIMELINE
   ============================================================ */

/* Background grid overlay for saga section */
.saga-bg-grid {
    background-image:
        linear-gradient(to right,  rgba(37,99,235,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(37,99,235,0.04) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* ── Section header ── */
.saga-label-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    animation: saga-fade-up 0.8s ease forwards;
}
.saga-label-wrap::before,
.saga-label-wrap::after {
    content: '';
    display: block;
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56,189,248,0.6));
}
.saga-label-wrap::after {
    background: linear-gradient(90deg, rgba(56,189,248,0.6), transparent);
}
.saga-label {
    font-size: 0.65rem;
    letter-spacing: 6px;
    color: rgba(56,189,248,0.7);
    text-transform: uppercase;
}

.saga-main-title {
    font-size: clamp(2.5rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 1.1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 0 0.18em;
    direction: ltr; /* اسم إنجليزي — لا نعكسه */
}
.saga-word {
    opacity: 0;
    transform: translateY(40px) skewY(4deg);
    animation: saga-word-in 0.7s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
    animation-delay: var(--d, 0ms);
    background: linear-gradient(to bottom, #fff 0%, #fff 52%, #94a3b8 52%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(4px 4px 0 #2563eb);
}
.saga-word.text-blue-400  { filter: drop-shadow(3px 3px 0 #1e40af); background: linear-gradient(to bottom, #60a5fa, #3b82f6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.saga-word.text-slate-400 { filter: drop-shadow(3px 3px 0 #1e293b); background: linear-gradient(to bottom, #94a3b8, #64748b); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.saga-trademark {
    align-self: flex-start;
    -webkit-text-fill-color: transparent;
    background: none;
    filter: none;
}

.saga-subtitle {
    font-size: clamp(0.65rem, 2vw, 1.1rem);
    color: rgba(148,163,184,0.4);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0;
    animation: saga-fade-up 1s ease 600ms forwards;
}

.saga-divider {
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #2563eb, #38bdf8, #7c3aed, transparent);
    animation: saga-line-expand 1.2s ease 800ms forwards;
    max-width: 300px;
}

@keyframes saga-fade-up {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes saga-word-in {
    to { opacity: 1; transform: translateY(0) skewY(0deg); }
}
@keyframes saga-line-expand {
    to { width: 100%; }
}

/* ── Timeline layout ── */
.saga-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 0 0 60px;
}

@media (min-width: 768px) {
    .saga-timeline {
        gap: 120px;
    }
}

/* The vertical progress line */
.saga-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0%;
    background: linear-gradient(to bottom,
        #2563eb 0%,
        #7c3aed 40%,
        #0891b2 70%,
        #4f46e5 100%
    );
    box-shadow: 0 0 12px rgba(37,99,235,0.5);
    transition: height 0.3s linear;
    z-index: 1;
}

@media (max-width: 767px) {
    .saga-line { left: 20px; }
}

/* ── Timeline entry ── */
.saga-entry {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
    opacity: 0;
    transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.175,0.885,0.32,1.275);
}

.saga-entry.is-visible { opacity: 1 !important; transform: none !important; }

.saga-entry--left  { transform: translateX(-60px); }
.saga-entry--right { transform: translateX(60px);  }

@media (min-width: 768px) {
    .saga-entry {
        grid-template-columns: 1fr 48px 1fr;
        align-items: start;
    }
    .saga-entry--left  .saga-card { grid-column: 1; grid-row: 1; }
    .saga-entry--left  .saga-dot  { grid-column: 2; grid-row: 1; justify-self: center; }
    .saga-entry--left::after      { content: ''; grid-column: 3; }

    .saga-entry--right .saga-card { grid-column: 3; grid-row: 1; }
    .saga-entry--right .saga-dot  { grid-column: 2; grid-row: 1; justify-self: center; }
    .saga-entry--right::before    { content: ''; grid-column: 1; }
}

/* ── Timeline dot ── */
.saga-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto;
    flex-shrink: 0;
}
.saga-dot--blue   { background: #2563eb; box-shadow: 0 0 20px #2563eb; }
.saga-dot--gray   { background: #475569; box-shadow: 0 0 12px #475569; }
.saga-dot--cyan   { background: #0891b2; box-shadow: 0 0 20px #0891b2; }
.saga-dot--indigo { background: #4f46e5; box-shadow: 0 0 20px #4f46e5; }
.saga-dot--pulse  { animation: dot-pulse-anim 2s ease-in-out infinite; }

.saga-dot-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid rgba(37,99,235,0.5);
    animation: ring-expand 2s ease-in-out infinite;
}
.saga-dot-ring--gray   { border-color: rgba(71,85,105,0.5); }
.saga-dot-ring--cyan   { border-color: rgba(8,145,178,0.5); }
.saga-dot-ring--indigo { border-color: rgba(79,70,229,0.5); }

@keyframes ring-expand {
    0%,100% { transform: scale(1);   opacity: 0.6; }
    50%      { transform: scale(1.5); opacity: 0;   }
}
@keyframes dot-pulse-anim {
    0%,100% { box-shadow: 0 0 20px #4f46e5; }
    50%      { box-shadow: 0 0 40px #818cf8, 0 0 60px #4f46e5; }
}

/* ── Saga card ── */
.saga-card {
    position: relative;
    padding: 36px 28px;
    border: 1px solid rgba(56,189,248,0.15);
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(14px);
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

@media (min-width: 768px) { .saga-card { padding: 48px 44px; } }

.saga-card:hover { transform: translateY(-4px); }

.saga-card--blue   { border-color: rgba(37,99,235,0.3);  }
.saga-card--blue:hover   { box-shadow: 0 20px 60px rgba(37,99,235,0.15);  }
.saga-card--gray   { border-color: rgba(71,85,105,0.3);  }
.saga-card--gray:hover   { box-shadow: 0 20px 60px rgba(15,23,42,0.4);    }
.saga-card--cyan   { border-color: rgba(8,145,178,0.35); }
.saga-card--cyan:hover   { box-shadow: 0 20px 60px rgba(8,145,178,0.15);  }
.saga-card--indigo { border-color: rgba(79,70,229,0.4);  }
.saga-card--indigo:hover { box-shadow: 0 20px 60px rgba(79,70,229,0.2);   }

/* Corner brackets on saga cards */
.saga-card::before, .saga-card::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid;
    opacity: 0.4;
    transition: all 0.4s ease;
}
.saga-card--blue::before, .saga-card--blue::after   { border-color: #2563eb; }
.saga-card--gray::before, .saga-card--gray::after   { border-color: #475569; }
.saga-card--cyan::before, .saga-card--cyan::after   { border-color: #0891b2; }
.saga-card--indigo::before,.saga-card--indigo::after{ border-color: #4f46e5; }
.saga-card::before { top: -1px; right: -1px; border-bottom: none; border-left: none; }
.saga-card::after  { bottom: -1px; left: -1px; border-top: none; border-right: none; }
.saga-card:hover::before,.saga-card:hover::after { opacity: 1; width: 28px; height: 28px; }

/* Animated top-edge glow line */
.saga-card-glow {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 2px;
    animation: glow-sweep 4s linear infinite;
}
.saga-card--blue   .saga-card-glow { background: linear-gradient(90deg, transparent, #2563eb, transparent); }
.saga-card--gray   .saga-card-glow { background: linear-gradient(90deg, transparent, #475569, transparent); animation-delay: 1s; }
.saga-card--cyan   .saga-card-glow { background: linear-gradient(90deg, transparent, #0891b2, transparent); animation-delay: 2s; }
.saga-card--indigo .saga-card-glow { background: linear-gradient(90deg, transparent, #4f46e5, transparent); animation-delay: 3s; }

@keyframes glow-sweep {
    0%   { left: -100%; }
    100% { left: 200%;  }
}

/* Year badge */
.saga-year-badge {
    position: absolute;
    top: -14px; right: 24px;
    background: #2563eb;
    color: white;
    font-family: 'DotGothic16', sans-serif;
    font-size: 1rem;
    padding: 4px 16px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
    z-index: 10;
}
.saga-year-badge--gray   { background: #334155; }
.saga-year-badge--cyan   { background: #0e7490; }
.saga-year-badge--indigo { background: #4338ca; }
.saga-badge--pulse { animation: badge-pulse 2s ease-in-out infinite; }
@keyframes badge-pulse {
    0%,100% { box-shadow: 3px 3px 0 rgba(0,0,0,0.4); }
    50%      { box-shadow: 3px 3px 0 rgba(0,0,0,0.4), 0 0 20px rgba(79,70,229,0.6); }
}

/* Background watermark word */
.saga-bg-word {
    position: absolute;
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(5rem, 18vw, 14rem);
    opacity: 0.025;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    z-index: 0;
}

/* Card title */
.saga-card-title {
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    font-weight: 900;
    color: white;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}
.saga-card--gray .saga-card-title { color: #94a3b8; }

.saga-card-body { position: relative; z-index: 1; }

/* Achievement list */
.saga-achievements { display: flex; flex-direction: column; gap: 12px; }
.saga-achievement {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(37,99,235,0.2);
    background: rgba(37,99,235,0.05);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    transition: all 0.3s ease;
}
.saga-achievement:hover {
    border-color: rgba(37,99,235,0.5);
    background: rgba(37,99,235,0.1);
    color: white;
    transform: translateX(-4px);
}
.saga-achievement-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    border: 1px solid rgba(37,99,235,0.4);
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background: rgba(37,99,235,0.08);
    transition: all 0.3s ease;
}
.saga-achievement:hover .saga-achievement-icon {
    background: rgba(37,99,235,0.2);
    border-color: #60a5fa;
    box-shadow: 0 0 10px rgba(37,99,235,0.3);
}
.saga-achievement-icon svg {
    width: 14px;
    height: 14px;
}

/* Void chapter bars animation */
.saga-void-quote { position: relative; }
.saga-void-bars {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 40px;
}
.saga-void-bars div {
    flex: 1;
    background: rgba(71,85,105,0.5);
    animation: void-bar 3s ease-in-out infinite;
}
.saga-void-bars div:nth-child(1) { height: 20%; animation-delay: 0s; }
.saga-void-bars div:nth-child(2) { height: 40%; animation-delay: 0.3s; }
.saga-void-bars div:nth-child(3) { height: 15%; animation-delay: 0.6s; }
.saga-void-bars div:nth-child(4) { height: 30%; animation-delay: 0.9s; }
.saga-void-bars div:nth-child(5) { height: 10%; animation-delay: 1.2s; }
@keyframes void-bar {
    0%,100% { opacity: 0.3; transform: scaleY(1); }
    50%      { opacity: 0.8; transform: scaleY(1.3); }
}

/* Saga bar tracks */
.saga-stat-bar { background: rgba(0,0,0,0.3); padding: 12px; border: 1px solid rgba(255,255,255,0.05); }
.saga-bar-track { height: 6px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.05); overflow: hidden; }
.saga-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.175,0.885,0.32,1.275);
    position: relative;
}
.saga-bar-fill::after {
    content: '';
    position: absolute; top:0; right:0;
    width: 20px; height: 100%;
    background: rgba(255,255,255,0.6);
    filter: blur(3px);
}

/* Octopus showcase */
.saga-octopus-frame {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
}
.saga-octopus-rings {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.oring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(79,70,229,0.3);
    animation: oring-spin linear infinite;
}
.oring-1 { width: 100px; height: 100px; animation-duration: 8s; }
.oring-2 { width: 150px; height: 150px; animation-duration: 12s; animation-direction: reverse; border-color: rgba(99,102,241,0.2); }
.oring-3 { width: 200px; height: 200px; animation-duration: 18s; border-color: rgba(139,92,246,0.1); }
@keyframes oring-spin { to { transform: rotate(360deg); } }

.saga-octopus-img {
    width: 100px; height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(79,70,229,0.7));
    animation: octopus-float 4s ease-in-out infinite;
    position: relative; z-index: 2;
}
@keyframes octopus-float {
    0%,100% { transform: translateY(0)   rotate(-2deg); }
    50%      { transform: translateY(-12px) rotate(2deg); }
}

/* ── Saga section particles canvas ── */
#saga-particles { z-index: 0; }

/* ============================================================
   CTA CARD — "مشروعك القادم هنا"
   ============================================================ */
.cta-card {
    border: 1px solid rgba(37,99,235,0.3) !important;
    background: rgba(15,23,42,0.6) !important;
    transition: all 0.5s cubic-bezier(0.175,0.885,0.32,1.275) !important;
}
.cta-card:hover {
    border-color: rgba(56,189,248,0.6) !important;
    box-shadow: 0 0 60px rgba(37,99,235,0.2), inset 0 0 30px rgba(37,99,235,0.05) !important;
    transform: translateY(-8px) !important;
}

.cta-card-inner { min-height: 300px; }

/* Animated rocket */
.cta-rocket-wrap {
    position: relative;
    width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
}
.cta-rocket-glow {
    position: absolute; inset: 0;
    background: radial-gradient(circle, rgba(37,99,235,0.3), transparent 70%);
    animation: rocket-glow-pulse 2s ease-in-out infinite;
    border-radius: 50%;
}
.cta-rocket {
    font-size: 3rem;
    animation: rocket-launch 3s ease-in-out infinite;
    position: relative; z-index: 1;
    filter: drop-shadow(0 0 10px rgba(56,189,248,0.5));
}
@keyframes rocket-launch {
    0%   { transform: translateY(6px)  rotate(-5deg); }
    50%  { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(6px)  rotate(-5deg); }
}
@keyframes rocket-glow-pulse {
    0%,100% { opacity: 0.5; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.4); }
}

.cta-btn {
    padding: 8px 20px;
    border: 1px solid rgba(37,99,235,0.5);
    color: #38bdf8;
    transition: all 0.3s ease;
    background: rgba(37,99,235,0.1);
}
.cta-card:hover .cta-btn {
    background: rgba(37,99,235,0.3);
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(37,99,235,0.3);
}

/* Orbiting dots around CTA */
.cta-orbit {
    position: absolute; inset: 0;
    pointer-events: none;
    animation: orbit-rotate 10s linear infinite;
}
.cta-orbit-dot {
    position: absolute;
    width: 5px; height: 5px;
    background: rgba(37,99,235,0.6);
    border-radius: 50%;
    top: 50%; left: 50%;
    transform-origin: 0 0;
    transform: rotate(var(--a)) translateX(110px) translateY(-50%);
    box-shadow: 0 0 6px rgba(37,99,235,0.8);
}
@keyframes orbit-rotate {
    to { transform: rotate(360deg); }
}

/* ============================================================
   SAGA DNA CARDS — Team Info Section
   ============================================================ */

.saga-dna-section {
    position: relative;
    z-index: 10;
}

.saga-dna-card {
    padding: 28px 24px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.saga-dna-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    opacity: 0.6;
    transition: opacity 0.4s;
}

.saga-dna-card:hover {
    transform: translateY(-5px);
}

.saga-dna-card:hover::before { opacity: 1; }

/* Color variants */
.saga-dna--blue   { border-color: rgba(37,99,235,0.25); }
.saga-dna--blue::before   { background: linear-gradient(90deg, transparent, #2563eb, transparent); }
.saga-dna--blue:hover     { box-shadow: 0 20px 50px rgba(37,99,235,0.15); border-color: rgba(37,99,235,0.5); }

.saga-dna--cyan   { border-color: rgba(8,145,178,0.25); }
.saga-dna--cyan::before   { background: linear-gradient(90deg, transparent, #0891b2, transparent); }
.saga-dna--cyan:hover     { box-shadow: 0 20px 50px rgba(8,145,178,0.15); border-color: rgba(8,145,178,0.5); }

.saga-dna--indigo { border-color: rgba(79,70,229,0.25); }
.saga-dna--indigo::before { background: linear-gradient(90deg, transparent, #4f46e5, transparent); }
.saga-dna--indigo:hover   { box-shadow: 0 20px 50px rgba(79,70,229,0.15); border-color: rgba(79,70,229,0.5); }

.saga-dna--geo    { border-color: rgba(16,185,129,0.2); }
.saga-dna--geo::before    { background: linear-gradient(90deg, transparent, #10b981, transparent); }
.saga-dna--geo:hover      { box-shadow: 0 20px 50px rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.4); }

.saga-dna--stats  { border-color: rgba(245,158,11,0.2); }
.saga-dna--stats::before  { background: linear-gradient(90deg, transparent, #f59e0b, transparent); }
.saga-dna--stats:hover    { box-shadow: 0 20px 50px rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.4); }

.saga-dna--tech   { border-color: rgba(139,92,246,0.2); }
.saga-dna--tech::before   { background: linear-gradient(90deg, transparent, #8b5cf6, transparent); }
.saga-dna--tech:hover     { box-shadow: 0 20px 50px rgba(139,92,246,0.1); border-color: rgba(139,92,246,0.4); }

/* Icon */
.saga-dna-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    animation: dna-icon-float 3s ease-in-out infinite;
}

.saga-dna-icon svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 10px rgba(56,189,248,0.25));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.saga-dna-card:hover .saga-dna-icon svg {
    transform: scale(1.12) rotateY(10deg);
    filter: drop-shadow(0 0 18px rgba(56,189,248,0.5));
}

@keyframes dna-icon-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.saga-dna-title {
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.1rem;
    color: white;
    margin-bottom: 10px;
}

.saga-dna-text {
    font-size: 0.92rem;
    line-height: 1.75;
    color: #94a3b8;
}

.saga-dna-tag {
    display: inline-block;
    margin-top: 16px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.65rem;
    padding: 3px 10px;
    border: 1px solid rgba(56,189,248,0.3);
    color: rgba(56,189,248,0.7);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Map icon */
.saga-dna-map-icon {
    flex-shrink: 0;
    animation: dna-icon-float 4s ease-in-out infinite;
}

.saga-dna-map-icon svg {
    filter: drop-shadow(0 0 12px rgba(16,185,129,0.3));
    transition: transform 0.4s ease, filter 0.4s ease;
}

.saga-dna-card:hover .saga-dna-map-icon svg {
    transform: scale(1.08) rotate(-3deg);
    filter: drop-shadow(0 0 20px rgba(16,185,129,0.5));
}

/* Location tags */
.saga-location-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.65rem;
    padding: 5px 10px;
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #6ee7b7;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.saga-location-tag:hover {
    background: rgba(16,185,129,0.15);
    border-color: rgba(16,185,129,0.5);
    box-shadow: 0 0 12px rgba(16,185,129,0.15);
}
.saga-location-tag svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* Mini stats */
.saga-mini-stat {
    padding: 14px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    text-align: center;
    transition: all 0.3s ease;
}
.saga-mini-stat:hover {
    border-color: rgba(245,158,11,0.4);
    background: rgba(245,158,11,0.05);
}
.saga-mini-num {
    display: block;
    font-family: 'DotGothic16', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}
.saga-mini-label {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 4px;
    font-family: 'DotGothic16', sans-serif;
}

/* Tech stack grid */
.saga-tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 640px) {
    .saga-tech-grid { grid-template-columns: repeat(5, 1fr); }
}
.saga-tech-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.04);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.65rem;
    color: #94a3b8;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.saga-tech-item:hover {
    background: rgba(139,92,246,0.1);
    border-color: rgba(139,92,246,0.3);
    color: white;
    transform: translateY(-2px);
}
.saga-tech-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px currentColor;
}

/* ============================================================
   TECH ARSENAL — Full Redesign
   ============================================================ */

/* ── 3D Scene header ── */
.tech-3d-scene {
    width: 260px;
    height: 260px;
    margin: 0 auto 24px;
    position: relative;
}
#tech-globe-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* ── Arsenal title ── */
.tech-arsenal-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    background: linear-gradient(135deg, #fff 0%, #38bdf8 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(56,189,248,0.3));
}

/* ── Counter badge ── */
.tech-count-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid rgba(56,189,248,0.3);
    background: rgba(56,189,248,0.06);
    animation: badge-breathe 3s ease-in-out infinite;
}
.tech-count-num {
    font-family: 'DotGothic16', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tech-count-label {
    font-size: 0.65rem;
    color: rgba(56,189,248,0.7);
    letter-spacing: 3px;
}
@keyframes badge-breathe {
    0%,100% { box-shadow: 0 0 0 rgba(56,189,248,0); }
    50%      { box-shadow: 0 0 20px rgba(56,189,248,0.2); }
}

/* ── Filter bar ── */
.tech-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 36px;
}
.tech-filter-btn {
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.65rem;
    padding: 6px 14px;
    background: rgba(15,23,42,0.8);
    border: 1px solid rgba(56,189,248,0.15);
    color: #64748b;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.tech-filter-btn:hover {
    border-color: rgba(56,189,248,0.4);
    color: #94a3b8;
}
.tech-filter-btn.active {
    background: rgba(37,99,235,0.2);
    border-color: #38bdf8;
    color: #e2e8f0;
    box-shadow: 0 0 14px rgba(56,189,248,0.2);
}

/* ── Cards grid ── */
.tech-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
@media (min-width: 640px)  { .tech-cards-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
@media (min-width: 1024px) { .tech-cards-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }

/* ── Individual tech card ── */
.tech-card {
    position: relative;
    padding: 16px 10px 14px;
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: default;
    transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    overflow: hidden;
    /* 3D perspective per card */
    perspective: 600px;
}

/* Revealed state */
.tech-card.tc-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: card-pop 0.5s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}

@keyframes card-pop {
    0%   { opacity:0; transform: translateY(16px) scale(0.92); }
    70%  { transform: translateY(-3px) scale(1.03); }
    100% { opacity:1; transform: translateY(0) scale(1); }
}

/* Hover */
.tech-card:hover {
    transform: translateY(-6px) scale(1.04) rotateX(4deg);
    border-color: var(--tc);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--tc) 25%, transparent),
                inset 0 0 20px color-mix(in srgb, var(--tc) 5%, transparent);
    z-index: 2;
}

/* Animated glow that sweeps top edge */
.tech-card-glow {
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--tc), transparent);
    transition: opacity 0.3s;
    opacity: 0;
}
.tech-card:hover .tech-card-glow {
    opacity: 1;
    animation: tech-sweep 1.8s linear infinite;
}
@keyframes tech-sweep {
    from { left: -100%; }
    to   { left: 200%;  }
}

/* SVG icon */
.tech-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tb);
    border-radius: 12px;
    padding: 8px;
    transition: transform 0.4s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.tech-card-icon svg {
    width: 36px;
    height: 36px;
}
.tech-card:hover .tech-card-icon {
    transform: translateY(-4px) rotateY(15deg);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--tc) 30%, transparent);
}

/* Name */
.tech-card-name {
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.6rem;
    color: #94a3b8;
    text-align: center;
    letter-spacing: 1px;
    transition: color 0.3s;
    line-height: 1.3;
}
.tech-card:hover .tech-card-name {
    color: #e2e8f0;
}

/* Skill bar at bottom */
.tech-card-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    border-radius: 2px;
}
.tech-card-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--tc), color-mix(in srgb, var(--tc) 60%, white));
    transition: width 1.2s cubic-bezier(0.175,0.885,0.32,1.275);
    position: relative;
}
.tech-card-bar-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0;
    width: 12px; height: 100%;
    background: white;
    filter: blur(3px);
    opacity: 0.7;
}

/* ============================================================
   SYRIA MAP CARD
   ============================================================ */

.syria-map-card {
    display: flex !important;
    flex-direction: column;
    gap: 24px;
    padding: 28px !important;
}

@media (min-width: 768px) {
    .syria-map-card {
        flex-direction: row !important;
        align-items: center;
    }
}

/* Map wrapper */
.syria-map-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .syria-map-wrapper {
        width: 340px;
    }
}

/* Canvas overlay for spread waves */
#syria-spread-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* SVG map */
#syria-svg {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 20px rgba(16,185,129,0.15));
}

/* Idlib pulse rings */
.idlib-pulse {
    animation: idlib-ring-expand 2.4s ease-out infinite;
    transform-origin: 118px 78px;
}

@keyframes idlib-ring-expand {
    0%   { r: 5;  opacity: 0.9; }
    100% { r: 45; opacity: 0; }
}

/* Spread lines draw animation */
.spread-line {
    stroke-dasharray: 4 3;
    animation: dash-flow 3s linear infinite;
}

@keyframes dash-flow {
    from { stroke-dashoffset: 100; }
    to   { stroke-dashoffset: 0; }
}

/* Idlib region glow */
#idlib-region {
    animation: idlib-glow 3s ease-in-out infinite;
}

@keyframes idlib-glow {
    0%,100% { fill: rgba(16,185,129,0.15); }
    50%      { fill: rgba(16,185,129,0.35); }
}

/* Label: من إدلب → سوريا والعالم */
.syria-map-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 0.65rem;
    color: #34d399;
    letter-spacing: 2px;
}

.syria-map-label .pixel-font {
    font-size: 0.6rem;
}

/* Text section */
.syria-map-text {
    flex: 1;
}

/* ============================================================
   SYRIA MAP CARD — Real SVG Path
   ============================================================ */
.syria-map-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    padding: 20px !important;
}

.syria-map-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 560 / 420;
    margin-bottom: 10px;
}

.syria-map-wrapper svg,
.syria-map-wrapper canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Syria border fill */
.syria-fill {
    fill: rgba(14, 43, 30, 0.85);
    stroke: #10b981;
    stroke-width: 1.4;
    stroke-linejoin: round;
}

/* City dots & labels */
.syria-city-dot { fill: #6ee7b7; }

.syria-city-label {
    font-family: 'DotGothic16', monospace;
    font-size: 9px;
    fill: #5f9d81;
}

/* Idlib — نقطة الانطلاق */
.idlib-ring {
    fill: none;
    stroke: #34d399;
    stroke-width: 1.2;
    animation: idlib-ring-expand 2.4s ease-out infinite;
    transform-origin: 90.7px 134.6px;
}

@keyframes idlib-ring-expand {
    0%   { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0;   transform: scale(3.5); }
}

.idlib-dot-inner { fill: #ffffff; }

.idlib-label-svg {
    font-family: 'DotGothic16', monospace;
    font-size: 11px;
    fill: #ffffff;
    font-weight: bold;
}

/* Spread lines inside Syria */
.syria-spread-line {
    stroke: #10b981;
    stroke-width: 0.9;
    stroke-dasharray: 4 4;
    stroke-linecap: round;
    opacity: 0;
    animation: line-appear 0.6s ease forwards, dash-flow 3s linear infinite;
}

@keyframes line-appear {
    from { opacity: 0; }
    to   { opacity: 0.45; }
}

/* Legend */
.syria-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-family: 'DotGothic16', monospace;
    font-size: 9px;
    color: #5f9d81;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(18,51,36,0.8);
}

.syria-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.syria-swatch {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Text below map */
.syria-map-text { flex: 1; }


/* ============================================================
   MOBILE FIXES — Super Professional
   ============================================================ */

/* Hide system log on mobile completely */
@media (max-width: 768px) {
    #system-log {
        display: none !important;
    }
}

/* Fix saga timeline on mobile */
@media (max-width: 767px) {
    /* Remove left/right translate on mobile */
    .saga-entry--left  { transform: translateY(40px); }
    .saga-entry--right { transform: translateY(40px); }

    .saga-entry {
        padding-right: 0;
        padding-left: 0;
    }

    /* Saga card mobile padding */
    .saga-card {
        padding: 28px 18px 24px;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        box-sizing: border-box;
    }

    /* No horizontal overflow from grid on mobile */
    .saga-card-body.grid {
        grid-template-columns: 1fr !important;
    }

    .saga-card-title {
        font-size: clamp(1.4rem, 7vw, 2rem);
    }

    .saga-bg-word {
        font-size: clamp(4rem, 30vw, 8rem);
    }

    /* Saga main title mobile */
    .saga-main-title {
        font-size: clamp(2rem, 12vw, 3.5rem);
    }

    /* Octopus frame on mobile */
    .saga-octopus-frame {
        padding: 20px 10px;
    }
    .oring-1 { width: 70px; height: 70px; }
    .oring-2 { width: 110px; height: 110px; }
    .oring-3 { width: 150px; height: 150px; }
    .saga-octopus-img { width: 70px; height: 70px; }

    /* DNA cards */
    .saga-dna-card {
        padding: 20px 16px;
    }

    /* Tech arsenal cards */
    .tech-cards-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    /* Stats section */
    .counter-value { font-size: 2.5rem; }

    /* Hero section */
    header.min-h-screen {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Section padding */
    #about {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }

    /* Projects grid */
    #projects {
        padding: 48px 12px !important;
    }

    #projects-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Project card on mobile */
    .pixel-card-container {
        width: 100%;
    }

    /* Category filter scroll */
    .flex.flex-wrap.justify-center.gap-2 {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .flex.flex-wrap.justify-center.gap-2::-webkit-scrollbar {
        display: none;
    }

    /* back to top btn — move above system-log area */
    #back-to-top {
        bottom: 20px !important;
        right: 16px !important;
    }

    /* Fix project details page */
    #p-title { font-size: 1.8rem; }
    #p-desc { font-size: 1rem; padding: 12px; border-right: 3px solid #2563eb; }
}

/* ============================================================
   PROJECT STORY GROUPS — 3 projects per group with a story
   ============================================================ */

.project-story-group {
    position: relative;
    margin-bottom: 80px;
}

@media (min-width: 768px) {
    .project-story-group {
        margin-bottom: 120px;
    }
}

/* The story banner that appears above each group of 3 */
.story-banner {
    position: relative;
    width: 100%;
    margin-bottom: 32px;
    padding: 0 4px;
    overflow: hidden;
}

.story-banner-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 24px;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.12);
    position: relative;
    overflow: hidden;
}

/* Accent left bar */
.story-banner-inner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--sb-color, #2563eb), transparent);
}

/* Sweep glow line */
.story-banner-inner::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, var(--sb-color, #2563eb), transparent);
    animation: story-sweep 4s linear infinite;
}

@keyframes story-sweep {
    0%   { left: -100%; }
    100% { left: 200%; }
}

.story-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px var(--sb-color, #38bdf8));
}

.story-banner-content {
    flex: 1;
    min-width: 0;
}

.story-banner-chapter {
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 4px;
    color: var(--sb-color, #38bdf8);
    opacity: 0.8;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.story-banner-title {
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    color: white;
    line-height: 1.3;
    margin-bottom: 6px;
}

.story-banner-text {
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.7;
}

@media (max-width: 767px) {
    .story-banner-inner {
        padding: 16px 16px;
        gap: 14px;
    }
    .story-banner-icon {
        font-size: 1.5rem;
    }
    .story-banner-title {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
    }
    .story-banner-text {
        font-size: 0.78rem;
        line-height: 1.6;
    }
}

/* Group title number badge */
.story-group-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--sb-color, #2563eb);
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.5);
}

/* Projects grid inside story group */
.story-projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .story-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .story-projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Subtle connector between story banner and cards */
.story-connector {
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, var(--sb-color, #2563eb), transparent);
    margin-right: 33px;
    margin-bottom: 4px;
    opacity: 0.5;
}

@media (max-width: 767px) {
    .story-connector {
        margin-right: 20px;
    }
}

/* Saga location tag */
.saga-location-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-family: 'DotGothic16', sans-serif;
    font-size: 0.6rem;
    color: #6ee7b7;
    border: 1px solid rgba(16,185,129,0.25);
    background: rgba(16,185,129,0.05);
    letter-spacing: 1px;
}


/* ============================================================
   MADE IN SYRIA — Footer Badge
   ============================================================ */
.made-in-syria-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
}

.made-in-syria-badge {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(37,99,235,0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.made-in-syria-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,0.08), transparent, rgba(56,189,248,0.05));
    opacity: 0;
    transition: opacity 0.4s;
}

.made-in-syria-badge:hover::before {
    opacity: 1;
}

.made-in-syria-badge:hover {
    border-color: rgba(56,189,248,0.5);
    box-shadow: 0 0 30px rgba(37,99,235,0.2), inset 0 0 20px rgba(37,99,235,0.05);
}

.syria-svg-logo {
    width: 72px;
    height: 56px;
    flex-shrink: 0;
    filter: invert(1) sepia(1) saturate(2) hue-rotate(190deg) brightness(1.2) drop-shadow(0 0 10px rgba(37,99,235,0.7));
    transition: filter 0.4s ease;
}

@media (min-width: 768px) {
    .syria-svg-logo {
        width: 88px;
        height: 68px;
    }
}

.made-in-syria-badge:hover .syria-svg-logo {
    filter: invert(1) sepia(1) saturate(2.5) hue-rotate(185deg) brightness(1.6) drop-shadow(0 0 18px rgba(56,189,248,0.9));
}

.made-in-syria-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
}

.made-in-syria-ar {
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: bold;
    color: white;
    text-shadow: 0 0 20px rgba(37,99,235,0.8);
    letter-spacing: 1px;
}

.made-in-syria-en {
    font-family: 'DotGothic16', sans-serif;
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    color: #60a5fa;
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Nav active link highlight */
.nav-link.active-link {
    color: white;
}
.nav-link.active-link::after {
    width: 100%;
}
