/* Command Center — capa estética y funcional */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary-light), var(--primary-color));
    z-index: 4000;
    transition: width 0.08s linear;
    box-shadow: 0 0 12px rgba(196, 30, 30, 0.5);
}

/* Terminal hero */
.hero-terminal {
    margin-bottom: 1.75rem;
    max-width: 520px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover);
    background: #141414;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    contain: layout;
}

.hero-terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    background: #1e1e1e;
    border-bottom: 1px solid #2a2a2a;
    color: #737373;
    font-size: 0.6875rem;
}

.hero-terminal-bar .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #404040;
}

.hero-terminal-bar .dot:nth-child(1) { background: #ef5350; }
.hero-terminal-bar .dot:nth-child(2) { background: #ffb74d; }
.hero-terminal-bar .dot:nth-child(3) { background: #66bb6a; }

.hero-terminal-body {
    padding: 0.65rem 1rem;
    color: #e0e0e0;
    min-height: 4.1rem;
    height: 4.1rem;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}

.hero-terminal-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.hero-terminal-line--cmd {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    line-height: 1.35;
    min-height: 1.35em;
}

.hero-terminal-line--cmd .prompt,
.hero-terminal-line--cmd .terminal-cursor {
    flex-shrink: 0;
}

.hero-terminal-line--cmd #terminal-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.hero-terminal-line--out {
    min-height: 1.35em;
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.35;
    color: #a3e635;
    font-size: inherit;
}

.hero-terminal-line--out:empty {
    visibility: hidden;
}

.hero-terminal-body .prompt {
    color: var(--primary-light);
    font-weight: 600;
}

.hero-terminal-body .terminal-output,
.hero-terminal-line--out {
    color: #a3e635;
}

.terminal-cursor {
    color: var(--primary-light);
    animation: terminal-blink 1s step-end infinite;
}

@keyframes terminal-blink {
    50% { opacity: 0; }
}

.hero-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    background: var(--background-card);
    color: var(--text-light);
}

.status-chip .pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    animation: status-pulse 2s infinite;
}

.status-chip--employed .pulse {
    background: #3b82f6;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    animation: status-pulse-employed 2s infinite;
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes status-pulse-employed {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.45); }
    70% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Timeline experiencia */
.experience-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 1.75rem;
    margin-top: 0.5rem;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light), var(--border-color));
    border-radius: 2px;
}

.timeline-item.job {
    position: relative;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
    margin: 0 0 1rem 0 !important;
    padding: 1rem 1.15rem 1rem 1.25rem !important;
}

.timeline-item.job::before {
    content: '';
    position: absolute;
    left: -1.55rem;
    top: 1.35rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 3px solid var(--background-section);
    box-shadow: 0 0 0 2px var(--primary-color), 0 0 14px rgba(196, 30, 30, 0.45);
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item.job.is-active::before {
    transform: scale(1.25);
    box-shadow: 0 0 0 3px var(--primary-light), 0 0 20px rgba(196, 30, 30, 0.6);
}

.timeline-item.job:last-child {
    margin-bottom: 0 !important;
}

@media (min-width: 901px) {
    .experience-content {
        display: block !important;
    }

    .experience-timeline {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem 1.25rem;
        padding-left: 0;
    }

    .experience-timeline::before {
        display: none;
    }

    .timeline-item.job::before {
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        height: auto;
        border-radius: 10px 0 0 10px;
        border: none;
        box-shadow: none;
        background: var(--primary-color);
    }

    .timeline-item.job {
        padding-left: 1.35rem !important;
    }

    .timeline-item.job.is-active::before {
        background: linear-gradient(180deg, var(--primary-light), var(--primary-color));
        box-shadow: 0 0 16px rgba(196, 30, 30, 0.35);
        transform: none;
    }

    .experience-timeline .timeline-item.job:last-child {
        grid-column: 1 / -1;
    }
}

/* Spotlight en proyectos */
.project-card {
    --spot-x: 50%;
    --spot-y: 50%;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(
        420px circle at var(--spot-x) var(--spot-y),
        rgba(196, 30, 30, 0.12),
        transparent 45%
    );
    pointer-events: none;
    z-index: 0;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-3px) scale(1.01);
}

/* Command dock — lateral derecho (no tapa el footer) */
.command-dock {
    position: fixed;
    top: 50%;
    right: 1rem;
    bottom: auto;
    left: auto;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.55rem 0.4rem;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    box-shadow: var(--shadow-hover);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3500;
}

.command-dock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

.command-dock-btn:hover,
.command-dock-btn.is-active {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.command-dock-btn .dock-tip {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    bottom: auto;
    left: auto;
    transform: translateY(-50%) translateX(6px);
    padding: 0.25rem 0.5rem;
    background: var(--text-color);
    color: var(--background);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}

.command-dock-btn:hover .dock-tip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.command-dock-divider {
    width: 22px;
    height: 1px;
    background: var(--border-color);
    margin: 0.1rem 0;
}

/* Botón buscar en el dock */
.command-dock-search {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: 42px;
    min-height: 42px;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(196, 30, 30, 0.08);
    color: var(--primary-color);
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition-fast);
}

.command-dock-search i {
    font-size: 0.85rem;
    line-height: 1;
}

.command-dock-kbd-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    line-height: 1;
}

@media (min-width: 768px) {
    .command-dock-search {
        display: flex;
    }
}

.command-dock-search:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(196, 30, 30, 0.35);
}

.command-dock-search:hover .command-dock-kbd-label {
    color: rgba(255, 255, 255, 0.85);
}

/* Legacy — ocultar si queda en alguna página */
.command-dock-kbd {
    display: none !important;
}

/* ─── Header — marca + contexto + acciones ─── */
header nav {
    gap: 0.75rem;
}

header .logo a,
header a.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    line-height: 0;
}

@media (min-width: 901px) {
    header nav {
        align-items: center;
    }

    header .logo,
    header .nav-context,
    header .nav-actions {
        align-self: center;
    }
}

.nav-brand-text {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-color);
    line-height: 1;
}

.nav-context {
    display: none;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    margin-right: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(196, 30, 30, 0.08);
    border: 1px solid rgba(196, 30, 30, 0.18);
    border-radius: 99px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

.nav-page-label {
    color: var(--text-color);
}

@media (min-width: 901px) {
    .nav-context {
        display: flex;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0.3rem 0.4rem;
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(196, 30, 30, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.nav-search-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.nav-actions .theme-toggle-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--background-section);
}

.nav-actions .language-btn {
    padding: 0.35rem 0.65rem;
    border-radius: 99px;
    font-size: 0.8125rem;
}

#mobile-menu .mobile-menu-nav a.is-current,
#mobile-menu .mobile-menu-nav a.is-active {
    background: rgba(196, 30, 30, 0.1);
    border-color: rgba(196, 30, 30, 0.18);
    color: var(--primary-color) !important;
}

#mobile-menu .mobile-menu-nav a.is-current i,
#mobile-menu .mobile-menu-nav a.is-active i {
    background: var(--primary-color);
    color: #fff;
}

@media (max-width: 900px) {
    .nav-actions {
        display: none !important;
    }
}

@media (min-width: 901px) {
    .mobile-menu:not(.active),
    .mobile-menu-overlay:not(.active) {
        display: none !important;
        pointer-events: none !important;
        visibility: hidden !important;
    }

    .nav-actions {
        display: flex !important;
    }
}

/* Command palette */
.command-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 1rem 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}

.command-palette-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.command-palette {
    width: min(520px, 100%);
    background: var(--background-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(196, 30, 30, 0.12);
    overflow: hidden;
    transform: translateY(-12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.command-palette-overlay.is-open .command-palette {
    transform: translateY(0) scale(1);
}

.command-palette-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    background: var(--background-section);
}

.command-palette-header i {
    color: var(--primary-color);
    font-size: 0.9375rem;
}

.command-palette-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-color);
    outline: none;
}

.command-palette-input::placeholder {
    color: var(--text-muted);
}

.command-palette-list {
    list-style: none;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.35rem;
}

.command-palette-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    font-size: 0.9375rem;
    transition: background 0.15s;
}

.command-palette-item:hover,
.command-palette-item.is-selected {
    background: rgba(196, 30, 30, 0.1);
    color: var(--primary-color);
}

.command-palette-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.command-palette-item:hover i,
.command-palette-item.is-selected i {
    color: var(--primary-color);
}

.command-palette-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
}

.command-palette-footer kbd {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.6875rem;
    font-family: inherit;
}

body.dock-pad {
    padding-bottom: 0;
}

@media (max-width: 900px) {
    .command-dock,
    .command-palette-overlay {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .command-dock-btn .dock-tip {
        display: none;
    }
}
