/* ============================================================
   site.css — portada · estilo vectorial
   ------------------------------------------------------------
   De fondo, los videos del proyecto en semitono (js/dither.js).
   Arriba a la izquierda el logo FUKU; arriba a la derecha el correo
   y el sonido (botones redondos). Al centro-izquierda una tarjeta
   blanca, simple: año y nombre arriba a la derecha, la info y sus
   etiquetas. Sin menú inferior ni login (el panel está en /admin).
   ============================================================ */

:root {
  --ink: #141210;
  --ink-dim: #4d4741;
  --ink-faint: #8a8178;
  --accent: #e0102b;        /* rojo de la marca */
  --accent-hot: #ff2a45;
  --display: "Archivo Black", "Inter", sans-serif;
  --head: "Space Grotesk", "Inter", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.site { height: 100dvh; overflow: hidden; background: #050505; }
.site::before { display: none; } /* sin la viñeta roja de base.css: aquí manda el video */

/* ---------- fondo ---------- */
.stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #050505;
  transition: opacity .4s ease;
}
.stage.is-off { opacity: 0; }
/* sin WebGL: el video tal cual, con una trama de puntos encima */
.stage-media { position: fixed; inset: 0; overflow: hidden; }
.stage-media video, .stage-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.2) contrast(1.1); }
.stage-media::after, .stage-yt::after {
  content: "";
  position: absolute;
  inset: 0;
  /* semitono: una grilla de agujeros redondos sobre negro */
  background:
    radial-gradient(circle at center, transparent 0 2.6px, rgba(5, 5, 5, .62) 3.4px) 0 0 / 9px 9px,
    radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, .5));
  pointer-events: none;
}
/* YouTube: su reproductor a pantalla completa ("cover" 16:9), sin poder tocarlo */
.stage-yt { position: fixed; inset: 0; overflow: hidden; background: #050505; }
.stage-yt iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  /* un poco más grande que la pantalla: esconde el título y el logo de YouTube */
  width: calc(max(100vw, 177.78vh) * 1.18);
  height: calc(max(100vh, 56.25vw) * 1.18);
  border: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: saturate(1.3) contrast(1.12);
}
.stage-shade { /* oscurece un poco arriba e izquierda para que se lea lo de encima */
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .32), transparent 50%),
    linear-gradient(180deg, rgba(0, 0, 0, .38), transparent 22%);
}

/* ---------- logo (arriba a la izquierda) ----------
   FUKU y, debajo, "Fullstack user centricity designer" escrito normal. */
.brand {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: calc(22px + env(safe-area-inset-left, 0px));
  z-index: 10;
  display: inline-grid;
  justify-items: stretch;
  font-size: 40px;              /* todo el logo escala con esto */
  line-height: 1;
  color: #fff;
}
.brand b { font-family: var(--display); font-size: 1em; font-weight: 400; letter-spacing: -.005em; }
.brand small {
  margin-top: .14em;
  font-family: var(--head);
  font-size: .25em;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  color: rgba(255, 255, 255, .88);
}

/* ---------- arriba a la derecha: correo + sonido ---------- */
.top-actions {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top, 0px));
  right: calc(22px + env(safe-area-inset-right, 0px));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}
.round-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 12, .55);
  border: 1.5px solid rgba(255, 255, 255, .2);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.round-btn svg { width: 18px; height: 18px; }
.round-btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); }
.round-btn:active { transform: scale(.94); }
.round-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--red-glow); }
.sound-btn[aria-pressed="true"] .s-off, .sound-btn:not([aria-pressed="true"]) .s-on { display: none; }
.sound-btn:not([aria-pressed="true"]) { color: rgba(255, 255, 255, .6); }
/* "toca para escuchar": hasta el primer toque (los navegadores no dejan sonar antes) */
.sound-hint {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  margin: 0;
  padding: 6px 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-family: var(--head);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: hint-in .4s var(--ease) both, hint-pulse 2.4s ease-in-out .4s infinite;
}
.sound-hint[hidden] { display: none; }
.vol-pop:not([hidden]) ~ .sound-hint { display: none; }
@keyframes hint-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes hint-pulse { 50% { opacity: .65; } }

/* ---------- volumen: panelcito bajo el botón ---------- */
.vol-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 99px;
  background: rgba(10, 10, 12, .62);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 16px 34px -18px rgba(0, 0, 0, .8);
  animation: hint-in .25s var(--ease) both;
}
.vol-pop[hidden] { display: none; }
.vol-mute {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  transition: background .2s;
}
.vol-mute:hover { background: rgba(255, 255, 255, .12); }
.vol-mute svg { width: 17px; height: 17px; }
.vol-mute[aria-pressed="true"] .s-off, .vol-mute:not([aria-pressed="true"]) .s-on { display: none; }
.vol-range {
  --v: 80%;
  width: 120px;
  height: 18px;
  margin: 0;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.vol-range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent-hot) var(--v), rgba(255, 255, 255, .25) var(--v)); }
.vol-range::-moz-range-track { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); }
.vol-range::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--accent-hot); }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.vol-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; }
.vol-range:focus-visible { outline: none; }
.vol-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--red-glow); }
.vol-val { min-width: 2ch; font-family: var(--mono); font-size: 11px; color: rgba(255, 255, 255, .8); text-align: right; }

/* ---------- pausa: ícono al centro ---------- */
.pause-ind {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 6;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 10, 12, .5);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.pause-ind[hidden] { display: none; }
.pause-ind svg { width: 30px; height: 30px; }
.pause-ind .pi-play { margin-left: 4px; }
.pause-ind:not(.is-paused) .pi-play, .pause-ind.is-paused .pi-pause { display: none; }
.pause-ind.is-flash { animation: pause-pop .7s var(--ease) both; }
.pause-ind.is-paused.is-flash { animation: pause-in .3s var(--ease) both; }
@keyframes pause-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); } }
@keyframes pause-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.85); } }

/* ---------- barra de avance (todos los videos del proyecto) ----------
   Una línea roja abajo; la zona sensible es más alta que la línea. */
.seek {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  height: 22px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  touch-action: none;
}
.seek[hidden] { display: none; }
.seek-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, .14);
  transition: height .15s ease;
}
.seek:hover .seek-track, .seek.is-dragging .seek-track, .seek:focus-visible .seek-track { height: 6px; }
.seek:focus-visible { outline: none; }
.seek-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-hot); box-shadow: 0 0 10px rgba(255, 42, 69, .55); }
/* separación entre un video y el siguiente */
.seek-marks i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(5, 5, 5, .85); }

/* ============================================================
   Tarjeta del proyecto (centro-izquierda): blanca y simple
   ============================================================ */

.folio {
  position: fixed;
  left: calc(44px + env(safe-area-inset-left, 0px));
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
}
/* la tarjeta: un cuadrado de vidrio oscuro, con letra blanca, que deja ver el video */
.pcard {
  --box: 230px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--box);
  height: var(--box);               /* cuadrado: siempre del mismo tamaño */
  padding: 16px 17px 17px;
  color: #fff;
  background: linear-gradient(160deg, rgba(20, 20, 24, .5), rgba(6, 6, 8, .62));
  border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .08);
}
/* un brillo rojo tenue en la esquina: la une con el semitono rojo del fondo */
.pcard::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: radial-gradient(120% 70% at 0% 0%, rgba(224, 16, 43, .22), transparent 60%);
}
.pcard > * { position: relative; }
/* año y nombre: arriba, bien chicos */
.pcard-meta {
  display: flex;
  gap: 6px;
  max-width: 100%;
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  white-space: nowrap;
  overflow: hidden;
}
.pcard-meta span:empty { display: none; }
.pcard-meta span + span::before { content: "·"; margin-right: 6px; }
.pcard-meta span:last-child { color: rgba(255, 255, 255, .9); overflow: hidden; text-overflow: ellipsis; }
.pcard-label {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-hot);
}
.pcard-text {
  min-height: 0;
  margin: 0;
  font-family: var(--head);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -.005em;
  color: #fff;
  text-wrap: pretty;
  /* si es muy largo, se corta con «…» (la tarjeta no crece) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}
.pcard-text:empty { display: none; }
.pcard:has(.pcard-tags:not(:empty)) .pcard-text { -webkit-line-clamp: 5; line-clamp: 5; }
.pcard-tags { flex: none; display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 12px 0 0; list-style: none; }
.pcard-tags:empty { display: none; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-family: var(--head);
  font-size: 10.5px;
  font-weight: 600;
}
.tag--real { background: #fff; color: var(--ink); }
.tag--ai { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }

/* cambio de proyecto: sale hacia arriba, entra desde abajo, en cascada */
.pcard .fx { transition: opacity .28s ease, transform .45s var(--ease); }
.pcard.is-out .fx { opacity: 0; transform: translateY(-6px); }
.pcard.is-in .fx { opacity: 0; transform: translateY(8px); transition: none; }
.pcard .fx:nth-child(3) { transition-delay: .03s; }
.pcard .fx:nth-child(4) { transition-delay: .06s; }
.pcard .fx:nth-child(5) { transition-delay: .09s; }

/* ---------- modal: ¿apagar el sonido? ---------- */
.sound-dialog {
  width: min(340px, calc(100vw - 32px));
  padding: 22px 22px 18px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8);
}
.sound-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.sound-dialog[open] { animation: dlg-in .25s var(--ease) both; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.sound-dialog p { margin: 0; font-size: 14.5px; line-height: 1.45; color: var(--ink-dim); }
.sound-dialog .sound-dialog-title { margin-bottom: 4px; font-family: var(--head); font-size: 19px; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.sound-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.sound-dialog-actions button {
  padding: 9px 16px;
  border-radius: 99px;
  font-family: var(--head);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .2s, border-color .2s;
}
.sd-off { border: 1.5px solid rgba(20, 18, 16, .2); color: var(--ink); }
.sd-off:hover { border-color: var(--ink); }
.sd-keep { background: var(--accent); color: #fff; }
.sd-keep:hover { background: var(--accent-hot); }
.sound-dialog-actions button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--red-glow); }

@media (max-width: 720px) {
  .brand { font-size: 34px; }
  .folio {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: calc(34px + env(safe-area-inset-bottom, 0px));   /* deja ver la barra de avance */
    transform: none;
  }
  .pcard { --box: min(230px, calc(100vw - 32px)); }
  .stage-shade { background: linear-gradient(0deg, rgba(0, 0, 0, .5), transparent 50%), linear-gradient(180deg, rgba(0, 0, 0, .38), transparent 22%); }
}

@media (prefers-reduced-motion: reduce) {
  .pcard .fx, .sound-hint, .sound-dialog[open] { transition: none; animation: none; }
}
