/* Orientation is a stable reading system; project type remains the filter layer. */
.work-heading { padding-bottom: 1.5rem !important; }
.work-heading h2 { font-size: clamp(3.3rem, 5.8vw, 6.8rem) !important; }
.filters { margin-bottom: 1.25rem !important; }
.work-empty { margin: 2rem 0; font: 500 var(--size-label) var(--font-mono); letter-spacing: .08em; }
.project-wall { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: clamp(1.5rem, 3vw, 4rem); align-items: start; }
.orientation-panel { min-width: 0; }
.orientation-panel.is-empty { display: none; }
.orientation-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0 .7rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.orientation-head p { margin: 0; font: 500 var(--size-label) var(--font-mono); letter-spacing: .11em; }
.orientation-head span { font: 500 var(--size-meta) var(--font-mono); opacity: .65; }
.portrait-grid, .landscape-grid { display: grid; gap: clamp(.8rem, 1.3vw, 1.4rem); }
.portrait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.landscape-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project-wall .project {
  display: block;
  grid-column: auto;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  position: relative;
  isolation: isolate;
  /* Keep the directional scroll entrance intact; this must include transform. */
  transition: opacity 620ms cubic-bezier(.22, .8, .24, 1), transform 760ms cubic-bezier(.22, .8, .24, 1), filter 620ms ease;
}
.project-wall .frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border: 0;
  border-radius: 30px;
  background: #101714;
  position: relative;
  z-index: 2;
  /* The shadow is deliberately offset to the lower right: no dark rim and no top-side lift. */
  box-shadow: 18px 28px 42px -25px rgba(17, 25, 21, .28), 34px 56px 92px -46px rgba(17, 25, 21, .22);
  transition: transform .45s cubic-bezier(.22, .8, .24, 1), box-shadow .45s cubic-bezier(.22, .8, .24, 1);
}
.project-wall .project:hover .frame,
.project-wall .project:focus-visible .frame {
  /* The lift transitions in first; the heartbeat joins only once it has landed. */
  transform: translateY(-18px);
  animation: sealed-heart 3.2s cubic-bezier(.37, .01, .2, 1) .52s infinite;
  box-shadow: 22px 38px 56px -25px rgba(17, 25, 21, .36), 42px 70px 116px -48px rgba(17, 25, 21, .28);
}
.portrait-grid .frame { aspect-ratio: 9 / 16; }
.project-wall .frame img { object-fit: contain; }
.project-wall .project:hover .frame img,
.project-wall .project:focus-visible .frame img { transform: none; filter: saturate(1.03) contrast(1.05); }
.project-wall .frame-shade { z-index: 1; }
.project-wall .frame-shade::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Glow starts at the inside edges and falls inward — never from the card centre. */
  background: transparent;
  box-shadow: inset 0 0 4px 2px rgba(255, 255, 255, 1), inset 0 0 30px 7px rgba(255, 255, 255, .78), inset 0 0 66px 15px rgba(255, 255, 255, .42);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}
.project-wall .project:hover .frame-shade::before,
.project-wall .project:focus-visible .frame-shade::before {
  animation: sealed-inner-glow 3.2s ease-in-out .52s infinite;
}
.project-wall .project-meta { padding-top: .55rem; }
.project-wall .project-meta strong { font-size: var(--size-ui); }

.project-wall .project:hover,
.project-wall .project:focus-visible { z-index: 4; }
@keyframes sealed-heart {
  /* A paired beat, then an unbroken low-amplitude drift before the next beat. */
  0% { transform: translateY(-18px) scale(1) rotate(.18deg); }
  9% { transform: translateY(-19px) scale(1.006) rotate(.52deg); }
  16% { transform: translateY(-24px) scale(1.028) rotate(.86deg); }
  22% { transform: translateY(-18px) scale(.992) rotate(-.56deg); }
  29% { transform: translateY(-26px) scale(1.042) rotate(.62deg); }
  36% { transform: translateY(-18px) scale(1) rotate(.2deg); }
  51% { transform: translateY(-19px) scale(1.004) rotate(-.52deg); }
  67% { transform: translateY(-17px) scale(1.007) rotate(.58deg); }
  84% { transform: translateY(-19px) scale(1.002) rotate(-.42deg); }
  100% { transform: translateY(-18px) scale(1) rotate(.18deg); }
}
@keyframes sealed-inner-glow {
  0%, 100% { opacity: .15; }
  9% { opacity: .33; }
  16% { opacity: .75; }
  22% { opacity: .21; }
  29% { opacity: .9; }
  36% { opacity: .27; }
  67% { opacity: .45; }
  84% { opacity: .24; }
}

@media (prefers-reduced-motion: reduce) {
  .project-wall .project:hover .frame,
  .project-wall .project:focus-visible .frame { animation: none; transform: translateY(-18px); }
  .project-wall .project:hover .frame-shade::before,
  .project-wall .project:focus-visible .frame-shade::before { animation: none; opacity: .36; }
}
@media (max-width: 700px) {
  .project-wall { grid-template-columns: 1fr; gap: 2.5rem; }
  .work-heading h2 { font-size: 3.5rem !important; }
  .portrait-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-wall .frame { border-radius: 21px; box-shadow: 13px 20px 31px -18px rgba(17, 25, 21, .25), 24px 40px 66px -31px rgba(17, 25, 21, .19); }
}
