/* ================= PROYECTOS Y CASOS DE ESTUDIO =================
   /proyectos · /caso-facturalo · /caso-yapecontrol · /caso-portal-vehicular
   Se carga después de styles.css y servicios.css. Solo light. Movimiento: transform/opacity
   y siempre bajo prefers-reduced-motion: no-preference. */

/* ----- Cabecera: página actual ----- */
.sp-nav a[aria-current="page"]{color:var(--purple);background:var(--tint)}

/* ----- Marco de navegador (CSS) ----- */
.cs-browser{background:#fff;border:1px solid var(--line);border-radius:22px;overflow:hidden;box-shadow:0 50px 100px -44px rgba(28,20,80,.38),var(--shadow-sm)}
.cs-bar{display:flex;align-items:center;gap:14px;height:46px;padding:0 18px;background:var(--tint);border-bottom:1px solid var(--line)}
.cs-dots{display:flex;gap:7px;flex-shrink:0}
.cs-dots i{display:block;width:11px;height:11px;border-radius:50%;background:#dcd2ff}
.cs-dots i:nth-child(2){background:#b9a3ff}
.cs-dots i:nth-child(3){background:#8b5cff}
.cs-url{flex:1;min-width:0;max-width:440px;margin:0 auto;display:flex;align-items:center;justify-content:center;gap:7px;height:28px;padding:0 12px;border-radius:9px;background:#fff;border:1px solid var(--line);font-size:12.5px;font-weight:500;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cs-url svg{width:13px;height:13px;flex-shrink:0;color:var(--green-ink)}
.cs-bar-sp{width:47px;flex-shrink:0}
.cs-view{background:var(--paper)}
.cs-view img{width:100%;height:auto}

/* ----- Hero del caso ----- */
.cs-hero{padding-bottom:88px}
.cs-head{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:20px 64px;align-items:end}
.cs-hero h1{font-size:clamp(40px,5.4vw,72px)}
.cs-h1-type{display:block;margin-top:14px;font-size:clamp(20px,2.1vw,27px);font-weight:600;letter-spacing:-.015em;line-height:1.25;color:var(--ink-2)}
.cs-lead{color:var(--muted);font-size:17px;line-height:1.75}
.cs-tags{list-style:none;display:flex;flex-wrap:wrap;gap:8px;margin-top:22px}
.cs-tag{display:inline-flex;align-items:center;min-height:34px;padding:6px 14px;border-radius:30px;background:#fff;border:1px solid var(--line);font-size:13.5px;font-weight:600;color:var(--ink-2)}
.cs-tag--type{background:var(--ink);border-color:var(--ink);color:#fff}
.cs-head .sp-actions{margin-top:26px}
.cs-shot{position:relative;z-index:1;margin:56px 0 0}
.cs-shot--tall{max-width:900px;margin-left:auto;margin-right:auto}
.cs-shot figcaption{margin-top:16px;text-align:center;font-size:13.5px;color:var(--muted);line-height:1.6}
@media(prefers-reduced-motion:no-preference){
  .cs-head-a>*,.cs-head-b>*{animation:spUp .8s var(--ease-out) both}
  .cs-head-a>:nth-child(2){animation-delay:.05s}
  .cs-head-a>:nth-child(3){animation-delay:.1s}
  .cs-head-b>*{animation-delay:.15s}
  .cs-shot .cs-browser{animation:csRise 1s var(--ease-out) .2s both}
}
@keyframes csRise{from{opacity:.3;transform:translateY(36px) scale(.985)}}

/* ----- Ficha ----- */
.cs-ficha-sec{padding:80px 0}
.cs-ficha{background:#fff;border:1px solid var(--line);border-radius:28px;padding:34px 36px;box-shadow:var(--shadow-sm)}
.cs-ficha-t{font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--purple);font-weight:600;margin-bottom:24px}
.cs-dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:26px 30px}
.cs-dl>div{display:flex;flex-direction:column;gap:8px;min-width:0}
.cs-dl>div+div{border-left:1px solid var(--line);padding-left:30px}
.cs-dl dt{display:flex;flex-direction:column;align-items:flex-start;gap:12px;font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.cs-dl dt .cs-ic{width:36px;height:36px;border-radius:11px}
.cs-dl dt .cs-ic svg{width:19px;height:19px}
.cs-dl dd{font-size:15px;line-height:1.6;color:var(--ink);font-weight:500}
.cs-ic{display:grid;place-items:center;flex-shrink:0;width:48px;height:48px;border-radius:14px;background:var(--tint);color:var(--purple)}
.cs-ic svg{width:24px;height:24px}

/* ----- Bloques a dos columnas (reto / Perú) ----- */
.cs-split{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:40px 72px;align-items:center}
.sp-page .cs-split .display{font-size:clamp(30px,3.5vw,44px);line-height:1.1}
.cs-p{margin-top:20px;color:var(--muted);font-size:16.5px;line-height:1.75}
.cs-p a,.cs-note a{color:var(--purple);font-weight:600;text-underline-offset:3px}
.cs-pains{list-style:none;display:grid;gap:18px}
.cs-pain{display:flex;gap:20px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-radius:22px;padding:26px 26px;box-shadow:var(--shadow-sm)}
.cs-pain h3,.cs-feat h3{font-size:18px;color:var(--ink);line-height:1.25;margin-bottom:8px}
.cs-pain p,.cs-feat p{color:var(--muted);font-size:15px;line-height:1.65}

/* ----- Qué construimos ----- */
.cs-feats{list-style:none;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-top:52px}
.cs-feat{background:#fff;border:1px solid var(--line);border-radius:22px;padding:26px 24px;box-shadow:var(--shadow-sm);transition:transform .4s var(--ease),box-shadow .4s var(--ease)}
.cs-feat:hover{transform:translateY(-6px);box-shadow:var(--shadow)}
.cs-feat .cs-ic{margin-bottom:18px}
.cs-feat p{font-size:14.5px}
.cs-src{max-width:720px;margin:28px auto 0;text-align:center;font-size:13.5px;color:var(--muted);line-height:1.6}

/* ----- Por qué importa en Perú ----- */
.cs-why{list-style:none;display:grid;gap:16px;counter-reset:cs}
.cs-why li{counter-increment:cs;display:grid;grid-template-columns:58px minmax(0,1fr);gap:4px 18px;align-items:start;background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px 26px;box-shadow:var(--shadow-sm)}
.cs-why li::before{content:counter(cs,decimal-leading-zero);grid-row:span 2;display:grid;place-items:center;width:58px;height:58px;border-radius:16px;background:linear-gradient(135deg,#8b5cff,#6a2ff0);color:#fff;font-weight:700;font-size:18px}
.cs-why h3{font-size:18px;color:var(--ink);line-height:1.25;align-self:end}
.cs-why p{color:var(--muted);font-size:15px;line-height:1.65}
.cs-note{margin-top:22px;font-size:13.5px;color:var(--muted);line-height:1.6}
.cs-note-box{margin-top:26px;display:flex;gap:16px;align-items:center;background:#fff;border:1px dashed #b9a3ff;border-radius:20px;padding:18px 22px}
.cs-note-box p{font-size:14.5px;color:var(--ink-2);line-height:1.6}
.cs-note-box a{color:var(--purple);font-weight:600;text-underline-offset:3px}

/* ----- Otros casos ----- */
.cs-others{list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;width:100%;max-width:1000px;margin:48px auto 0;text-align:left}
.cs-others>li{display:flex}
.cs-others>li>.pj-card{flex:1}

/* ----- Tarjeta de proyecto (archivo y otros casos) ----- */
.pj-card{position:relative;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:24px;overflow:hidden;box-shadow:var(--shadow-sm);transition:transform .45s var(--ease-out),box-shadow .45s var(--ease)}
.pj-card.is-link:hover,.pj-card.is-link:focus-within{transform:translateY(-8px);box-shadow:var(--shadow)}
.pj-shot{position:relative;background:var(--paper);border-bottom:1px solid var(--line)}
.pj-shot-bar{display:flex;align-items:center;gap:6px;height:26px;padding:0 12px;background:var(--tint);border-bottom:1px solid var(--line)}
.pj-shot-bar i{width:8px;height:8px;border-radius:50%;background:#dcd2ff}
.pj-shot-bar i:nth-child(2){background:#b9a3ff}
.pj-shot-bar i:nth-child(3){background:#8b5cff}
.pj-shot-img{height:200px;overflow:hidden}
.pj-shot-img img{width:100%;height:100%;object-fit:cover;object-position:top center;transition:transform .6s var(--ease)}
.pj-card.is-link:hover .pj-shot-img img{transform:scale(1.04)}
.pj-shot-img--contain{display:grid;place-items:center;background:var(--paper);padding:0 10px}
.pj-shot-img--contain img{height:auto;object-fit:contain}
.pj-body{flex:1;display:flex;flex-direction:column;padding:20px 22px 22px}
.pj-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin-bottom:10px}
.pj-type{display:inline-flex;align-items:center;min-height:26px;padding:3px 11px;border-radius:30px;background:var(--tint);color:var(--purple);font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase}
.pj-badge{display:inline-flex;align-items:center;gap:5px;min-height:26px;padding:3px 11px;border-radius:30px;background:#e5f8ef;color:var(--green-ink);font-size:12px;font-weight:600}
.pj-badge svg{width:13px;height:13px}
.pj-card h3{font-size:20px;color:var(--ink);line-height:1.2;margin-bottom:8px}
.pj-link{color:inherit;text-decoration:none}
.pj-link::after{content:"";position:absolute;inset:0;z-index:2;border-radius:24px}
.pj-link:focus-visible{outline:none}
.pj-link:focus-visible::after{outline:3px solid var(--purple);outline-offset:-3px}
.pj-desc{color:var(--muted);font-size:14.5px;line-height:1.6}
.pj-more{display:inline-flex;align-items:center;gap:8px;margin-top:auto;padding-top:16px;color:var(--purple);font-weight:600;font-size:14.5px}
.pj-more svg{width:18px;height:18px;transition:transform .3s var(--ease-out)}
.pj-card.is-link:hover .pj-more svg{transform:translateX(4px)}

/* ----- /proyectos: hero ----- */
.pj-hero .sp-hero-in{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr)}
.pj-collage{position:relative;width:100%;max-width:500px;aspect-ratio:1/.86;justify-self:center}
.pj-collage .cs-browser{position:absolute;width:74%;border-radius:16px}
.pj-collage .cs-bar{height:24px;gap:8px;padding:0 10px}
.pj-collage .cs-dots{gap:5px}
.pj-collage .cs-dots i{width:7px;height:7px}
.pj-collage .cs-view{aspect-ratio:16/10;overflow:hidden}
.pj-collage .cs-view img{height:100%;object-fit:cover;object-position:top left}
.pj-c1{left:0;top:4%;transform:rotate(-5deg)}
.pj-c2{right:0;top:22%;transform:rotate(4deg)}
.pj-c3{left:11%;bottom:0;transform:rotate(-1.5deg)}
@media(prefers-reduced-motion:no-preference){
  .pj-collage .cs-browser{animation:pjIn .9s var(--ease-out) both}
  .pj-collage .pj-c2{animation-delay:.12s}
  .pj-collage .pj-c3{animation-delay:.24s}
}
/* translate (propiedad de transformación) para no pisar el rotate de cada marco */
@keyframes pjIn{from{opacity:.2;translate:0 28px}}

/* ----- /proyectos: filtro (solo CSS, radios) ----- */
.pj-filter{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;min-width:0;margin:40px auto 0;padding:0;border:0}
.pj-filter input{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.pj-filter label{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border-radius:30px;background:#fff;border:1px solid var(--line);font-size:14.5px;font-weight:600;color:var(--ink-2);cursor:pointer;transition:background-color .2s,color .2s,border-color .2s}
.pj-filter label:hover{border-color:#b9a3ff;color:var(--ink)}
.pj-filter .pj-n{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:12px;background:var(--tint);color:var(--purple);font-size:12.5px}
.pj-filter input:checked+label{background:var(--ink);border-color:var(--ink);color:#fff}
.pj-filter input:checked+label .pj-n{background:rgba(255,255,255,.16);color:#fff}
.pj-filter input:focus-visible+label{outline:3px solid var(--purple);outline-offset:3px}
@supports not selector(:has(*)){.pj-filter{display:none}}
.pj-grid{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px;margin-top:34px}
.pj-grid>li{display:flex}
.pj-grid>li>.pj-card{flex:1}
.pj-sec:has(#pj-f-sistema:checked) .pj-grid>li:not([data-type="sistema"]),
.pj-sec:has(#pj-f-panel:checked) .pj-grid>li:not([data-type="panel"]),
.pj-sec:has(#pj-f-herramienta:checked) .pj-grid>li:not([data-type="herramienta"]){display:none}
.pj-foot{max-width:720px;margin:34px auto 0;text-align:center;font-size:14px;color:var(--muted);line-height:1.65}

/* ----- CTA: garantías ----- */
.cs-guar{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:30px}
.cs-guar a{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 16px;border-radius:30px;background:#fff;border:1px solid var(--line);font-size:14px;font-weight:600;color:var(--ink-2);text-decoration:none;transition:border-color .2s,color .2s}
.cs-guar a:hover{border-color:#b9a3ff;color:var(--purple)}
.cs-guar .hf-ic{color:var(--green)}

/* ----- Responsive ----- */
@media(max-width:1100px){
  .cs-feats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cs-dl{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cs-dl>div:nth-child(3){border-left:0;padding-left:0}
}
@media(max-width:1000px){
  .cs-head{grid-template-columns:1fr;align-items:start}
  .cs-split{grid-template-columns:1fr}
  .pj-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pj-hero .sp-hero-in{grid-template-columns:1fr}
  .pj-collage{max-width:420px}
}
@media(max-width:700px){
  .cs-others{grid-template-columns:1fr}
}
@media(max-width:600px){
  .cs-hero{padding-bottom:52px}
  .cs-hero h1{font-size:clamp(34px,10vw,44px)}
  .cs-h1-type{font-size:18px;margin-top:10px}
  .cs-lead{font-size:14.5px;line-height:1.65}
  .cs-shot{margin-top:34px;margin-left:-6px;margin-right:-6px}
  .cs-browser{border-radius:16px}
  .cs-bar{height:34px;padding:0 12px;gap:10px}
  .cs-dots i{width:8px;height:8px}
  .cs-url{height:22px;font-size:11px}
  .cs-bar-sp{display:none}
  .cs-shot figcaption{font-size:12.5px}
  .cs-ficha-sec{padding:48px 0}
  .cs-ficha{padding:24px 20px;border-radius:22px}
  .cs-dl{grid-template-columns:1fr;gap:0}
  .cs-dl dt{flex-direction:row;align-items:center;gap:10px}
  .cs-dl>div,.cs-dl>div+div{border-left:0;padding-left:0}
  .cs-dl>div+div{border-top:1px solid var(--line);padding-top:16px;margin-top:16px}
  .cs-p{font-size:14.5px;line-height:1.65;margin-top:14px}
  .cs-pain{padding:20px 18px;gap:14px;border-radius:18px}
  .cs-ic{width:42px;height:42px;border-radius:12px}
  .cs-ic svg{width:21px;height:21px}
  .cs-feats{grid-template-columns:1fr;gap:12px;margin-top:30px}
  .cs-feat{display:grid;grid-template-columns:42px minmax(0,1fr);gap:0 14px;padding:18px;border-radius:18px}
  .cs-feat .cs-ic{grid-row:span 2;margin:0}
  .cs-feat h3,.cs-pain h3,.cs-why h3{font-size:16px;margin-bottom:4px}
  .cs-feat p,.cs-pain p,.cs-why p{font-size:14px}
  .cs-why li{grid-template-columns:44px minmax(0,1fr);gap:2px 14px;padding:18px;border-radius:18px}
  .cs-why li::before{width:44px;height:44px;border-radius:12px;font-size:15px}
  .cs-note-box{padding:16px;align-items:flex-start}
  .cs-others{margin-top:30px;gap:16px}
  .pj-hero .pj-collage{display:none}
  .pj-filter{align-self:stretch;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;margin:26px -20px 0;padding:2px 20px 6px;scrollbar-width:none}
  .pj-filter::-webkit-scrollbar{display:none}
  .pj-filter label{flex-shrink:0;padding:0 15px;font-size:14px}
  .pj-grid{grid-template-columns:1fr;gap:16px;margin-top:22px}
  .pj-shot-img{height:176px}
  .pj-body{padding:16px 18px 18px}
  .pj-card h3{font-size:18px}
  .pj-desc{font-size:14px}
  .cs-guar{gap:8px}
  .cs-guar a{font-size:13px;padding:0 14px}
}
