/* =============================================================
   DIYFOMO — Página de Portafolio
   ============================================================= */
.nav-links a.is-current { color: var(--ink); }
.nav-links a.is-current::after { content: ""; display: block; height: 2px; background: var(--accent); margin-top: 4px; border-radius: 2px; }

/* Hero */
.pf-hero { position: relative; padding: 150px 0 80px; overflow: hidden; isolation: isolate; }
.pf-grad { opacity: .5; }
.pf-title { font-family: var(--serif); font-size: clamp(56px, 10vw, 150px); line-height: .9; letter-spacing: -0.035em; margin: 26px 0 28px; }
.pf-title em { color: var(--accent); }
.pf-lead { font-size: clamp(17px, 1.5vw, 20px); color: #dcdae1; max-width: 60ch; }
.pf-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.pf-stats b { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 5vw, 64px); line-height: 1; }
.pf-stats span { color: var(--mute); font-size: 14px; }

/* Filtros */
.pf-list { padding: 30px 0 110px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; position: sticky; top: 76px; z-index: 20; padding: 12px 0; background: linear-gradient(var(--bg) 70%, transparent); }
.flt { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--mute); font-size: 14px; font-weight: 500; transition: all .3s var(--ease-out); }
.flt span { font-family: var(--mono); font-size: 11px; opacity: .7; margin-left: 4px; }
.flt:hover { color: var(--ink); border-color: var(--ink); }
.flt.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Tarjetas de trabajo */
.works { display: grid; gap: 28px; }
.work { display: grid; border-radius: 28px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); transition: border-color .4s, transform .6s var(--ease-out); }
.work:hover { border-color: rgba(212, 255, 58, .35); }
.work.is-hidden { display: none; }
.work-shot { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #07090d; cursor: zoom-in; }
.work-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), filter .6s; }
.work:hover .work-shot img { transform: scale(1.05); }
.work-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); padding: 12px 20px; border-radius: 999px; background: rgba(11, 10, 15, .75); backdrop-filter: blur(8px); color: var(--ink); font-size: 14px; font-weight: 600; opacity: 0; transition: all .4s var(--ease-out); white-space: nowrap; border: 1px solid var(--line-2); }
.work-play::before { content: "▶ "; color: var(--accent); }
.work-shot:hover .work-play, .work-shot:focus-visible .work-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.work-num { position: absolute; top: 16px; left: 16px; font-family: var(--mono); font-size: 12px; padding: 5px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 500; }
.work-body { padding: 26px 26px 28px; display: flex; flex-direction: column; gap: 14px; }
.work-rubro { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.work-name { font-family: var(--serif); font-size: clamp(40px, 4.4vw, 60px); line-height: .95; letter-spacing: -.02em; }
.work-desc { color: #d4d2da; font-size: 16px; }
.work-feat { display: grid; gap: 6px; }
.work-feat li { position: relative; padding-left: 22px; color: var(--mute); font-size: 14px; }
.work-feat li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 2px; }
.work-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 0; border-block: 1px solid var(--line); }
.work-meta div:last-child { grid-column: 1 / -1; }
.work-meta small { display: block; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute-2); margin-bottom: 4px; }
.work-meta b { font-weight: 500; font-size: 14px; }
.sw { display: flex; gap: 6px; }
.sw i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: block; }
.work-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.work-cta .btn { padding: 11px 18px; font-size: 14px; }
.pf-note { margin-top: 40px; color: var(--mute-2); font-size: 13px; text-align: center; }

/* CTA final */
.pf-cta { padding: 0 0 110px; }
.pf-cta-in { display: grid; gap: 30px; padding: clamp(28px, 5vw, 64px); border-radius: 32px; background: radial-gradient(circle at 90% 10%, rgba(123, 60, 255, .35), transparent 50%), radial-gradient(circle at 10% 90%, rgba(212, 255, 58, .14), transparent 45%), var(--bg-2); border: 1px solid var(--line-2); }
.pf-cta-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Vista previa en vivo */
.pv { position: fixed; inset: 0; z-index: 300; background: rgba(5, 5, 8, .9); backdrop-filter: blur(10px); display: flex; flex-direction: column; animation: pvIn .35s var(--ease-out); }
.pv[hidden] { display: none; }
@keyframes pvIn { from { opacity: 0; } }
.pv-bar { display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pv-title { font-family: var(--serif); font-size: 26px; margin-right: auto; }
.pv-devices { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--line-2); }
.pv-devices button { padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--mute); }
.pv-devices button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pv-open { padding: 9px 16px; font-size: 13px; }
.pv-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 16px; }
.pv-close:hover { background: var(--accent); color: var(--accent-ink); }
.pv-stage { flex: 1; display: grid; place-items: center; padding: 18px var(--gutter); overflow: hidden; }
.pv-frame { position: relative; width: 100%; height: 100%; max-width: 1400px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8); transition: max-width .6s var(--ease-out), border-radius .6s, height .6s; }
.pv-frame.is-mobile { max-width: 390px; max-height: 800px; border-radius: 40px; border: 10px solid #1c1a23; }
.pv-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pv-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-2); color: var(--mute); font-family: var(--mono); font-size: 13px; transition: opacity .4s; }
.pv-loading.is-done { opacity: 0; pointer-events: none; }
.pv-open-body { overflow: hidden; }

@media (min-width: 720px) {
  .pf-stats { grid-template-columns: repeat(4, 1fr); }
  .works { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
  .work { grid-template-rows: auto 1fr; }
}
@media (max-width: 719px) {
  .filters { top: 72px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .flt { white-space: nowrap; }
  .work-play { opacity: 1; transform: translate(-50%, -50%); }
  .pv-devices { display: none; }
  .pv-stage { padding: 0; }
  .pv-frame { border-radius: 0; }
}

/* Proyectos a medida (webs para marcas y aplicaciones) */
.pf-proj { padding-top: 40px; border-top: 1px solid var(--line); }
.pf-proj-head { margin-bottom: 44px; }
.pf-proj-sub { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin: 8px 0 22px; display: flex; align-items: center; gap: 10px; }
.pf-proj-sub span { color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 2px 9px; font-size: 11px; }
.pf-proj .works + .pf-proj-sub { margin-top: 64px; }

/* Portadas con respaldo JPG */
.work-shot picture, .pf-img picture { display: block; width: 100%; height: 100%; }
