/* =============================================================================
   PORTFOLIO — editorial redesign. Loaded only by portfolio.html, on top of
   main.css. Every rule is scoped to a .pf-* section (or the lightbox, which
   this page owns), so no other page changes.
   ========================================================================== */
:root {
  --pf-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --pf-slate: #0B1220;
  --pf-slate-2: #101A2E;
  --pf-ice: #EEF3FA;
  --pf-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
.pf-h2 em, .pf-feature__title em { font-style: italic; color: var(--brand-gold-light); }

/* ---------- Hero ---------- */
.pf-hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate; background: var(--pf-slate);
  padding: calc(var(--header-h) + 3rem) 0 clamp(4.5rem, 10vh, 7rem);
}
.pf-hero__bg { position: absolute; inset: -6% 0 0 0; z-index: -2; }
.pf-hero__bg picture, .pf-hero__bg img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%;
}
.pf-hero__bg img { animation: pf-settle 2.4s var(--pf-ease) both; }
.pf-hero::before {                       /* legibility veil: dark at the bottom-left where the type sits */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 7, 15, 0.55) 0%, rgba(4, 7, 15, 0.05) 35%, rgba(4, 7, 15, 0.85) 100%),
    linear-gradient(90deg, rgba(4, 7, 15, 0.75) 0%, rgba(4, 7, 15, 0) 65%);
}
.pf-hero__inner { width: 100%; }
.pf-hero__crumbs { margin-bottom: 2rem; opacity: 0.8; }
.pf-hero__kicker {
  font-size: var(--fs-xs); letter-spacing: 0.32em; text-transform: uppercase; color: var(--brand-gold-light);
  margin: 0 0 1.4rem; animation: pf-rise 1s 0.2s var(--pf-ease) both;
}
.pf-hero__title {                       /* same type as the home-page hero */
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase; color: #fff;
  font-size: clamp(2.6rem, 7vw, 6.6rem); line-height: 0.95; letter-spacing: -0.04em; max-width: 13ch; margin: 0;
}
.pf-hero__title > * { display: inline-block; animation: pf-rise 1.2s var(--pf-ease) both; }
.pf-hero__title > :nth-child(2) { animation-delay: 0.15s; }
.pf-hero__title > :nth-child(3) { animation-delay: 0.3s; }
.pf-hero__lead {
  margin: 1.6rem 0 0; font-size: clamp(0.8rem, 1.1vw, 0.95rem); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--pf-ice); animation: pf-rise 1s 0.5s var(--pf-ease) both;
}
.pf-hero__cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2rem; margin-top: 2.4rem;
  animation: pf-rise 1s 0.65s var(--pf-ease) both;
}
.pf-hero__ghost {
  color: #fff; font-size: var(--fs-sm); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  padding-bottom: 0.3rem; border-bottom: 1px solid rgba(255, 255, 255, 0.45); transition: border-color 0.3s;
}
.pf-hero__ghost:hover { border-color: var(--brand-gold); }
.pf-hero__scroll {
  position: absolute; left: 50%; bottom: 1.4rem; width: 1px; height: 56px; transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.25); overflow: hidden;
}
.pf-hero__scroll span {
  position: absolute; inset: 0; background: var(--brand-gold-light);
  animation: pf-scroll 2.2s var(--pf-ease) infinite;
}
@keyframes pf-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes pf-settle { from { transform: scale(1.1); filter: brightness(0.6); } to { transform: none; filter: none; } }
@keyframes pf-scroll { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Shared section heads ---------- */
.pf-section { background: var(--pf-slate); }
.pf-section + .pf-section { border-top: 1px solid var(--line); }
.pf-head { margin-bottom: clamp(2.2rem, 5vw, 4rem); }
.pf-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; }
.pf-h2 {
  font-family: var(--pf-serif); font-weight: 400; letter-spacing: -0.01em; line-height: 1.02;
  font-size: clamp(2.2rem, 5vw, 4.4rem); margin: 0.6rem 0 0; color: #fff;
}
.pf-count { margin: 0; font-size: var(--fs-sm); color: var(--text-mute); font-variant-numeric: tabular-nums; }

/* ---------- Featured: signature stories as alternating rows, then an even case-study row ---------- */
.pf-stories { display: grid; gap: clamp(4rem, 9vw, 8rem); }
.pf-stories .pf-feature__item {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; gap: clamp(2rem, 5vw, 6rem);
}
.pf-stories .pf-feature__item:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.pf-stories .pf-feature__item:nth-child(even) .pf-feature__img { order: 2; }
.pf-stories .pf-feature__img { aspect-ratio: 4 / 5; max-height: 86vh; }
.pf-stories .pf-feature__body { max-width: 30rem; }
.pf-stories .pf-feature__title { font-size: clamp(2.2rem, 4.4vw, 4rem); line-height: 1.02; margin: 0.8rem 0 1.2rem; }
.pf-stories .pf-feature__text { font-size: var(--fs-md, 1.05rem); margin-bottom: 2rem; }
.pf-feature__num {
  display: block; font-family: var(--pf-serif); font-style: italic; font-size: clamp(3rem, 6vw, 5.5rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 168, 43, 0.6); margin-bottom: 1.2rem;
}
.pf-cases { margin-top: clamp(5rem, 10vw, 9rem); padding-top: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.pf-cases__kicker { margin-bottom: 2rem; }
.pf-cases__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); }
.pf-cases .pf-feature__img { aspect-ratio: 4 / 5; }
.pf-feature__item { display: flex; flex-direction: column; }
.pf-feature__img { overflow: hidden; background: var(--pf-slate-2); }
.pf-feature__img picture, .pf-feature__img img {
  display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--pf-ease);
}
.pf-feature__item:hover .pf-feature__img img { transform: scale(1.035); }
.pf-feature__body { padding-top: 1.25rem; max-width: 34rem; }
.pf-feature__meta { margin: 0; font-size: var(--fs-xs); letter-spacing: 0.24em; text-transform: uppercase; color: var(--brand-gold-light); }
.pf-feature__title { font-family: var(--pf-serif); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.1; margin: 0.5rem 0 0.7rem; color: #fff; }
.pf-feature__text { margin: 0 0 1.1rem; color: var(--text-soft); font-size: var(--fs-sm); line-height: 1.65; }
.pf-link {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0 0 0.35rem; background: none; border: 0;
  border-bottom: 1px solid var(--line-gold); color: #fff; font: inherit; font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: gap 0.4s var(--pf-ease), color 0.3s;
}
.pf-link svg { width: 15px; height: 15px; }
.pf-link:hover { gap: 1rem; color: var(--brand-gold-light); }

/* ---------- Archive: filters + gallery ---------- */
.pf-gallery .filters { gap: 0.25rem 1.6rem; margin-bottom: clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
.pf-gallery .filter {
  border: 0; border-radius: 0; background: none; padding: 0.7rem 0; margin-bottom: -1px; color: var(--text-mute);
  font-size: var(--fs-xs); letter-spacing: 0.16em; text-transform: uppercase; border-bottom: 1px solid transparent;
}
.pf-gallery .filter:hover { color: #fff; }
.pf-gallery .filter[aria-pressed="true"] { background: none; color: #fff; border-bottom-color: var(--brand-gold); }
.pf-gallery .filter__n { color: var(--brand-gold-light); opacity: 0.85; }
.pf-gallery .gallery { gap: 10px; }
.pf-gallery .tile { border-radius: 2px; background: var(--pf-slate-2); margin-bottom: 0; }
.pf-gallery .tile:hover { transform: none; box-shadow: none; }
.pf-gallery .tile img { transition: transform 1.2s var(--pf-ease), filter 0.6s, opacity 0.6s; }
.pf-gallery .tile:hover img { transform: scale(1.06); }
.pf-gallery .tile__zoom { border-radius: 0; background: none; backdrop-filter: none; }
.pf-gallery .tile__meta strong { font-family: var(--pf-serif); font-weight: 400; font-size: 1.15rem; }
/* Loading state: a soft shimmer until the photo has painted (JS adds .is-loaded). */
.js-motion .pf-gallery .tile:not(.is-loaded) {
  background: linear-gradient(100deg, var(--pf-slate-2) 30%, #17233B 50%, var(--pf-slate-2) 70%) 0 0 / 300% 100%;
  animation: pf-shimmer 1.6s linear infinite;
}
.js-motion .pf-gallery .tile:not(.is-loaded) img { opacity: 0; }
@keyframes pf-shimmer { to { background-position: -150% 0; } }
/* Category change: shown tiles settle in, staggered by JS through --pf-i. */
.pf-gallery .tile.is-entering { animation: pf-enter 0.7s var(--pf-ease) both; animation-delay: calc(var(--pf-i, 0) * 28ms); }
@keyframes pf-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.pf-gallery .showmore .btn { border-radius: 0; letter-spacing: 0.16em; text-transform: uppercase; font-size: var(--fs-xs); }

/* ---------- Calls to action ---------- */
.pf-ctas__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pf-ctas__list li { border-bottom: 1px solid var(--line); }
.pf-ctas__list a {
  display: grid; grid-template-columns: 3.5rem 1fr auto 1.5rem; align-items: baseline; gap: 1.5rem;
  padding: clamp(1.2rem, 2.4vw, 1.8rem) 0; color: #fff; text-decoration: none; transition: padding 0.5s var(--pf-ease), color 0.3s;
}
.pf-ctas__n { font-size: var(--fs-xs); color: var(--brand-gold-light); letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.pf-ctas__t { font-family: var(--pf-serif); font-size: clamp(1.5rem, 3.2vw, 2.8rem); line-height: 1.1; }
.pf-ctas__d { color: var(--text-mute); font-size: var(--fs-sm); text-align: right; }
.pf-ctas__list svg { width: 20px; height: 20px; align-self: center; transition: transform 0.5s var(--pf-ease); }
.pf-ctas__list a:hover { padding-left: 1rem; color: var(--brand-gold-light); }
.pf-ctas__list a:hover svg { transform: translateX(6px); }

/* ---------- Image viewer: exhibition feel ---------- */
.lightbox { background: rgba(3, 5, 11, 0.97); }
.lightbox.is-open { animation: pf-fade 0.45s var(--pf-ease) both; }
.lightbox img { border-radius: 0; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6); transition: opacity 0.35s var(--pf-ease), transform 0.5s var(--pf-ease); }
.lightbox img.is-swapping { opacity: 0; transform: scale(0.985); }
.lightbox__cap { font-family: var(--pf-serif); font-size: 1.05rem; color: var(--pf-ice); letter-spacing: 0.02em; }
.lightbox__btn { background: transparent; border-color: rgba(255, 255, 255, 0.22); }
@keyframes pf-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .pf-stories .pf-feature__item, .pf-stories .pf-feature__item:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; }
  .pf-ctas__d { display: none; }
  .pf-ctas__list a { grid-template-columns: 3rem 1fr 1.5rem; }
}
/* ---------- Phone: designed for one hand, not a shrunken desktop ---------- */
@media (max-width: 767px) {
  /* Photo on top, words underneath: on a narrow screen the type would sit on the face. */
  .pf-hero { display: block; min-height: 0; padding: 50svh 0 5rem; }
  .pf-hero__bg { inset: 0 0 auto 0; height: 62svh; }
  .pf-hero__bg picture, .pf-hero__bg img { object-position: 62% 18%; }
  .pf-hero::before { background: linear-gradient(180deg, rgba(4, 7, 15, 0.35) 0%, rgba(4, 7, 15, 0) 22%,
                                                 rgba(11, 18, 32, 0.75) 46svh, var(--pf-slate) 62svh); }
  .pf-hero__crumbs { display: none; }
  .pf-hero__title { font-size: clamp(2.4rem, 11.5vw, 3.4rem); }
  .pf-hero__lead { letter-spacing: 0.2em; line-height: 1.8; }
  .pf-hero__cta .btn { width: 100%; justify-content: center; }
  .pf-stories .pf-feature__item, .pf-stories .pf-feature__item:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .pf-stories .pf-feature__item:nth-child(even) .pf-feature__img { order: 0; }
  .pf-stories .pf-feature__img { max-height: none; }
  .pf-feature__num { font-size: 2.6rem; margin-bottom: 0.6rem; }
  /* Case studies: a swipeable strip instead of three squeezed columns. */
  .pf-cases__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto;
    scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .pf-cases__grid::-webkit-scrollbar { display: none; }
  .pf-cases .pf-feature__item { scroll-snap-align: start; }
  .pf-gallery .tile__meta { display: none; }
  /* Filters scroll sideways inside their own strip; the page itself never does. */
  .pf-gallery .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: calc(-1 * var(--gutter, 1rem)); padding-inline: var(--gutter, 1rem); }
  .pf-gallery .filters::-webkit-scrollbar { display: none; }
  .pf-gallery .filter { flex: none; }
  .pf-gallery .gallery { gap: 6px; }
  .pf-ctas__list a { grid-template-columns: 2.2rem 1fr 1.25rem; gap: 0.9rem; }
  .pf-ctas__t { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pf-hero__bg img, .pf-hero__kicker, .pf-hero__title > *, .pf-hero__lead, .pf-hero__cta,
  .pf-hero__scroll span, .pf-gallery .tile.is-entering, .lightbox.is-open { animation: none; }
  .pf-feature__img img, .pf-gallery .tile img, .lightbox img { transition: none; }
}
