/* SPECTRA — phantom.land-style spherical gallery */
:root {
  --bg: #070708;
  --fg: #f4f4f2;
  --dim: rgba(255, 255, 255, 0.55);
  --mono: 'Cascadia Mono', Consolas, 'Roboto Mono', monospace;
  --sans: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 3px; }

#webgl {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
body.dragging #webgl { cursor: grabbing; }
body.cardhover #webgl { cursor: pointer; }

.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse 115% 90% at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.6) 100%);
}
.noise { position: fixed; inset: 0; pointer-events: none; z-index: 2; opacity: 0.07; }

/* ---------- chrome / UI ---------- */
.ui {
  position: fixed; left: 0; right: 0; z-index: 10;
  display: flex; pointer-events: none;
  padding: 22px 26px;
}
.ui button, .ui a { pointer-events: auto; }
.ui.top { top: 0; align-items: flex-start; justify-content: space-between; }
/* La barra de abajo va POR ENCIMA de la lista (30) y de los paneles de contenido
   (35), o quedan sepultados sus propios botones; el detalle (40) sí la tapa
   porque trae su propio "VOLVER". */
.ui.bottom {
  bottom: 0; z-index: 36;
  align-items: flex-end; justify-content: space-between; padding-bottom: 26px;
}

.logo { display: block; line-height: 0; }
.logo svg { width: 46px; height: 46px; }

.top-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  padding-top: 4px; text-align: center;
}
/* Sonido de interfaz. Las barras del ecualizador NO se animan en bucle: solo
   pulsan cuando se dispara un sonido de verdad (la clase .pulse la pone el JS y
   la quita al terminar). Encendido y en silencio = barras quietas. */
.sound {
  display: inline-flex; gap: 9px; align-items: center;
  font-size: 10px; letter-spacing: 0.1em;
  margin-bottom: 12px; opacity: 0.5;
  transition: opacity 0.25s ease;
}
.sound:hover, .sound.on { opacity: 1; }
.bars { display: flex; gap: 2px; align-items: flex-end; height: 10px; }
.bars i { width: 2px; height: 3px; background: #fff; }
.sound.pulse .bars i { animation: eq 0.24s ease-in-out 2 alternate; }
.sound.pulse .bars i:nth-child(2) { animation-delay: 0.05s; }
.sound.pulse .bars i:nth-child(3) { animation-delay: 0.10s; }
.sound.pulse .bars i:nth-child(4) { animation-delay: 0.15s; }
@keyframes eq { from { height: 3px; } to { height: 10px; } }

.tagline {
  font-size: 10px; line-height: 1.65; letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-right { display: flex; gap: 28px; align-items: flex-start; }
.clocks { display: flex; flex-direction: column; gap: 7px; font-size: 10px; letter-spacing: 0.08em; padding-top: 4px; }
.clock { display: flex; gap: 10px; align-items: center; text-transform: uppercase; }
.clock .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; flex: none; }
.clock .dot.hollow { background: transparent; border: 1px solid rgba(255,255,255,.55); }
.clock.dim { color: var(--dim); }
.clock .time { margin-left: 10px; font-variant-numeric: tabular-nums; }
.cta {
  background: #fff; color: #0a0a0a;
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  padding: 17px 30px; border-radius: 999px;
  transition: transform 0.25s ease;
}
.cta:hover { transform: scale(1.05); }

.view-toggles { display: flex; gap: 8px; }
.toggle {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.28);
  display: grid; place-items: center;
  color: #fff; transition: all 0.25s ease;
}
.toggle svg { width: 15px; height: 15px; }
.toggle.active { background: #fff; color: #0a0a0a; border-color: #fff; }
.toggle:not(.active):hover { border-color: rgba(255,255,255,.7); }

.main-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2px;
  background: rgba(219, 219, 219, 0.92);
  border-radius: 999px; padding: 5px;
  font-family: var(--sans);
  pointer-events: auto;
}
.nav-item {
  font-size: 14px; font-weight: 600; color: #4b4b4b;
  padding: 12px 26px; border-radius: 999px;
  transition: all 0.25s ease;
}
.nav-item:hover { color: #000; }
.nav-item.active { background: #fff; color: #0a0a0a; box-shadow: 0 2px 12px rgba(0,0,0,.2); }

/* ---------- pista de uso (donde antes iba el banner de cookies) ---------- */
.hint {
  position: fixed; right: 24px; bottom: 26px; z-index: 20;
  width: 268px; background: rgba(14, 14, 16, 0.88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px; padding: 15px 16px 13px;
  color: var(--fg);
}
.hint-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9px; letter-spacing: 0.16em; color: var(--dim);
}
.hint-x { font-size: 12px; line-height: 1; padding: 2px 4px; color: var(--dim); }
.hint-x:hover, .hint-x:focus-visible { color: #fff; }
.hint-list { list-style: none; margin: 12px 0 13px; }
.hint-list li {
  font-size: 11px; line-height: 1.35; letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.68);
  padding: 5px 0 5px 13px; position: relative;
}
.hint-list li::before {
  content: ""; position: absolute; left: 0; top: 11px;
  width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.4);
}
.hint-list b { color: #fff; font-weight: 600; }
.hint-ok {
  width: 100%; background: #fff; color: #0a0a0a;
  font-family: var(--sans); font-weight: 600; font-size: 12px;
  padding: 9px 0; border-radius: 999px;
  transition: opacity 0.2s ease;
}
.hint-ok:hover, .hint-ok:focus-visible { opacity: 0.82; }

/* ---------- list view ---------- */
.list-panel {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(7, 7, 8, 0.97);
  padding: 130px 6vw 140px; /* hueco para la barra inferior, que va por encima */
  overflow-y: auto;
}
.list-head {
  display: flex; justify-content: space-between;
  font-size: 9px; letter-spacing: 0.14em; color: var(--dim);
  border-bottom: 1px solid rgba(255,255,255,.16); padding-bottom: 12px;
  text-transform: uppercase;
}
.list-panel ol { list-style: none; }
.list-panel li {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 18px;
  padding: 17px 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.list-panel li:hover { background: #f2f2f2; color: #0a0a0a; }
.list-panel .idx { font-size: 10px; opacity: 0.5; }
.list-panel .lt {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(16px, 2.2vw, 26px);
  text-transform: uppercase; letter-spacing: -0.01em;
}
.list-panel .lm { font-size: 9.5px; letter-spacing: 0.06em; opacity: 0.6; text-transform: uppercase; }
/* own projects: solo el número destacado, sin etiqueta */
.list-panel li.mine .idx { color: #fff; opacity: 1; }

/* ---------- detail page ---------- */
.detail {
  position: fixed; inset: 0; z-index: 40;
  background: #0d0d0f;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-inner { padding: 26px 5vw 90px; max-width: 1500px; margin: 0 auto; }
.detail-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9vh; }
#backBtn {
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
  padding: 13px 24px; font-size: 10px; letter-spacing: 0.12em;
  transition: all 0.25s ease;
}
#backBtn:hover { background: #fff; color: #0a0a0a; }
#dClient { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }
.detail h1 {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(44px, 8.5vw, 140px);
  line-height: 0.95; letter-spacing: -0.025em;
  text-transform: uppercase;
  margin-bottom: 5vh;
}
.detail-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.16);
  border-bottom: 1px solid rgba(255,255,255,.16);
}
#dTags { display: flex; gap: 8px; flex-wrap: wrap; }
#dTags span {
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06);
  padding: 8px 15px; border-radius: 999px;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
}
#dYear { font-size: 10px; color: var(--dim); letter-spacing: 0.12em; }
.detail figure { margin: 44px 0; }
.detail img { width: 100%; max-height: 64vh; object-fit: cover; display: block; }
.detail-copy {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 440px)); gap: 42px;
  font-size: 11px; line-height: 1.95; letter-spacing: 0.04em;
  color: rgba(255,255,255,.62); text-transform: uppercase;
}
#nextBtn {
  margin-top: 9vh;
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(20px, 3vw, 34px);
  text-transform: uppercase;
  border-bottom: 2px solid #fff; padding-bottom: 6px;
  transition: opacity 0.25s ease;
}
#nextBtn:hover { opacity: 0.55; }

/* ---------- fichas que no son proyectos propios: aviso de obra ----------
   Las tarjetas de relleno vienen de la plantilla de referencia y no tienen
   contenido real. Al abrirlas no se finge un caso: se dice que están en
   construcción. Amarillo de señalética, cinta de peligro y andamiaje. */
.detail--wip h1 { color: #f2b705; }
.detail--wip .detail-meta { position: relative; border-color: rgba(242,183,5,.45); }
.detail--wip .detail-meta::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px;
  background: repeating-linear-gradient(45deg, #f2b705 0 10px, transparent 10px 20px);
  background-size: 28px 3px;
  animation: wip-stripes 1.1s linear infinite;
}
@keyframes wip-stripes { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) {
  .detail--wip .detail-meta::after { animation: none; }
}
#dTags span { transition: border-color .25s ease, background .25s ease, color .25s ease; }
.detail--wip #dTags span {
  border-color: rgba(242,183,5,.5); background: rgba(242,183,5,.1); color: #f2b705;
}
.detail--wip figure {
  position: relative; margin: 44px 0; overflow: hidden;
  border: 6px solid #f2b705; border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(242,183,5,.16), 0 24px 55px rgba(0,0,0,.55);
}
.detail--wip .wip-ribbon {
  display: block; position: absolute; left: 0; right: 0; bottom: 0;
  background: #15171a;
  background-image: repeating-linear-gradient(45deg, rgba(242,183,5,.13) 0 12px, transparent 12px 24px);
  border-top: 5px solid #f2b705;
  color: #f2b705;
  padding: 13px 16px;
  font: 700 10.5px/1.3 var(--mono);
  letter-spacing: .16em; text-transform: uppercase; text-align: center;
}
.detail--wip .wip-ribbon span {
  display: inline-block; padding: 4px 12px; background: #15171a;
}
.detail--wip .detail-copy {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px;
  border-left: 4px solid #f2b705;
  background: rgba(242,183,5,.06);
  padding: 26px 30px;
  text-transform: none; letter-spacing: .02em; line-height: 1.8;
  color: rgba(244,244,242,.74);
}

/* ---------- embedded dashboard (own projects) ---------- */
.detail-embed { margin-top: 30px; }
/* default: standard content visible, embed hidden */
.detail:not(.detail--embed) .detail-embed { display: none; }
/* embed mode: hide the fake figure / copy / next-cycle, widen the shell */
.detail.detail--embed .detail-copy,
.detail.detail--embed figure,
.detail.detail--embed #nextBtn { display: none; }
.detail--embed .detail-inner { max-width: 1640px; }
.detail--embed .detail-top { margin-bottom: 4vh; }
.detail--embed h1 {
  font-size: clamp(30px, 5vw, 76px);
  margin-bottom: 2.5vh;
}
.detail-blurb {
  font-family: var(--sans);
  font-size: clamp(15px, 1.5vw, 19px); line-height: 1.55;
  color: rgba(255,255,255,.72); max-width: 74ch;
  margin: 0 0 26px;
}
.embed-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}
.embed-label {
  font-size: 9.5px; letter-spacing: 0.14em; color: var(--dim);
  text-transform: uppercase;
}
.embed-open {
  flex: none;
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
  padding: 11px 20px; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; text-decoration: none; color: var(--fg);
  transition: all 0.25s ease;
}
.embed-open:hover { background: #fff; color: #0a0a0a; }
.embed-frame {
  position: relative; width: 100%;
  height: calc(100vh - 300px); min-height: 520px;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- paneles de contenido (Sobre mí / Contacto) ---------- */
.info-panel {
  position: fixed; inset: 0; z-index: 35;
  background: #0b0b0d;
  overflow-y: auto; overscroll-behavior: contain;
}
.info-inner { padding: 26px 6vw 150px; max-width: 1180px; margin: 0 auto; }
.info-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8vh;
}
.info-back {
  border: 1px solid rgba(255,255,255,.3); border-radius: 999px;
  padding: 13px 24px; font-size: 10px; letter-spacing: 0.12em;
  transition: background 0.25s ease, color 0.25s ease;
}
.info-back:hover, .info-back:focus-visible { background: #fff; color: #0a0a0a; }
.info-kicker { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; }

.info-panel h1 {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(38px, 7vw, 104px);
  line-height: 0.95; letter-spacing: -0.025em;
  text-transform: uppercase;
  margin-bottom: 6vh;
}
.info-lede {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px 46px; max-width: 1000px;
  margin-bottom: 46px;
}
.info-lede p {
  font-family: var(--sans);
  font-size: clamp(15px, 1.45vw, 18px); line-height: 1.62;
  color: rgba(255,255,255,.7);
}
.info-lede b { color: var(--fg); font-weight: 600; }

.info-h2 {
  font-size: 10px; letter-spacing: 0.18em; color: var(--dim);
  text-transform: uppercase; font-weight: 600;
  padding-bottom: 12px; margin: 60px 0 26px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}

/* bloque a completar por Alejandro — deliberadamente visible */
.todo {
  border: 1px dashed rgba(255,255,255,.3); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 46px; max-width: 760px;
  background: rgba(255,255,255,.03);
}
.todo-tag {
  display: inline-block; margin-bottom: 9px;
  font-size: 8.5px; letter-spacing: 0.16em;
  background: #fff; color: #0a0a0a; border-radius: 999px; padding: 4px 10px;
}
.todo p {
  font-family: var(--sans); font-size: 14px; line-height: 1.6;
  color: rgba(255,255,255,.55);
}
.todo code {
  font-family: var(--mono); font-size: 12px;
  background: rgba(255,255,255,.09); border-radius: 4px; padding: 1px 5px;
}

.info-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.14); border-radius: 14px;
  overflow: hidden;
}
.info-stats > div { background: #0b0b0d; padding: 22px 24px; }
.info-stats .n {
  display: block; font-family: var(--sans); font-weight: 800;
  font-size: 42px; line-height: 1; letter-spacing: -0.03em;
}
.info-stats .l {
  display: block; margin-top: 10px;
  font-size: 9.5px; line-height: 1.6; letter-spacing: 0.1em;
  color: var(--dim); text-transform: uppercase;
}

.method { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 34px; }
.method li { border-top: 1px solid rgba(255,255,255,.16); padding-top: 16px; }
.method .mn { font-size: 9.5px; letter-spacing: 0.16em; color: var(--dim); }
.method h3 {
  font-family: var(--sans); font-weight: 700; font-size: 19px;
  margin: 10px 0 9px; letter-spacing: -0.01em;
}
.method p { font-family: var(--sans); font-size: 14px; line-height: 1.62; color: rgba(255,255,255,.6); }
/* La trayectoria son CUATRO hitos: con el minmax de arriba caerían 3 + 1 huérfano
   (el ancho útil de .info-inner tope a 1180 px no da para cuatro de 270). Con 360
   quedan 2 × 2 en escritorio y una columna en móvil, como el resto.
   El `min(...)` no es adorno: una pista de 360 px fijos NO encoge por debajo de
   360, así que a 390 px de pantalla se salía del panel. */
.method--4 { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06);
  padding: 9px 16px; border-radius: 999px;
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
}

.contact-list { list-style: none; border-top: 1px solid rgba(255,255,255,.16); margin-bottom: 46px; }
.contact-list li {
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
  padding: 20px 4px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.contact-list .cl { flex: none; width: 130px; font-size: 9.5px; letter-spacing: 0.14em; color: var(--dim); }
.contact-list .cv {
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(17px, 2.2vw, 27px); letter-spacing: -0.01em;
  color: var(--fg); text-decoration: none;
}
a.cv { border-bottom: 1px solid rgba(255,255,255,.3); transition: border-color 0.2s ease; }
a.cv:hover, a.cv:focus-visible { border-color: #fff; }
.copy {
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 7px 14px; font-size: 9px; letter-spacing: 0.12em;
  transition: background 0.2s ease, color 0.2s ease;
}
.copy:hover, .copy:focus-visible { background: #fff; color: #0a0a0a; }
.copy.done { background: #fff; color: #0a0a0a; }

.info-cta { margin-top: 64px; }
.info-cta p { font-size: 10px; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; margin-bottom: 14px; }
.big-link {
  display: inline-block;
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(20px, 3vw, 34px); text-transform: uppercase;
  color: var(--fg); text-decoration: none;
  border-bottom: 2px solid #fff; padding-bottom: 6px;
  transition: opacity 0.25s ease;
}
.big-link:hover, .big-link:focus-visible { opacity: 0.55; }

/* ---------- foco visible (navegación por teclado) ---------- */
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nav-item:focus-visible { outline-color: #0a0a0a; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .ui { padding: 16px 16px; }
  .logo svg { width: 36px; height: 36px; }
  .top-center { position: static; transform: none; text-align: left; padding: 0; }
  .tagline { display: none; }
  /* sin la tagline debajo, el hueco del botón de sonido sobra */
  .sound { margin-bottom: 0; opacity: 1; }
  .top-right { flex-direction: column; align-items: flex-end; gap: 12px; }
  .clocks { font-size: 9px; gap: 5px; }
  .clock.dim { display: none; }
  .cta { font-size: 12px; padding: 12px 20px; }

  .ui.bottom { padding: 16px 16px 18px; align-items: center; }
  .toggle { width: 40px; height: 40px; }
  .main-nav { position: static; transform: none; padding: 4px; }
  .nav-item { font-size: 12px; padding: 10px 15px; }

  .hint { right: 12px; left: 12px; bottom: 84px; width: auto; }

  .list-panel { padding: 92px 6vw 120px; }
  .detail-inner, .info-inner { padding-left: 6vw; padding-right: 6vw; }
  .detail-top, .info-top { margin-bottom: 5vh; }
  .info-panel h1 { margin-bottom: 4vh; }
  .contact-list .cl { width: 100%; }
  .embed-frame { height: 68vh; min-height: 380px; }
  .detail--embed .detail-inner { padding-left: 4vw; padding-right: 4vw; }
}

@media (max-width: 560px) {
  .clocks { display: none; }
  .list-panel .lm { display: none; }
  .list-panel li { grid-template-columns: 40px 1fr; }
  /* la píldora de nav más los dos toggles no caben a 390 px con el tamaño de tablet */
  .ui.bottom { padding-left: 12px; padding-right: 12px; gap: 10px; }
  .view-toggles { gap: 6px; flex: none; }
  .toggle { width: 38px; height: 38px; }
  .main-nav { flex: 1 1 auto; justify-content: center; padding: 4px 3px; }
  .nav-item { font-size: 11px; padding: 9px 11px; white-space: nowrap; }
  /* en vertical la pista tapa la tercera tarjeta propia: se compacta */
  .hint { bottom: 88px; padding: 12px 14px 11px; }
  .hint-list { margin: 9px 0 10px; }
  .hint-list li { font-size: 10.5px; padding: 3px 0 3px 13px; }
  .hint-list li::before { top: 9px; }
  .hint-list .no-movil { display: none; }
  .hint-ok { padding: 8px 0; }
}

/* ---------- accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.05s !important; }
}
