/* Portafolio — brochures inmersivos con identidad visual por proyecto. */

.portfolio-page {
  --pf-primary: #17141d;
  --pf-accent: #1fb6ce;
  --pf-accent-2: #5fd0e0;
  --pf-accent-readable: color-mix(in srgb, var(--pf-accent) 45%, var(--pf-text));
  --pf-canvas: #f5f5f2;
  --pf-surface: #ffffff;
  --pf-ink: #ffffff;
  --pf-text: #17141d;
  --pf-muted: #5b5863;
  --pf-font-display: "Roboto", system-ui, sans-serif;
  --pf-font-body: "Roboto", system-ui, sans-serif;
}

.portfolio-page main {
  overflow: clip;
  background: var(--pf-canvas);
}

.pf-brochure,
.pf-brochure h1,
.pf-brochure h2,
.pf-brochure h3,
.pf-section-head__title {
  font-family: var(--pf-font-display);
}

/* Hero ------------------------------------------------------------------ */
.pf-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: max(720px, calc(100svh - var(--header-h, 88px)));
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--pf-ink);
  background: var(--pf-primary);
}

.pf-hero__art {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.pf-hero__art i,
.pf-hero__art b {
  position: absolute;
  display: block;
}

.pf-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(460px, 1.16fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: center;
  width: 100%;
  padding-top: clamp(4.5rem, 9vw, 8.5rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

.pf-hero__copy {
  position: relative;
  z-index: 2;
  max-width: 670px;
}

.pf-hero__brand {
  display: inline-flex;
  min-width: 108px;
  min-height: 62px;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.pf-hero__brand img {
  width: auto;
  max-width: 220px;
  height: clamp(34px, 4vw, 52px);
  object-fit: contain;
}

.pf-hero__brand--text {
  color: var(--pf-primary);
  font-family: var(--pf-font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.pf-hero__tag,
.pf-gallery__head > span,
.pf-section-head__kicker {
  display: block;
  color: var(--pf-accent);
  font-family: var(--pf-font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.3;
  text-transform: uppercase;
}

.pf-hero h1 {
  max-width: 10ch;
  margin-top: 0.7rem;
  color: inherit;
  font-size: clamp(3.5rem, 7.2vw, 7.8rem);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.88;
  text-wrap: balance;
}

.pf-hero__headline {
  max-width: 28ch;
  margin-top: clamp(1.6rem, 3vw, 2.5rem);
  color: inherit;
  font-family: var(--pf-font-display);
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.pf-hero__description {
  max-width: 58ch;
  margin-top: 1.2rem;
  color: color-mix(in srgb, var(--pf-ink) 78%, transparent);
  font-family: var(--pf-font-body);
  font-size: clamp(0.98rem, 1.2vw, 1.1rem);
  line-height: 1.7;
}

.pf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.pf-btn {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--pf-font-body);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.pf-btn:hover { transform: translateY(-3px); }
.pf-btn:focus-visible { outline: 3px solid var(--pf-accent-2); outline-offset: 4px; }

.pf-btn--accent {
  color: var(--pf-primary);
  background: var(--pf-accent);
}

.pf-btn--accent:hover { background: var(--pf-accent-2); }

.pf-btn--ghost {
  color: var(--pf-ink);
  border-color: color-mix(in srgb, var(--pf-ink) 42%, transparent);
  background: color-mix(in srgb, var(--pf-primary) 74%, transparent);
}

.pf-btn--ghost:hover { border-color: var(--pf-ink); }

.pf-hero__visual {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(100%, 760px);
  padding: clamp(1rem, 2.5vw, 2rem) 0;
}

.pf-browser {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pf-ink) 25%, transparent);
  border-radius: clamp(14px, 2vw, 24px);
  color: var(--pf-text);
  background: var(--pf-surface);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.36);
  text-align: left;
  transform: translateZ(0);
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.pf-browser:hover {
  box-shadow: 0 42px 105px rgba(0, 0, 0, 0.44);
  transform: translateY(-5px);
}

.pf-browser:focus-visible { outline: 4px solid var(--pf-accent); outline-offset: 5px; }

.pf-browser--hero { transform: rotate(1.2deg); }
.pf-browser--hero:hover { transform: rotate(0deg) translateY(-5px); }

.pf-browser__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border-bottom: 1px solid rgba(20, 20, 24, 0.1);
  color: #5d5d62;
  background: #f7f7f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
}

.pf-browser__dots { display: flex; gap: 5px; }
.pf-browser__dots i { width: 7px; height: 7px; border-radius: 50%; background: #cacacd; }
.pf-browser__dots i:first-child { background: var(--pf-accent); }
.pf-browser__address { overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pf-browser__open { font-size: 0.85rem; }
.pf-browser__viewport { display: block; overflow: hidden; aspect-ratio: 16 / 10; background: #e9e9e7; }
.pf-browser__viewport img { width: 100%; height: 100%; object-fit: cover; }

.pf-hero__metric {
  position: absolute;
  right: clamp(-1.1rem, -1.5vw, -0.35rem);
  bottom: clamp(-1rem, -1.5vw, -0.25rem);
  display: grid;
  width: clamp(118px, 12vw, 156px);
  aspect-ratio: 1;
  place-content: center;
  padding: 1rem;
  border-radius: 50%;
  color: var(--pf-primary);
  background: var(--pf-accent);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
  text-align: center;
  transform: rotate(-7deg);
}

.pf-hero__metric strong {
  color: inherit;
  font-family: var(--pf-font-display);
  font-size: clamp(2.2rem, 4vw, 4rem);
  letter-spacing: -0.06em;
  line-height: 0.8;
}

.pf-hero__metric span {
  max-width: 11ch;
  margin: 0.5rem auto 0;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.pf-hero__stamp {
  position: absolute;
  top: -1.6rem;
  right: 1.5rem;
  color: color-mix(in srgb, var(--pf-ink) 70%, transparent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Motivos de marketing por identidad ------------------------------------ */
.pf-motif--aura .pf-hero__art::before,
.pf-motif--aura .pf-hero__art::after {
  position: absolute;
  width: 52vw;
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  filter: blur(55px);
  opacity: 0.22;
}
.pf-motif--aura .pf-hero__art::before { top: -28vw; right: -10vw; background: #9b6bd9; }
.pf-motif--aura .pf-hero__art::after { bottom: -34vw; left: 8vw; background: #5bd9a0; }
.pf-motif--aura .pf-hero__art i { top: 13%; right: 8%; width: 38vw; aspect-ratio: 1; border: 1px solid rgba(224, 189, 122, 0.32); border-radius: 50%; }
.pf-motif--aura .pf-hero__art i:nth-child(2) { inset: 21% auto auto 61%; width: 24vw; }

.pf-motif--rioja .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 8vw, rgba(255, 255, 255, 0.035) 8vw calc(8vw + 1px));
  content: "";
}
.pf-motif--rioja .pf-hero__art i { top: -12%; right: 4%; width: 22vw; height: 130%; border: 1px solid rgba(200, 16, 46, 0.35); transform: skewX(-12deg); }
.pf-motif--rioja .pf-hero__art i:nth-child(2) { right: 30%; border-color: rgba(255, 255, 255, 0.1); }
.pf-motif--rioja .pf-hero__art b { right: -8vw; bottom: -20vw; width: 42vw; aspect-ratio: 1; border: 9vw solid rgba(200, 16, 46, 0.12); border-radius: 50%; }

.pf-motif--candle .pf-hero__art i { border-radius: 999px 999px 40% 40%; background: var(--pf-accent); opacity: 0.18; transform: rotate(32deg); }
.pf-motif--candle .pf-hero__art i:nth-child(1) { top: 5%; right: 5%; width: 13vw; height: 30vw; }
.pf-motif--candle .pf-hero__art i:nth-child(2) { right: 34%; bottom: -8%; width: 8vw; height: 20vw; background: var(--pf-accent-2); transform: rotate(-28deg); }
.pf-motif--candle .pf-hero__art i:nth-child(3) { top: 12%; left: 40%; width: 4vw; height: 10vw; background: #d9a85c; transform: rotate(18deg); }
.pf-motif--candle .pf-hero__art b { width: 18px; aspect-ratio: 1; border-radius: 50%; background: #fff; opacity: 0.6; box-shadow: 70px 80px 0 #7fa968, 150px 12px 0 #d9a85c, 240px 110px 0 #fff; }
.pf-motif--candle .pf-hero__art b:first-of-type { top: 13%; left: 48%; }

.pf-motif--blueprint .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(95, 175, 196, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(95, 175, 196, 0.12) 1px, transparent 1px);
  background-size: 46px 46px;
  content: "";
  mask-image: linear-gradient(90deg, transparent, #000 48%, #000);
}
.pf-motif--blueprint .pf-hero__art i { top: 14%; right: 3%; width: 34vw; aspect-ratio: 1; border: 1px solid rgba(95, 175, 196, 0.36); border-radius: 50%; }
.pf-motif--blueprint .pf-hero__art i::before,
.pf-motif--blueprint .pf-hero__art i::after { position: absolute; background: rgba(95, 175, 196, 0.3); content: ""; }
.pf-motif--blueprint .pf-hero__art i::before { top: 50%; left: -20%; width: 140%; height: 1px; }
.pf-motif--blueprint .pf-hero__art i::after { top: -20%; left: 50%; width: 1px; height: 140%; }

.pf-motif--casefile .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 40%, rgba(158, 34, 38, 0.2), transparent 32%), repeating-linear-gradient(135deg, transparent 0 32px, rgba(201, 162, 94, 0.035) 32px 33px);
  content: "";
}
.pf-motif--casefile .pf-hero__art i { top: 5%; right: 11%; width: 18vw; aspect-ratio: 1; border: 1px solid rgba(201, 162, 94, 0.22); transform: rotate(45deg); }
.pf-motif--casefile .pf-hero__art i:nth-child(2) { top: auto; right: 36%; bottom: -8%; width: 12vw; border-color: rgba(158, 34, 38, 0.38); }
.pf-motif--casefile .pf-hero__art b { top: 15%; left: 4%; width: 11rem; height: 2px; background: #9e2226; opacity: 0.45; transform: rotate(-18deg); }

.pf-motif--cosmos .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.86) 1px, transparent 1.5px), radial-gradient(circle, rgba(0, 229, 255, 0.75) 1px, transparent 1.5px);
  background-position: 0 0, 37px 53px;
  background-size: 83px 83px, 121px 121px;
  content: "";
  opacity: 0.38;
}
.pf-motif--cosmos .pf-hero__art i { top: 5%; right: -5%; width: 34vw; aspect-ratio: 1; border: 7vw solid rgba(247, 194, 41, 0.12); border-radius: 50%; transform: rotate(-18deg) scaleY(0.42); }
.pf-motif--cosmos .pf-hero__art i:nth-child(2) { top: auto; right: 40%; bottom: -15%; width: 20vw; border-width: 4vw; border-color: rgba(0, 229, 255, 0.1); }

.pf-motif--organic .pf-hero__art i { border-radius: 56% 44% 63% 37% / 47% 64% 36% 53%; background: var(--pf-accent); opacity: 0.18; }
.pf-motif--organic .pf-hero__art i:nth-child(1) { top: -18%; right: -8%; width: 48vw; aspect-ratio: 1; transform: rotate(24deg); }
.pf-motif--organic .pf-hero__art i:nth-child(2) { bottom: -20%; left: 29%; width: 28vw; aspect-ratio: 1; background: var(--pf-accent-2); transform: rotate(-18deg); }
.pf-motif--organic .pf-hero__art b { top: 10%; left: 47%; width: 17vw; aspect-ratio: 1; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%; }

.pf-motif--campus .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 48%, rgba(1, 185, 3, 0.14) 48% 63%, transparent 63%), linear-gradient(36deg, transparent 0 62%, rgba(72, 0, 209, 0.18) 62% 78%, transparent 78%);
  content: "";
}
.pf-motif--campus .pf-hero__art i { top: 12%; right: 3%; width: 22vw; aspect-ratio: 1; border-radius: 50%; background: #01b903; opacity: 0.2; }
.pf-motif--campus .pf-hero__art i:nth-child(2) { top: 38%; right: 25%; width: 16vw; background: #4800d1; }

.pf-motif--momentum .pf-hero__art::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(118deg, transparent 0 15vw, rgba(251, 186, 0, 0.08) 15vw 24vw, transparent 24vw 36vw);
  content: "";
}
.pf-motif--momentum .pf-hero__art i { top: -20%; right: 1%; width: 9vw; height: 145%; background: var(--pf-accent); opacity: 0.18; transform: rotate(21deg); }
.pf-motif--momentum .pf-hero__art i:nth-child(2) { right: 18%; width: 3vw; opacity: 0.32; }
.pf-motif--momentum .pf-hero__art b { right: -7vw; bottom: -15vw; width: 34vw; aspect-ratio: 1; border: 6vw solid rgba(251, 186, 0, 0.12); border-radius: 50%; }

/* Narrativa ------------------------------------------------------------- */
.pf-story {
  position: relative;
  padding: clamp(6rem, 12vw, 12rem) 0;
  color: var(--pf-text);
  background: var(--pf-surface);
}

.pf-story__grid {
  display: grid;
  grid-template-columns: minmax(130px, 0.24fr) minmax(0, 1fr);
  gap: clamp(2rem, 8vw, 8rem);
  align-items: start;
}

.pf-story__label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--pf-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.pf-story__label span {
  color: var(--pf-accent);
  font-family: var(--pf-font-display);
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.85;
}

.pf-story__content h2 {
  max-width: 18ch;
  color: var(--pf-text);
  font-size: clamp(2.7rem, 6.1vw, 6.4rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.98;
  text-wrap: balance;
}

.pf-story__highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: clamp(3rem, 7vw, 6rem);
}

.pf-story__highlights li {
  min-height: 150px;
  padding: 1.4rem;
  border: 1px solid color-mix(in srgb, var(--pf-text) 12%, transparent);
  border-radius: 20px;
  color: var(--pf-text);
  background: var(--pf-canvas);
  font-family: var(--pf-font-display);
  font-size: clamp(1rem, 1.7vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
}

.pf-story__highlights span {
  display: block;
  margin-bottom: 2.7rem;
  color: var(--pf-accent);
  font-family: var(--pf-font-body);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.pf-story__label span,
.pf-story__highlights span,
.pf-gallery__head > span,
.pf-chapter__number {
  color: var(--pf-accent-readable);
}

/* Galería editorial ----------------------------------------------------- */
.pf-gallery {
  padding: clamp(6rem, 11vw, 11rem) 0;
  color: var(--pf-text);
  background: var(--pf-canvas);
}

.pf-gallery__head {
  display: grid;
  max-width: 900px;
  margin-bottom: clamp(5rem, 9vw, 9rem);
}

.pf-gallery__head h2 {
  max-width: 15ch;
  margin-top: 1rem;
  color: var(--pf-text);
  font-size: clamp(3rem, 6.4vw, 6.8rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-wrap: balance;
}

.pf-gallery__head p {
  max-width: 58ch;
  margin-top: 1.5rem;
  color: var(--pf-muted);
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  line-height: 1.7;
}

.pf-gallery__chapters { display: grid; gap: clamp(7rem, 14vw, 14rem); }

.pf-chapter {
  display: grid;
  grid-template-columns: minmax(230px, 0.34fr) minmax(0, 1fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: center;
  min-height: min(78vh, 850px);
}

.pf-chapter--reverse { grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr); }
.pf-chapter--reverse .pf-chapter__copy { order: 2; }
.pf-chapter--reverse .pf-chapter__media { order: 1; }

.pf-chapter__copy { position: relative; z-index: 1; }
.pf-chapter__number { color: var(--pf-accent-readable); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.18em; }
.pf-chapter__copy h3 { margin-top: 1.15rem; color: var(--pf-text); font-size: clamp(2rem, 4.1vw, 4.4rem); font-weight: 750; letter-spacing: -0.045em; line-height: 0.98; text-wrap: balance; }
.pf-chapter__copy p { max-width: 38ch; margin-top: 1.2rem; color: var(--pf-muted); font-size: 1rem; line-height: 1.72; }
.pf-chapter__media { position: relative; min-width: 0; }
.pf-browser--chapter { border-color: color-mix(in srgb, var(--pf-text) 18%, transparent); box-shadow: 0 32px 90px color-mix(in srgb, var(--pf-primary) 24%, transparent); }
.pf-chapter:nth-child(3n + 2) .pf-browser--chapter { transform: rotate(-0.7deg); }
.pf-chapter:nth-child(3n + 3) .pf-browser--chapter { transform: rotate(0.7deg); }
.pf-chapter .pf-browser--chapter:hover { transform: translateY(-5px); }

.pf-gallery__chapters--single .pf-chapter {
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 1fr);
  min-height: 58vh;
}

/* CTA, tecnologías y relacionados -------------------------------------- */
.pf-cta-band {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
  color: var(--pf-ink);
  background: var(--pf-primary);
}

.pf-cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.pf-cta-band p { max-width: 24ch; color: var(--pf-ink); font-family: var(--pf-font-display); font-size: clamp(2rem, 4.4vw, 4.2rem); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }

.pf-related-section {
  padding: clamp(5.5rem, 10vw, 9rem) 0;
  color: #fff;
  background: #191721;
}

.pf-section-head { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.pf-section-head__title { margin-top: 0.8rem; color: inherit; font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 700; letter-spacing: -0.05em; }
.pf-related-section .pf-section-head__kicker { color: #5fd0e0; }

.pf-related-section .cases-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.pf-related-section .case {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #fff;
  background: #24212d;
  box-shadow: none;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.pf-related-section .case:hover { border-color: rgba(95, 208, 224, 0.65); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28); transform: translateY(-7px); }
.pf-related-section .case__media { width: 100%; height: auto; aspect-ratio: 16 / 10; margin: 0; padding: 0; border: 0; border-radius: 0; background: #ececec; }
.pf-related-section .case__media img { width: 100%; height: 100%; object-fit: cover; filter: none; }
.pf-related-section .case__body { flex: 1; padding: 1.25rem; }
.pf-related-section .case__tag { color: #5fd0e0; font-size: 0.67rem; font-weight: 800; letter-spacing: 0.14em; }
.pf-related-section .case__body h3 { margin-top: 0.55rem; color: #fff; font-size: 1.1rem; }
.pf-related-section .case__body p { margin-top: 0.65rem; color: rgba(255, 255, 255, 0.68); font-size: 0.82rem; line-height: 1.55; }

/* Visor de capturas ----------------------------------------------------- */
body.pf-lightbox-open { overflow: hidden; }
.portfolio-page .footer { margin-top: 0; }
.pf-lightbox {
  width: min(94vw, 1540px);
  max-width: none;
  max-height: 94vh;
  padding: clamp(2.7rem, 5vw, 4.5rem);
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  color: #fff;
  background: #111115;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.64);
}
.pf-lightbox::backdrop { background: rgba(7, 7, 9, 0.88); backdrop-filter: blur(10px); }
.pf-lightbox figure { margin: 0; }
.pf-lightbox figure img { width: 100%; max-height: calc(94vh - 10rem); object-fit: contain; border-radius: 12px; background: #242429; }
.pf-lightbox figcaption { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; font-family: var(--pf-font-body); }
.pf-lightbox figcaption strong { color: #fff; font-size: 0.95rem; }
.pf-lightbox figcaption span { color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
.pf-lightbox__close,
.pf-lightbox__nav { position: absolute; display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.24); border-radius: 50%; color: #fff; background: #19191e; font-size: 1.35rem; }
.pf-lightbox__close:hover,
.pf-lightbox__nav:hover { border-color: var(--pf-accent); color: var(--pf-accent); }
.pf-lightbox__close { top: 0.7rem; right: 0.7rem; }
.pf-lightbox__nav { top: 50%; transform: translateY(-50%); }
.pf-lightbox__nav--prev { left: 0.65rem; }
.pf-lightbox__nav--next { right: 0.65rem; }

.pf-not-found { min-height: 70vh; padding: 8rem 0; color: var(--pf-ink); background: var(--pf-primary); text-align: center; }
.pf-not-found span { color: var(--pf-accent); font-family: var(--pf-font-display); font-size: clamp(5rem, 15vw, 12rem); font-weight: 800; line-height: 0.8; }
.pf-not-found h1 { margin: 1.5rem auto 2rem; color: inherit; }

/* Responsive ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .pf-hero__grid { grid-template-columns: 1fr; gap: 3rem; }
  .pf-hero__copy { max-width: 820px; }
  .pf-hero h1 { max-width: 12ch; }
  .pf-hero__visual { justify-self: center; width: min(92%, 800px); }
  .pf-story__grid { grid-template-columns: 1fr; gap: 2rem; }
  .pf-story__label { flex-direction: row; align-items: baseline; }
  .pf-chapter,
  .pf-chapter--reverse,
  .pf-gallery__chapters--single .pf-chapter { grid-template-columns: 1fr; min-height: 0; }
  .pf-chapter--reverse .pf-chapter__copy,
  .pf-chapter--reverse .pf-chapter__media { order: initial; }
  .pf-chapter__copy { max-width: 650px; }
  .pf-related-section .cases-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .pf-hero { min-height: auto; }
  .pf-hero__grid { padding-top: 4rem; padding-bottom: 5rem; }
  .pf-hero h1 { font-size: clamp(3.4rem, 16vw, 5.8rem); }
  .pf-hero__headline { font-size: 1.35rem; }
  .pf-hero__description { font-size: 0.96rem; }
  .pf-hero__visual { width: 100%; padding-right: 0.5rem; }
  .pf-hero__metric { right: -0.2rem; bottom: -2.5rem; width: 112px; }
  .pf-hero__stamp { display: none; }
  .pf-browser__bar { min-height: 36px; }
  .pf-browser__address { font-size: 0.55rem; }
  .pf-story { padding: 6rem 0; }
  .pf-story__content h2 { font-size: clamp(2.65rem, 13vw, 4.8rem); }
  .pf-story__highlights { grid-template-columns: 1fr; }
  .pf-story__highlights li { min-height: 120px; }
  .pf-story__highlights span { margin-bottom: 1.6rem; }
  .pf-gallery { padding: 6rem 0; }
  .pf-gallery__head { margin-bottom: 5rem; }
  .pf-gallery__head h2 { font-size: clamp(2.8rem, 13vw, 4.8rem); }
  .pf-gallery__chapters { gap: 7rem; }
  .pf-chapter { gap: 2rem; }
  .pf-chapter__copy h3 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .pf-cta-band__inner { align-items: flex-start; flex-direction: column; }

  .pf-lightbox { width: 96vw; padding: 3.5rem 0.8rem 1.2rem; border-radius: 16px; }
  .pf-lightbox figure img { max-height: calc(94vh - 9rem); }
  .pf-lightbox__nav { top: auto; bottom: 0.7rem; transform: none; }
  .pf-lightbox__nav--prev { left: 0.75rem; }
  .pf-lightbox__nav--next { right: 0.75rem; }
  .pf-lightbox figcaption { padding: 0 3.2rem; }
}

@media (max-width: 560px) {
  .pf-hero__actions { align-items: stretch; flex-direction: column; }
  .pf-btn { width: 100%; }
  .pf-hero__brand img { max-width: 180px; }
  .pf-related-section .cases-grid { grid-template-columns: 1fr; }

  .pf-cta-band .pf-btn { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-browser,
  .pf-btn { transition: none; }
  .pf-browser--hero,
  .pf-chapter:nth-child(3n + 2) .pf-browser--chapter,
  .pf-chapter:nth-child(3n + 3) .pf-browser--chapter { transform: none; }
}

@supports not (color: color-mix(in srgb, white, black)) {
  .portfolio-page { --pf-accent-readable: var(--pf-text); }
  .pf-hero__description { color: rgba(255, 255, 255, 0.78); }
  .pf-btn--ghost { border-color: rgba(255, 255, 255, 0.4); background: transparent; }
  .pf-browser { border-color: rgba(255, 255, 255, 0.25); }
  .pf-story__highlights li { border-color: rgba(0, 0, 0, 0.12); }

}

/* ═════════════════════════════════════════════════════════════════════════
   ÍNDICE DEL PORTAFOLIO — portafolio.html sin ?slug=
   ═════════════════════════════════════════════════════════════════════════
   Portada que lista todos los proyectos y lleva a cada ficha. Usa las mismas
   variables --pf-* que las fichas, pero con el tema por defecto de Trixel.
   Cada tarjeta toma prestado el color de acento de su propio proyecto en
   --card-accent, así el listado ya anticipa la identidad de cada caso.
   ───────────────────────────────────────────────────────────────────────── */
.pf-index {
  background: var(--pf-primary);
  color: var(--pf-ink);
  padding: calc(var(--header-h, 88px) + 4rem) 0 6rem;
}

.pf-index__head {
  max-width: 62ch;
  margin-bottom: 3.5rem;
}
.pf-index__kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pf-accent);
  margin-bottom: 1rem;
}
.pf-index__head h1 {
  font-family: var(--pf-font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  /* base.css pinta todos los h1 con --c-text (tinta oscura). Sobre el fondo
     oscuro del índice hay que devolverle el color heredado de .pf-index. */
  color: inherit;
}
/* ── Rejilla de proyectos ────────────────────────────────────────────────── */
.pf-index__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.pf-index__card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  overflow: hidden;
  color: inherit;
}
.pf-index__card:hover {
  border-color: var(--card-accent, var(--pf-accent));
  background: rgba(255, 255, 255, 0.07);
}
.pf-index__shot {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 3px solid var(--card-accent, var(--pf-accent));
}
.pf-index__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.pf-index__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.6rem;
  padding: 1.5rem;
}
.pf-index__tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--card-accent, var(--pf-accent));
}
.pf-index__name {
  font-family: var(--pf-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pf-index__headline {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.68);
  flex: 1;
}
.pf-index__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--card-accent, var(--pf-accent));
}
.pf-index__link i { font-style: normal; }

/* ── Cierre ──────────────────────────────────────────────────────────────── */
.pf-index__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 4rem;
  padding: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}
.pf-index__cta p {
  margin: 0;
  font-family: var(--pf-font-display);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
  /* base.css pinta los <p> con --c-text-soft, que aquí sería ilegible. */
  color: var(--pf-ink);
}

@media (max-width: 980px) {
  .pf-index__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .pf-index { padding: calc(var(--header-h, 88px) + 2.5rem) 0 4rem; }
  .pf-index__grid { grid-template-columns: 1fr; }
  .pf-index__cta { flex-direction: column; align-items: flex-start; }
}
