:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-alt: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: rgba(37, 99, 235, 0.08);
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.10);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --header-height: 68px;
    --radius: 12px;
    --whatsapp-green: #25D366;
}


/* RESET */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* TYPOGRAPHY */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* LAYOUT */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-block {
    padding: 6rem 0;
}

/* =====================
   HEADER STICKY
   ===================== */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}


#site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo-link { display: flex; align-items: center; }

.logo-main {
    height: 44px;
    width: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.08));
}

nav#main-nav ul {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

nav#main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

nav#main-nav a:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

/* HAMBURGER */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    padding: 6px;
    transition: background 0.2s;
}

.hamburger:hover { background: var(--accent-light); }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE MENU */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.97);
    backdrop-filter: blur(12px);
    z-index: 99;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}


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

.mobile-menu ul {
    list-style: none;
    text-align: center;
}

.mobile-menu ul li {
    margin-bottom: 0.5rem;
}

.mobile-menu a {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.mobile-menu a:hover {
    color: var(--accent-color);
    background: var(--accent-light);
}

/* =====================
   HERO
   ===================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: var(--header-height);
    overflow: hidden;
    background: linear-gradient(160deg, var(--bg-main) 0%, #eef2ff 50%, var(--bg-main) 100%);
}


.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 40%, transparent 80%);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.hero-logo {
    max-width: 400px;
    width: 70%;
    height: auto;
    margin-bottom: 2.5rem;
    filter: drop-shadow(0 8px 24px rgba(37, 99, 235, 0.15));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.hero-eyebrow {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.25rem;
}

.hero h1 { margin-bottom: 1.25rem; }

.highlight { color: var(--accent-color); }

.hero-sub {
    max-width: 560px;
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 1.4rem;
    animation: scrollBounce 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.hero-scroll-hint:hover {
    border-color: var(--accent-color);
}

.hero-scroll-hint svg {
    opacity: 0.6;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* =====================
   BUTTONS
   ===================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: #ffffff;
    padding: 0.9rem 1.8rem;
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.975rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    font-family: inherit;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn:active { transform: translateY(0); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: none;
}

/* =====================
   SECTION HEADERS
   ===================== */
.section-header {
    margin-bottom: 3.5rem;
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent-color);
    background: var(--accent-light);
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.section-desc {
    max-width: 520px;
    font-size: 1.1rem;
    margin-top: 0.75rem;
}

/* =====================
   SERVICIOS
   ===================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.25);
}

.service-icon {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--accent-light);
}

.service-icon svg {
    width: 28px;
    height: 28px;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* =====================
   TECH STACK
   ===================== */
.tech-stack-section {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 3.5rem 0;
}

.tech-label {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.tech-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    transition: all 0.25s;
    cursor: default;
    opacity: 0;
    transform: translateY(12px);
    animation: techFadeIn 0.5s ease-out forwards;
}

.tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-item:nth-child(4) { animation-delay: 0.4s; }
.tech-item:nth-child(5) { animation-delay: 0.5s; }
.tech-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes techFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tech-item:hover {
    border-color: rgba(37, 99, 235, 0.4);
    color: var(--accent-color);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.tech-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* =====================
   PROYECTOS
   ===================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #8b5cf6);
    opacity: 0;
    transition: opacity 0.3s;
}

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

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(37, 99, 235, 0.25);
}

.project-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-color);
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.project-card p {
    font-size: 0.95rem;
    flex: 1;
}

.project-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.project-stack span {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    background: var(--bg-alt);
    border-radius: 50px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* =====================
   SECTION ALT (TURNOS)
   ===================== */
.section-alt {
    background: linear-gradient(135deg, #eef2ff 0%, #f1f5f9 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}


/* =====================
   FORMS
   ===================== */
.form-container {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    max-width: 640px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.975rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder { color: #94a3b8; }

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--bg-card);
}

.form-control:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #ef4444;
}

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

.form-message {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 8px;
    display: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* =====================
   CONTACTO SPLIT
   ===================== */
.contact-split {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h2 { margin-top: 1rem; }

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    font-size: 0.975rem;
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    padding: 0.4rem 0;
}

.contact-link:hover {
    color: var(--accent-color);
    transform: translateX(4px);
}

.contact-link svg {
    flex-shrink: 0;
}

.contact-form-box {
    max-width: none;
    margin: 0;
}

/* =====================
   FOOTER
   ===================== */
footer {
    background: var(--text-main);
    color: rgba(255,255,255,0.7);
}


.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    padding-top: 4rem;
    padding-bottom: 3rem;
}

.footer-brand p {
    color: rgba(255,255,255,0.5);
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
}

.footer-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1) opacity(0.8);
}

.footer-links {
    display: flex;
    gap: 3rem;
}

.footer-links > div {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links strong {
    color: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.25rem;
}

.footer-links a {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    transition: color 0.2s;
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.25rem 2rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.35);
    font-size: 0.85rem;
    margin: 0;
}

/* =====================
   BACK TO TOP BUTTON
   ===================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* =====================
   WHATSAPP FLOATING BUTTON
   ===================== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--whatsapp-green);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 50;
    transition: all 0.3s ease;
    animation: whatsappPulse 3s ease-in-out infinite;
}

.whatsapp-float:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.5);
}

@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(37, 211, 102, 0.6); }
}

/* =====================
   FADE-IN ANIMATIONS
   ===================== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
    .contact-split {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .footer-links {
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    nav#main-nav { display: none; }

    .hamburger { display: flex; }

    .section-block { padding: 4rem 0; }

    .form-row {
        grid-template-columns: 1fr;
    }

    .hero-logo {
        max-width: 280px;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }

    .form-container {
        padding: 1.75rem;
    }

    .whatsapp-float {
        bottom: 1.25rem;
        left: 1.25rem;
        width: 50px;
        height: 50px;
    }

    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 1.25rem; }

    .hero-cta { flex-direction: column; width: 100%; }
    .hero-cta .btn { text-align: center; justify-content: center; }

    .tech-grid { gap: 0.75rem; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .hero-logo { animation: none; }
    .hero-scroll-hint { animation: none; }
    .whatsapp-float { animation: none; }
    .fade-in { opacity: 1; transform: none; transition: none; }
    .tech-item { opacity: 1; transform: none; animation: none; }
}
