/* =====================================================
   JOYPIXEL · SERVICE PILAR PAGES
   ===================================================== */

/* ----- Breadcrumb ----- */
.sp-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8125rem;
    color: var(--muted);
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}
.sp-breadcrumb a { color: var(--muted); text-decoration: none; transition: color .2s; }
.sp-breadcrumb a:hover { color: var(--text); }
.sp-breadcrumb .sp-bc-cur { color: var(--text); }
.sp-breadcrumb .sp-bc-sep { opacity: .3; }

/* ----- Hero ----- */
.sp-hero {
    min-height: 88vh;
    position: relative;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: 50% 20%;
    padding: 10rem 0 7rem;
}

.sp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(6,6,5,.82) 0%,
        rgba(6,6,5,.45) 55%,
        rgba(6,6,5,.96) 100%
    );
}

.sp-hero > .wrap {
    width: 100%;
}

.sp-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.sp-split a {
    color: var(--a);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .25s ease;
}

/* Ocultar hijos del hero hasta que GSAP los anime */
.sp-hero-content > * {
    opacity: 0;
}

.sp-hero-tagline {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    margin: 1.25rem 0;
}

.sp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--a);
    margin-bottom: 1.25rem;
}

.sp-hero-sub {
    font-size: 1.125rem;
    color: rgb(240 239 232 / 68%);
    line-height: 1.72;
    margin: 1.25rem 0 2.5rem;
    max-width: 54ch;
}

/* ----- Shared section spacing ----- */
.sp-section { padding: 3rem 0; }
.sp-section-alt { background: var(--bg2); }
.sp-section-dark { background: var(--bg3); }

.sp-section-header { margin-bottom: 4rem; max-width: 640px; }
.sp-section-header.center { text-align: center; margin-left: auto; margin-right: auto; }

/* ----- Feature cards ----- */
.sp-feat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.sp-feat-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.sp-feat-card {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 2rem 1.75rem;
    position: relative;
    overflow: hidden;
    transition: border-color .3s, transform .35s cubic-bezier(.16,1,.3,1);
}

.sp-feat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: linear-gradient(to bottom, var(--a), var(--a2));
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity .3s;
}

.sp-feat-card:hover { border-color: rgba(233,160,0,.25); transform: translateY(-3px); }
.sp-feat-card:hover::before { opacity: 1; }

.sp-feat-icon {
    width: 42px; height: 42px;
    background: rgba(233,160,0,.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.125rem;
    color: var(--a);
    flex-shrink: 0;
}

.sp-feat-title {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--fd);
    color: var(--text);
    margin-bottom: .5rem;
}

.sp-feat-desc {
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ----- Oblique Cinema Reveal (replaces sp-split) ----- */
.sp-reveal {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
}

.sp-reveal-img {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 62%;
    overflow: hidden;
    clip-path: polygon(16% 0%, 100% 0%, 100% 100%, 0% 100%);
    will-change: clip-path;
    z-index: 1;
}

.sp-reveal-img img {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    display: block;
    will-change: transform;
}

/* Dark gradient veil */
.sp-reveal-veil {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        106deg,
        #060605 20%,
        rgba(6,6,5,.97) 34%,
        rgba(6,6,5,.62) 50%,
        rgba(6,6,5,.10) 66%,
        transparent 80%
    );
}

.sp-reveal.sp-section-dark .sp-reveal-veil {
    background: linear-gradient(
        106deg,
        #161614 20%,
        rgba(22,22,20,.97) 34%,
        rgba(22,22,20,.62) 50%,
        rgba(22,22,20,.10) 66%,
        transparent 80%
    );
}

/* Subtle gold aura behind text */
.sp-reveal::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 48%;
    background: radial-gradient(ellipse at 15% 55%, rgba(233,160,0,.065) 0%, transparent 62%);
    z-index: 1;
    pointer-events: none;
}


/* Gold bar accent before label */
.sp-reveal-text .sec-label::before {
    content: '';
    display: block;
    width: 28px;
    height: 1.5px;
    background: var(--a);
    margin-bottom: .9rem;
    opacity: .65;
}

/* Text block */
.sp-reveal > .wrap {
    position: relative;
    z-index: 4;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.sp-reveal-text {
    max-width: 520px;
    padding: 7rem 0;
}

.sp-reveal-text .sp-tech-grid {
    margin-top: 2rem;
}

/* ----- Process steps ----- */
.sp-process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    position: relative;
}

.sp-process-grid::before {
    content: '';
    position: absolute;
    top: 1.75rem;
    left: calc(0% + 1rem);
    right: calc(0% + 1rem);
    height: 1px;
    background: linear-gradient(90deg, var(--a) 0%, var(--a2) 100%);
    opacity: .25;
}

.sp-process-step { position: relative; }

.sp-process-num {
    width: 3.5rem; height: 3.5rem;
    border: 2px solid rgba(233,160,0,.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .875rem;
    font-weight: 700;
    font-family: var(--fd);
    color: var(--a);
    margin-bottom: 1.25rem;
    background: var(--bg);
    position: relative;
    z-index: 1;
}

.sp-process-step-title {
    font-size: 1.0625rem;
    font-weight: 700;
    font-family: var(--fd);
    color: var(--text);
    margin-bottom: .5rem;
}

.sp-process-step-desc {
    font-size: .875rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ----- Tech pills ----- */
.sp-tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 2rem;
}

.sp-tech-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--bg3);
    border: 1px solid var(--bdr);
    border-radius: 100px;
    padding: .45rem 1rem;
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color .2s;
}

.sp-tech-pill:hover { border-color: rgba(233,160,0,.3); }

/* ----- Stats strip ----- */
.sp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 4rem 0;
}

.sp-stat { text-align: center; }

.sp-stat-num {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    font-family: var(--fd);
    background: linear-gradient(135deg, var(--a), var(--a2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: .5rem;
    display: block;
}

.sp-stat-label {
    font-size: .875rem;
    color: var(--muted);
}

/* ----- FAQ accordion ----- */
.sp-faq-list { max-width: 780px; }

.sp-faq-item { border-bottom: 1px solid var(--bdr); }
.sp-faq-item:first-child { border-top: 1px solid var(--bdr); }

.sp-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--fd);
    list-style: none;
    color: var(--text);
    transition: color .2s;
}

.sp-faq-question::-webkit-details-marker { display: none; }
.sp-faq-question::marker { display: none; }

.sp-faq-icon {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border: 1px solid var(--bdr);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    transition: transform .4s cubic-bezier(.16,1,.3,1), background .2s, border-color .2s, color .2s;
    margin-top: .1rem;
}

.sp-faq-item:hover .sp-faq-icon {
    color: var(--a);
}

details[open] .sp-faq-icon,
.sp-faq-icon.is-open {
    transform: rotate(45deg);
    background: rgba(233,160,0,.15);
    border-color: rgba(233,160,0,.4);
}

.sp-faq-answer {
    overflow: hidden; /* necesario para la animación GSAP de altura */
    color: var(--muted);
    line-height: 1.78;
    font-size: .9375rem;
}

.sp-faq-answer p { padding-bottom: 1.5rem; margin: 0; }

/* ----- CTA band ----- */
.sp-cta-band {
    background: linear-gradient(135deg, rgba(233,160,0,.07), rgba(255,104,53,.05));
    border: 1px solid rgba(233,160,0,.15);
    border-radius: calc(var(--r) * 1.5);
    padding: 4.5rem;
    text-align: center;
    margin: 2rem 0 5rem;
}

.sp-cta-band-title {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 800;
    font-family: var(--fd);
    margin-bottom: 1rem;
}

.sp-cta-band-sub {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 52ch;
    margin-left: auto; margin-right: auto;
}

/* ----- Service-specific: checklist ----- */
.sp-checklist {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sp-check-item {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1rem 1.25rem;
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
}

.sp-check-icon {
    width: 20px; height: 20px;
    background: rgba(233,160,0,.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-top: .1rem;
    color: var(--a);
}

.sp-check-text {
    font-size: .9rem;
    color: var(--text);
    line-height: 1.5;
}

/* ----- Service-specific: plan cards ----- */
.sp-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.sp-plan-card {
    background: var(--bg2);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    transition: border-color .3s, transform .3s;
}

.sp-plan-card.featured {
    border-color: rgba(233,160,0,.4);
    background: linear-gradient(160deg, rgba(233,160,0,.06), var(--bg2));
}

.sp-plan-card:hover { transform: translateY(-4px); }

.sp-plan-tag {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .875rem;
}

.sp-plan-card.featured .sp-plan-tag { color: var(--a); }

.sp-plan-name {
    font-size: 1.375rem;
    font-weight: 800;
    font-family: var(--fd);
    color: var(--text);
    margin-bottom: 1.5rem;
}

.sp-plan-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .625rem;
    margin-bottom: 2rem;
    flex: 1;
}

.sp-plan-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    font-size: .875rem;
    color: var(--muted);
}

.sp-plan-item::before {
    content: '';
    width: 5px; height: 5px;
    background: var(--a);
    border-radius: 50%;
    flex-shrink: 0;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .sp-feat-grid { grid-template-columns: repeat(2, 1fr); }
    .sp-process-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem; }
    .sp-process-grid::before { display: none; }
    .sp-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sp-plans-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sp-hero { min-height: 100dvh; padding: 8rem 0 5rem; align-items: flex-end; }
    .sp-section-header { margin-bottom: 2.5rem; }
    .sp-feat-grid,
    .sp-feat-grid-2 { grid-template-columns: 1fr; gap: 1rem; }
    .sp-process-grid { grid-template-columns: 1fr; gap: 2rem; }
    .sp-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; padding: 3rem 0; margin-bottom: 3rem; }
    .sp-cta-band { padding: 2.5rem 1.5rem; }
    .sp-checklist { grid-template-columns: 1fr; }
    .sp-plans-grid { grid-template-columns: 1fr; }

    /* Oblique Reveal mobile */
    .sp-reveal-img {
        position: relative;
        right: auto; top: auto; bottom: auto;
        width: 100%;
        height: 260px;
        clip-path: none;
        overflow: hidden;
    }
    .sp-reveal-img img {
        inset: 0;
        width: 100%; height: 100%;
    }
    .sp-reveal-img::after {
        content: '';
        position: absolute;
        bottom: 0; left: 0; right: 0;
        height: 100px;
        background: linear-gradient(to bottom, transparent, var(--bg));
        z-index: 2;
    }
    .sp-reveal.sp-section-dark .sp-reveal-img::after {
        background: linear-gradient(to bottom, transparent, var(--bg3));
    }
    .sp-reveal-veil { display: none; }
    .sp-reveal::before { display: none; }
    .sp-reveal > .wrap { min-height: auto; display: block; }
    .sp-reveal-text { padding: 2.5rem 0 4rem; max-width: 100%; }
    .sp-reveal-text .sec-label::before { display: none; }
}

/* ==========================================================
   DATA REVEAL PANEL — reemplaza .sp-reveal-img en las 6
   páginas de servicios. Anillos orbitales + stats animados.
   ========================================================== */

.sp-reveal-data {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 62%;
    overflow: hidden;
    clip-path: polygon(16% 0%, 100% 0%, 100% 100%, 0% 100%);
    will-change: clip-path;
    z-index: 1;
    display: flex;
    align-items: center;
}

/* Fondo oscuro base */
.sp-rdata-bg {
    position: absolute;
    inset: 0;
    background: #080807;
}

/* Textura de cuadrícula dorada */
.sp-rdata-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(233,160,0,.046) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233,160,0,.046) 1px, transparent 1px);
    background-size: 58px 58px;
    -webkit-mask-image: radial-gradient(ellipse 88% 82% at 64% 50%,
        rgba(0,0,0,.88) 0%, rgba(0,0,0,.3) 64%, transparent 100%);
    mask-image: radial-gradient(ellipse 88% 82% at 64% 50%,
        rgba(0,0,0,.88) 0%, rgba(0,0,0,.3) 64%, transparent 100%);
}

/* ── Anillos orbitales ── */
.sp-rdata-orbs {
    position: absolute;
    right: 7%;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.sp-rdata-ring {
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 50%;
    animation: rdataOrbit linear infinite;
    will-change: transform;
}

.sp-rdata-ring-lg {
    width: 320px; height: 320px;
    margin: -160px 0 0 -160px;
    border: 1px solid rgba(233,160,0,.11);
    animation-duration: 52s;
}
.sp-rdata-ring-lg::after {
    content: '';
    position: absolute;
    top: 50%; left: 0;
    transform: translateY(-50%);
    margin-left: -4px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--a);
    box-shadow: 0 0 0 3px rgba(233,160,0,.14), 0 0 14px rgba(233,160,0,.5);
}

.sp-rdata-ring-md {
    width: 210px; height: 210px;
    margin: -105px 0 0 -105px;
    border: 1px solid rgba(255,104,53,.14);
    animation-duration: 32s;
    animation-direction: reverse;
}
.sp-rdata-ring-md::after {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    margin-top: -3.5px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--a2);
    box-shadow: 0 0 0 2px rgba(255,104,53,.18), 0 0 10px rgba(255,104,53,.5);
}

.sp-rdata-ring-sm {
    width: 110px; height: 110px;
    margin: -55px 0 0 -55px;
    border: 1px solid rgba(233,160,0,.26);
    animation-duration: 18s;
}
.sp-rdata-ring-sm::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    margin-bottom: -2.5px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--a);
    box-shadow: 0 0 8px rgba(233,160,0,.65);
}

/* Núcleo central pulsante */
.sp-rdata-core {
    position: absolute;
    top: 0; left: 0;
    width: 28px; height: 28px;
    margin: -14px 0 0 -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233,160,0,.38) 0%, rgba(233,160,0,.07) 60%, transparent 100%);
    box-shadow: 0 0 0 1px rgba(233,160,0,.14), 0 0 20px rgba(233,160,0,.22), 0 0 48px rgba(233,160,0,.07);
    animation: rdataCorePulse 3.5s ease-in-out infinite;
    will-change: transform, opacity;
}

@keyframes rdataOrbit {
    to { transform: rotate(360deg); }
}
@keyframes rdataCorePulse {
    0%, 100% { opacity: .6;  transform: scale(1); }
    50%       { opacity: 1;  transform: scale(1.5); }
}

@media (prefers-reduced-motion: reduce) {
    .sp-rdata-ring { animation: none; }
    .sp-rdata-core { animation: none; }
}

/* ── Stats ── */
.sp-rdata-stats {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 0 44% 0 27%;
    width: 100%;
}

.sp-rdata-stat {
    position: relative;
    padding: 1.875rem 0 1.875rem 1.5rem;
    border-bottom: 1px solid rgba(233,160,0,.1);
}
.sp-rdata-stat:first-child {
    border-top: 1px solid rgba(233,160,0,.1);
}

/* Barra de acento animada por GSAP */
.sp-rdata-bar {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, var(--a), var(--a2));
    border-radius: 2px;
    will-change: height;
}

/* Número grande en gradiente dorado */
.sp-rdata-num {
    display: block;
    font-size: clamp(2.5rem, 3.4vw, 3.75rem);
    font-weight: 900;
    font-family: var(--fd);
    line-height: 1;
    letter-spacing: -.03em;
    background: linear-gradient(110deg, var(--a) 0%, var(--a2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: .625rem;
}

/* Etiqueta descriptiva */
.sp-rdata-lbl {
    font-size: .775rem;
    font-weight: 400;
    color: rgba(240,239,232,.37);
    line-height: 1.5;
    max-width: 26ch;
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* Móvil: ocultar panel — el texto izquierdo lo soporta solo */
@media (max-width: 768px) {
    .sp-reveal-data { display: none; }
}
