/* OptiPath "Our Work" page: a classic portfolio. White page, the title, a way to narrow the list,
   two full client stories, then every other project in a staggered two-column grid.
   Sits on top of home.css (type, buttons, FAQ, closing panel). Everything here is prefixed pf-. */

/* ---------- Title ---------- */

.pf-hero { padding: calc(80px + clamp(3rem, 6vw, 5.5rem)) 0 0; color: var(--hx-text); background: #fff; }
.pf-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.pf-hero .hx-h1 { font-size: clamp(2.75rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -0.04em; color: var(--hx-text); }
.pf-intro { max-width: 27rem; padding-bottom: 0.45rem; font-size: clamp(1.0625rem, 1.3vw, 1.2rem); line-height: 1.55; color: var(--hx-mute); }

/* Narrow the list. One rounded bar holding the four choices. A dark tab slides to the chosen one. */
.pf-filter {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: auto;
  margin-top: clamp(2rem, 4vw, 3.25rem);
  padding: 5px;
  border: 1px solid var(--hx-line);
  border-radius: 999px;
  background: var(--hx-tint);
}
.pf-filter::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--w, 0px);
  border-radius: 999px;
  background: var(--hx-ink);
  box-shadow: 0 10px 24px -12px rgba(10, 16, 32, 0.7);
  transform: translateX(var(--x, 5px));
  transition: transform 0.5s var(--hx-ease), width 0.5s var(--hx-ease);
}
.pf-filter:not(.is-ready)::before { transition: none; }
.pf-filter button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.35rem;
  border: 0;
  border-radius: 999px;
  background: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--hx-mute);
  cursor: pointer;
  transition: color 0.35s;
}
.pf-filter small { font-size: 0.8125rem; font-weight: 500; color: #98a2b3; transition: color 0.35s; }
.pf-filter button:hover { color: var(--hx-text); }
.pf-filter button.is-on { color: #fff; }
.pf-filter button.is-on small { color: rgba(255, 255, 255, 0.6); }
.pf-filter button:focus-visible { outline: 2px solid var(--hx-blue); outline-offset: 3px; }

/* ---------- The work ---------- */

.pf-work { padding: clamp(3rem, 6vw, 5.5rem) 0 var(--hx-pad); background: #fff; }
.pf-work [hidden] { display: none; }

/* A cover: the client's color, their site on a desktop screen, and the phone version beside it. */
.pf-cover { position: relative; display: block; aspect-ratio: 4 / 3.15; overflow: hidden; border-radius: clamp(16px, 1.8vw, 24px); background: var(--c); }
.pf-d, .pf-m { position: absolute; display: block; overflow: hidden; background: #0b1220; }
.pf-d { top: 13%; left: 10%; width: 80%; aspect-ratio: 16 / 10.6; border-radius: clamp(6px, 0.8vw, 11px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6); transition: transform 0.9s var(--hx-ease); }
.pf-m { right: 5%; bottom: -12%; width: 19%; aspect-ratio: 9 / 18.4; border: clamp(3px, 0.4vw, 6px) solid #0d1528; border-radius: clamp(12px, 1.7vw, 24px); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); transition: transform 0.9s var(--hx-ease); }
.pf-d img, .pf-m img { display: block; width: 100%; height: auto; transition: transform 2.4s cubic-bezier(0.3, 0, 0.2, 1); }
.pf-cover:focus-visible { outline: 2px solid var(--hx-blue); outline-offset: 4px; }
@media (hover: hover) {
  /* Pointing at a cover lifts it a touch and scrolls a little way down the real page. */
  .pf-cover:hover .pf-d { transform: translateY(-2.5%); }
  .pf-cover:hover .pf-m { transform: translateY(-5%); }
  .pf-cover:hover .pf-d img { transform: translateY(-34%); }
}

/* Two full stories */
.pf-feature { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-bottom: clamp(3.5rem, 7vw, 6.5rem); }
.pf-feature.is-flip { grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr); }
.pf-feature.is-flip .pf-feature-info { order: 2; }
.pf-feature h2 { font-size: clamp(2rem, 3.3vw, 3rem); font-weight: 700; line-height: 1.03; letter-spacing: -0.035em; color: var(--hx-text); }
.pf-sub { margin-top: 0.7rem; font-size: 1.0625rem; color: var(--hx-mute); }
.pf-story { max-width: 30rem; margin-top: clamp(1.1rem, 2vw, 1.6rem); font-size: clamp(1.0625rem, 1.3vw, 1.2rem); line-height: 1.6; color: var(--hx-text); }
/* The client's own words, set the way a Google review looks: stars, the review, who wrote it. */
.pf-review { max-width: 30rem; margin: clamp(1.5rem, 2.8vw, 2.25rem) 0 0; padding-top: clamp(1.25rem, 2.2vw, 1.75rem); border-top: 1px solid var(--hx-line); }
.pf-review { position: relative; }
/* The whole review is a link to it on Google. */
.pf-review-link { position: absolute; z-index: 1; inset: 0; }
.pf-review-link:focus-visible { outline: 2px solid var(--hx-blue); outline-offset: 4px; border-radius: 8px; }
.pf-review-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.pf-review .hx-stars { margin: 0; font-size: 1.0625rem; }
.pf-review .hx-g { width: 20px; height: 20px; }
.pf-review blockquote, .pf-review strong { transition: color 0.3s; }
.pf-review:hover blockquote { color: var(--hx-text); }
.pf-review:hover strong { color: var(--hx-blue); }
.pf-review blockquote { margin: 0; font-size: 1rem; line-height: 1.6; color: var(--hx-mute); }
.pf-review figcaption { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.1rem; }
.pf-review .hx-ava { width: 38px; height: 38px; font-size: 0.8125rem; }
.pf-review strong { display: block; font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; color: var(--hx-text); }
.pf-review small { display: block; font-size: 0.8125rem; color: var(--hx-mute); }
.pf-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: clamp(1.75rem, 3vw, 2.4rem); }

/* Everything else: two columns, the right one starting lower */
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(3rem, 5vw, 4.5rem) clamp(1.5rem, 3vw, 2.75rem); }
.pf-grid.is-stagger > .is-low { margin-top: clamp(3.5rem, 7vw, 6.5rem); }
.pf-cap { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.4rem 0.25rem 0; color: inherit; }
.pf-cap h3 { font-size: clamp(1.35rem, 1.9vw, 1.75rem); font-weight: 700; letter-spacing: -0.03em; color: var(--hx-text); }
.pf-cap p { margin-top: 0.35rem; font-size: 1rem; color: var(--hx-mute); }
.pf-go { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border: 1px solid var(--hx-line); border-radius: 50%; color: var(--hx-text); transition: background 0.4s var(--hx-ease), border-color 0.4s, color 0.4s, transform 0.5s var(--hx-ease); }
.pf-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-card:hover .pf-go { border-color: var(--hx-text); background: var(--hx-text); color: #fff; transform: rotate(45deg); }

/* ---------- Phones and tablets ---------- */

@media (max-width: 899px) {
  .pf-hero { padding-top: calc(80px + 2.25rem); }
  .pf-hero .hx-h1 { font-size: clamp(2.5rem, 12vw, 3.6rem); }
  /* On a phone the bar spans the screen with four equal tabs, so nothing is cut off. */
  .pf-filter { display: grid; grid-auto-columns: minmax(0, 1fr); width: 100%; margin-top: 1.75rem; padding: 4px; }
  .pf-filter::before { top: 4px; bottom: 4px; }
  .pf-filter button { gap: 0.25rem; padding: 0.7rem 0.2rem; font-size: 0.875rem; }
  .pf-filter small { font-size: 0.6875rem; }
  .pf-feature, .pf-feature.is-flip { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; padding-bottom: 3.5rem; }
  .pf-feature .pf-cover { order: -1; }
  .pf-feature.is-flip .pf-feature-info { order: 0; }
  .pf-story, .pf-review { max-width: none; }
  .pf-grid { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
  .pf-grid.is-stagger > .is-low { margin-top: 0; }
  .pf-go { width: 46px; height: 46px; }
}

/* ---------- Phones: less to read, more to watch ---------- */

@media (max-width: 699px) {
  .pf-intro { padding-bottom: 0; }
  .pf-filter small { display: none; }
  .pf-filter button { font-size: 0.9375rem; }
  /* The write-up is left to the case study. Here it is the picture, the name, the review and the buttons. */
  .pf-story { display: none; }
  .pf-review { margin-top: 1.25rem; padding-top: 1.1rem; }
  .pf-review blockquote { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  .pf-btns { flex-wrap: nowrap; gap: 0.6rem; margin-top: 1.4rem; }
  .pf-btns .hx-link { padding-right: 1.1rem; padding-left: 1.1rem; }
  /* Covers are taller on a phone so the site inside has room to move as the page scrolls. */
  .pf-cover { aspect-ratio: 4 / 3.7; }
  .pf-d { top: 11%; left: 7%; width: 86%; }
  .pf-m { right: 4%; width: 23%; }
  .pf-cap { padding-top: 1.1rem; }
  .pf-cap p { font-size: 0.9375rem; }
}
