/* ========================================
   SCREYPTD HUB — STYLES
   ======================================== */

/* BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { font-family: 'Inter', sans-serif; }
::selection { background: rgba(99, 102, 241, 0.3); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #6366f1; border-radius: 3px; }

/* ========================================
   ANIMATIONS — KEYFRAMES
   ======================================== */

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

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

@keyframes gradientX {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes scrollDot {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(8px); }
}

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.15); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.3); }
}

@keyframes borderRotate {
    0% { --angle: 0deg; }
    100% { --angle: 360deg; }
}

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

@keyframes slideReveal {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.6s ease-out forwards;
}

.animate-gradient-x {
    animation: gradientX 4s ease infinite;
}

.animate-scroll-dot {
    animation: scrollDot 1.5s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Reveal on scroll */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ========================================
   NAVBAR
   ======================================== */

#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(3, 3, 12, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: color 0.3s;
    border-radius: 0.75rem;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: #818cf8;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #6366f1;
    border-radius: 1px;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.05);
}

/* ========================================
   STAT CARDS
   ======================================== */

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(99, 102, 241, 0.2);
}

.stat-number {
    font-family: 'Orbitron', monospace;
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
}

/* ========================================
   SCRIPT CARDS
   ======================================== */

.script-card {
    opacity: 1;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
}

.script-card.hidden-card {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    position: absolute;
}

.script-card-inner {
    position: relative;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.script-card-inner:hover {
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-6px);
    box-shadow: 0 25px 50px -20px rgba(99, 102, 241, 0.15);
}

.script-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.06), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.script-card-inner:hover .script-card-glow {
    opacity: 1;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 9999px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.02em;
}

.copy-btn {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.copy-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.copy-btn:hover::after {
    width: 200%;
    height: 200%;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px -8px rgba(99, 102, 241, 0.5);
}

.copy-btn:active {
    transform: scale(0.97);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #22c55e, #10b981);
}

/* ========================================
   FILTER BUTTONS
   ======================================== */

.filter-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
}

.filter-btn:hover {
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ========================================
   FEATURE CARDS
   ======================================== */

.feature-card {
    padding: 2rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.03);
}

.feature-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

/* ========================================
   STATUS
   ======================================== */

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.status-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.status-name {
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.03em;
}

.status-badge.operational {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.status-badge.updating {
    color: #facc15;
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.2);
}

.status-badge.down {
    color: #f87171;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ========================================
   FAQ
   ======================================== */

.faq-item {
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.faq-item.open {
    border-color: rgba(99, 102, 241, 0.3);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e5e7eb;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    text-align: left;
    transition: color 0.3s;
}

.faq-question:hover {
    color: #fff;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
    color: #818cf8;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s;
}

.faq-item.open .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.5rem 1.25rem;
    font-size: 0.9rem;
    color: #9ca3af;
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 640px) {
    .stat-number {
        font-size: 1.25rem;
    }
    .script-card-inner:hover {
        transform: translateY(-3px);
    }
}


/* ========================================
   CHECKPOINT GATEWAY STYLES
   ======================================== */

/* Spinner for verifying state */
.cp-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.1);
    border-top-color: #818cf8;
    border-radius: 50%;
    animation: cp-spin 0.8s linear infinite;
}

@keyframes cp-spin {
    to { transform: rotate(360deg); }
}

/* Checkpoint overlay scroll on small screens */
#checkpoint-overlay {
    -webkit-overflow-scrolling: touch;
}
