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

body {
    min-height: 100vh;
    background: #0a0e1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

/* Canvas de fondo para las particulas */
canvas#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Grid tecnologico de fondo */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image:
        linear-gradient(rgba(30, 60, 180, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 60, 180, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0%   { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

/* Lineas de codigo flotantes */
.code-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.code-line {
    position: absolute;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: rgba(60, 130, 255, 0.08);
    white-space: nowrap;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-100px) translateX(30px); opacity: 0; }
}

/* Circuitos animados */
.circuit {
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.circuit-h {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(60, 140, 255, 0.3), transparent);
    animation: circuitPulseH 4s ease-in-out infinite;
}

.circuit-v {
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(60, 140, 255, 0.3), transparent);
    animation: circuitPulseV 4s ease-in-out infinite;
}

@keyframes circuitPulseH {
    0%, 100% { opacity: 0; transform: scaleX(0); }
    50%       { opacity: 1; transform: scaleX(1); }
}

@keyframes circuitPulseV {
    0%, 100% { opacity: 0; transform: scaleY(0); }
    50%       { opacity: 1; transform: scaleY(1); }
}

/* Nodo brillante */
.node {
    position: fixed;
    width: 4px;
    height: 4px;
    background: rgba(80, 150, 255, 0.6);
    border-radius: 50%;
    z-index: 0;
    box-shadow: 0 0 8px rgba(80, 150, 255, 0.4);
    animation: nodePulse 3s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50%       { transform: scale(2); opacity: 0.8; }
}

/* Glow orbs */
.orb {
    position: fixed;
    border-radius: 50%;
    z-index: 0;
    filter: blur(80px);
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 60, 200, 0.15), transparent);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(40, 80, 220, 0.12), transparent);
    bottom: -80px;
    left: -80px;
    animation-delay: -4s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(60, 100, 240, 0.1), transparent);
    top: 40%;
    left: 50%;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(30px, -20px) scale(1.1); }
    50%       { transform: translate(-20px, 30px) scale(0.95); }
    75%       { transform: translate(20px, 20px) scale(1.05); }
}

/* Brackets decorativos */
.brackets {
    position: fixed;
    font-family: 'Courier New', monospace;
    font-size: 120px;
    font-weight: 100;
    color: rgba(60, 130, 255, 0.04);
    z-index: 1;
    pointer-events: none;
}

.bracket-left {
    top: 50%;
    left: 5%;
    transform: translateY(-50%);
    animation: bracketPulse 4s ease-in-out infinite;
}

.bracket-right {
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    animation: bracketPulse 4s ease-in-out infinite 2s;
}

@keyframes bracketPulse {
    0%, 100% { opacity: 0.3; }
    50%       { opacity: 0.8; }
}

/* ── Contenido principal ── */
.content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px 20px 60px;
    width: 100%;
    max-width: 1100px;
}

.logo-container {
    margin-bottom: 36px;
    animation: fadeInDown 1.2s ease-out;
}

.logo-container img {
    max-width: 220px;
    width: 60vw;
    filter: drop-shadow(0 0 30px rgba(60, 130, 255, 0.2));
    transition: filter 0.5s ease;
}

.logo-container img:hover {
    filter: drop-shadow(0 0 50px rgba(60, 130, 255, 0.4));
}

@keyframes fadeInDown {
    0%   { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.title {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 300;
    color: #e0e8ff;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 10px;
    animation: fadeInUp 1.2s ease-out 0.3s both;
}

.title span {
    font-weight: 600;
    background: linear-gradient(135deg, #4a8fff, #7bb3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    color: rgba(160, 180, 220, 0.5);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: fadeInUp 1.2s ease-out 0.5s both;
}

@keyframes fadeInUp {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Linea decorativa */
.divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4a8fff, transparent);
    margin: 24px auto 40px;
    position: relative;
    animation: fadeInUp 1.2s ease-out 0.4s both;
}

.divider::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    width: 8px;
    height: 8px;
    background: #4a8fff;
    border-radius: 50%;
    animation: dividerDot 3s ease-in-out infinite;
}

@keyframes dividerDot {
    0%, 100% { left: 0; }
    50%       { left: calc(100% - 8px); }
}

/* ── Grid de proyectos ── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    animation: fadeInUp 1.2s ease-out 0.7s both;
}

@media (max-width: 750px) {
    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ── Tarjeta de proyecto ── */
.project-card {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(74, 143, 255, 0.12);
    backdrop-filter: blur(12px);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    cursor: pointer;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(74, 143, 255, 0.06), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(74, 143, 255, 0.4);
    box-shadow: 0 20px 60px rgba(74, 143, 255, 0.15), 0 0 0 1px rgba(74, 143, 255, 0.1);
}

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

/* Imagen del proyecto */
.project-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    position: relative;
    background: linear-gradient(160deg, #0d1530 0%, #111828 100%);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.04);
}

/* Placeholder cuando no hay imagen */
.project-image .img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: rgba(74, 143, 255, 0.25);
}

.placeholder-icon {
    font-size: 48px;
    opacity: 0.5;
}

.placeholder-text {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

.img-placeholder::after {
    content: '';
    position: absolute;
    inset: 16px;
    border: 1px solid rgba(74, 143, 255, 0.08);
    border-radius: 8px;
}

/* Overlay degradado sobre la imagen */
.project-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.9), transparent);
}

/* Info del proyecto */
.project-info {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.project-name {
    font-size: 1rem;
    font-weight: 600;
    color: #dde6ff;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.project-enter {
    font-size: 0.72rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: rgba(74, 143, 255, 0.55);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease, gap 0.3s ease;
}

.project-card:hover .project-enter {
    color: rgba(74, 143, 255, 0.9);
    gap: 10px;
}

.project-enter::after {
    content: '→';
}

/* Indicador de seguridad */
.project-lock {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(74, 143, 255, 0.08);
    border: 1px solid rgba(74, 143, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.3s ease;
}

.project-card:hover .project-lock {
    background: rgba(74, 143, 255, 0.16);
}
