/* =========================================================
   RAY—B · Portafolio (portafolio.html): galería 3D a pantalla completa
   ========================================================= */
html:has(body.pf-page), body.pf-page { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.pf-page { background: var(--papel); }
/* Sin menú: la marca con el sello en la esquina */
.pf-brand { position: fixed; top: 20px; left: var(--gutter); z-index: 60; display: flex; align-items: center; gap: 12px; }
.pf-brand { text-decoration: none; }
.pf-brand .wordmark { color: var(--tinta); }
/* en computadora, la marca al doble de su tamaño normal (sello 60×80 y RAY—B a 40 px); en celular queda como en el resto de la web */
@media (min-width: 700px) {
  .pf-brand { gap: 22px; }
  .pf-brand .seal { width: 60px; height: 80px; font-size: 26px; border-radius: 5px; }
  .pf-brand .wordmark { font-size: 40px; }
}

.pf-main { position: fixed; inset: 0; }
.pf-stage {
  position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none;
  background: radial-gradient(120% 90% at 62% 46%, var(--washi) 0%, var(--papel) 55%, var(--hormigon) 130%);
  cursor: grab;
}
.pf-stage.is-drag { cursor: grabbing; }
.pf-info[hidden], .pf-side[hidden], .pf-nav[hidden], .pf-hint[hidden], .pf-canvas[hidden] { display: none; }
.pf-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* Número, nombre y cliente del proyecto al frente */
.pf-info {
  position: absolute; left: var(--gutter); bottom: clamp(70px, 11vh, 120px); z-index: 5;
  max-width: min(420px, 44vw); pointer-events: none; color: var(--tinta);
}
.pf-mark { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 13px; letter-spacing: .04em; color: var(--grafito); }
.pf-mark b { font-family: var(--jp); font-weight: 900; color: var(--hanko); font-size: 15px; }
.pf-count { margin: 0; font-weight: 800; font-size: clamp(64px, 9vw, 128px); line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pf-count small { font-size: .22em; font-weight: 600; letter-spacing: 0; margin-left: .4em; color: var(--grafito); vertical-align: top; }
.pf-info.is-swap .pf-count { animation: pfSwap .6s var(--ease-out) both; }

/* Al costado: tipo, nombre, resumen breve y paleta de colores del proyecto */
/* A la izquierda: cliente y servicios (como «Estudio / Rol / Servicios» de la referencia) */
.pf-facts {
  /* Cliente y Servicios lado a lado: cada uno con su rótulo arriba */
  position: absolute; left: var(--gutter); top: 50%; z-index: 5; transform: translateY(-50%);
  max-width: min(440px, calc(50vw - 21.5vw - var(--gutter) - 24px)); margin: 0;
  display: grid; grid-template-rows: auto auto; grid-auto-flow: column; grid-auto-columns: minmax(0, max-content); gap: 8px clamp(20px, 2.4vw, 44px);
  font-size: 13px; line-height: 1.35; color: var(--tinta); pointer-events: none;
}
.pf-facts dt { color: var(--grafito); opacity: .85; }
.pf-facts dd { margin: 0; font-weight: 500; }
.pf-facts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pf-facts[hidden] { display: none; }
.pf-facts.is-swap dd { animation: pfSwap .6s var(--ease-out) both; }
.pf-facts.is-swap dd + dt + dd { animation-delay: .06s; }
.pf-side {
  /* exactamente el recuadro que marcó el usuario: de 1520 a 1815 px en una ventana de 2000 (14,75 % de ancho,
     9,25 % libre a la derecha), a media altura; todo centrado dentro de él */
  position: absolute; right: 9.25vw; top: 50%; z-index: 5; width: max(220px, 14.75vw);
  transform: translateY(-50%); text-align: center; color: var(--tinta); pointer-events: none;
}
.pf-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; font-size: 12px; color: var(--grafito); }
.pf-title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; }
.pf-name { margin: 0; font-weight: 800; font-size: clamp(22px, 1.55vw, 32px); line-height: 1.1; letter-spacing: -.01em; }
.pf-palette { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex: none; }
.pf-palette li { width: 12px; height: 12px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(28, 29, 26, .12); }
.pf-summary { margin: 12px auto 0; padding-top: 12px; border-top: 1px solid var(--linea); font-size: 14px; line-height: 1.45; color: var(--grafito); }
.pf-meta { margin: 8px 0 0; font-size: 12px; color: var(--grafito); opacity: .8; }
.pf-meta:empty, .pf-summary:empty { display: none; }
.pf-side.is-swap > * { animation: pfSwap .6s var(--ease-out) both; }
.pf-side.is-swap > :nth-child(2) { animation-delay: .05s; }
.pf-side.is-swap > :nth-child(3) { animation-delay: .1s; }
.pf-side.is-swap > :nth-child(4) { animation-delay: .14s; }
@keyframes pfSwap { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Flechas (alternativa a la rueda) */
.pf-nav { position: absolute; right: var(--gutter); bottom: clamp(70px, 11vh, 120px); z-index: 5; display: flex; gap: 8px; }
.pf-arrow {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--linea); background: rgba(244, 242, 238, .7); color: var(--tinta);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); cursor: pointer;
  transition: background .25s var(--ease-out), transform .25s var(--ease-out);
}
.pf-arrow:hover { background: var(--tinta); color: #fff; }
.pf-arrow:active { transform: scale(.94); }
.pf-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pf-hint {
  position: absolute; left: 50%; bottom: 22px; z-index: 5; transform: translateX(-50%); margin: 0;
  font-size: 13px; color: var(--grafito); white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 10px var(--papel), 0 0 2px var(--papel);
  display: flex; align-items: center; gap: 10px;
}
.pf-hint::before { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }
.pf-hint::after { content: ""; width: 28px; height: 1px; background: currentColor; opacity: .6; }

/* Pie mínimo con el sello (abre el modo admin con 5 clics) */
.pf-page .site-footer.pf-foot {
  position: fixed; left: var(--gutter); bottom: 18px; z-index: 6; padding: 0; margin: 0;
  background: none; color: var(--grafito); border: 0; overflow: visible;
}
.pf-foot .footer-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.pf-foot .seal { transform: scale(.62); transform-origin: left center; margin-right: -10px; }

/* Lista simple: sin WebGL (o sin proyectos) */
.pf-stage.is-list { overflow-y: auto; touch-action: pan-y; cursor: auto; user-select: auto; padding: calc(var(--header) + 24px) var(--gutter) 80px; }
.pf-list { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; display: grid; gap: 28px; }
.pf-list figure { margin: 0; }
.pf-list img { width: 100%; aspect-ratio: 1.6; object-fit: cover; display: block; border-radius: var(--radius-s); background: var(--hormigon); }
.pf-list figcaption { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
.pf-list figcaption b { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.pf-list figcaption small { color: var(--grafito); font-size: 14px; }
.pf-empty { text-align: center; color: var(--grafito); padding: 20vh 0; }

@media (max-width: 699px) {
  .pf-brand { top: 14px; left: 16px; }
  /* el contador baja al hueco que marcó el usuario, bajo el logo y alineado con él (antes top: 74px) */
  .pf-info { left: 16px; right: auto; top: 154px; bottom: auto; max-width: none; }
  .pf-mark { display: none; }
  .pf-side { left: 16px; right: 16px; top: auto; bottom: 50px; width: auto; transform: none; }
  /* en celular no salen «Cliente» ni «Servicios» (se encimaban con la tarjeta de frente) */
  .pf-facts { display: none !important; }
  .pf-summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  /* en celular la tarjeta de abajo pasa detrás del texto: un velo suave lo mantiene legible */
  .pf-main::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 300px; z-index: 4; pointer-events: none;
    background: linear-gradient(rgba(236, 234, 229, 0), rgba(236, 234, 229, .88) 55%);
  }
  .pf-count { font-size: 56px; }
  .pf-name { font-size: 20px; }
  .pf-nav { display: none; }
  .pf-hint { bottom: 18px; font-size: 12px; }
  .pf-page .site-footer.pf-foot { left: auto; right: 4px; bottom: 10px; }
  .pf-foot .footer-brand > span:not(.seal) { display: none; }
}

/* =========================================================
   Modo admin del portafolio: bolita del usuario a la derecha y panel grande de proyectos
   (la ventana usa los estilos de vidrio de admin-vidrio.css; aquí solo lo propio)
   ========================================================= */
.pf-user {
  position: fixed; top: 20px; right: var(--gutter); z-index: 70; display: inline-flex; align-items: center; gap: 10px;
  padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--sans); color: var(--tinta);
}
.pf-user-av {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 0 0 3px rgba(244, 242, 238, .9), 0 8px 22px rgba(0, 0, 0, .18); transition: transform .25s var(--ease-out);
}
.pf-user:hover .pf-user-av { transform: scale(1.06); }
.pf-user-name { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; font-weight: 600; line-height: 1.2; opacity: 0; transform: translateX(6px); transition: opacity .25s var(--ease-out), transform .25s var(--ease-out); text-shadow: 0 0 8px var(--papel); }
.pf-user-name small { font-weight: 400; color: var(--grafito); font-size: 11.5px; }
.pf-user:hover .pf-user-name, .pf-user:focus-visible .pf-user-name { opacity: 1; transform: none; }
html.pf-dash-open .pf-user { opacity: 0; pointer-events: none; }
html.avx-on .ed-rail, html.avx-on .ed-dock { display: none !important; }
.pf-dash .avx-panel, .pf-dash[data-menu] .avx-panel { left: 14px; right: 14px; top: 14px; bottom: 14px; }
.pf-dash .avx-scrim { position: fixed; inset: 0; z-index: 6990; background: rgba(10, 10, 9, .35); }
.pf-dash .avx-pcard.pf-off { opacity: .55; }
.pf-dash-in { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--ink2); cursor: pointer; }
.pf-dash-in input { accent-color: var(--hanko); margin: 0; }
.pf-dash-in.big { font-size: 14px; color: var(--ink); margin: 0 0 14px; }
.pf-dash-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; }
.pf-dash-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; }
.pf-dash-strip button { flex: none; width: 96px; aspect-ratio: 1.6; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: rgba(255, 255, 255, .06); cursor: pointer; position: relative; }
.pf-dash-strip button[aria-pressed="true"] { border-color: var(--hanko); }
.pf-dash-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-dash-strip small { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(0, 0, 0, .65); color: #fff; padding: 1px 5px; border-radius: 4px; }
.pf-dash-fr { aspect-ratio: 1.6; max-width: 420px; }
.pf-dash-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pf-dash-chips label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--glass2); border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.pf-dash-chips input { accent-color: var(--hanko); margin: 0; }
.pf-dash-link { border: 0; background: none; color: var(--warn); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
@media (max-width: 699px) {
  .pf-user { top: 12px; right: 16px; }
  .pf-user-av { width: 40px; height: 40px; }
  .pf-dash .avx-panel { left: 6px; right: 6px; top: 6px; bottom: 6px; }
  .pf-dash-cols { grid-template-columns: 1fr; }
}

/* =========================================================
   Proyecto abierto: la página real del proyecto sobre el portafolio
   ========================================================= */
.pf-open {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: var(--papel);
  clip-path: inset(var(--t, 30%) var(--r, 30%) var(--b, 30%) var(--l, 30%) round 6px); opacity: 0;
  transition: clip-path .75s var(--ease-in-out), opacity .3s var(--ease-out);
}
.pf-open[hidden] { display: none; }
.pf-open.is-in { clip-path: inset(0 0 0 0 round 0); opacity: 1; }
.pf-open-body { position: relative; flex: 1; }
/* único control: botón rojo flotante arriba a la izquierda, sobre la página del proyecto */
.pf-back {
  position: absolute; top: 16px; left: var(--gutter); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px 0 14px; border: 0; border-radius: 999px;
  background: var(--hanko); color: #fff; font: 600 14px var(--sans); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: background .2s var(--ease-out), transform .2s var(--ease-out);
}
.pf-back:hover { background: var(--hanko-oscuro); }
.pf-back:active { transform: scale(.96); }
.pf-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-open:not(.is-in) .pf-back { opacity: 0; }
.pf-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--hormigon); }
.pf-open-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; background: var(--papel); transition: opacity .45s var(--ease-out); }
.pf-open.is-ready .pf-open-load { opacity: 0; pointer-events: none; }
.pf-open-bar-load { width: 120px; height: 2px; background: var(--linea); overflow: hidden; }
.pf-open-bar-load i { display: block; height: 100%; width: 40%; background: var(--hanko); animation: pfLoad 1.1s var(--ease-in-out) infinite; }
@keyframes pfLoad { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
html.pf-is-open .cursor, html.pf-is-open .cursor-ring { opacity: 0 !important; }   /* la página del proyecto dibuja su propio cursor */
.pf-stage.is-hover { cursor: pointer; }
@media (max-width: 699px) {
  /* en celular, solo un circulito rojo con la flecha, en el mismo lugar */
  .pf-back { top: 12px; left: 12px; width: 42px; height: 42px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; }
  .pf-back svg { width: 18px; height: 18px; }
  .pf-back-txt { display: none; }
}
.pf-dash .pf-dash-save { position: absolute; top: 22px; right: 84px; z-index: 2; margin: 0; }
@media (max-width: 699px) { .pf-dash .pf-dash-save { top: auto; bottom: 12px; right: 12px; } }
