/*
 * Portfolio (#works): the original staggered Webflow layout (.works-main-info-item
 * set-3 = left, set-1 = right) with three cases. Each case shows two pieces side
 * by side (branding + website, or product + templates), kept close together.
 */
.section-works.set-2 { padding-top: 8rem; padding-bottom: 10rem; }
.pf2-item { position: relative; }
.pf2-item.set-1 { margin-top: -2rem; }
.pf2-pair {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
}
.pf2-pane {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  background: #111;
  aspect-ratio: 16 / 9;
  width: 21rem;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pf2-pane + .pf2-pane { width: 14rem; margin-bottom: 1.5rem; }
.pf2-pane.is-square { aspect-ratio: 1; width: 10.5rem; }
.pf2-pane video,
.pf2-pane img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf2-pane figcaption {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  padding: 0.3rem 0.4rem 0.25rem;
  background: rgba(8, 8, 8, 0.65);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pf2-item:hover .pf2-pane { transform: translateY(-4px); }
.pf2-item:hover .pf2-pane + .pf2-pane { transform: translateY(-8px); }
@media (max-width: 767px) {
  .section-works.set-2 { padding-top: 5rem; padding-bottom: 6rem; }
  .pf2-item.set-1 { margin-top: 0; }
  .pf2-pair { width: 100%; }
  .pf2-pane { width: 62%; }
  .pf2-pane + .pf2-pane { width: 38%; margin-bottom: 1rem; }
  .pf2-pane.is-square { width: 32%; }
}
@media (prefers-reduced-motion: reduce) {
  .pf2-pane { transition: none; }
}

.section-works .works-heading { color: #fff !important; }
.pf-title { margin-bottom: 3rem; }

/* ---------- Website shown in a browser frame (both layouts) ---------- */
.pf-browser { display: flex; flex-direction: column; background: #1a1a1d; }
.pf-browser-bar {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  flex: none;
  height: 1.1rem;
  padding: 0 0.5rem;
  background: #232327;
}
.pf-browser-bar i { width: 0.35rem; height: 0.35rem; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.pf-browser-view { position: relative; flex: 1; min-height: 0; overflow: hidden; display: block; }
.pf-browser-view video,
.pf-browser-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Long page screenshot scrolls slowly inside the frame */
.pf-browser-view img.is-scroll { object-position: 50% 0%; animation: pf-page-scroll 16s ease-in-out infinite alternate; }
@keyframes pf-page-scroll { 0%, 8% { object-position: 50% 0%; } 92%, 100% { object-position: 50% 100%; } }
.pf2-pane.pf-browser figcaption { top: 1.55rem; }

/* ---------- Layout switch (prototype) ---------- */
.pf-layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  margin-bottom: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pf-layout-switch span { padding: 0 8px 0 6px; color: rgba(255, 255, 255, 0.45); }
.pf-layout-switch button {
  padding: 8px 10px; border: 0; background: none; color: rgba(255, 255, 255, 0.7);
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.pf-layout-switch button[aria-pressed="true"] { background: #fff; color: #080808; }
.section-works[data-layout="rows"] .pf-layout-grid,
.section-works[data-layout="grid"] .pf-layout-rows { display: none; }

/* ---------- Layout B: case rows ---------- */
.pf-b { display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.pf-b-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 4rem;
  align-items: center;
  padding: 4.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
}
.pf-b-row.is-flipped .pf-b-info { order: 2; }
.pf-b-info { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.pf-b-num { font-size: 0.875rem; font-weight: 600; color: rgba(255, 255, 255, 0.5); font-variant-numeric: tabular-nums; }
.pf-b-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2.8vw, 3rem);
  line-height: 1;
  color: #fff;
  white-space: nowrap;
}
.pf-b-desc { margin: 0; max-width: 26rem; color: rgba(255, 255, 255, 0.7); font-size: 1rem; line-height: 1.45; }
.pf-b-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding: 0.6rem 0.65rem 0.5rem;
  background: #fff;
  color: #080808;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: transform 0.35s ease;
}
.pf-b-cta img { width: 0.75rem; height: 0.75rem; }
.pf-b-row:hover .pf-b-cta { transform: translateX(6px); }

.pf-b-media { position: relative; padding-bottom: 9%; }
.pf-b-brand,
.pf-b-site { margin: 0; overflow: hidden; background: #111; }
.pf-b-brand {
  position: relative;
  width: 80%;
  aspect-ratio: 16 / 9;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pf-b-brand video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-b-site {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 52%;
  aspect-ratio: 16 / 10.5;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pf-b-row.is-flipped .pf-b-brand { margin-left: auto; }
.pf-b-row.is-flipped .pf-b-site { right: auto; left: 0; }
.pf-b-row:hover .pf-b-brand { transform: translateY(-6px); }
.pf-b-row:hover .pf-b-site { transform: translateY(-12px); }
.pf-b figcaption {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
  z-index: 1;
  padding: 0.3rem 0.4rem 0.25rem;
  background: rgba(8, 8, 8, 0.65);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pf-b-site figcaption { top: 1.7rem; }

@media (max-width: 767px) {
  .pf-layout-switch { margin-bottom: 2rem; }
  .pf-layout-switch span { display: none; }
  .pf-b-row { grid-template-columns: 1fr; gap: 2rem; padding: 3rem 0; }
  .pf-b-row .pf-b-info,
  .pf-b-row.is-flipped .pf-b-info { order: 2; }
  .pf-b-media { padding-bottom: 14%; }
  .pf-b-brand { width: 86%; }
  .pf-b-site { width: 60%; }
}
@media (prefers-reduced-motion: reduce) {
  .pf-browser-view img.is-scroll { animation: none; }
  .pf-b-brand, .pf-b-site, .pf-b-cta { transition: none; }
}

/* "View case study" pill that follows the cursor over a row's videos (desktop).
   On touch screens the button under the tags is shown instead. */
.pf-b-pill {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.7rem 0.5rem;
  background: #fff;
  color: #080808;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pf-b-pill.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pf-b-pill img { width: 0.75rem; height: 0.75rem; }
@media (hover: hover) and (pointer: fine) {
  .pf-b-row .pf-b-cta { display: none; }
  .pf-b-row .pf-b-media { cursor: none; }
}
@media (hover: none), (pointer: coarse) {
  .pf-b-pill { display: none; }
}
