:root {
    --bg: #f8fbff;
    --surface: #ffffff;
    --surface-muted: #eef5ff;
    --text: #122033;
    --text-soft: #526277;
    --line: #dbe6f2;
    --brand: #0f7bff;
    --brand-dark: #0b5fcc;
    --accent: #12b981;
    --shadow: 0 24px 60px rgba(15, 35, 64, 0.12);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --max-width: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(15, 123, 255, 0.10), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, #ffffff 24%, #f4f8fd 100%);
    color: var(--text);
    line-height: 1.65;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    background: var(--text);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    z-index: 10001;
    text-decoration: none;
}

.skip-link:focus {
    top: 16px;
}

.container {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.site-main {
    overflow: hidden;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(219, 230, 242, 0.8);
}

.site-header .container {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo a {
    text-decoration: none;
}

.logo-text {
    display: inline-flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

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

#logo-text {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#logo-text.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    background: var(--surface-muted);
    color: var(--brand-dark);
}

.idioma-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    color: var(--text-soft);
}

.idioma-selector a {
    min-height: auto;
    padding: 8px 10px;
    font-size: 0.92rem;
}

.idioma-selector a.active {
    color: var(--brand-dark);
    font-weight: 700;
}

#loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loader-text {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 800;
    color: var(--text);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

#loader-text span {
    opacity: 0;
    transform: translateY(24px);
    animation: letterIn 0.5s forwards;
}

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

#loader-text span:nth-child(1) { animation-delay: 0s; }
#loader-text span:nth-child(2) { animation-delay: 0.04s; }
#loader-text span:nth-child(3) { animation-delay: 0.08s; }
#loader-text span:nth-child(4) { animation-delay: 0.12s; }
#loader-text span:nth-child(5) { animation-delay: 0.16s; }
#loader-text span:nth-child(6) { animation-delay: 0.20s; }
#loader-text span:nth-child(7) { animation-delay: 0.24s; }
#loader-text span:nth-child(8) { animation-delay: 0.28s; }
#loader-text span:nth-child(9) { animation-delay: 0.32s; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
}

.section-header {
    max-width: 720px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    margin-top: 14px;
}

.section-header p:last-child {
    margin-top: 16px;
    color: var(--text-soft);
    font-size: 1.05rem;
}

[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

a.button,
a.button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 14px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, #3f98ff 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 14px 30px rgba(15, 123, 255, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

a.button:hover,
a.button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(15, 123, 255, 0.24);
}

.button-secondary,
.button-secondary:visited {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: var(--surface);
    color: var(--brand-dark);
}

.site-footer {
    margin-top: 40px;
    padding: 56px 0 24px;
    background: #0f172a;
    color: rgba(255, 255, 255, 0.82);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.footer-links,
.footer-contact {
    display: grid;
    gap: 10px;
}

.footer-links a,
.footer-contact a,
.site-footer a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #7dc3ff;
}

.footer-bottom {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 20px;
    font-size: 0.95rem;
}

body::-webkit-scrollbar {
    width: 8px;
}

body::-webkit-scrollbar-track {
    background: transparent;
}

body::-webkit-scrollbar-thumb {
    background-color: rgba(15, 123, 255, 0.34);
    border-radius: 999px;
}

@media (max-width: 920px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-header .container {
        min-height: 74px;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 10px);
        left: 16px;
        right: 16px;
        display: none;
        padding: 16px;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--line);
        border-radius: 24px;
        box-shadow: var(--shadow);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: stretch;
    }

    .main-nav a {
        justify-content: flex-start;
        border-radius: 14px;
    }

    .idioma-selector {
        margin-left: 0;
        padding: 8px 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(var(--max-width), calc(100% - 24px));
    }

    .logo-text {
        font-size: 1.55rem;
    }

    #loader-text {
        max-width: 220px;
        text-align: center;
    }

    .footer-bottom {
        font-size: 0.9rem;
    }
}

@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;
    }
}
