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

:root {
    --bg-dark: #070a13; /* Deep Midnight */
    --card-bg: rgba(12, 18, 32, 0.65); /* Frosted midnight glass */
    --primary: #38bdf8; /* Calm Sky Blue */
    --secondary: #818cf8; /* Soft Indigo */
    --accent-teal: #2dd4bf; /* Gentle Teal */
    --text-bright: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(129, 140, 248, 0.18);
    --border-glow: rgba(56, 189, 248, 0.25);
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    font-family: 'Outfit', sans-serif;
    color: var(--text-bright);
    overflow: hidden;
    perspective: 1200px;
    cursor: default;
}

/* Calm Animated Aurora Background */
.aurora-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    filter: blur(85px);
    opacity: 0.85;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
    will-change: transform;
}

/* Deep Indigo Nebula Blob */
.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.38) 0%, rgba(67, 56, 202, 0.18) 50%, transparent 70%);
    top: -15%;
    left: 10%;
    animation: auroraFloat1 28s ease-in-out infinite alternate;
}

/* Calm Teal / Cyan Aurora Blob */
.blob-2 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.32) 0%, rgba(45, 212, 191, 0.15) 50%, transparent 70%);
    top: 35%;
    right: -10%;
    animation: auroraFloat2 34s ease-in-out infinite alternate;
}

/* Soft Midnight Violet Blob */
.blob-3 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.14) 50%, transparent 70%);
    bottom: -15%;
    left: 20%;
    animation: auroraFloat3 30s ease-in-out infinite alternate;
}

/* Deep Cyan / Ocean Wave Blob */
.blob-4 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.25) 0%, rgba(14, 165, 233, 0.12) 50%, transparent 70%);
    top: 20%;
    left: 40%;
    animation: auroraFloat4 38s ease-in-out infinite alternate;
}

@keyframes auroraFloat1 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(120px, 80px, 0) scale(1.15); }
    100% { transform: translate3d(-60px, 140px, 0) scale(0.95); }
}

@keyframes auroraFloat2 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-140px, -90px, 0) scale(1.1); }
    100% { transform: translate3d(-80px, 100px, 0) scale(0.9); }
}

@keyframes auroraFloat3 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(100px, -110px, 0) scale(1.12); }
    100% { transform: translate3d(180px, -40px, 0) scale(0.92); }
}

@keyframes auroraFloat4 {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(-100px, 90px, 0) scale(1.18); }
    100% { transform: translate3d(80px, -80px, 0) scale(0.9); }
}

/* Subtle Particles Canvas */
#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Calming Ambient Light following mouse */
#ambient-light {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(56, 189, 248, 0.05) 40%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.5s ease;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    opacity: 1;
    pointer-events: all;
    transform: translateZ(0) scale(1);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.container.active {
    opacity: 1;
    pointer-events: all;
    transform: translateZ(0) scale(1);
}

/* Premium Frosted Glass Card */
.glass-card {
    width: 650px;
    padding: 70px 60px;
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border);
    border-top: 1px solid var(--border-glow);
    border-radius: 20px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7), 0 0 35px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    text-align: center;
}

/* Soft cinematic glare */
.glare {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    z-index: 1;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glass-card:hover .glare {
    opacity: 1;
}

.card-content {
    transform: translateZ(60px);
    position: relative;
    z-index: 2;
}

/* Animation Delays for cascading reveal */
.welcome-text, .logo-container, .typewriter-container, .progress-bar, .footer-text {
    opacity: 0;
    transform: translateY(15px);
}

.welcome-text.show { animation: premiumFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s; }
.logo-container.show { animation: premiumFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 1s; }
.typewriter-container.show { animation: premiumFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 2.2s; }
.progress-bar.show { animation: premiumFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 2.8s; }
.footer-text.show { animation: premiumFadeUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 3.2s; }

@keyframes premiumFadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.welcome-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    letter-spacing: 8px;
    font-weight: 400;
    text-transform: uppercase;
}

.line {
    width: 30px;
    height: 1px;
    background: var(--primary);
    opacity: 0.5;
}

/* Refined Premium Glitch */
.glitch {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    color: var(--text-bright);
    margin-bottom: 0px;
    letter-spacing: 8px;
    display: inline-block;
}

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

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--secondary);
    clip: rect(44px, 450px, 56px, 0);
    animation: subtle-glitch 4s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--primary);
    clip: rect(44px, 450px, 56px, 0);
    animation: subtle-glitch 5s infinite linear alternate-reverse;
}

@keyframes subtle-glitch {
    0%, 100% { clip: rect(10px, 9999px, 86px, 0); }
    10% { clip: rect(40px, 9999px, 20px, 0); }
    20% { clip: rect(90px, 9999px, 60px, 0); }
    30% { clip: rect(20px, 9999px, 10px, 0); }
    40% { clip: rect(60px, 9999px, 80px, 0); }
    50% { clip: rect(30px, 9999px, 50px, 0); }
    60% { clip: rect(80px, 9999px, 90px, 0); }
    70% { clip: rect(10px, 9999px, 30px, 0); }
    80% { clip: rect(50px, 9999px, 15px, 0); }
    90% { clip: rect(38px, 9999px, 23px, 0); }
}

.sub-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 500;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-muted);
    letter-spacing: 20px;
    margin-bottom: 35px;
    margin-top: 10px;
    position: relative;
    margin-left: 20px; /* Offset for tracking */
}

.sub-logo::after {
    content: "X";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--primary);
    -webkit-text-stroke: 0px;
    width: 0%;
    overflow: hidden;
    white-space: nowrap;
}

.logo-container.show .sub-logo::after {
    animation: elegantFill 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 1.2s;
}

@keyframes elegantFill {
    to { width: 100%; }
}

.typewriter-container {
    min-height: 50px;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.subtitle {
    font-size: 1.8rem;
    color: var(--text-bright);
    letter-spacing: 0.5px;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 2rem;
    background: var(--primary);
    vertical-align: middle;
    margin-right: 8px;
    animation: blink-cursor 1s infinite;
}

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

.progress-bar {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 40px 0 20px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.progress-bar.show .progress-fill {
    animation: loadProgress 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.5s;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    letter-spacing: 6px;
    font-weight: 300;
}

@media (max-width: 768px) {
    .glass-card { width: 90%; padding: 40px 20px; }
    .glitch { font-size: 2.2rem; letter-spacing: 4px; }
    .sub-logo { font-size: 1.2rem; letter-spacing: 12px; margin-left: 12px; }
    .subtitle { font-size: 1.3rem; }
}
