/* CASOS: grilla con antes/después y filtros (lógica en js/casos.js, datos en js/datos/casos.js) */
.casos .wrap { padding-block: 110px 100px; }
.sec-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: end; margin-bottom: 44px; }
.sec-head p { color: var(--muted); margin: 0 0 18px; max-width: 46ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.86rem; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 14px; color: var(--muted); transition: all .2s; }
.filters button .ico { font-size: 1rem; }
.filters button:hover { color: var(--text); border-color: var(--muted); }
.filters button[aria-pressed="true"] { color: var(--glow); border-color: var(--accent); background: rgba(46,123,255,.12); box-shadow: 0 0 22px -8px var(--accent); }
@media (max-width: 860px) { .sec-head { grid-template-columns: 1fr; gap: 12px; } }
#casos { scroll-margin-top: 64px; }
.case.reveal { animation: caseIn .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes caseIn { from { opacity: 0; transform: translateY(20px) scale(.98); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.case { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); min-width: 0; transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease; }
.case:hover { transform: translateY(-4px); border-color: rgba(46,123,255,.5); box-shadow: 0 24px 60px -30px var(--accent); }
.case.big { grid-column: span 2; }
.case[hidden] { display: none !important; }
.ba { position: relative; aspect-ratio: 16 / 10; overflow: hidden; --pos: 50%; max-width: 100%; }
.case.big .ba { aspect-ratio: 16 / 8; }
.before, .after { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 7% 8%; gap: 10px; }
.before { background: #E3E0D8; color: #50504C; font-family: Georgia, "Times New Roman", serif; }
.before .bn { font-size: clamp(1rem, 2vw, 1.4rem); font-weight: 700; }
.before .nav { display: flex; gap: 8px; }
.before .nav i { height: 6px; width: 36px; background: #B9B5AB; border-radius: 1px; }
.before .blk { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.before .blk i { background: #CBC7BD; border: 1px solid #B9B5AB; }
.before .txt { height: 6px; background: #B9B5AB; width: 70%; }
.after { clip-path: inset(0 0 0 var(--pos)); background: radial-gradient(circle at 78% 28%, hsl(var(--h) 92% 58% / .55), transparent 55%), radial-gradient(circle at 10% 100%, rgba(46,123,255,.25), transparent 50%), #0B0F1E; color: #fff; justify-content: flex-end; }
.after .an { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 2.8rem); line-height: .95; letter-spacing: -0.03em; text-align: right; overflow-wrap: anywhere; }
.after .al { height: 2px; width: 55%; margin-left: auto; background: linear-gradient(90deg, transparent, hsl(var(--h) 92% 65%), #fff); box-shadow: 0 0 12px hsl(var(--h) 92% 60%); }
.after .ap { align-self: flex-end; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 4px 10px; }
.after .ac { position: absolute; top: 9%; right: 8%; width: 34px; height: 34px; border-radius: 50%; border: 2px solid hsl(var(--h) 92% 65%); box-shadow: 0 0 18px hsl(var(--h) 92% 60%); }
.lbl { position: absolute; top: 12px; z-index: 2; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: rgba(10,14,26,.7); color: #fff; pointer-events: none; }
.lbl.l { left: 12px; } .lbl.r { right: 12px; }
.handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; transform: translateX(-1px); background: #fff; box-shadow: 0 0 16px 2px var(--accent); pointer-events: none; z-index: 2; }
.handle::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; letter-spacing: 2px; box-shadow: 0 0 22px var(--accent); }
.ba:focus-within .handle::after { outline: 2px solid var(--cool); outline-offset: 3px; }
.ba input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.meta { padding: 18px 20px 20px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; align-items: start; }
.meta h3 { font-size: 1.25rem; font-weight: 700; overflow-wrap: anywhere; }
.meta .rubro { grid-column: 1; font-size: 0.88rem; color: var(--muted); margin: 0; }
.meta .imp { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
.meta .imp b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; color: var(--glow); text-shadow: 0 0 16px var(--accent); font-variant-numeric: tabular-nums; }
/* Mientras la métrica sea un marcador, se achica para no romper la tarjeta */
.meta .imp b.completar { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; line-height: 1.3; max-width: 12ch; margin-left: auto; text-shadow: none; color: var(--cool); }
.meta .imp small { font-size: 0.76rem; color: var(--muted); }
.meta .pil { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.meta .pil span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--cool); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
.case.next { border-style: dashed; background: transparent; align-items: flex-start; justify-content: center; padding: 32px; gap: 14px; min-height: 280px; }
.case.next h3 { font-size: 1.6rem; font-weight: 800; }
.case.next p { color: var(--muted); margin: 0; }
.case.next .plus { width: 54px; height: 54px; border-radius: 50%; border: 1px solid var(--accent); display: grid; place-items: center; color: var(--glow); font-size: 1.6rem; box-shadow: 0 0 30px -6px var(--accent); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } .case.big { grid-column: span 1; } .case.big .ba { aspect-ratio: 16 / 10; } }
