/* ═══════════════════════════════════════════════════
   Portfolio — cinematic cases
   ═══════════════════════════════════════════════════ */

.pf-page {
  overflow-x: clip;
}

.pf-text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  transition: color 0.35s var(--ease-out), border-color 0.35s var(--ease-out), gap 0.35s var(--ease-out);
}
.pf-text-link i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease-out);
}
.pf-text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 14px;
}
.pf-text-link:hover i {
  transform: rotate(45deg) translate(2px, -2px);
}

/* ─── HERO — split (copy | featured visual) ─── */
.pf-hero {
  padding: 120px 0 0;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(ellipse 50% 40% at 8% 18%, var(--accent-subtle), transparent 55%),
    var(--bg-base);
}
.pf-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  align-items: stretch;
  min-height: min(62svh, 640px);
}
.pf-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 5vw, 64px) clamp(20px, 3vw, 40px) clamp(48px, 6vw, 72px) 0;
  max-width: 38rem;
}
.pf-hero__copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.5vw, 4.75rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.045em;
  line-height: 0.94;
  margin: 0 0 18px;
  max-width: 11ch;
}
.pf-hero__copy h1 .hl { color: var(--accent); }
.pf-hero__copy > p {
  margin: 0 0 28px;
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 40ch;
}
.pf-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 24px;
}
.pf-hero__visual {
  position: relative;
  min-height: 340px;
  border-left: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
}
.pf-hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: var(--img-filter);
  transition: transform 1.1s var(--ease-out), filter 0.5s;
}
.pf-hero:hover .pf-hero__visual img {
  transform: scale(1.04);
  filter: var(--img-filter-hover);
}
.pf-hero__cap {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 14px 18px;
  background: var(--overlay-strong);
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.pf-hero__cap span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pf-hero__cap em {
  font-style: normal;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pf-hero__rail {
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}
.pf-hero__rail-inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}
.pf-hero__rail a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  border-right: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  transition: color 0.3s, background 0.3s;
  min-width: 0;
}
.pf-hero__rail a:last-child { border-right: none; }
.pf-hero__rail a:not(:first-child) { padding-left: 16px; }
.pf-hero__rail a em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.pf-hero__rail a {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 1.1vw, 0.95rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.pf-hero__rail a:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ─── CASES HEAD + FILTERS ─── */
.pf-cases {
  padding: clamp(64px, 9vw, 120px) 0 0;
  background: var(--bg-base);
  border-top: 1px solid var(--border);
}
.pf-cases__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 72px);
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.pf-cases__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0;
}
.pf-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}
.pf-toolbar__count {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pf-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.pf-filter {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 14px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s;
}
.pf-filter::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: transparent;
  transition: background 0.25s;
}
.pf-filter:hover { color: var(--text-primary); }
.pf-filter.is-active {
  color: var(--accent);
}
.pf-filter.is-active::after {
  background: var(--accent);
}

/* ─── CASE BANDS ─── */
.pf-cases__list {
  display: flex;
  flex-direction: column;
}
.pf-case {
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 96px;
}
.pf-case:nth-child(even) {
  background: var(--bg-section-alt);
}
.pf-case.is-hidden { display: none; }

.pf-case__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  width: min(100% - 48px, var(--max-w-wide));
  margin-inline: auto;
  box-sizing: border-box;
}
.pf-case--flip .pf-case__inner {
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}
.pf-case--flip .pf-case__media { order: 2; }
.pf-case--flip .pf-case__body { order: 1; }

.pf-case__media {
  position: sticky;
  top: 96px;
}
.pf-case__frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.pf-case__frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--overlay-ghost));
  pointer-events: none;
  opacity: 0.55;
  transition: opacity 0.45s;
}
.pf-case__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  filter: var(--img-filter);
  transition: transform 1s var(--ease-out), filter 0.5s;
}
.pf-case:hover .pf-case__frame img {
  transform: scale(1.045);
  filter: var(--img-filter-hover);
}
.pf-case:hover .pf-case__frame::after {
  opacity: 0.2;
}
.pf-case__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 11px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
}

.pf-case__body {
  position: relative;
  padding-top: 8px;
  min-width: 0;
}
.pf-case__ghost {
  position: absolute;
  top: -18px;
  right: 0;
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 12vw, 8.5rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--border-strong);
  pointer-events: none;
  user-select: none;
  opacity: 0.55;
}
.pf-case__industry {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.pf-case__body > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 0 0 16px;
  max-width: 14ch;
  overflow-wrap: break-word;
  word-break: normal;
}
.pf-case__lede {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 46ch;
}

.pf-case__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 32px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pf-case__meta > div {
  padding-right: 14px;
  border-right: 1px solid var(--border);
}
.pf-case__meta > div:last-child {
  border-right: none;
  padding-right: 0;
}
.pf-case__meta > div:not(:first-child) {
  padding-left: 14px;
}
.pf-case__meta dt {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pf-case__meta dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--text-primary);
  line-height: 1.25;
}

.pf-case__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 28px;
  margin-bottom: 32px;
}
.pf-case__cols h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.pf-case__cols p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.pf-case__cols ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-case__cols li {
  position: relative;
  padding: 0 0 12px 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.pf-case__cols li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 1.5px;
  background: var(--accent);
}

.pf-case__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 4px;
}
.pf-case__stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pf-case__stack li {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 11px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: border-color 0.3s, color 0.3s;
}
.pf-case:hover .pf-case__stack li {
  border-color: var(--border-strong);
}
.pf-case__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
  transition: color 0.35s var(--ease-out), border-color 0.35s var(--ease-out), gap 0.35s var(--ease-out);
}
.pf-case__link i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease-out);
}
.pf-case__link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  gap: 14px;
}
.pf-case__link:hover i {
  transform: rotate(45deg) translate(2px, -2px);
}

.pf-empty {
  margin: 48px auto 64px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ─── METHOD — mosaic ─── */
.pf-method {
  padding: clamp(72px, 10vw, 132px) 0;
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}
.pf-method__head {
  max-width: 34rem;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.pf-method__head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 14px;
}
.pf-method__head p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
}
.pf-method__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}
.pf-method__grid li {
  padding: clamp(28px, 3.5vw, 40px);
  min-height: 260px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.pf-method__grid li:hover {
  background: var(--accent);
  transform: translateY(-4px);
}
.pf-method__grid span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  transition: color 0.35s;
}
.pf-method__grid li:hover span,
.pf-method__grid li:hover h3,
.pf-method__grid li:hover p {
  color: var(--on-accent);
}
.pf-method__grid h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  margin: 0;
  transition: color 0.35s;
}
.pf-method__grid p {
  margin: 0;
  margin-top: auto;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  transition: color 0.35s;
}

@media (max-width: 960px) {
  .pf-hero__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .pf-hero__copy {
    max-width: none;
    padding: 40px 0 32px;
  }
  .pf-hero__visual {
    min-height: 260px;
    border-left: none;
    border-top: 1px solid var(--border);
    aspect-ratio: 16 / 10;
  }
  /* Scrollable jump strip — never clip project names */
  .pf-hero__rail {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
  }
  .pf-hero__rail-inner {
    display: flex;
    width: max-content;
    min-width: 0;
    max-width: none;
    margin-inline: 0;
    padding-inline: 20px;
    box-sizing: border-box;
    grid-template-columns: none;
  }
  .pf-hero__rail a {
    flex: 0 0 auto;
    min-width: 8.75rem;
    padding: 14px 18px;
    white-space: nowrap;
    border-right: 1px solid var(--border);
    border-top: none;
  }
  .pf-hero__rail a:first-child {
    padding-left: 0;
  }
  .pf-hero__rail a:last-child {
    border-right: none;
    padding-right: 4px;
  }
  .pf-hero__rail a:not(:first-child) {
    padding-left: 18px;
  }
  .pf-case__inner,
  .pf-case--flip .pf-case__inner {
    grid-template-columns: 1fr;
    width: min(100% - 40px, var(--max-w-wide));
  }
  .pf-case__body > h2 {
    font-size: clamp(1.25rem, 5.5vw, 1.65rem);
    letter-spacing: -0.03em;
    max-width: none;
    overflow-wrap: normal;
    word-break: normal;
  }
  .pf-case__ghost {
    font-size: clamp(3rem, 16vw, 4.5rem);
    opacity: 0.3;
  }
  .pf-case--flip .pf-case__media,
  .pf-case--flip .pf-case__body {
    order: initial;
  }
  .pf-case__media {
    position: relative;
    top: 0;
  }
  .pf-case__ghost {
    top: -8px;
    opacity: 0.35;
  }
  .pf-method__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .pf-hero__copy h1 {
    font-size: clamp(1.65rem, 8vw, 2.35rem);
    max-width: none;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.05;
  }
  .pf-hero__rail-inner {
    padding-inline: 16px;
  }
  .pf-hero__rail a {
    min-width: 8rem;
    font-size: 0.8rem;
    padding: 14px 14px;
  }
  .pf-cases__head h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }
  .pf-case__body > h2 {
    font-size: clamp(1.05rem, 4.8vw, 1.35rem);
  }
  .pf-case__inner,
  .pf-case--flip .pf-case__inner {
    width: min(100% - 32px, var(--max-w-wide));
  }
  .pf-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .pf-filter {
    flex: 0 0 auto;
  }
  .pf-case__meta,
  .pf-case__cols,
  .pf-method__grid {
    grid-template-columns: 1fr;
  }
  .pf-case__meta > div,
  .pf-case__meta > div:not(:first-child) {
    padding: 12px 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .pf-case__meta > div:last-child {
    border-bottom: none;
  }
  .pf-method__grid li {
    min-height: 0;
  }
  .pf-method__grid li:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pf-case__frame img,
  .pf-hero__visual img,
  .pf-case__link,
  .pf-case__link i,
  .pf-text-link,
  .pf-text-link i,
  .pf-method__grid li {
    transition: none;
  }
  .pf-case:hover .pf-case__frame img,
  .pf-hero:hover .pf-hero__visual img,
  .pf-method__grid li:hover {
    transform: none;
  }
}
