:root {
    --primary: #004aad;
    --secondary: #00a8e8;
    --dark: #0f172a;
    --muted: #64748b;
    --bg: #f4f7fb;
    --header-bg: rgba(15, 23, 42, 0.97);
    --header-tab-bg: #00a8e8;
    --header-text: #94a3b8;
    --header-text-active: #ffffff;
    --header-border: rgba(255, 255, 255, 0.06);
    --header-tab-hover: rgba(255, 255, 255, 0.05);
    --header-tab-shadow: rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 10% auto auto 55%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(0, 168, 232, 0.25), transparent 60%);
    filter: blur(5px);
    z-index: -1;
}

section,
.hero {
    scroll-margin-top: 120px;
}

/* ===== REVEAL ANIMATIONS ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--reveal-delay, 0s);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { --reveal-delay: 0.15s; }
.delay-2 { --reveal-delay: 0.3s; }
.delay-3 { --reveal-delay: 0.45s; }
.delay-4 { --reveal-delay: 0.6s; }

/* ================================================================
   CHROME-STYLE TABS NAVIGATION
   ================================================================ */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    color: white;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

nav {
    display: flex;
    align-items: flex-end;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 58px;
    position: relative;
}

/* --- Logo --- */
.logo {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 0.6rem 0.8rem 0.55rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 250ms ease;
}
.logo:hover { color: var(--header-text-active); }
.logo img {
    height: 32px;
    width: auto;
    display: block;
}
.logo span a {
    color: inherit;
    text-decoration: none;
    transition: color 250ms ease;
}
.logo span a:hover {
    color: var(--header-text-active);
}

/* --- Tab bar container --- */
.nav-tabs {
    display: flex;
    align-items: flex-end;
    margin-left: 12.75rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

/* --- Individual tab --- */
.nav-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--header-text);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    border: none;
    background: transparent;
    border-radius: 10px 10px 0 0;
    margin-top: 5px;
    user-select: none;
    flex-shrink: 0;
    transition:
        color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        background 250ms cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 250ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inactive hover */
.nav-tab:not(.active):hover {
    color: var(--header-text-active);
    background: var(--header-tab-hover);
    margin-top: 2px;
}

/* Active tab */
.nav-tab.active {
    color: var(--header-text-active);
    background: var(--header-tab-bg);
    margin-top: 0;
    z-index: 2;
    box-shadow:
        0 -2px 6px var(--header-tab-shadow),
        0 -1px 2px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Active tab curved "fin" — Chrome tab shape */
.nav-tab.active::before,
.nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 0px;
    height: 0px;
    background: transparent;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-tab.active::before {
    left: -12px;
    border-bottom-right-radius: 12px;
    box-shadow: 4px -4px 0 var(--header-tab-bg);
}
.nav-tab.active::after {
    right: -12px;
    border-bottom-left-radius: 12px;
    box-shadow: -4px -4px 0 var(--header-tab-bg);
}

/* Active tab covers bottom separator */
.nav-tab.active {
    border-bottom: 1px solid var(--header-tab-bg);
    margin-bottom: -1px;
    padding-bottom: calc(0.6rem + 1px);
}

/* Tab SVG icon sizing */
.tab-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 250ms ease;
}
.nav-tab:hover .tab-icon,
.nav-tab.active .tab-icon {
    opacity: 1;
}

/* Bottom separator line behind tabs */
nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--header-border);
    z-index: 1;
}

/* --- Hamburger (mobile) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
    flex-shrink: 0;
    z-index: 10;
}
.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--header-text);
    border-radius: 2px;
    transition: all 250ms ease;
}
.menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
    background: var(--header-text-active);
}
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    background: var(--header-text-active);
}

/* --- Mobile dropdown --- */
.mobile-nav {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 0.5rem;
    z-index: 999;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    animation: mobileSlideDown 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-nav.open { display: block; }

@keyframes mobileSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1rem;
    color: var(--header-text);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 250ms ease;
}
.mobile-nav a:hover,
.mobile-nav a.active {
    color: var(--header-text-active);
    background: var(--header-tab-hover);
}
.mobile-nav .tab-icon {
    width: 16px;
    height: 16px;
}

/* ===== HERO ===== */
.hero {
    min-height: 80vh;
    padding: 2rem 5vw 4rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(70, 72, 73, 0.95), rgba(238, 241, 241, 0.9)),
                url('https://images.unsplash.com/photo-1520607162513-77705c0f0d4a?auto=format&fit=crop&w=1600&q=80') center/cover;
    color: white;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    max-width: 540px;
    margin-bottom: 1.5rem;
}

.hero-content {
    max-width: 700px;
}

/* ===== BUTTONS ===== */
.cta {
    display: inline-flex;
    gap: 0.75rem;
}

.btn {
    border: none;
    padding: 0.95rem 1.75rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: white;
    color: var(--primary);
    box-shadow: 0 12px 25px rgba(255, 255, 255, 0.2);
}

.btn-outline {
    border: 1px solid white;
    color: white;
    background: transparent;
}

.btn:hover {
    transform: translateY(-2px);
}

/* ===== SECTIONS ===== */
section {
    padding: 4rem 5vw;
}

.section-title {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: clamp(2rem, 3vw, 2.4rem);
    margin-bottom: 1rem;
}

/* ===== METRICS ===== */
.metrics {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.metric {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
    transition: transform 250ms ease, box-shadow 250ms ease;
}

.metric:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 45px rgba(15, 23, 42, 0.14);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.metric-label {
    font-size: 0.95rem;
    color: var(--muted);
}

/* ===== GRID ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

/* ===== CARDS ===== */
.card {
    background: white;
    padding: 1.75rem;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.15);
}

/* ===== SERVICES ===== */
.services {
    background: white;
}

.services .card h3 {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.services .card h3::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    flex-shrink: 0;
}

/* ===== TIMELINE ===== */
.timeline {
    border-left: 3px solid var(--secondary);
    margin-top: 1.5rem;
    padding-left: 1.5rem;
}

.timeline-step {
    margin-bottom: 1.5rem;
    padding: 0.25rem 0 0.25rem 0;
    transition: transform 0.25s ease, color 0.25s ease;
}

.timeline-step h4 {
    margin-bottom: 0.35rem;
    color: var(--primary);
}

.timeline-step:hover {
    transform: translateX(6px);
}

/* ===== CONTACT ===== */
#contacto-mp {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    background: var(--bg);
}

.contact {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--dark);
    color: white;
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.contact ul {
    list-style: none;
    margin-top: 1.5rem;
    line-height: 1.8;
}

.contact ul li strong {
    color: var(--secondary);
}

/* ===== FORM ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input,
textarea {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

input:hover,
textarea:hover,
input:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 14px 30px rgba(0, 74, 173, 0.2);
    transform: translateY(-2px);
}

#form-status {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}
#form-status.success { color: #22c55e; }
#form-status.error { color: #ef4444; }

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem 5vw 3rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ===== FLOATING CTA ===== */
.floating-cta {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    background: var(--primary);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 20px 35px rgba(0, 74, 173, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 45px rgba(0, 74, 173, 0.4);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* --- Tablet (max 768px) --- */
@media (max-width: 768px) {
    nav {
        padding: 0 1.25rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    section {
        padding: 3.5rem 4vw;
    }

    .contact {
        padding: 2.5rem;
        border-radius: 20px;
    }
}

/* --- Mobile (max 600px) --- */
@media (max-width: 600px) {
    /* Hide desktop tabs, show hamburger */
    .nav-tabs { display: none; }
    .menu-toggle { display: flex; }

    nav {
        height: 54px;
    }

    .logo {
        font-size: 0.9rem;
        padding: 0.5rem 0.5rem 0.5rem 0;
    }
    .logo img {
        height: 28px;
    }

    section {
        padding: 3rem 1rem;
    }

    .hero {
        min-height: 70vh;
        padding: 5rem 1rem 3rem;
        text-align: center;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
        max-width: 100%;
    }

    .cta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn {
        padding: 0.8rem 1.4rem;
        font-size: 0.9rem;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .metric {
        padding: 1.25rem 1rem;
        border-radius: 14px;
    }
    .metric-value {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 14px;
    }

    h2 {
        font-size: 1.4rem;
    }

    .contact {
        padding: 1.75rem;
        border-radius: 16px;
    }

    input,
    textarea {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }

    .floating-cta {
        right: 1rem;
        bottom: 1.25rem;
        font-size: 0.85rem;
        padding: 0.7rem 1.2rem;
    }

    .pill {
        font-size: 0.82rem;
        padding: 0.5rem 1.1rem;
    }
}

/* --- Small mobile (max 380px) --- */
@media (max-width: 380px) {
    .logo span { display: none; }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .metric-value { font-size: 1.3rem; }

    .metric-label { font-size: 0.8rem; }

    .card { padding: 1rem; }

    .contact { padding: 1.25rem; }
}

/* --- Wide nav overflow (min 1200px) --- */
@media (min-width: 1200px) {
    .nav-tabs {
        flex-wrap: nowrap;
    }
}
