:root {
    --bg-color: #0b0f19;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --astra-color: #38bdf8;
    --astra-glow: rgba(56, 189, 248, 0.45);
    
    --atlas-color: #34d399;
    --atlas-glow: rgba(52, 211, 153, 0.45);
    
    --brand-emerald: #10b981;
    --brand-emerald-glow: rgba(16, 185, 129, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: clamp(1rem, 2.5vw, 2.5rem) clamp(0.75rem, 2vw, 1.5rem);
    padding-top: max(clamp(0.75rem, 2vh, 2rem), env(safe-area-inset-top, 0px));
    padding-bottom: max(clamp(0.75rem, 2vh, 2rem), env(safe-area-inset-bottom, 0px));
    padding-left: max(clamp(0.75rem, 2vw, 1.5rem), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(0.75rem, 2vw, 1.5rem), env(safe-area-inset-right, 0px));
}

/* Background Animations and Grid */
.bg-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    z-index: 1;
    mask-image: radial-gradient(circle at center, black, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 85%);
    pointer-events: none;
}

.bg-shape {
    position: fixed;
    filter: blur(100px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: float 18s infinite alternate ease-in-out;
}

.shape-1 {
    width: min(400px, 75vw);
    height: min(400px, 75vw);
    background: var(--astra-glow);
    top: -80px;
    left: -80px;
}

.shape-2 {
    width: min(350px, 70vw);
    height: min(350px, 70vw);
    background: var(--atlas-glow);
    bottom: -80px;
    right: -80px;
    animation-delay: -9s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(25px, 25px) scale(1.1); }
}

/* Main Container */
.container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 2.5vh, 2.5rem);
}

/* Header */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.4rem, 1vh, 0.85rem);
    width: 100%;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Central Animated Radar Logo */
.radar-logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(64px, 10vh, 90px);
    height: clamp(64px, 10vh, 90px);
    margin-bottom: 0;
}

.radar-logo-badge {
    position: relative;
    z-index: 2;
    width: clamp(52px, 8.5vh, 74px);
    height: clamp(52px, 8.5vh, 74px);
    border-radius: clamp(16px, 2.5vh, 22px);
    background: radial-gradient(130% 130% at 50% 10%, rgba(16, 185, 129, 0.22) 0%, rgba(15, 23, 42, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 
        0 8px 24px -4px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(16, 185, 129, 0.22),
        inset 0 1px 1px rgba(255, 255, 255, 0.25),
        inset 0 0 15px rgba(16, 185, 129, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.radar-icon {
    width: clamp(28px, 4.5vh, 40px);
    height: clamp(28px, 4.5vh, 40px);
    color: #34d399;
    animation: spinRadar 10s linear infinite;
    filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.55));
    transform-origin: center center;
}

@keyframes spinRadar {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Concentric Radar Pulse Rings */
.radar-ping-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(16, 185, 129, 0.35);
    pointer-events: none;
    z-index: 1;
    animation: radarPulse 3.5s cubic-bezier(0.15, 0.85, 0.35, 1) infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 1.75s; }

@keyframes radarPulse {
    0% {
        width: 48px;
        height: 48px;
        opacity: 0.85;
        transform: scale(0.85);
        border-color: rgba(52, 211, 153, 0.5);
    }
    60% {
        border-color: rgba(16, 185, 129, 0.25);
    }
    100% {
        width: 140px;
        height: 140px;
        opacity: 0;
        transform: scale(1.4);
        border-color: rgba(16, 185, 129, 0);
    }
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: clamp(0.65rem, 1.5vw, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cbd5e1;
    backdrop-filter: blur(8px);
}

.header h1 {
    font-size: clamp(1.6rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 35%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    font-size: clamp(0.8rem, 2vw, 1rem);
    color: var(--text-muted);
    max-width: 520px;
    line-height: 1.45;
    padding: 0 0.5rem;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.75rem);
    width: 100%;
}

/* System Cards */
.system-card {
    position: relative;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: clamp(16px, 2.5vw, 20px);
    padding: clamp(1rem, 2.5vw, 2rem) clamp(1rem, 2vw, 1.75rem);
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(18px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.astra-card { animation-delay: 0.12s; }
.atlas-card { animation-delay: 0.22s; }

.card-glow {
    position: absolute;
    width: 140px;
    height: 140px;
    background: var(--astra-color);
    filter: blur(60px);
    border-radius: 50%;
    top: -40px;
    right: -40px;
    opacity: 0.12;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.atlas-card .card-glow { background: var(--atlas-color); }

.card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(0.5rem, 1.2vh, 1rem);
}

.icon-wrapper {
    width: clamp(38px, 6vw, 48px);
    height: clamp(38px, 6vw, 48px);
    border-radius: clamp(10px, 1.8vw, 14px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-wrapper svg {
    width: clamp(20px, 3.2vw, 26px);
    height: clamp(20px, 3.2vw, 26px);
}

.astra-card .icon-wrapper {
    background: rgba(56, 189, 248, 0.14);
    color: var(--astra-color);
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

.atlas-card .icon-wrapper {
    background: rgba(52, 211, 153, 0.14);
    color: var(--atlas-color);
    border: 1px solid rgba(52, 211, 153, 0.3);
    box-shadow: 0 0 16px rgba(52, 211, 153, 0.2);
}

.system-tag {
    font-size: clamp(0.625rem, 1.2vw, 0.7rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
}

.astra-tag {
    background: rgba(56, 189, 248, 0.1);
    color: var(--astra-color);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.atlas-tag {
    background: rgba(52, 211, 153, 0.1);
    color: var(--atlas-color);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.system-card h2 {
    font-size: clamp(1.3rem, 2.8vw, 1.75rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.system-card p {
    color: var(--text-muted);
    font-size: clamp(0.775rem, 1.8vw, 0.885rem);
    line-height: 1.45;
    flex-grow: 1;
    margin-bottom: clamp(0.65rem, 1.5vh, 1.25rem);
}

.btn-ingresar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(0.5rem, 1.2vh, 0.65rem) clamp(0.75rem, 1.5vw, 1rem);
    border-radius: 11px;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.5vw, 0.825rem);
    letter-spacing: 0.01em;
    transition: all 0.25s ease;
}

.astra-card .btn-ingresar {
    background: rgba(56, 189, 248, 0.12);
    color: var(--astra-color);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.atlas-card .btn-ingresar {
    background: rgba(52, 211, 153, 0.12);
    color: var(--atlas-color);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.arrow {
    transition: transform 0.25s ease;
    font-size: 1rem;
    line-height: 1;
}

/* Hover & Active States */
@media (hover: hover) {
    .system-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    .astra-card:hover {
        border-color: rgba(56, 189, 248, 0.45);
        box-shadow: 0 12px 32px -6px rgba(56, 189, 248, 0.25), 0 20px 40px rgba(0,0,0,0.5);
    }
    .atlas-card:hover {
        border-color: rgba(52, 211, 153, 0.45);
        box-shadow: 0 12px 32px -6px rgba(52, 211, 153, 0.25), 0 20px 40px rgba(0,0,0,0.5);
    }
    .system-card:hover .card-glow { opacity: 0.22; }
    .system-card:hover .icon-wrapper { transform: scale(1.05) rotate(-2deg); }
    .system-card:hover .arrow { transform: translateX(3px); }
    .astra-card:hover .btn-ingresar {
        background: rgba(56, 189, 248, 0.22);
        border-color: rgba(56, 189, 248, 0.45);
    }
    .atlas-card:hover .btn-ingresar {
        background: rgba(52, 211, 153, 0.22);
        border-color: rgba(52, 211, 153, 0.45);
    }
}

/* Mobile Active Touch feedback */
.system-card:active {
    transform: scale(0.985);
    transition-duration: 0.1s;
}

.astra-card:active {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(56, 189, 248, 0.4);
}

.atlas-card:active {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(52, 211, 153, 0.4);
}

/* Footer */
.footer {
    text-align: center;
    color: #64748b;
    font-size: clamp(0.68rem, 1.4vw, 0.75rem);
    font-weight: 500;
    line-height: 1.4;
}

.footer-sub {
    font-size: clamp(0.625rem, 1.2vw, 0.7rem);
    color: #475569;
    margin-top: 0.1rem;
}

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

/* Mobile Layout (< 640px) - Ultra Compact to fit in 100dvh without scrolling */
@media (max-width: 640px) {
    body {
        padding: 0.75rem 0.85rem;
    }

    .container {
        gap: 0.65rem;
    }

    .header {
        gap: 0.35rem;
    }

    .radar-logo-wrapper {
        width: 50px;
        height: 50px;
    }

    .radar-logo-badge {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .radar-icon {
        width: 24px;
        height: 24px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header p {
        font-size: 0.775rem;
        line-height: 1.35;
        max-width: 310px;
    }

    .cards-container {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }
    
    .system-card {
        padding: 0.75rem 1rem;
        border-radius: 16px;
    }

    .card-top {
        margin-bottom: 0.25rem;
    }

    .icon-wrapper {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .icon-wrapper svg {
        width: 17px;
        height: 17px;
    }

    .system-tag {
        font-size: 0.6rem;
        padding: 0.15rem 0.5rem;
    }

    .system-card h2 {
        font-size: 1.2rem;
        margin-bottom: 0.15rem;
    }

    .system-card p {
        font-size: 0.75rem;
        line-height: 1.35;
        margin-bottom: 0.45rem;
    }

    .btn-ingresar {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
        border-radius: 9px;
    }

    .footer {
        font-size: 0.65rem;
        margin-top: 0;
    }

    .footer-sub {
        font-size: 0.6rem;
    }
}

/* Very short height screens (< 680px height) */
@media (max-height: 680px) and (max-width: 640px) {
    .radar-logo-wrapper {
        display: none;
    }
    .badge {
        padding: 0.15rem 0.5rem;
    }
    .container {
        gap: 0.4rem;
    }
    .cards-container {
        gap: 0.45rem;
    }
    .system-card {
        padding: 0.65rem 0.85rem;
    }
    .system-card p {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 0.35rem;
    }
}
