/* =================== PROYECTOS (proyectos.html) =================== */
.pj-page {
  --pj-cyan: #00c3ff;
  --pj-green: #00ff88;
  --pj-line: rgba(255, 255, 255, 0.12);
  --pj-card: rgba(255, 255, 255, 0.045);
  --pj-card-hover: rgba(255, 255, 255, 0.07);
  --pj-radius: 14px;
  --pj-bar-h: 64px;
}

.pj-page .header {
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--pj-line);
}

.pj-page .nav__logo-link { display: inline-flex; }

.pj-eyebrow {
  color: var(--pj-green);
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

/* ---------- Hero ---------- */
.pj-hero {
  position: relative;
  padding: calc(var(--header-height) + 4.5rem) 0 3.5rem;
  overflow: hidden;
  isolation: isolate;
}

.pj-hero__collage {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  opacity: 0.32;
  filter: grayscale(0.55) contrast(1.05);
}

.pj-hero__collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pj-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 10, 26, 0.97) 0%, rgba(10, 10, 26, 0.86) 45%, rgba(10, 10, 26, 0.55) 100%),
    linear-gradient(0deg, #0a0a1a 0%, rgba(10, 10, 26, 0) 40%);
}

.pj-hero__inner { max-width: 1200px; }

.pj-hero__title {
  font-size: clamp(2.3rem, 1.4rem + 4vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
  margin-bottom: 1.25rem;
}

.pj-hero__lead {
  max-width: 56ch;
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
  color: var(--text-color);
}

.pj-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2.75rem;
  max-width: 580px;
  background: var(--pj-line);
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  overflow: hidden;
}

.pj-stats > div {
  background: rgba(10, 10, 26, 0.82);
  padding: 1rem 1.1rem;
}

.pj-stats dt {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pj-stats dd {
  font-family: var(--title-font);
  font-weight: 800;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  color: var(--title-color);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* ---------- Barra fija: etapas + filtro ---------- */
.pj-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--pj-line);
  border-bottom: 1px solid var(--pj-line);
}

.pj-bar__inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  min-height: var(--pj-bar-h);
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.pj-eras {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.pj-eras__link {
  font-family: var(--title-font);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.pj-eras__link:hover { color: var(--title-color); }

.pj-eras__link.is-current {
  color: #0a0a1a;
  background: var(--pj-cyan);
}

.pj-filter {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
  padding: 2px;
}

.pj-filter::-webkit-scrollbar { display: none; }

.pj-chip {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-color);
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--pj-line);
  border-radius: 999px;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.pj-chip:hover { border-color: rgba(255, 255, 255, 0.35); }

.pj-chip.is-active {
  background: rgba(0, 255, 136, 0.12);
  border-color: var(--pj-green);
  color: var(--pj-green);
}

/* ---------- Etapas ---------- */
.pj-era {
  padding: 4.5rem 0 2rem;
  scroll-margin-top: calc(var(--header-height) + var(--pj-bar-h));
}

.pj-era__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  margin-bottom: 2.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--pj-line);
}

.pj-era__years {
  font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--pj-cyan);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.pj-era__sub {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- Línea de tiempo ---------- */
.pj-timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 5rem;
  row-gap: 3rem;
}

.pj-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--pj-cyan) 0%, rgba(0, 195, 255, 0.25) 70%, rgba(0, 195, 255, 0) 100%);
}

.pj-card {
  position: relative;
  grid-column: 1;
  background: var(--pj-card);
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.pj-card--right { grid-column: 2; margin-top: 7rem; }
.pj-card--left + .pj-card--left,
.pj-card--right + .pj-card--right { margin-top: 0; }

.pj-card:hover {
  background: var(--pj-card-hover);
  border-color: rgba(0, 195, 255, 0.35);
}

.pj-card__dot {
  position: absolute;
  top: 2rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0a0a1a;
  border: 3px solid var(--pj-cyan);
}

.pj-card--left .pj-card__dot { right: calc(-2.5rem - 7px); }
.pj-card--right .pj-card__dot { left: calc(-2.5rem - 7px); }

.pj-card--event { border-color: rgba(0, 255, 136, 0.4); }
.pj-card--event .pj-card__dot { border-color: var(--pj-green); }

.pj-card__media { padding: 6px 6px 0; }

.pj-card__cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--pj-radius) - 5px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  cursor: zoom-in;
}

.pj-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.pj-card__cover:hover img { transform: scale(1.04); }

.pj-card__count {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  background: rgba(10, 10, 26, 0.78);
  border-radius: 999px;
}

.pj-card__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 6px;
}

.pj-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(255, 255, 255, 0.04);
}

.pj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.pj-thumb:hover img { opacity: 1; }

.pj-thumb__more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--title-font);
  font-weight: 700;
  color: #fff;
  background: rgba(10, 10, 26, 0.62);
}

.pj-card__body { padding: 1.2rem 1.4rem 1.5rem; }

.pj-card__meta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pj-cyan);
  margin-bottom: 0.35rem;
}

.pj-card__meta i { margin-right: 0.2rem; }

.pj-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.6rem;
}

.pj-badge {
  display: inline-block;
  vertical-align: 0.2em;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0a0a1a;
  background: var(--pj-green);
  border-radius: 4px;
}

.pj-badge--live {
  color: #0a0a1a;
  background: #ffc940;
}

.pj-card__client {
  font-size: 0.9rem;
  color: var(--title-color);
  margin-bottom: 0.5rem;
}

.pj-card__client span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.35rem;
}

.pj-card__desc {
  font-size: 0.98rem;
  color: var(--text-color);
  line-height: 1.6;
}

.pj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

.pj-tags li {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--pj-line);
  border-radius: 999px;
}

/* Etapa con un solo proyecto: tarjeta horizontal a todo el ancho */
.pj-timeline--single { grid-template-columns: 1fr; }
.pj-timeline--single::before { display: none; }
.pj-timeline--single .pj-card {
  grid-column: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: center;
}
.pj-timeline--single .pj-card__media { padding: 6px; }
.pj-timeline--single .pj-card__dot { display: none; }
.pj-timeline--single .pj-card__body { padding: 1.5rem 2rem; }
.pj-timeline--single .pj-card__title { font-size: clamp(1.4rem, 1.1rem + 0.9vw, 1.9rem); }

/* ---------- Otras obras ---------- */
.pj-more {
  margin-top: 3rem;
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  background: rgba(255, 255, 255, 0.025);
}

.pj-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  font-family: var(--title-font);
  font-weight: 700;
  color: var(--title-color);
  cursor: pointer;
  list-style: none;
}

.pj-more summary::-webkit-details-marker { display: none; }
.pj-more summary i { transition: transform 0.25s ease; color: var(--pj-cyan); }
.pj-more[open] summary i { transform: rotate(180deg); }

.pj-more__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 2rem;
  padding: 0 1.4rem 1.4rem;
}

.pj-more__list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text-color);
}

.pj-more__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pj-cyan);
}

/* ---------- Vacío / CTA ---------- */
.pj-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.pj-link {
  color: var(--pj-cyan);
  text-decoration: underline;
  font-size: inherit;
}

.pj-cta { padding: 4rem 0 5rem; }

.pj-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border: 1px solid var(--pj-line);
  border-radius: var(--pj-radius);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(0, 195, 255, 0.16) 0%, rgba(0, 195, 255, 0) 60%),
    rgba(255, 255, 255, 0.035);
}

.pj-cta__title {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem);
  font-weight: 800;
  max-width: 22ch;
}

.pj-cta__text {
  max-width: 52ch;
  color: var(--text-color);
}

.pj-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pj-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0 1.6rem;
  border-radius: 10px;
  font-family: var(--title-font);
  font-weight: 700;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.pj-btn:active { transform: scale(0.97); }

.pj-btn--primary {
  color: #fff;
  background: #0066cc;
}

.pj-btn--primary:hover { background: #0057b0; }

.pj-crumbs {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pj-crumbs a { color: var(--pj-cyan); }
.pj-crumbs a:hover { text-decoration: underline; }

.pj-btn--ghost {
  color: var(--title-color);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.pj-btn--ghost:hover { border-color: var(--pj-cyan); }

/* ---------- Lightbox ---------- */
.pj-lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 6, 14, 0.96);
  color: #fff;
}

.pj-lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }

.pj-lightbox__figure {
  position: absolute;
  inset: 3.5rem 4.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.pj-lightbox__img {
  max-width: 100%;
  max-height: calc(100% - 2.5rem);
  object-fit: contain;
  border-radius: 6px;
}

.pj-lightbox__caption {
  display: flex;
  gap: 1rem;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 0.95rem;
}

.pj-lightbox__count { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.pj-lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease;
}

.pj-lightbox__btn:hover { background: rgba(255, 255, 255, 0.2); }
.pj-lightbox__close { top: 1rem; right: 1rem; }
.pj-lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.pj-lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }

/* ---------- Aparición al hacer scroll ---------- */
.pj-js .pj-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.25s ease, border-color 0.25s ease;
}

.pj-js .pj-card.is-in {
  opacity: 1;
  transform: none;
}

.pj-card.is-hidden { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pj-js .pj-card { opacity: 1; transform: none; transition: none; }
  .pj-card__cover img { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pj-bar__inner { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .pj-filter { margin-left: 0; }
  .pj-era { scroll-margin-top: calc(var(--header-height) + 108px); }
}

@media (max-width: 900px) {
  .pj-timeline {
    grid-template-columns: 1fr;
    row-gap: 2rem;
    padding-left: 1.75rem;
  }

  .pj-timeline::before { left: 6px; transform: none; }
  .pj-timeline--single { padding-left: 0; }
  .pj-timeline--single .pj-card { grid-template-columns: 1fr; }
  .pj-timeline--single .pj-card__media { padding: 6px 6px 0; }
  .pj-timeline--single .pj-card__body { padding: 1.2rem 1.4rem 1.5rem; }

  .pj-card,
  .pj-card--right { grid-column: 1; margin-top: 0; }

  .pj-card--left .pj-card__dot,
  .pj-card--right .pj-card__dot { left: calc(-1.75rem - 1px); right: auto; }

  .pj-more__list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .pj-hero { padding-top: calc(var(--header-height) + 2.5rem); }
  .pj-hero__collage { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
  .pj-stats > div { padding: 0.85rem 0.8rem; }
  .pj-stats dt { font-size: 0.7rem; letter-spacing: 0.04em; }
  .pj-eras { overflow-x: auto; scrollbar-width: none; }
  .pj-era { padding-top: 3rem; }
  .pj-card__body { padding: 1rem 1.1rem 1.25rem; }
  .pj-cta__actions, .pj-btn { width: 100%; }
  .pj-lightbox__figure { inset: 3.75rem 0.5rem 4.5rem; }
  .pj-lightbox__prev, .pj-lightbox__next { top: auto; bottom: 1rem; transform: none; }
  .pj-lightbox__prev { left: calc(50% - 56px); }
  .pj-lightbox__next { right: calc(50% - 56px); }
}
