/* Portafolio en linea de tiempo — "Laboratorios bajo nuestro escudo" (solo /portafolio/). */

.pf-hero { position: relative; overflow: hidden; background: var(--carbon); color: #f2f2f2; padding: 5rem 1.5rem 4.5rem; text-align: center; }
.pf-hero-shield { position: absolute; right: -4%; top: 50%; width: 360px; transform: translateY(-50%); fill: none; stroke: rgba(254,201,0,.12); stroke-width: 1; }
.pf-hero-inner { position: relative; max-width: 760px; margin: 0 auto; }
.pf-eyebrow { margin: 0 0 .7em; color: var(--gold); font-size: .8rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.pf-hero h1 { color: #f6f6f6; font-weight: 300; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.1; margin-bottom: .5em; }
.pf-hero p:last-child { color: #cfcfcf; font-weight: 300; font-size: 1.1rem; margin: 0; }

/* ---------- Linea de tiempo ---------- */
.pf-timeline { max-width: 1100px; margin: 0 auto; padding: 4rem 1.5rem 3rem; }
.pf-timeline ol { list-style: none; margin: 0; padding: 0; position: relative; }
.pf-timeline ol::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, var(--gold) 4%, var(--gold-dark) 96%, transparent);
}
.pf-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0 5rem; margin-bottom: 3.2rem; }
.pf-item > :not(.pf-node) { grid-column: 1; text-align: right; }
.pf-item:nth-child(even) > :not(.pf-node) { grid-column: 2; text-align: left; }

/* Nodo = escudo sobre la linea; en los proyectos se "activa" (relleno dorado + check) al entrar en pantalla */
.pf-node { position: absolute; left: 50%; top: .4rem; width: 40px; transform: translateX(-50%); z-index: 1; }
.pf-node svg { width: 100%; height: auto; display: block; }
.pf-node path:first-child { fill: #fff; stroke: var(--gold-dark); stroke-width: 2.5; stroke-linejoin: round; transition: fill .6s ease, stroke .6s ease; }
.pf-proyecto .pf-node path:first-child { fill: var(--gold); stroke: var(--gold-dark); }
.pf-check { fill: none; stroke: var(--carbon); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 0; transition: stroke-dashoffset .6s ease .35s; }
.pf-hito .pf-node { width: 48px; }
.pf-hito .pf-node path:first-child { fill: var(--carbon); stroke: var(--gold); }

/* Hitos de la empresa */
.pf-hito-body { padding-top: .2rem; }
.pf-hito-body .pf-year { font-size: 2.6rem; }
.pf-hito-body h2 { font-weight: 600; font-size: 1.15rem; margin-bottom: .3rem; }
.pf-hito-body p { margin: 0; color: var(--charcoal); font-weight: 300; }

.pf-year { display: block; color: var(--gold-dark); font-weight: 200; font-size: 2rem; line-height: 1; letter-spacing: .02em; margin-bottom: .35rem; }
.pf-year.is-pending { font-size: 1rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gray); }

/* Tarjetas de proyecto */
.pf-card { background: #fff; border: 1px solid #ebe6db; box-shadow: 0 6px 22px rgba(36,29,17,.07); text-align: left !important; transition: box-shadow .3s ease, transform .3s ease; }
.pf-card:hover { box-shadow: 0 14px 34px rgba(36,29,17,.14); transform: translateY(-3px); }
.pf-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.pf-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; }
.pf-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.pf-card:hover .pf-media img { transform: scale(1.05); }
.pf-count { position: absolute; right: .7rem; bottom: .7rem; padding: .25rem .7rem; border-radius: 999px; background: rgba(36,29,17,.82); color: var(--gold); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.pf-card-body { padding: 1.1rem 1.3rem 1.3rem; border-top: 3px solid var(--gold); }
.pf-card-body h3 { margin: 0 0 .25rem; font-weight: 600; font-size: 1.25rem; }
.pf-protegido { margin: 0; color: var(--gray); font-size: .85rem; }
.pf-protegido::before { content: ""; display: inline-block; width: .7em; height: .8em; margin-right: .45em; vertical-align: -.05em; background: var(--gold); clip-path: polygon(50% 0, 100% 15%, 100% 50%, 50% 100%, 0 50%, 0 15%); }

/* Aparicion al hacer scroll (solo si hay JS y sin "reducir movimiento") */
.pf-anim .pf-item > :not(.pf-node) { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.pf-anim .pf-item.is-visible > :not(.pf-node) { opacity: 1; transform: none; }
.pf-anim .pf-proyecto .pf-node path:first-child { fill: #fff; }
.pf-anim .pf-proyecto.is-visible .pf-node path:first-child { fill: var(--gold); }
.pf-anim .pf-proyecto .pf-check { stroke-dashoffset: 30; }
.pf-anim .pf-proyecto.is-visible .pf-check { stroke-dashoffset: 0; }

@media (max-width: 860px) {
  .pf-timeline ol::before { left: 20px; }
  .pf-item, .pf-item:nth-child(even) { grid-template-columns: 1fr; padding-left: 58px; }
  .pf-item > :not(.pf-node), .pf-item:nth-child(even) > :not(.pf-node) { grid-column: 1; text-align: left; }
  .pf-node { left: 20px; width: 34px; }
  .pf-hito .pf-node { width: 40px; }
  .pf-hero-shield { width: 220px; right: -18%; }
}

/* ---------- Galeria ---------- */
.pf-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(18,14,8,.94); padding: 3rem 4.5rem; }
.pf-lightbox[hidden] { display: none; }
.pf-lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.pf-lightbox img { max-width: 100%; max-height: calc(100vh - 9rem); object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.pf-lightbox figcaption { margin-top: .9rem; color: #e8e8e8; font-size: .95rem; }
.pf-lb-name { color: var(--gold); font-weight: 600; margin-right: .6rem; }
.pf-lb-counter { color: var(--gray); }
.pf-lb-close, .pf-lb-prev, .pf-lb-next { position: absolute; border: 0; background: rgba(255,255,255,.08); color: var(--gold); cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 1.3rem; display: grid; place-items: center; }
.pf-lb-close:hover, .pf-lb-prev:hover, .pf-lb-next:hover { background: rgba(254,201,0,.2); }
.pf-lb-close { top: 1rem; right: 1rem; font-size: 1.8rem; }
.pf-lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.pf-lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
.pf-lb-prev[hidden], .pf-lb-next[hidden] { display: none; }
@media (max-width: 600px) {
  .pf-lightbox { padding: 3.5rem .5rem; }
  .pf-lb-prev, .pf-lb-next { top: auto; bottom: 1rem; transform: none; }
}
