/* ============================================================
   SECCIÓN SERVICIOS — rubenpantxo.com
   Estética editorial oscura (inspiración: Bang & Olufsen,
   O'Neill by Evan Kosowski). Usa patrones CSS modernos:
   - Scroll-driven Animations (animation-timeline: view/scroll)
   - View Transition API (::view-transition-*)
   - @property + conic-gradient animado
   ============================================================ */

/* ---------- Animación global de View Transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
    ::view-transition-old(root) { animation: sv-vt-out .3s ease both; }
    ::view-transition-new(root) { animation: sv-vt-in .5s cubic-bezier(.16, 1, .3, 1) both; }
}
@keyframes sv-vt-in  { from { opacity: 0; transform: translateY(26px) scale(.992); } }
@keyframes sv-vt-out { to   { opacity: 0; transform: translateY(-18px) scale(1.004); } }

/* ============================================================
   LIENZO OSCURO
   ============================================================ */
#servicios {
    --sv-bg: #0a0a0f;
    --sv-surface: #14141d;
    --sv-surface-2: #1b1b27;
    --sv-text: #f4f3ee;
    --sv-muted: #9a99a8;
    --sv-line: rgba(255, 255, 255, .09);
    --sv-violet: #7c6cff;
    --sv-rose: #ff5e82;
    --sv-amber: #ffb648;
    --sv-mint: #4ce0b3;
}
#servicios .sv-wrap {
    position: relative;
    background:
        radial-gradient(900px 480px at 85% -5%, rgba(124, 108, 255, .16), transparent 60%),
        radial-gradient(700px 420px at -10% 35%, rgba(255, 94, 130, .08), transparent 55%),
        var(--sv-bg);
    color: var(--sv-text);
    border-radius: 34px;
    overflow: hidden;
    padding: clamp(2.4rem, 5vw, 4.5rem) clamp(1.1rem, 4vw, 3.5rem) clamp(2.5rem, 5vw, 4rem);
    box-shadow: 0 30px 80px rgba(10, 10, 25, .35);
}
#servicios ::selection { background: var(--sv-violet); color: #fff; }

/* ---------- Barra de progreso de scroll ---------- */
.sv-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 500;
    background: linear-gradient(90deg, var(--sv-violet), var(--sv-rose), var(--sv-amber));
    transform-origin: 0 50%;
    transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
    .sv-progress {
        animation: sv-grow-x linear both;
        animation-timeline: scroll(root);
    }
}
@keyframes sv-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================================================
   HERO
   ============================================================ */
.sv-hero { text-align: left; }
.sv-eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 12px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
    color: var(--sv-muted);
}
.sv-eyebrow::before {
    content: ''; width: 34px; height: 1px; background: var(--sv-violet);
}
.sv-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.2rem, 6.5vw, 4.6rem);
    font-weight: 900;
    letter-spacing: -.035em;
    line-height: .98;
    margin-top: .35rem;
    background: linear-gradient(100deg, #fff 30%, #b9b3ff 65%, var(--sv-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-wrap: balance;
}
.sv-sub {
    max-width: 52ch;
    margin-top: 1.2rem;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.65;
    color: var(--sv-muted);
    text-wrap: pretty;
}
.sv-sub strong { color: var(--sv-text); font-weight: 700; }
.sv-slogan {
    max-width: 56ch;
    margin-top: 1.4rem;
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    line-height: 1.6;
    color: var(--sv-text);
    font-weight: 500;
    text-wrap: pretty;
}

/* ---------- Marquee infinito (guiño O'Neill) ---------- */
.sv-marquee {
    margin: clamp(1.8rem, 4vw, 3rem) calc(clamp(1.1rem, 4vw, 3.5rem) * -1) 0;
    padding-block: .9rem;
    border-block: 1px solid var(--sv-line);
    overflow: hidden;
    white-space: nowrap;
    user-select: none;
}
.sv-marquee-track {
    display: inline-flex;
    animation: sv-marquee 30s linear infinite;
    will-change: transform;
}
.sv-marquee-track span {
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, .38);
    padding-right: .5em;
}
.sv-marquee-track span em {
    font-style: normal;
    -webkit-text-stroke: 0;
    color: var(--sv-violet);
}
@keyframes sv-marquee { to { transform: translateX(-50%); } }

/* ============================================================
   LEY DE JAKOB
   ============================================================ */
.sv-jakob {
    position: relative;
    margin: clamp(3rem, 7vw, 5.5rem) auto 0;
    max-width: 880px;
    padding: clamp(1.6rem, 4vw, 3rem) clamp(1.2rem, 4vw, 3rem);
    border: 1px solid var(--sv-line);
    border-radius: 26px;
    background: linear-gradient(160deg, rgba(124, 108, 255, .09), rgba(255, 255, 255, .02) 55%);
    text-align: center;
}
.sv-jakob-mark {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(4rem, 9vw, 6.5rem);
    line-height: .4;
    margin-bottom: .6rem;
    background: linear-gradient(135deg, var(--sv-violet), var(--sv-rose));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.sv-jakob-text {
    font-size: clamp(1.25rem, 3.2vw, 2rem);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -.015em;
    text-wrap: balance;
}
.sv-jakob-text em { font-style: normal; color: var(--sv-violet); }
.sv-jakob-author {
    margin-top: 1.1rem;
    font-family: 'Kalam', cursive;
    font-size: 1.05rem;
    color: var(--sv-amber);
}
.sv-jakob-author span { color: var(--sv-muted); font-size: .85em; }
.sv-jakob-note {
    max-width: 56ch;
    margin: 1.4rem auto 0;
    font-size: .95rem;
    line-height: 1.7;
    color: var(--sv-muted);
    text-wrap: pretty;
}
.sv-jakob-note strong { color: var(--sv-text); }

/* ============================================================
   QUÉ OFREZCO — tarjetas con borde cónico animado
   ============================================================ */
@property --sv-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}
.sv-offer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
    gap: 18px;
    margin-top: clamp(2.6rem, 6vw, 4.5rem);
}
.sv-offer-card {
    position: relative;
    border-radius: 22px;
    padding: clamp(1.4rem, 3vw, 2.1rem);
    border: 1px solid transparent;
    background:
        linear-gradient(var(--sv-surface), var(--sv-surface)) padding-box,
        conic-gradient(from var(--sv-angle),
            rgba(124, 108, 255, .8), rgba(255, 94, 130, .5),
            rgba(76, 224, 179, .5), rgba(124, 108, 255, .8)) border-box;
}
@media (prefers-reduced-motion: no-preference) {
    .sv-offer-card { animation: sv-spin 7s linear infinite; }
}
@keyframes sv-spin { to { --sv-angle: 360deg; } }
.sv-offer-card .ico {
    display: inline-grid; place-items: center;
    width: 52px; height: 52px; border-radius: 16px; font-size: 26px;
    background: var(--sv-surface-2); border: 1px solid var(--sv-line);
}
.sv-offer-card h3 {
    font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin-top: 1rem;
}
.sv-offer-card > p { font-size: .92rem; line-height: 1.65; color: var(--sv-muted); margin-top: .5rem; }
.sv-offer-card ul { list-style: none; margin-top: 1rem; padding: 0; display: grid; gap: .45rem; }
.sv-offer-card li {
    font-size: .88rem; color: var(--sv-text);
    display: flex; gap: .55rem; align-items: baseline;
}
.sv-offer-card li::before { content: '→'; color: var(--sv-violet); font-weight: 800; }

/* ============================================================
   SHOWCASE: 5 SIMULACIONES
   ============================================================ */
.sv-demos { margin-top: clamp(3.5rem, 8vw, 6rem); }
.sv-demos-head { text-align: center; max-width: 720px; margin: 0 auto; }
.sv-demos-head h3 {
    font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 900; letter-spacing: -.03em;
    text-wrap: balance;
}
.sv-demos-head h3 em { font-style: normal; color: var(--sv-violet); }
.sv-demos-head h3 .sv-demos-l1 { display: block; color: #fff; }
.sv-demos-head h3 .sv-demos-l2 { display: block; color: var(--sv-violet); }
.sv-demos-head p { margin-top: .8rem; font-size: 1rem; line-height: 1.7; color: var(--sv-muted); }
.sv-demos-head .sv-touch {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 1rem;
    font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--sv-mint); border: 1px solid rgba(76, 224, 179, .35);
    padding: 8px 16px; border-radius: 999px;
}

.sv-case {
    --accent: var(--sv-violet);
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.6rem, 4vw, 3.5rem);
    align-items: center;
    margin-top: clamp(3rem, 7vw, 5.5rem);
    padding-top: clamp(2rem, 5vw, 3.5rem);
    border-top: 1px solid var(--sv-line);
}
@media (min-width: 880px) {
    .sv-case { grid-template-columns: 1.05fr .95fr; }
    .sv-case:nth-of-type(even) .sv-case-info  { order: 2; }
    .sv-case:nth-of-type(even) .sv-case-stage { order: 1; }
}
.sv-case-num {
    font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 900; line-height: 1;
    color: transparent; -webkit-text-stroke: 1.5px var(--accent);
}
.sv-case-chip {
    display: inline-block; margin-top: .9rem;
    font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    padding: 6px 12px; border-radius: 999px;
}
.sv-case-info h4 {
    font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; letter-spacing: -.025em;
    margin-top: .8rem; text-wrap: balance;
}
.sv-case-info > p {
    margin-top: .7rem; font-size: .98rem; line-height: 1.7; color: var(--sv-muted); text-wrap: pretty;
}
.sv-case-ux { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: .55rem; }
.sv-case-ux li {
    display: flex; gap: .6rem; align-items: baseline;
    font-size: .9rem; color: var(--sv-text);
}
.sv-case-ux li::before { content: '✓'; color: var(--accent); font-weight: 900; flex: 0 0 auto; }
.sv-case-open {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 1.4rem;
    font-size: .88rem; font-weight: 800; color: #0d0d12; text-decoration: none;
    background: var(--accent); padding: 12px 20px; border-radius: 999px;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 35%, transparent);
}
.sv-case-open:hover { transform: translateY(-2px); box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---------- Mockup de móvil ---------- */
.sv-case-stage { display: grid; place-items: center; }
.sv-phone {
    position: relative;
    width: min(340px, 86vw);
    aspect-ratio: 9 / 18.5;
    border-radius: 46px;
    padding: 11px;
    background: linear-gradient(160deg, #23232e, #101016);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow:
        0 40px 90px rgba(0, 0, 0, .55),
        inset 0 1px 0 rgba(255, 255, 255, .12);
}
.sv-phone::before {
    content: '';
    position: absolute; inset: -22px; z-index: -1; border-radius: 60px;
    background: conic-gradient(from var(--sv-angle), var(--accent), transparent 35%, var(--accent) 70%, transparent);
    filter: blur(34px); opacity: .35;
}
@media (prefers-reduced-motion: no-preference) {
    .sv-phone::before { animation: sv-spin 9s linear infinite; }
}
.sv-phone-island {
    position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
    width: 86px; height: 21px; border-radius: 999px; background: #0a0a0e; z-index: 3;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.sv-phone iframe {
    width: 100%; height: 100%; border: 0; border-radius: 36px;
    background: #fff; display: block;
}
.sv-phone-hint {
    margin-top: 1rem; text-align: center;
    font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--sv-muted);
}

/* ============================================================
   CONTACTO
   ============================================================ */
.sv-contact {
    margin-top: clamp(3.5rem, 8vw, 6rem);
    padding: clamp(1.8rem, 5vw, 3.2rem);
    border-radius: 28px;
    border: 1px solid var(--sv-line);
    background:
        radial-gradient(600px 300px at 90% 0%, rgba(124, 108, 255, .18), transparent 60%),
        var(--sv-surface);
    display: grid;
    gap: clamp(1.6rem, 4vw, 3rem);
}
@media (min-width: 880px) { .sv-contact { grid-template-columns: 1fr 1.1fr; } }
.sv-contact-intro h3 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem); font-weight: 900; letter-spacing: -.03em;
    line-height: 1.1; text-wrap: balance;
}
.sv-contact-intro h3 em { font-style: normal; color: var(--sv-violet); }
.sv-contact-intro p { margin-top: .9rem; font-size: .97rem; line-height: 1.7; color: var(--sv-muted); }
.sv-contact-links { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 10px; }
.sv-contact-links a {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .85rem; font-weight: 700; color: var(--sv-text); text-decoration: none;
    border: 1px solid var(--sv-line); background: var(--sv-surface-2);
    padding: 10px 16px; border-radius: 999px;
    transition: border-color .2s, transform .2s;
}
.sv-contact-links a:hover { border-color: var(--sv-violet); transform: translateY(-2px); }

#sv-contact-form { display: grid; gap: 12px; }
#sv-contact-form label {
    font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    color: var(--sv-muted);
}
#sv-contact-form input,
#sv-contact-form select,
#sv-contact-form textarea {
    width: 100%;
    font-family: 'Inter', sans-serif; font-size: .95rem; color: var(--sv-text);
    background: var(--sv-surface-2);
    border: 1.5px solid var(--sv-line); border-radius: 14px;
    padding: 13px 16px; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
#sv-contact-form input:focus,
#sv-contact-form select:focus,
#sv-contact-form textarea:focus {
    border-color: var(--sv-violet);
    box-shadow: 0 0 0 4px rgba(124, 108, 255, .18);
}
#sv-contact-form select { appearance: none; cursor: pointer; }
#sv-contact-form select option { background: var(--sv-surface-2); color: var(--sv-text); }
#sv-contact-form textarea { resize: vertical; min-height: 110px; }
.sv-submit {
    border: none; cursor: pointer; margin-top: .4rem;
    font-family: 'Inter', sans-serif; font-size: 1rem; font-weight: 800; color: #fff;
    background: linear-gradient(120deg, var(--sv-violet), var(--sv-rose));
    padding: 16px; border-radius: 16px;
    box-shadow: 0 12px 36px rgba(124, 108, 255, .35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.sv-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 44px rgba(124, 108, 255, .5); }
.sv-submit:active { transform: scale(.98); }
.sv-form-note { font-size: .78rem; color: var(--sv-muted); text-align: center; }

/* ============================================================
   SCROLL-DRIVEN REVEALS
   (nativo si hay soporte; si no, fallback con IntersectionObserver
   que añade .sv-in desde js/servicios.js)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        #servicios .sv-reveal {
            animation: sv-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 65%;
        }
        #servicios .sv-phone {
            animation: sv-phone-in linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 80%;
        }
    }
    @supports not (animation-timeline: view()) {
        #servicios .sv-reveal {
            opacity: 0;
            transform: translateY(48px);
            transition: opacity .8s ease, transform .9s cubic-bezier(.16, 1, .3, 1);
        }
        #servicios .sv-reveal.sv-in { opacity: 1; transform: none; }
    }
}
@keyframes sv-rise {
    from { opacity: 0; transform: translateY(64px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
@keyframes sv-phone-in {
    from { opacity: 0; transform: translateY(70px) rotate(4deg) scale(.92); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .sv-marquee-track, .sv-offer-card, .sv-phone::before { animation: none !important; }
}
