/* =========================================================
   OyK Contador Corporativo — Hoja de estilos
   Sistema de diseño basado en tokens (custom properties)
   ========================================================= */

:root {
    /* Paleta institucional: rojo · negro · blanco */
    --navy-900: #161616;   /* negro corporativo (color base oscuro) */
    --navy-800: #0a0a0a;   /* negro más profundo */
    --navy-700: #2b2b2b;   /* gris muy oscuro para degradados */
    --accent: #d2a64c;     /* dorado corporativo */
    --accent-strong: #9d7c39;
    --on-accent: #ffffff;  /* texto sobre rojo/negro */

    /* Superficies y texto */
    --bg: #f6f6f7;
    --surface: #ffffff;
    --surface-alt: #f0f0f1;
    --text: #171717;
    --text-muted: #5c5c5c;
    --border: #e3e3e5;

    /* Tipografía */
    --font: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;

    /* Espaciado y forma */
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.14);
    --container: 1120px;

    --transition: 0.25s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0d0e;
        --surface: #1a1a1c;
        --surface-alt: #232326;
        --text: #f0f0f1;
        --text-muted: #a6a6aa;
        --border: #2e2e31;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    font-family: var(--font);
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* ---------- Utilidades ---------- */
.container {
    width: min(90%, var(--container));
    margin-inline: auto;
}

.section {
    padding: clamp(56px, 8vw, 96px) 0;
}

.section-head {
    text-align: center;
    max-width: 620px;
    margin: 0 auto clamp(36px, 5vw, 56px);
}

.section-head h2,
.about-inner h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    color: var(--text);
}

.section-head p {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 14px;
}

.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    top: 0;
    left: 0;
    background: var(--accent);
    color: var(--on-accent);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    z-index: 100;
}
.skip-link:focus {
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    left: 16px;
    top: 16px;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border: 2px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition), background-color var(--transition),
        box-shadow var(--transition), border-color var(--transition);
}
.btn:hover {
    transform: translateY(-2px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 6px 18px rgba(210, 166, 76, 0.35);
}
.btn-primary:hover {
    background-color: var(--accent-strong);
}

.btn-ghost {
    background-color: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}
.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: #fff;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: color-mix(in srgb, var(--navy-900) 92%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}
.brand-logo {
    height: 40px;
    width: auto;
    display: block;
}
.brand-logo-footer {
    height: 46px;
}

.primary-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 28px;
}
.primary-nav a {
    font-weight: 600;
    color: #e4e4e4;
    transition: color var(--transition);
}
.primary-nav a:hover {
    color: var(--accent);
}
.nav-cta {
    padding: 9px 20px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent) !important;
    font-weight: 700;
}
.nav-cta:hover {
    background: var(--accent-strong);
}

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.nav-toggle-bar {
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    color: #fff;
    text-align: center;
    padding: clamp(80px, 12vw, 140px) 0;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-bg-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: grayscale(15%);
    transition: opacity 1.6s ease;
}
.hero-bg-photo.active {
    opacity: 0.32;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(900px 500px at 50% -10%, rgba(210, 165, 76, 0.181), transparent 60%),
        linear-gradient(160deg, rgba(22, 22, 22, 0.251), rgba(43, 43, 43, 0.333));
}

.hero > .container {
    position: relative;
    z-index: 2;
}

.hero-inner {
    max-width: 780px;
}
.hero h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.4rem);
    font-weight: 800;
}
.hero-lead {
    margin: 22px auto 0;
    max-width: 620px;
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: #cccccc;
}
.hero-actions {
    margin-top: 34px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-stats {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 620px;
    margin-inline: auto;
}
.hero-stats dt {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    color: var(--accent);
}
.hero-stats dd {
    font-size: 0.9rem;
    color: #cccccc;
}

/* ---------- Servicios ---------- */
.services {
    background: var(--bg);
}
.service-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.service-item {
    background: var(--surface);
    padding: 32px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition),
        border-color var(--transition);
}
.service-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}
.service-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--surface-alt);
    font-size: 1.6rem;
    margin-bottom: 18px;
}
.service-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text);
}
.service-item p {
    color: var(--text-muted);
}

/* ---------- Sobre nosotros ---------- */
.about {
    background: var(--surface);
}
.about-inner {
    max-width: 760px;
    text-align: center;
}
.about-inner p {
    margin-top: 18px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* ---------- Contacto ---------- */
.contact {
    background: var(--bg);
}
.contact-form {
    max-width: 620px;
    margin-inline: auto;
    display: grid;
    gap: 20px;
    background: var(--surface);
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.field {
    display: grid;
    gap: 7px;
}
.field label {
    font-weight: 600;
    font-size: 0.95rem;
}
.field input,
.field textarea {
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    color: var(--text);
    background: var(--bg);
    resize: vertical;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(210, 166, 76, 0.25);
}
.field.invalid input,
.field.invalid textarea {
    border-color: #e5484d;
}
.field-error {
    min-height: 1em;
    font-size: 0.83rem;
    color: #e5484d;
}
.contact-form .btn {
    justify-self: start;
}
.form-status {
    font-weight: 600;
    min-height: 1.2em;
}
.form-status.success {
    color: #2e9e5b;
}
.form-status.error {
    color: #e5484d;
}

/* ---------- Carrusel de fotos ---------- */
.gallery {
    background: var(--surface);
}
.carousel {
    position: relative;
    max-width: 960px;
    margin-inline: auto;
}
.carousel-viewport {
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
.carousel-track {
    list-style: none;
    display: flex;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.carousel-slide {
    min-width: 100%;
}
.carousel-slide img {
    width: 100%;
    aspect-ratio: 15 / 8;
    object-fit: cover;
}

/* ---------- Tarjeta de servicio dentro del carrusel ---------- */
.service-slide {
    min-height: 420px;
    padding: clamp(32px, 5vw, 56px) clamp(24px, 6vw, 64px);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.service-slide .service-icon {
    margin-bottom: 6px;
}
.service-slide .eyebrow {
    margin-bottom: 6px;
}
.service-slide h3 {
    font-size: clamp(1.3rem, 2.6vw, 1.7rem);
    color: var(--text);
    max-width: 560px;
}
.service-slide-lead {
    margin-top: 14px;
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.02rem;
}
.tag-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
    max-width: 720px;
}
.tag {
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
}
.tag-dark {
    background: var(--navy-900);
    color: #fff;
}
.tag-accent {
    background: var(--accent);
    color: var(--on-accent);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition), transform var(--transition);
}
.carousel-btn:hover {
    background: var(--accent-strong);
    transform: translateY(-50%) scale(1.08);
}
.carousel-prev {
    left: 14px;
}
.carousel-next {
    right: 14px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}
.carousel-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: background-color var(--transition), transform var(--transition);
}
.carousel-dot.active {
    background: var(--accent);
    transform: scale(1.25);
}

/* ---------- "Confían en nosotros" (marquee de logos) ---------- */
.trust {
    background: var(--bg);
}
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 45s linear infinite;
}
.marquee:hover .marquee-track {
    animation-play-state: paused;
}
.marquee-group {
    display: flex;
    align-items: center;
    gap: clamp(40px, 6vw, 80px);
    padding-inline: clamp(20px, 3vw, 40px);
}
.marquee .logo {
    height: 72px;
    width: auto;
    opacity: 0.95;
    transition: opacity var(--transition), transform var(--transition);
}
.marquee .logo:hover {
    opacity: 1;
    transform: scale(1.06);
}
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy-900);
    color: #cccccc;
    padding: 40px 0;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.site-footer .brand {
    color: #fff;
}
.site-footer nav {
    display: flex;
    gap: 24px;
}
.site-footer nav a {
    color: #cccccc;
    transition: color var(--transition);
}
.site-footer nav a:hover {
    color: var(--accent);
}
.copyright {
    font-size: 0.88rem;
    width: 100%;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Redes sociales (footer) ---------- */
.social {
    list-style: none;
    display: flex;
    gap: 12px;
}
.social a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transition: background-color var(--transition), transform var(--transition),
        color var(--transition);
}
.social a:hover {
    background: var(--accent);
    color: var(--on-accent);
    transform: translateY(-3px);
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-fab {
    position: fixed;
    right: clamp(16px, 4vw, 28px);
    bottom: clamp(16px, 4vw, 28px);
    z-index: 60;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    color: #fff;
    background: #25d366;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fab-pop 0.4s ease both;
}
.whatsapp-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.6);
}
@keyframes fab-pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ---------- Animación de aparición ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

/* ---------- Responsive: menú móvil ---------- */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .primary-nav {
        position: fixed;
        inset: 72px 0 auto 0;
        background: var(--navy-800);
        transform: translateY(-120%);
        visibility: hidden;
        pointer-events: none;
        transition: transform var(--transition), visibility var(--transition);
        box-shadow: var(--shadow-md);
    }
    .primary-nav.open {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }
    .primary-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 0;
    }
    .primary-nav li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
    .primary-nav a {
        display: block;
        padding: 16px 24px;
    }
    .nav-cta {
        border-radius: 0;
        text-align: center;
    }
}

/* ---------- Respeta reducción de movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}
