:root {
    --bg-deep: #0B0E14;
    --sky-blue: #38BDF8;
    --neon-pink: #F472B6;
    --deep-purple: #7C3AED;
    --text-glow: 0 0 10px rgba(56, 189, 248, 0.6);
    --glass-bg: rgba(20, 24, 33, 0.6);
    --glass-border: rgba(255, 255, 255, 0.12);
    --accent-glow: 0 0 30px rgba(56, 189, 248, 0.2);
}

@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 400;
    src: url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');
}

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

body {
    background-color: var(--bg-deep);
    color: #ffffff;
    font-family: 'Cairo', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    direction: rtl;
}

/* Background Layers */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.topo-overlay {
    position: absolute;
    inset: -10%;
    background-image: url('img/topo_bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.18; /* Increased for visibility */
    mix-blend-mode: overlay;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.3)); /* Neon glow effect */
    animation: parallaxTopo 70s ease-in-out infinite;
}

@keyframes parallaxTopo {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-2%, -2%) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

.noise-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: overlay;
    z-index: 1;
}

.streaming-data {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.data-point, .cipher-stat, .data-bit {
    position: absolute;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
}

.data-point {
    font-size: 0.75rem;
    color: var(--sky-blue);
    animation: dataFloat 6s linear forwards;
}

.cipher-stat {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.15);
    animation: dataFloatRotate 8s linear forwards;
}

.data-bit {
    width: 2px;
    height: 2px;
    background: var(--sky-blue);
    box-shadow: 0 0 5px var(--sky-blue);
    animation: dataFloat 4s linear forwards;
}

@keyframes dataFloat {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    20% { opacity: 0.25; }
    80% { opacity: 0.25; }
    100% { transform: translateY(-150px) translateX(20px); opacity: 0; }
}

@keyframes dataFloatRotate {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 0.15; }
    80% { opacity: 0.15; }
    100% { transform: translateY(-200px) rotate(15deg); opacity: 0; }
}

.neon-glow {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.2;
    pointer-events: none;
}

.neon-glow-1 {
    top: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--sky-blue) 0%, transparent 70%);
    animation: neonPulse 8s infinite alternate;
}

.neon-glow-2 {
    bottom: -15%;
    left: -10%;
    background: radial-gradient(circle, var(--neon-pink) 0%, transparent 70%);
    animation: neonPulse 10s infinite alternate-reverse;
}

@keyframes neonPulse {
    0% { opacity: 0.15; transform: scale(1); }
    100% { opacity: 0.3; transform: scale(1.2); }
}

canvas#particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

/* Main Content */
main {
    flex: 1 0 auto;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 6rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center if space is available */
}

.content-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 1.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo-container {
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-backlight {
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, var(--sky-blue) 0%, var(--neon-pink) 30%, transparent 70%);
    opacity: 0.3;
    filter: blur(50px);
    z-index: -1;
    animation: breathing 5s ease-in-out infinite;
}

@keyframes breathing {
    0%, 100% { transform: scale(1); opacity: 0.25; filter: blur(50px); }
    50% { transform: scale(1.4); opacity: 0.5; filter: blur(65px); }
}

.logo {
    width: clamp(100px, 15vw, 140px);
    height: clamp(100px, 15vw, 140px);
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.4));
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 35px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--sky-blue);
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
}

h1::before,
h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

h1::before {
    color: var(--neon-pink);
    z-index: -1;
}

h1::after {
    color: var(--sky-blue);
    z-index: -2;
}

h1:hover::before,
h1:hover::after,
h1 {
    animation: titleGlitch 4s infinite linear alternate-reverse;
}

h1::before {
    animation: titleGlitchBefore 3s infinite linear alternate-reverse;
}

h1::after {
    animation: titleGlitchAfter 2.5s infinite linear alternate-reverse;
}

@keyframes titleGlitchBefore {
    0%, 90%, 100% { opacity: 0; transform: translate(0); }
    92% { opacity: 0.8; transform: translate(-3px, 1px); }
    94% { opacity: 0.8; transform: translate(3px, -1px); }
    96% { opacity: 0; transform: translate(0); }
}

@keyframes titleGlitchAfter {
    0%, 92%, 100% { opacity: 0; transform: translate(0); }
    94% { opacity: 0.8; transform: translate(3px, -1px); }
    96% { opacity: 0.8; transform: translate(-3px, 1px); }
    98% { opacity: 0; transform: translate(0); }
}

@keyframes titleGlitch {
    0%, 95%, 100% { transform: skew(0); }
    96% { transform: skew(-1deg); }
    97% { transform: skew(1deg); }
    98% { transform: skew(0); }
}

.countdown-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 700px;
}

.count-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(56, 189, 248, 0.1);
    padding: 2rem 1rem;
    border-radius: 24px;
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.5),
        inset 0 0 1px 1px rgba(255, 255, 255, 0.05);
    animation: borderBreathing 4s ease-in-out infinite;
}

.count-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

@keyframes borderBreathing {
    0%, 100% { 
        border-color: rgba(56, 189, 248, 0.1);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    }
    50% { 
        border-color: rgba(56, 189, 248, 0.4);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.1);
    }
}

.count-item:hover {
    border-color: var(--sky-blue);
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.04);
}

.count-number {
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
}

.count-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 1px;
}

/* Glitch Animation for Numbers */
.glitch-tick {
    animation: numberGlitch 0.2s ease;
}

@keyframes numberGlitch {
    0% { transform: translate(0); color: #fff; }
    20% { transform: translate(-1px, 1px); color: var(--sky-blue); opacity: 0.9; }
    40% { transform: translate(1px, -1px); color: var(--neon-pink); opacity: 0.9; }
    60% { transform: translate(-1px, -1px); color: var(--sky-blue); opacity: 0.9; }
    80% { transform: translate(1px, 1px); color: var(--neon-pink); opacity: 0.9; }
    100% { transform: translate(0); color: #fff; opacity: 1; }
}

p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem; /* Reduced to sit closer to detail */
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.desc-detail {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
    max-width: 600px;
    margin: 0 auto 4rem auto;
    line-height: 1.8;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

.stats-icon {
    width: 24px;
    height: 24px;
    color: var(--sky-blue);
    filter: drop-shadow(0 0 5px var(--sky-blue));
    animation: iconPulse 3s infinite ease-in-out;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Subscription Form */
/* Subscription Form Modernization */
.subscription-container {
    display: flex;
    gap: 2rem;
    background: transparent;
    backdrop-filter: none;
    border: none;
    padding: 1rem 0;
    border-radius: 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    box-shadow: none;
    align-items: flex-end;
}

input {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(56, 189, 248, 0.3);
    outline: none;
    color: #ffffff;
    padding: 0.8rem 0.5rem;
    flex-grow: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

input:focus {
    border-bottom-color: var(--sky-blue);
    box-shadow: 0 4px 15px -5px rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.03);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    font-size: 0.8rem;
}

button {
    background: var(--sky-blue);
    color: var(--bg-deep);
    border: none;
    padding: 1rem 2.5rem;
    font-weight: 800;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
    clip-path: polygon(
        0% 0%, 90% 0%, 100% 30%, 100% 100%, 10% 100%, 0% 70%
    );
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

button::before,
button::after {
    content: 'كن أول من يعرف';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sky-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: -1;
    clip-path: polygon(
        0% 0%, 90% 0%, 100% 30%, 100% 100%, 10% 100%, 0% 70%
    );
}

button:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(56, 189, 248, 0.5);
}

button:hover::before {
    opacity: 1;
    z-index: 1;
    background: var(--neon-pink);
    transform: translate(-4px, 2px);
    mix-blend-mode: screen;
    animation: buttonGlitchShift 0.3s infinite;
}

button:hover::after {
    opacity: 1;
    z-index: 1;
    background: var(--sky-blue);
    transform: translate(4px, -2px);
    mix-blend-mode: screen;
    animation: buttonGlitchShift 0.3s reverse infinite;
}

@keyframes buttonGlitchShift {
    0% { transform: translate(-2px, 1px); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-1px, 2px); }
    75% { transform: translate(1px, -2px); }
    100% { transform: translate(-2px, 1px); }
}

/* Footer */
footer {
    flex-shrink: 0;
    width: 100%;
    padding: 3rem 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
    z-index: 10;
    background: rgba(11, 14, 20, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
}

.codeify, .codeify-link {
    color: var(--sky-blue);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.codeify-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px var(--sky-blue);
    opacity: 1;
}


/* Responsive Scaling */
@media (max-width: 600px) {
    .subscription-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    input {
        width: 100%;
        text-align: center;
    }
    
    button {
        width: 100%;
        height: 55px;
    }
}
