/* ============================================================
   ALOPEZTI — Sistema de diseño
   Concepto: "Circuito" — líneas de conexión sutiles que evocan
   integración de sistemas / arquitectura técnica, sin caer en
   cliché de "matrix" o "hacker". Paleta azul/negro/blanco/gris
   pedida en el brief, con un acento eléctrico como firma.
   ============================================================ */

:root {
    /* Color */
    --ink:        #0A0E1A;   /* casi negro, base oscura */
    --ink-soft:   #131826;   /* superficies oscuras secundarias */
    --paper:      #FAFBFC;   /* blanco cálido, no #FFF puro */
    --paper-soft: #F1F3F7;   /* gris muy claro para secciones alternas */
    --line:       #E3E7EE;   /* bordes sutiles sobre paper */
    --line-dark:  #232A3D;   /* bordes sutiles sobre ink */
    --slate:      #5B6577;   /* texto secundario */
    --slate-dim:  #8B93A3;   /* texto terciario */
    --accent:     #2F6FED;   /* azul eléctrico — la firma */
    --accent-soft:#EAF1FF;   /* fondo suave del acento */
    --accent-glow:rgba(47, 111, 237, 0.35);

    /* Tipografía */
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body:    'Inter', 'Segoe UI', sans-serif;
    --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    /* Espaciado */
    --container: 1180px;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;

    --transition: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body {
    background: var(--ink);
    color: var(--paper);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: var(--accent);
}

/* Foco visible accesible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============ NAV ============ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(250, 251, 252, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}

[data-theme="dark"] .nav {
    background: rgba(10, 14, 26, 0.85);
    border-bottom-color: var(--line-dark);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 38px;
    width: auto;
    display: block;
}

.footer-brand .logo-img { height: 44px; }

.logo-dot { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    font-size: 14.5px;
    color: var(--slate);
    transition: color var(--transition);
    position: relative;
}

[data-theme="dark"] .nav-links a { color: var(--slate-dim); }

.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--slate);
    transition: var(--transition);
}

[data-theme="dark"] .theme-toggle { border-color: var(--line-dark); color: var(--slate-dim); }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink);
}
[data-theme="dark"] .nav-toggle { color: var(--paper); }

/* ============ BOTONES ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-primary:hover {
    background: #2860d4;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}
[data-theme="dark"] .btn-ghost { border-color: var(--line-dark); color: var(--paper); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ============ HERO ============ */
.hero {
    position: relative;
    padding: 168px 0 110px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}

.hero-title {
    font-size: clamp(38px, 5vw, 60px);
    font-weight: 600;
    margin-bottom: 22px;
}

.hero-title .accent { color: var(--accent); }

.hero-sub {
    font-size: 18px;
    color: var(--slate);
    max-width: 480px;
    margin-bottom: 34px;
}
[data-theme="dark"] .hero-sub { color: var(--slate-dim); }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-meta {
    display: flex;
    gap: 32px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}
[data-theme="dark"] .hero-meta { border-top-color: var(--line-dark); }

.hero-meta-item .num {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
    color: var(--accent);
    display: block;
}
.hero-meta-item .label {
    font-size: 13px;
    color: var(--slate);
}
[data-theme="dark"] .hero-meta-item .label { color: var(--slate-dim); }

/* Signature element: panel de "circuito" — nodos conectados que
   representan sistemas integrándose, animados suavemente */
.circuit-panel {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    background: var(--ink);
    overflow: hidden;
    border: 1px solid var(--line-dark);
}

.circuit-panel svg { width: 100%; height: 100%; }

.circuit-line {
    stroke: var(--line-dark);
    stroke-width: 1;
    fill: none;
}

.circuit-line.active {
    stroke: var(--accent);
    stroke-dasharray: 6 10;
    animation: flow 3.5s linear infinite;
    opacity: 0.85;
}

@keyframes flow {
    to { stroke-dashoffset: -160; }
}

.circuit-node {
    fill: var(--ink-soft);
    stroke: var(--line-dark);
    stroke-width: 1.5;
}

.circuit-node.lit {
    fill: var(--accent);
    stroke: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.circuit-label {
    font-family: var(--font-mono);
    font-size: 9px;
    fill: var(--slate-dim);
    letter-spacing: 0.05em;
}

/* ============ SECCIONES GENERALES ============ */
.section { padding: 110px 0; }
.section-alt { background: var(--paper-soft); }
[data-theme="dark"] .section-alt { background: var(--ink-soft); }

.section-head {
    max-width: 640px;
    margin-bottom: 56px;
}

.section-title {
    font-size: clamp(28px, 3.4vw, 38px);
    font-weight: 600;
}

.section-desc {
    color: var(--slate);
    font-size: 16px;
    margin-top: 14px;
}
[data-theme="dark"] .section-desc { color: var(--slate-dim); }

/* ============ SERVICIOS ============ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}
[data-theme="dark"] .services-grid { background: var(--line-dark); border-color: var(--line-dark); }

.service-card {
    background: var(--paper);
    padding: 32px 28px;
    transition: var(--transition);
}
[data-theme="dark"] .service-card { background: var(--ink); }

.service-card:hover {
    background: var(--accent-soft);
}
[data-theme="dark"] .service-card:hover { background: var(--ink-soft); }

.service-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 18px;
}
[data-theme="dark"] .service-icon { background: var(--ink-soft); }

.service-card h3 {
    font-size: 16.5px;
    font-weight: 600;
    margin-bottom: 8px;
}

.service-card p {
    font-size: 14px;
    color: var(--slate);
    margin: 0;
}
[data-theme="dark"] .service-card p { color: var(--slate-dim); }

/* ============ SOBRE MI ============ */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 64px;
    align-items: start;
}

.about-card {
    background: var(--ink);
    border-radius: var(--radius-lg);
    padding: 36px;
    color: var(--paper);
    position: relative;
    overflow: hidden;
}

.about-card .role {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-card h3 { font-size: 24px; margin: 10px 0 4px; }

.about-card .projects {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line-dark);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.about-card .project-tag {
    font-family: var(--font-mono);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--paper);
}

.about-card .project-tag .dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
    flex-shrink: 0;
}

.about-text p {
    font-size: 16.5px;
    color: var(--slate);
    margin: 0 0 18px;
}
[data-theme="dark"] .about-text p { color: var(--slate-dim); }

.about-text strong { color: var(--ink); font-weight: 600; }
[data-theme="dark"] .about-text strong { color: var(--paper); }

/* ============ POR QUÉ ELEGIRME ============ */
.why-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 28px 24px;
}

.why-item { display: flex; gap: 12px; align-items: flex-start; }

.why-check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    margin-top: 2px;
}
[data-theme="dark"] .why-check { background: var(--ink-soft); }

.why-item span.text { font-size: 14.5px; }

/* ============ PORTAFOLIO ============ */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.portfolio-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    background: var(--paper);
}
[data-theme="dark"] .portfolio-card { border-color: var(--line-dark); background: var(--ink-soft); }

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(10, 14, 26, 0.08);
}

.portfolio-img {
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, var(--ink) 0%, var(--ink-soft) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 13px;
}

.portfolio-body { padding: 22px; }

.portfolio-body h3 { font-size: 17px; margin-bottom: 8px; }

.portfolio-body p {
    font-size: 14px;
    color: var(--slate);
    margin: 0 0 14px;
}
[data-theme="dark"] .portfolio-body p { color: var(--slate-dim); }

.tech-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }

.tech-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 5px;
    background: var(--paper-soft);
    color: var(--slate);
}
[data-theme="dark"] .tech-tag { background: var(--ink); color: var(--slate-dim); }

.portfolio-actions { display: flex; gap: 10px; }

/* ============ CONTACTO ============ */
.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 56px;
}

.contact-info h2 { font-size: 30px; margin-bottom: 16px; }

.contact-info p {
    color: var(--slate);
    font-size: 15.5px;
    margin-bottom: 32px;
}
[data-theme="dark"] .contact-info p { color: var(--slate-dim); }

.contact-channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}
[data-theme="dark"] .contact-channel { border-top-color: var(--line-dark); }

.contact-channel .icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
[data-theme="dark"] .contact-channel .icon { background: var(--ink-soft); }

.contact-channel .label { font-size: 12.5px; color: var(--slate-dim); }
.contact-channel .value { font-size: 14.5px; font-weight: 500; }

.form-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 40px;
}
[data-theme="dark"] .form-card { background: var(--ink-soft); border-color: var(--line-dark); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 7px;
    color: var(--slate);
}
[data-theme="dark"] .form-group label { color: var(--slate-dim); }

.form-control {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--paper);
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--ink);
    transition: var(--transition);
}
[data-theme="dark"] .form-control {
    background: var(--ink);
    border-color: var(--line-dark);
    color: var(--paper);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea.form-control { resize: vertical; min-height: 110px; }

.honeypot-field { position: absolute; left: -9999px; opacity: 0; }

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 22px;
}
.alert-success { background: #E7F7EE; color: #1A7A4C; border: 1px solid #BFE8D2; }
.alert-error   { background: #FDEAEA; color: #B3261E; border: 1px solid #F6C7C5; }

/* ============ FOOTER ============ */
.footer {
    background: var(--ink);
    color: var(--paper);
    padding: 64px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--line-dark);
}

.footer-brand .logo { color: var(--paper); margin-bottom: 14px; }
.footer-brand p { color: var(--slate-dim); font-size: 14px; max-width: 280px; }

.footer-col h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--slate-dim);
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14.5px; color: var(--paper); opacity: 0.85; transition: var(--transition); }
.footer-col a:hover { color: var(--accent); opacity: 1; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 28px;
    font-size: 13px;
    color: var(--slate-dim);
    flex-wrap: wrap;
    gap: 12px;
}

.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
    width: 34px; height: 34px;
    border: 1px solid var(--line-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--paper);
    transition: var(--transition);
}
.footer-socials a:hover { border-color: var(--accent); color: var(--accent); }

/* ============ WHATSAPP FLOTANTE ============ */
.whatsapp-float {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    z-index: 90;
    transition: var(--transition);
}
.whatsapp-float:hover { transform: scale(1.08); }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
    .hero-grid { grid-template-columns: 1fr; }
    .circuit-panel { max-width: 420px; margin: 0 auto; }
    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .contact-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
    .why-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
    .nav-links, .nav-actions .btn-ghost { display: none; }
    .nav-toggle { display: block; }
    .hero { padding: 130px 0 70px; }
    .hero-meta { flex-wrap: wrap; gap: 24px; }
    .services-grid { grid-template-columns: 1fr; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
    .section { padding: 72px 0; }
}

/* ============ REVEAL ON SCROLL ============ */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============ MENÚ MÓVIL ============ */
.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    z-index: 99;
    padding: 8px 24px 20px;
}
[data-theme="dark"] .mobile-menu { background: var(--ink); border-bottom-color: var(--line-dark); }

.mobile-menu.open { display: block; }

.mobile-menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }

.mobile-menu a {
    display: block;
    padding: 14px 0;
    font-size: 15.5px;
    border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .mobile-menu a { border-bottom-color: var(--line-dark); }

.mobile-menu .btn { margin-top: 16px; }

/* ============ TESTIMONIOS ============ */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.testimonial-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: var(--transition);
}
[data-theme="dark"] .testimonial-card {
    background: var(--ink-soft);
    border-color: var(--line-dark);
}
.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(10,14,26,.07);
}

.testimonial-stars { display: flex; gap: 2px; }
.star { color: #F59E0B; font-size: 15px; }

.testimonial-text {
    font-size: 15px;
    line-height: 1.65;
    color: var(--slate);
    margin: 0;
    flex: 1;
    font-style: italic;
}
[data-theme="dark"] .testimonial-text { color: var(--slate-dim); }

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
[data-theme="dark"] .testimonial-author { border-top-color: var(--line-dark); }

.testimonial-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.testimonial-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.testimonial-name { font-size: 14px; font-weight: 600; }
.testimonial-role { font-size: 12.5px; color: var(--slate-dim); margin-top: 2px; }

@media (max-width: 860px) {
    .testimonials-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .testimonials-grid { grid-template-columns: 1fr; }
}

/* ============ FAQ ============ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .faq-item { border-bottom-color: var(--line-dark); }
.faq-item:first-child { border-top: 1px solid var(--line); }
[data-theme="dark"] .faq-item:first-child { border-top-color: var(--line-dark); }

.faq-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: 500;
    color: var(--ink);
    text-align: left;
    transition: color var(--transition);
}
[data-theme="dark"] .faq-trigger { color: var(--paper); }
.faq-trigger:hover { color: var(--accent); }
.faq-trigger.open { color: var(--accent); }

.faq-icon {
    flex-shrink: 0;
    transition: transform var(--transition);
    color: var(--slate-dim);
}
.faq-trigger.open .faq-icon { transform: rotate(180deg); color: var(--accent); }

.faq-body { padding-bottom: 18px; }
.faq-answer {
    font-size: 15px;
    line-height: 1.65;
    color: var(--slate);
}
[data-theme="dark"] .faq-answer { color: var(--slate-dim); }

@media (max-width: 860px) {
    #faq .container > div { grid-template-columns: 1fr !important; gap: 32px !important; }
}
