/* ============================================
   Liufke v3 — Software Factory · Chile · 2013
   ============================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #020617; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

::selection { background: rgba(36, 148, 179, 0.3); color: #f1f5f9; }

:focus-visible {
    outline: 2px solid #2494b3;
    outline-offset: 2px;
    border-radius: 4px;
}

#navbar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(2, 6, 23, 0.85);
    border-bottom: 1px solid #1e293b;
    height: 64px;
}
#navbar.scrolled {
    border-color: rgba(36, 148, 179, 0.3);
    background: rgba(2, 6, 23, 0.95);
}

#mobileMenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #1e293b;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}
#mobileMenu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #f1f5f9;
    border-radius: 1px;
    transition: all 0.25s ease;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

.terminal {
    background: #0a0d17;
    border: 1px solid #1e293b;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.terminal-header {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #111624;
    border-bottom: 1px solid #1e293b;
}
.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.terminal-header .dot:nth-child(1) { background: #e8513a; }
.terminal-header .dot:nth-child(2) { background: #e8a84c; }
.terminal-header .dot:nth-child(3) { background: #3a9d5c; }

.terminal-body {
    padding: 20px 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.8;
    min-height: 280px;
    color: #cbd5e1;
}

#terminalOutput {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}
#terminalOutput .prompt    { color: #3a9d5c; }
#terminalOutput .cmd       { color: #f8fafc; }
#terminalOutput .info      { color: #64748b; }
#terminalOutput .highlight { color: #2494b3; }
#terminalOutput .success   { color: #4ade80; }
#terminalOutput .error     { color: #e8513a; }
#terminalOutput .dim       { color: #475569; }
#terminalOutput .cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: #2494b3;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

/* ===== Service grid perspective ===== */
#servicesGrid {
    perspective: 800px;
}

/* ===== Cards with 3D tilt ===== */
.dark-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 12px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    transform-style: preserve-3d;
}
.dark-card.hover-active {
    border-color: rgba(36, 148, 179, 0.3);
    box-shadow: 0 4px 24px rgba(36, 148, 179, 0.06);
}
.dark-card .service-icon {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dark-card:hover .service-icon {
    transform: scale(1.15) rotate(-4deg);
    box-shadow: 0 0 20px rgba(36, 148, 179, 0.15);
}

@keyframes reveal-card {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    animation: none;
}
.reveal.visible {
    animation: reveal-card 0.6s ease-out var(--delay, 0ms) forwards;
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(36, 148, 179, 0.1);
    color: #2494b3;
    margin-bottom: 20px;
}

.tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 6px;
}
.tag-core { background: rgba(36, 148, 179, 0.15); color: #2db5d4; }
.tag-new  { background: rgba(58, 157, 92, 0.15); color: #4ade80; }
.tag-etl  { background: rgba(232, 81, 58, 0.12);  color: #f87171; }
.tag-api  { background: rgba(106, 76, 204, 0.15); color: #a78bfa; }

.tech-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    padding: 18px 14px;
    background: rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(30, 41, 59, 0.2);
    border-radius: 12px;
    cursor: default;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s,
                box-shadow 0.3s,
                background 0.3s;
}
.tech-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}
.tech-name {
    font-size: 10px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.3);
    letter-spacing: 0.5px;
    transition: color 0.3s;
    text-transform: uppercase;
    text-align: center;
}
.tech-card:hover .tech-name {
    color: #f1f5f9;
}

@media (min-width: 768px) {
    #techRow1, #techRow2, #techRow3 {
        perspective: 800px;
    }
    .tech-card {
        width: 116px;
        max-width: none;
        padding: 20px 6px;
        min-height: 100px;
        box-shadow: none;
    }
    .tech-card + .tech-card {
        margin-left: -28px;
    }
    .tech-card:nth-child(odd) {
        transform: rotateY(20deg) rotateX(-4deg);
    }
    .tech-card:nth-child(even) {
        transform: rotateY(20deg) rotateX(4deg);
    }
    .tech-card:nth-child(odd):hover,
    .tech-card:nth-child(even):hover {
        transform: rotateY(0deg) translateY(-18px) translateZ(48px) scale(1.05);
        z-index: 100;
        background: #0f172a;
        border-color: rgba(36, 148, 179, 0.5);
        box-shadow: 0 24px 64px rgba(36, 148, 179, 0.3);
    }
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
}
.form-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.form-input:focus {
    outline: none;
    border-color: #2494b3;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(36, 148, 179, 0.15);
}
textarea.form-input { resize: vertical; }

/* ===== Animated gradient — services section ===== */
#servicios {
    background: linear-gradient(
        135deg,
        #020617 0%,
        #0d1a2e 25%,
        #060d1a 50%,
        #0e1c30 75%,
        #020617 100%
    );
    background-size: 300% 300%;
    animation: gradient-shift 18s ease infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== Particle canvas — stack section ===== */
#stackCanvas {
    display: block;
    opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
    #terminalOutput .cursor { animation: none; opacity: 0; }
    .dark-card .service-icon { transform: none !important; }
    #techRow1, #techRow2, #techRow3 { perspective: none !important; }
    .tech-card { transform: none !important; margin-left: 0 !important; background: #0f172a !important; border-color: #1e293b !important; }
    .tech-card:hover { transform: none !important; }

}
