/* ==========================================================================
   On My Show · Work Page (v2)
   Motion, mechanics and typography
   ========================================================================== */

/* ---------- Page Canvas ---------- */
body[data-page="work"] {
  background-color: var(--white, #ffffff);
  color: var(--ink-on-light, #0a0a0a);
}

/* Ensure the shared header inverts cleanly against white canvas */
body[data-page="work"] .oms-header {
  color: var(--ink-on-light, #0a0a0a);
}
body[data-page="work"] .oms-logo {
  color: var(--ink-on-light, #0a0a0a);
}
body[data-page="work"] .oms-nav a {
  color: var(--ink-on-light, #0a0a0a);
}
body[data-page="work"] .oms-menu-toggle {
  color: var(--ink-on-light, #0a0a0a);
}

/* ---------- 1. Main Gallery Wrapper ---------- */
.work__gallery-wrapper {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--header-h, 56px) + 24px) clamp(12px, 2vw, 32px) clamp(40px, 8vw, 80px);
  background-color: var(--white, #ffffff);
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}

.work__gallery-wrapper.is-hidden {
  display: none;
}

/* Giant Headline */
.work__gallery__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6.67vw, 6rem);
  line-height: 0.85;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 clamp(20px, 3vw, 40px) 0;
  color: var(--ink-on-light, #0a0a0a);
}
.work__gallery__title .serif {
  color: var(--pink, #ff0063);
}

/* Sub-Header & Toolbar */
.work__gallery__header {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--header-h, 56px) + 4px);
  z-index: 25;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 12px 0;
  margin-bottom: clamp(24px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(10, 10, 10, 0.12);
  border-bottom: 1px solid rgba(10, 10, 10, 0.12);
}

/* Category Filters */
.work__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.work__chip {
  font-family: var(--font-display);
  font-size: var(--fs-ui, 0.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #6b6b6b;
  padding: 4px 6px;
  border-radius: 2px;
  transition: color 0.25s var(--ease);
}
.work__chip:hover {
  color: var(--ink-on-light, #0a0a0a);
}
.work__chip.is-active {
  color: #d1004f;
}

/* View Switcher Controls */
.work__switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switcher__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: var(--fs-ui, 0.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #6b6b6b;
  padding: 5px 10px;
  border: 1px solid rgba(10, 10, 10, 0.15);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.switcher__button svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.switcher__label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.switcher__button:hover {
  color: var(--ink-on-light, #0a0a0a);
  border-color: rgba(10, 10, 10, 0.4);
}
.switcher__button.is-active {
  color: var(--white, #ffffff);
  background: var(--ink-on-light, #0a0a0a);
  border-color: var(--ink-on-light, #0a0a0a);
}

/* ---------- 2. Gallery Grid (View 1) ---------- */
.work__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.5vw, 36px) clamp(16px, 2vw, 28px);
  width: 100%;
}
.work__gallery.is-hidden {
  display: none;
}

.work__gallery__item {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.work__gallery__item__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #181818;
  overflow: hidden;
  border-radius: 2px;
}

.work__gallery__item[data-aspect="portrait"] .work__gallery__item__media {
  aspect-ratio: 4 / 5;
}
.work__gallery__item[data-aspect="portrait"] .work__gallery__item__media img,
.work__gallery__item[data-aspect="portrait"] .work__gallery__item__media video {
  object-fit: cover;
  object-position: center 30%;
}

.work__gallery__item__media .media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.work__gallery__item__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.work__gallery__item:hover .work__gallery__item__media img {
  transform: scale(1.035);
}

.work__gallery__item__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.work__gallery__item:hover .work__gallery__item__media video {
  opacity: 1;
}

.work__gallery__item__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
}

.work__gallery__item__title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink-on-light, #0a0a0a);
  margin: 0;
}

.work__gallery__item__meta {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 20px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-transform: uppercase;
  color: #6b6b6b;
  margin: 0;
  white-space: nowrap;
}
.work__gallery__item:hover .work__gallery__item__meta {
  color: #d1004f;
}

/* ---------- 3. List View (View 2) ---------- */
.work__list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.work__list.is-hidden {
  display: none;
}

.work__list__item {
  border-top: 1px dashed rgba(10, 10, 10, 0.2);
  transition: background-color 0.2s var(--ease);
}
.work__list__item:last-child {
  border-bottom: 1px dashed rgba(10, 10, 10, 0.2);
}

.work__list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(14px, 2vw, 24px) 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.work__list__item:hover .work__list__row {
  color: #d1004f;
  transform: translateX(6px);
}

.work__list__index {
  font-family: var(--font-display);
  font-size: var(--fs-ui, 0.75rem);
  font-weight: 700;
  color: #6b6b6b;
  min-width: 3ch;
}

.work__list__title {
  flex: 1;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 1;
  margin: 0;
}

.work__list__type {
  font-family: var(--font-display);
  font-size: var(--fs-ui, 0.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #6b6b6b;
}

.work__list__thumb {
  width: clamp(70px, 9vw, 130px);
  aspect-ratio: 16 / 9;
  background: #181818;
  overflow: hidden;
  border-radius: 2px;
  flex-shrink: 0;
}
.work__list__thumb img, .work__list__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.work__list__item[data-aspect="portrait"] .work__list__thumb {
  aspect-ratio: 4 / 5;
}
.work__list__item[data-aspect="portrait"] .work__list__thumb img,
.work__list__item[data-aspect="portrait"] .work__list__thumb video {
  object-fit: cover;
  object-position: center 30%;
}

/* Empty State */
.work__empty {
  padding: 60px 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--fs-lead, 1.25rem);
  color: #6b6b6b;
}
.work__empty[hidden] {
  display: none;
}

/* ---------- 4. Full-Screen view + player ----------
   a muted preview loop with a centred title, a
   title slider and the layout switch; clicking the stage opens the player
   (sound on, Back / Sound, Made by / Director, frame thumbnails + scrub bar).
   Sits under the header (which keeps inverting over it); the view is
   transparent so the video grows out of the white page on entry. */
.work__fs {
  position: fixed; inset: 0; z-index: 40;
  height: 100svh; padding: 80px 10px 0;
  color: #fff; overflow: hidden;
  font-size: 12px; font-weight: 700; line-height: 0.96; letter-spacing: -0.03em;
}
.work__fs[hidden] { display: none; }
.work__fs.is-settled { background: #000; }
html.is-work-fs .work__gallery-wrapper,
html.is-work-fs .oms-footer,
html.is-work-fs [data-site-footer] { display: none; }

.work__fs__layer { position: absolute; inset: 0; z-index: 0; visibility: hidden; pointer-events: none; }
.work__fs__layer.is-active, .work__fs__layer.is-next { visibility: visible; }
.work__fs__layer.is-next { z-index: 1; }
.work__fs__video {
  position: absolute; top: 50%; left: 50%; width: 100%; height: 100%;
  transform: translate(-50%, -50%); object-fit: cover; background: #000;
}

/* centred title between two rows of squares */
.work__fs__frame {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: min(720px, calc(100% - 20px)); transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 120px;
  mix-blend-mode: difference; pointer-events: none;
}
.work__fs__squares { display: flex; justify-content: space-between; }
.work__fs__squares i { width: 6px; height: 6px; background: #fff; }
.work__fs__preview-title {
  margin: 0; text-align: center; text-transform: uppercase;
  font-size: 64px; line-height: 0.9; letter-spacing: -0.03em;
}
.work__fs.is-player .work__fs__frame { visibility: hidden; }

/* title wipe: one mask per line, scaled on X */
.work__fs-text { position: relative; display: inline-block; }
.work__fs-mask { position: absolute; inset: 0; background: currentColor; transform: scaleX(0); transform-origin: left center; }

.work__fs__wrap { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; justify-content: space-between; padding-top: 80px; pointer-events: none; }
.work__fs__wrap.is-visible { display: flex; }
.work__fs__wrap button { pointer-events: auto; }

/* preview: timing left-middle, layout switch right-middle, titles along the bottom */
.work__fs__info {
  position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%);
  display: flex; justify-content: space-between; align-items: center; padding: 0 10px 0 0;
}
.work__fs__timing { font-variant-numeric: tabular-nums; }
.work__fs__timing::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 4px 1.5px 0; background: var(--pink, #ff0063);
}
.work__fs__nav { display: flex; gap: 12px; }
.work__fs__nav-btn { display: flex; align-items: flex-end; gap: 11px; color: #8a8a88; line-height: inherit; }
.work__fs__nav-btn.is-active { color: #fff; cursor: default; }
.work__fs__nav-btn:hover { color: #fff; }
.work__fs__slider-viewport { position: absolute; left: 25px; right: 25px; bottom: 10px; overflow: hidden; pointer-events: auto; }
.work__fs__slider { display: flex; gap: 64px; width: max-content; will-change: transform; }
.work__fs__slide {
  flex: none; color: #808080; text-transform: uppercase; line-height: inherit; white-space: nowrap;
  transition: color 0.3s var(--ease-fade, ease);
}
.work__fs__slide:hover { color: #b3b3b3; }
.work__fs__slide.is-active { color: #fff; }

/* player */
.work__fs__buttons { display: flex; justify-content: space-between; align-items: flex-start; padding: 0; }
.work__fs__back { width: fit-content; line-height: inherit; }
.work__fs__sound { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.work__fs__sound-k { margin-bottom: 6px; line-height: 0.89; text-transform: uppercase; opacity: 0.75; }
.work__fs__sound-v { font-size: 16px; line-height: 0.72; letter-spacing: -0.03em; }
.work__fs__meta { display: flex; justify-content: space-between; overflow: hidden; }
.work__fs__meta > div:last-child { text-align: right; }
.work__fs__meta > div { will-change: transform; }
.work__fs__grey { display: inline-block; margin-bottom: 6px; opacity: 0.75; }
.work__fs__full-data { display: flex; justify-content: space-between; align-items: flex-end; width: calc(100% - 20px); padding-bottom: 6px; }
.work__fs__title { width: 20%; margin: 0; font-size: 32px; line-height: 0.9; letter-spacing: -0.03em; text-transform: uppercase; }
.work__fs__timeline { display: flex; flex-direction: column; gap: 6px; width: 50%; pointer-events: auto; }
.work__fs__frames { display: flex; }
.work__fs__thumb {
  flex: 1 1 0; aspect-ratio: 1.5 / 1; opacity: 0.5;
  background: #2e2e2e center / cover no-repeat; border: 2px solid transparent;
  transition: opacity 0.3s ease;
}
.work__fs__thumb.is-current { opacity: 1; border-color: rgba(255, 255, 255, 0.5); }
.work__fs__thumb:hover { opacity: 1; }
.work__fs__bar { position: relative; height: 3px; background: rgba(255, 255, 255, 0.5); cursor: pointer; touch-action: none; }
.work__fs__bar::before { content: ""; position: absolute; inset: -10px 0; } /* hit area */
.work__fs__watched { position: relative; width: 0; height: 100%; background: #fff; }
.work__fs__watched i { position: absolute; right: 0; top: 0; width: 6px; height: 6px; background: #fff; transform: translate(50%, -25%); }
.work__fs__hover { position: absolute; top: 0; left: 0; width: 0; height: 100%; background: rgba(255, 255, 255, 0.75); opacity: 0; pointer-events: none; }
.work__fs.is-no-video .work__fs__timeline { opacity: 0.3; pointer-events: none; }

/* paused: the player greys out (filter tweened by work.js) */
.work__fs__video.is-paused { filter: grayscale(1) contrast(1.08) brightness(0.78); }

/* keyboard / screen-reader stage controls; visible only while focused */
.work__fs__sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.work__fs__sr:focus-visible {
  width: auto; height: auto; margin: 0; clip: auto; overflow: visible;
  top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 6px 8px; z-index: 5;
  background: #000; color: #fff; text-transform: uppercase; outline: 1px solid #fff;
}
.work__fs :focus-visible { outline: 1px solid #fff; outline-offset: 3px; }

@media (max-width: 991px) {
  .work__fs { padding: 65px 10px 10px; }
  .work__fs::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgb(0 0 0 / 78%), transparent 30%, transparent 65%, rgb(0 0 0 / 85%)); }
  .work__fs__nav-btn, .work__fs__slide { color: #bdbdbd; }
  .work__fs__preview-title { font-size: 32px; }
  .work__fs__frame { gap: 64px; }
  .work__fs__wrap { padding: 65px 10px 10px; }
  .work__fs__info { top: 65px; transform: none; padding: 0 10px; flex-direction: row-reverse; }
  .work__fs__slider-viewport { left: 10px; right: 10px; }
  .work__fs__slider { gap: 16px; }
  /* player: video adapts aspect ratio on mobile, title + bar on top, buttons at the bottom */
  .work__fs.is-detail .work__fs__video { top: 40%; height: auto; max-height: 45vh; max-height: 45svh; aspect-ratio: auto; object-fit: contain; }
  .work__fs__detail.is-visible { flex-direction: column-reverse; }
  .work__fs__buttons { align-items: flex-end; }
  .work__fs__meta { margin-top: 30%; }
  .work__fs__full-data { width: 100%; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 0; }
  .work__fs__title { width: auto; font-size: 16px; }
  .work__fs__timeline { width: 100%; }
  .work__fs__frames { display: none; }
}

/* ---------- 5. Mobile & Responsive Layout (≤991px and ≤600px) ---------- */
@media screen and (max-width: 991px) {
  .work__gallery__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .work__switcher {
    width: 100%;
    justify-content: flex-start;
  }
}

@media screen and (max-width: 767px) {
  .work__gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .work__gallery__item__title {
    font-size: 1.15rem;
  }
  .work__gallery__item__info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media screen and (max-width: 767px) {
  .work__gallery__title {
    font-size: 32px;
    line-height: 0.85;
  }
}
.work__fs:focus { outline: none; }
