/* Variables y Reset */
:root {
    --bg-dark: #000000;
    --bg-card-dark: #1D1D1F;
    --bg-light: #F5F5F7;
    --bg-card-light: #FFFFFF;
    --text-dark: #1D1D1F;
    --text-light: #F5F5F7;
    --neon-green: #00FF87;
    --silver: linear-gradient(135deg, #E0E0E0, #8C8C8C);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.4s, color 0.4s;
    overflow-x: hidden;
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* Utilidades */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

body:not(.dark-mode) .glass {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Navegación */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    z-index: 1000;
    border-radius: 0 0 20px 20px;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}
.nav-logo span {
    color: var(--neon-green);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}
.nav-links a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--neon-green);
}

.nav-controls button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 1rem;
    transition: transform 0.2s;
}
.nav-controls button:hover { transform: scale(1.2); }

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6rem 5% 2rem;
    gap: 2rem;
}

.hero-content {
    flex: 1;
}
.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, currentColor 30%, var(--neon-green) 90%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: none;
    display: inline-block;
}
.btn:hover { transform: translateY(-3px); }

.btn-primary {
    background-color: var(--neon-green);
    color: #000;
}
.btn-secondary {
    border: 1px solid var(--neon-green);
    color: inherit;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}
.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    max-height: 80vh;
    object-fit: cover;
}

/* Secciones */
.section {
    padding: 6rem 5%;
}
.section h2 {
    font-size: clamp(2rem, 3.5vw, 3rem);
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 700;
}

/* Timeline */
.timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}
.timeline-item {
    padding: 2rem;
    border-radius: 20px;
    flex: 1;
    min-width: 280px;
    max-width: 350px;
}
.timeline-year {
    color: var(--neon-green);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.timeline-item h3 {
    margin: 0.5rem 0 1rem;
    font-size: 1.3rem;
}

/* Servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}
.card {
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    transition: transform 0.3s;
}
.card:hover { transform: translateY(-10px); }

.card.featured {
    border: 1px solid var(--neon-green);
}
.badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: var(--neon-green);
    color: #000;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.card h3 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.card p { opacity: 0.7; margin-bottom: 1rem; }
.price {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--silver);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.card ul {
    list-style: none;
}
.card ul li {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
    font-size: 0.95rem;
}

/* Portafolio */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}
.filter-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--neon-green);
    color: #000;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
.portfolio-item {
    border-radius: 20px;
    overflow: hidden;
    transition: opacity 0.5s, transform 0.5s;
}
.portfolio-item.hide {
    display: none;
}
.placeholder-img {
    height: 200px;
    background: var(--silver);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 600;
}
.portfolio-item h4 {
    padding: 1.5rem;
    text-align: center;
}

/* Contacto */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-form input, .contact-form textarea {
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: 2px solid var(--neon-green);
    border: transparent;
}

footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--glass-border);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Animaciones de entrada */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Mobile First adjustments */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { flex-direction: column; text-align: center; padding-top: 8rem; }
    .hero-cta { justify-content: center; }
}

/* Creado por a mano */
#contact p {
  text-align: center;
  margin-bottom: 30px;
}

/* Creado para el Blog */
/* === Estilos del Blog === */
.blog-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Barra Lateral */
.blog-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 100px;
    padding: 2rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-green);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.sidebar-title:first-child {
    margin-top: 0;
}

#search-input {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s;
    width: 100%;
}
#search-input:focus {
    border: 1px solid var(--neon-green);
}

.sidebar-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Botones de filtro en vertical */
.sidebar-filter-group .filter-btn {
    text-align: left;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
}
.sidebar-filter-group .filter-btn:hover {
    background: rgba(0, 255, 135, 0.1);
}
.sidebar-filter-group .filter-btn.active {
    background: var(--neon-green);
    color: #000;
    font-weight: 600;
}

/* Contenedor de Artículos */
.blog-main {
    flex: 1;
    min-width: 0; /* Previene desbordamiento en flex */
}

/* Estilo de lectura del Post (post.html) */
.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: inherit;
}
.post-body h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, currentColor 0%, var(--neon-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.post-body h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.post-body p {
    margin-bottom: 1.5rem;
}
.post-body code {
    background: rgba(128, 128, 128, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    color: var(--neon-green);
}
.post-body ul, .post-body ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

/* Responsive: En móvil, la barra lateral se va arriba */
@media (max-width: 768px) {
    .blog-layout {
        flex-direction: column;
    }
    .blog-sidebar {
        position: static;
        width: 100%;
        flex: none;
    }
}