:root {
    --bg: #09090b; --surface: #111113; --surface2: #18181b; --border: #27272a;
    --accent: #a78bfa; --text: #fafafa; --muted: #71717a;
    --radius: 20px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.noise { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.05; 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"); }

/* ===== HEADER ===== */
header { position: sticky; top: 0; z-index: 100; background: rgba(9,9,11,0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; padding: 15px 24px; }
.logo { font-family: 'Syne'; font-weight: 800; font-size: 1.5rem; }
.logo span { color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 20px; }
.nav-links-desktop { display: flex; align-items: center; gap: 20px; }
.nav-link { text-decoration: none; color: var(--text); font-size: 0.9rem; font-weight: 500; }
.nav-link:hover { color: var(--accent); }

.lang-switch { display: flex; gap: 4px; background: var(--surface); padding: 3px; border-radius: 8px; border: 1px solid var(--border); }
.lang-btn { background: none; border: none; color: var(--muted); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 0.75rem; font-weight: 800; }
.lang-btn.active { background: var(--accent); color: var(--bg); }

.badge-arg { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 700; background: var(--surface2); border: 1px solid var(--border); padding: 6px 14px; border-radius: 100px; color: var(--muted); }
.badge-arg .flag { font-size: 0.9rem; }
.badge-arg .loc-text { text-transform: uppercase; letter-spacing: 0.05em; }

.nav-mobile-row { display: none; }

/* ===== HERO ===== */
.hero { padding: 100px 0 80px; text-align: center; }
.hero-tag { display: inline-block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); margin-bottom: 20px; font-weight: 700; background: rgba(167,139,250,0.1); padding: 6px 12px; border-radius: 100px; }
.hero h1 {
    font-family: 'Syne';
    font-size: clamp(2.2rem, 8vw, 5rem);
    line-height: 1.0;
    margin-bottom: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    word-break: break-word;
    overflow-wrap: break-word;
}
.hero h1 span.outlined { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero-sub { color: var(--muted); font-size: 1.1rem; line-height: 1.6; max-width: 600px; margin: 0 auto; }

/* ===== APPS GRID ===== */
.apps-section { padding: 60px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 16px; }
.section-header h2 { font-family: 'Syne'; font-size: 2rem; font-weight: 800; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1); display: flex; flex-direction: column; height: 100%; }
.app-card:hover { border-color: rgba(167,139,250,0.5); transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

.card-top { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.app-icon { width: 56px; height: 56px; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: 'Syne'; font-weight: 800; font-size: 1.5rem; color: #fff; flex-shrink: 0; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-meta h3 { font-family: 'Syne'; font-size: 1.1rem; margin-bottom: 4px; font-weight: 700; }
.app-category-badge { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: 0.05em; background: rgba(255,255,255,0.05); padding: 2px 8px; border-radius: 4px; }
.app-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }

/* ===== STORE LINKS ===== */
.app-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.store-link { flex: 1 1 calc(50% - 4px); min-width: 100px; text-align: center; padding: 10px 8px; border-radius: 10px; text-decoration: none; font-size: 0.78rem; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.app-links.has-three .store-link.web { flex: 1 1 100%; }
.app-links.has-one .store-link { flex: 1 1 100%; }
.store-link.android { background: #fff; color: #000; }
.store-link.ios { background: #27272a; color: #fff; border: 1px solid var(--border); }
.store-link.web { background: rgba(167,139,250,0.15); color: var(--accent); border: 1px solid rgba(167,139,250,0.3); }
.store-link.web:hover { background: rgba(167,139,250,0.25); }

/* ===== PAGINACIÓN ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.pag-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 100px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s ease;
}
.pag-btn:hover:not(:disabled) {
    background: var(--surface2);
    border-color: rgba(167,139,250,0.4);
    color: var(--accent);
}
.pag-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pag-info {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 80px;
    text-align: center;
}

/* ===== ABOUT ===== */
.about-section { padding: 100px 0; background: #0c0c0e; border-top: 1px solid var(--border); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.section-tag { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; font-weight: 700; }
.about-content h2 { font-family: 'Syne'; font-size: 2.8rem; margin-bottom: 20px; font-weight: 800; line-height: 1.1; }
.about-content p { color: var(--muted); line-height: 1.8; margin-bottom: 15px; font-size: 0.95rem; }
.about-values { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.value-chip { background: var(--surface2); border: 1px solid var(--border); padding: 8px 16px; border-radius: 100px; font-size: 0.85rem; font-weight: 500; color: var(--text); }

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat-card { background: var(--surface); padding: 40px; border-radius: 20px; border: 1px solid var(--border); text-align: center; }
.stat-num { font-family: 'Syne'; font-size: 3rem; color: var(--accent); font-weight: 800; }
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 4px; }

/* ===== ADMIN ===== */
.admin-section { background: #18181b; padding: 40px 0; border-bottom: 1px solid var(--border); }
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input, textarea { background: var(--bg); border: 1px solid var(--border); color: #fff; padding: 12px; border-radius: 10px; width: 100%; margin-bottom: 10px; font-family: inherit; font-size: 0.9rem; }
.btn-add { background: var(--accent); color: var(--bg); border: none; padding: 14px; border-radius: 10px; font-weight: 800; cursor: pointer; width: 100%; font-size: 0.9rem; }
.admin-controls { margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; gap: 10px; font-size: 0.8rem; }
.edit-btn { background: none; border: none; color: var(--accent); cursor: pointer; }
.del-btn { background: none; border: none; color: #ef4444; cursor: pointer; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: var(--bg); padding: 30px; border-radius: 20px; width: 90%; max-width: 450px; border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; }
.btn-group-modal { display: flex; gap: 10px; margin-top: 15px; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); padding: 12px; border-radius: 10px; flex: 1; cursor: pointer; font-family: inherit; }

/* ===== FOOTER ===== */
footer { padding: 40px 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; flex-wrap: wrap; gap: 10px; }
.footer-brand { font-family: 'Syne'; font-weight: 800; }
.footer-brand span { color: var(--accent); }

/* ===== MEDIA QUERIES ===== */

@media (max-width: 768px) {
    .container { padding: 0 16px; } /* Un poco más de aire a los costados */

    /* --- NAV --- */
    .nav-right { gap: 8px; }
    .nav-links-desktop { display: none; }

    .nav-mobile-row { display: block; background: rgba(17,17,19,0.8); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px 0; }
    .nav-links-mobile { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
    .nav-link-mob { text-decoration: none; color: var(--text); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
    .nav-mob-sep { color: var(--muted); font-size: 0.75rem; }

    .badge-arg-mob { display: flex; align-items: center; gap: 4px; font-size: 0.65rem; font-weight: 700; background: rgba(167,139,250,0.1); border: 1px solid rgba(167,139,250,0.3); padding: 4px 10px; border-radius: 100px; color: var(--accent); }
    .badge-arg-mob .flag { font-size: 0.75rem; }

    /* --- HERO (SOLUCIÓN 1: Fuente fluida para evitar corte) --- */
    .hero {
            padding: 50px 0 40px;
        }
        
        .hero-tag {
            font-size: 0.7rem;
            padding: 4px 10px;
            margin-bottom: 16px;
        }
        
        /* Dentro de @media (max-width: 768px) */
        .hero h1 {
            /* 1. Reducimos el multiplicador de 8.5vw a 7.5vw para ganar margen */
            font-size: clamp(1.5rem, 7.5vw, 2.4rem);
            
            line-height: 1.1;
            margin-bottom: 18px;
            
            /* 2. Quitamos el nowrap para que "apps." pueda bajar si el
                  teléfono es muy angosto, pero evitamos que se corte "Construimos" */
            white-space: normal;
            word-break: keep-all; /* Mantiene las palabras enteras */
            overflow-wrap: normal;
            hyphens: none;

            /* 3. Forzamos un ancho máximo con margen automático para centrarlo */
            max-width: 100%;
            padding: 0 4px; /* Pequeño resguardo para que no toque los bordes */
            margin-left: auto;
            margin-right: auto;
        }

        /* Opcional: Si quieres que "apps." siempre baje en móviles muy chicos
           para que "Construimos" tenga todo el ancho para ella sola */
        @media (max-width: 400px) {
            .hero h1 {
                font-size: clamp(1.4rem, 9vw, 2.2rem);
            }
        }
        
        .hero-sub {
            font-size: 0.9rem;
            line-height: 1.5;
            padding: 0 10px;
        }

    /* --- APPS --- */
    .apps-grid { grid-template-columns: 1fr; gap: 16px; }
    .section-header h2 { font-size: 1.5rem; }
    .store-link { font-size: 0.75rem; padding: 10px 6px; }

    /* --- PAGINACIÓN --- */
    .pagination { gap: 10px; margin-top: 32px; padding-top: 24px; }
    .pag-btn { padding: 8px 12px; font-size: 0.75rem; gap: 6px; }
    .pag-info { font-size: 0.7rem; min-width: 60px; }

    /* --- ABOUT (SOLUCIÓN 2: Mejor Responsive en la parte de abajo) --- */
    .about-section { padding: 60px 0; }
    .about-grid {
        grid-template-columns: 1fr; /* Forzamos una columna desde tablets */
        gap: 32px;
    }
    
    /* Achicamos la fuente del título de la sección */
    .about-content h2 {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        line-height: 1.1;
        margin-bottom: 16px;
    }
    .about-content p { font-size: 0.9rem; line-height: 1.6; margin-bottom: 12px; }
    
    /* Chips de valores más pequeños */
    .about-values { gap: 6px; margin-top: 20px; }
    .value-chip { padding: 6px 12px; font-size: 0.75rem; }

    /* Forzamos que las estadísticas ocupen una columna si la pantalla es muy chica */
    @media (max-width: 480px) {
        .about-stats { grid-template-columns: 1fr; gap: 12px; }
    }
    
    /* Reducimos drásticamente los tamaños fijos que causaban desborde */
    .stat-card {
        padding: 20px; /* Antes era 40px o 25px, demasiado para mobile */
        border-radius: 16px;
    }
    .stat-num {
        /* Fuente fluida para el número también */
        font-size: clamp(2rem, 8vw, 2.8rem);
    }
    .stat-label { font-size: 0.7rem; margin-top: 2px; }

    /* --- ADMIN/MODAL --- */
    .input-grid { grid-template-columns: 1fr; }
    .modal-content { padding: 20px; border-radius: 16px; }
}
