/* ─── LOADER ─── */
/* CSS de combate: si lo tocas sin probar, luego no preguntes por que exploto. */
#loader-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0c;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

#ldr-canvas {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(1);
}

#ldr-ui {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(340px, 60vw);
    z-index: 10000;
    transition: opacity 0.6s ease;
}

#ldr-bar-wrap {
    width: 100%;
    height: 2px;
    background: rgba(16,185,129,0.15);
    border-radius: 2px;
    overflow: hidden;
}

#ldr-fill {
    height: 100%;
    width: 0%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    transition: width 0.1s linear;
}

#ldr-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 3px;
    color: #10b981;
    opacity: 0.55;
    text-transform: uppercase;
}

.loader-settings {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    margin-bottom: 18px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.loader-label {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.loader-select {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
}

.loader-select option {
    background: var(--card);
    color: var(--text);
}

.settings-menu {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10001;
    display: grid;
    gap: 8px;
    align-items: start;
}

.settings-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.settings-btn:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
}

.settings-panel {
    display: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card);
    padding: 10px 12px;
    min-width: 200px;
}

.settings-menu.open .settings-panel {
    display: grid;
    gap: 8px;
}

body.loader-bar #ldr-label {
    display: none;
}

body.loader-bar #ldr-ui {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(320px, 55vw);
}

body.loader-bar #ldr-bar-wrap {
    height: 3px;
    background: rgba(255,255,255,0.12);
}

body.loader-bar #ldr-fill {
    background: #e8e9ea;
    box-shadow: none;
    transition: width 0.15s linear;
}

:root {
    --bg: #0a0a0c;
    --card: #111114;
    --card-border: #1e1e22;
    --accent: #10b981;
    --accent-dim: rgba(16, 185, 129, 0.08);
    --text: #e8e9ea;
    --text-dim: #6b7280;
    --border: #1e1e22;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.mono { font-family: 'DM Mono', monospace; }

.container {
    width: 95%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── HEADER ─── */
header {
    padding: 80px 0 60px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    margin-bottom: 60px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: 24px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.status-pill-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.status-pill-row .status-pill {
    margin-bottom: 0;
}

.status-pill.status-green {
    border-color: rgba(16, 185, 129, 0.45);
    color: #9be5c4;
}

.status-pill.status-orange {
    border-color: rgba(245, 158, 11, 0.45);
    color: #f7d08a;
    background: rgba(245, 158, 11, 0.08);
}

.status-pill.status-red {
    border-color: rgba(239, 68, 68, 0.45);
    color: #f0a2a2;
    background: rgba(239, 68, 68, 0.08);
}

.status-pill.status-orange .dot {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-pill.status-red .dot {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

h1 {
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -3px;
    margin-bottom: 12px;
    line-height: 1;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 400;
}

/* ─── SECTIONS ─── */
section {
    margin-bottom: 60px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.mobile-tap-hint {
    display: none;
    margin: -8px 0 14px;
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* ─── SOBRE MÍ ─── */
.about-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    font-size: 0.97rem;
    color: var(--text-dim);
    line-height: 1.8;
}

.about-card strong {
    color: var(--text);
    font-weight: 500;
}

/* ─── STACK ─── */
.stack-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stack-badge {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: 0.2s;
}

.stack-badge:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── PIPO ─── */
.pipo-welcome {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    background: var(--card);
    padding: 22px 28px;
    border-radius: 16px;
    border: 1px solid var(--border);
    min-height: 90px;
    position: relative;
    overflow: visible;
}

.pipo-avatar {
    width: 52px;
    height: 52px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

.pipo-eye-row { display: flex; gap: 7px; margin-bottom: 4px; }
.eye { width: 9px; height: 9px; background: #000; border-radius: 50%; position: relative; }
.pupil { width: 4px; height: 4px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; }
.pipo-mouth { width: 12px; height: 2px; background: #000; border-radius: 2px; transition: 0.3s; }

.pipo-trigger:hover .pipo-mouth {
    height: 7px;
    width: 16px;
    background: transparent;
    border: 2px solid #000;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    margin-top: 2px;
}

.pipo-bubble {
    font-size: 1rem;
    font-weight: 400;
    transition: opacity 0.3s ease;
    color: var(--text-dim);
}

.pipo-hover-bubble {
    position: absolute;
    left: -340px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: var(--accent);
    color: #00130f;
    padding: 14px 16px;
    border-radius: 14px;
    width: min(300px, 32vw);
    font-size: 0.9rem;
    line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .26);
    border: 1px solid rgba(0, 0, 0, .12);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    z-index: 20;
}

.pipo-hover-bubble::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    border: 9px solid transparent;
    border-left-color: var(--accent);
}

.pipo-hover-bubble.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

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

/* ─── PROYECTOS GRID ─── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.p-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 28px 24px;
    border-radius: 16px;
    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    position: relative;
    cursor: pointer;
}

.p-card:hover {
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-4px);
    background: #131317;
}

.p-card i { color: var(--accent); margin-bottom: 14px; }
.p-card h3 { font-size: 0.95rem; font-weight: 500; margin-bottom: 6px; }
.p-card p { font-size: 0.82rem; color: var(--text-dim); flex-grow: 1; }

/* ─── PLEX SHIMMER ─── */
.plex-span {
    position: relative;
    display: inline-block;
    font-weight: 600;
    color: var(--text);
}

.plex-span::after {
    content: attr(data-text);
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,0.8) 50%, var(--accent) 70%, transparent 90%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.4s;
    animation: shimmer-sweep 2.5s infinite linear;
}

.plex-trigger:hover .plex-span::after { opacity: 1; }

@keyframes shimmer-sweep {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* ─── TOOLTIPS ─── */
.help-bubble {
    display: none;
}

.help-bubble::after {
    display: none;
}

.p-card:hover .help-bubble,
.help-target.active .help-bubble {
    display: none;
}

/* ─── BTN EXPLORE ─── */
.btn-explore {
    margin-top: 18px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    text-align: center;
    transition: 0.2s;
    background: transparent;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

.btn-explore:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ─── SERVICIOS ─── */
.services-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.svc-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-dim);
}

.svc-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent);
    animation: pulse 2s infinite;
}

.svc-pill.state-green {
    border-color: rgba(16, 185, 129, 0.45);
    color: #9be5c4;
}

.svc-pill.state-orange {
    border-color: rgba(245, 158, 11, 0.45);
    color: #f7d08a;
}

.svc-pill.state-red {
    border-color: rgba(239, 68, 68, 0.45);
    color: #f0a2a2;
}

.svc-pill.state-green .svc-dot {
    background: #10b981;
    box-shadow: 0 0 7px #10b981;
}

.svc-pill.state-orange .svc-dot {
    background: #f59e0b;
    box-shadow: 0 0 7px #f59e0b;
}

.svc-pill.state-red .svc-dot {
    background: #ef4444;
    box-shadow: 0 0 7px #ef4444;
}

/* ─── TELEMETRÍA ─── */
/* ─── CONTACTO ─── */
.discord-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #5865F2;
    color: #fff;
    border-radius: 10px;
    padding: 11px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: 0.2s;
    font-family: 'DM Sans', sans-serif;
}

.discord-btn:hover {
    background: #4752c4;
    transform: translateY(-2px);
}

/* ─── MODAL ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 40px 36px;
    text-align: center;
    width: 100%;
    max-width: 320px;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}
.modal-overlay.active .modal-box {
    transform: translateY(0);
}
.modal-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.modal-icon i { color: var(--accent); }
.modal-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text);
}
.modal-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 28px;
}
.modal-close {
    padding: 9px 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: 0.2s;
}
.modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ─── FOOTER ─── */
footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    margin-top: 20px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
    .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .project-grid { grid-template-columns: 1fr; }
    .pipo-welcome { flex-direction: column; text-align: center; }
    .mobile-tap-hint {
        display: block;
    }
    .p-card::after {
        content: "Pulsa y te cuento";
        position: absolute;
        top: 10px;
        right: 10px;
        font-family: 'DM Mono', monospace;
        font-size: 0.62rem;
        letter-spacing: .6px;
        text-transform: uppercase;
        color: var(--accent);
        background: rgba(16, 185, 129, .1);
        border: 1px solid rgba(16, 185, 129, .35);
        border-radius: 999px;
        padding: 3px 8px;
        pointer-events: none;
    }
    .pipo-hover-bubble {
        position: fixed;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: 12px;
        transform: translateY(16px);
        width: auto;
        max-height: 36vh;
        overflow: auto;
        border-radius: 12px;
        z-index: 10020;
    }
    .pipo-hover-bubble.show {
        transform: translateY(0);
    }
    .pipo-hover-bubble::after {
        display: none;
    }
    h1 { letter-spacing: -2px; }
}
/* ─── PROYECTOS DESTACADOS ─── */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, transform 0.2s;
}
.featured-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.featured-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.featured-card-header i { color: var(--accent); width: 22px; height: 22px; }

.featured-tag {
    font-size: 0.7rem;
    font-family: 'DM Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(16,185,129,0.2);
}

.featured-card h3 {
    font-size: 1.1rem;
    font-weight: 500;
}
.featured-card p {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.featured-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.featured-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'DM Mono', monospace;
}
.featured-meta i { width: 12px; height: 12px; }

.featured-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--accent);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}
.featured-cta i { width: 14px; height: 14px; transition: transform 0.2s; }
.featured-card:hover .featured-cta i { transform: translateX(4px); }
