/* Work page in the style of unseen.co/projects (see work-menu.js). Hidden until the WebGL
   view takes over (html.ec-work-on); without WebGL the original grid stays. */
.ec-work { display: none; }
/* (ec-work-leaving: on the way to another page the lock is released at once, so the next page is
   measured as a normal scrollable document while the Work layer stays visible under the swoosh) */
html.ec-work-on:not(.ec-work-leaving),
html.ec-work-on:not(.ec-work-leaving) body { overflow: hidden; height: 100%; overscroll-behavior: none; background: #e5e5e5; }
/* The page's original heading, grid and footer are out of the layout from the first frame, also
   during the swoosh (html.ec-js is set first thing in <head>). This has to be display:none:
   the site's text-reveal animation sets its own visibility on the words, which shows them
   through a hidden parent. The header (nav) stays. */
html.ec-js [data-barba="container"]:has(> [data-ec-work]) > :not([data-ec-work]):not(.nav):not([data-nav]):not(script):not(style) {
  display: none !important;
}
/* The Work layer is complete from the first frame: a still of the room, the title and the filter
   pills (in the HTML). The live WebGL room and the cards fade in over it when they are ready. */
html.ec-js .ec-work {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  background: #e5e5e5 url("/assets/brand/room/room-bg.jpg") center / cover no-repeat;
  font-family: "Helvetica Now Subset", "Helvetica Neue", Arial, sans-serif;
  color: #101010;
}
.ec-work__gl {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.ec-work.is-live .ec-work__gl { opacity: 1; }

/* Title + filter pills, fixed above the cards */
.ec-work__filters {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(6.25rem, 15vh, 8.5rem);
  pointer-events: none;
}
.ec-work__title {
  margin: 0 0 0.9rem;
  font-size: clamp(2.5rem, 4.55vw, 5.6rem);
  font-weight: 400;
  font-variation-settings: "wght" 420;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.ec-work__pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem;
  border-radius: 0;
  background: #fff;
  pointer-events: auto;
  touch-action: none; /* a swipe here scrolls the project list */
}
.ec-work__pill {
  display: inline-flex;
  align-items: flex-start;
  padding: 0.42rem 0.8rem 0.4rem;
  border: 1px solid rgba(16, 16, 16, 0.12);
  border-radius: 0;
  background: #fff;
  color: #101010;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}
.ec-work__pill sup { margin-left: 0.15em; font-size: 0.68em; line-height: 0.7; }
.ec-work__pill:hover { border-color: rgba(16, 16, 16, 0.45); }
.ec-work__pill.is-active { background: #101010; border-color: #101010; color: #fff; cursor: default; }

/* "Have a project in mind?" at the end of the list */
.ec-work__cta {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 6vh, 3.5rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  transform: translate(-50%, 1rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.6s cubic-bezier(0.19, 1, 0.22, 1), visibility 0s linear 0.3s;
  text-align: center;
}
.ec-work__cta.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.ec-work__cta p { margin: 0; font-size: 1.05rem; }
.ec-work__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border-radius: 0;
  background: #101010;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}
.ec-work__btn:hover { transform: scale(1.04); }
.ec-work__btn svg { width: 0.75em; height: 0.75em; }

/* ---- Without WebGL (html.ec-work-dom, work-boot.js): the same page as plain HTML ---------- */
html.ec-work-dom:not(.ec-work-leaving),
html.ec-work-dom:not(.ec-work-leaving) body { overflow: hidden; height: 100%; background: #e5e5e5; }
html.ec-work-dom .ec-work {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  background: #e5e5e5 url("/assets/brand/room/room-bg.jpg") center / cover no-repeat;
  font-family: "Helvetica Now Subset", "Helvetica Neue", Arial, sans-serif;
  color: #101010;
}
html.ec-work-dom .ec-work__gl { display: none; }
html.ec-work-dom .ec-work__filters {
  background: linear-gradient(#e5e5e5 0%, rgba(229, 229, 229, 0.92) 70%, rgba(229, 229, 229, 0));
  padding-bottom: 2.2rem;
}
.ec-work__dom {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(15rem, 38vh, 18.5rem) 0 clamp(9rem, 30vh, 14rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ec-work__dom::-webkit-scrollbar { display: none; }
.ec-work__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem 2.4rem;
  width: min(84vw, 1300px);
  margin: 0 auto;
}
@media (min-width: 1024px) { .ec-work__grid { grid-template-columns: 1fr 1fr; width: min(80vw, 1300px); } }
.ec-wcard {
  display: block;
  color: #101010;
  text-decoration: none;
  transform-origin: 50% 100%;
  transition: opacity 0.35s ease;
}
.ec-wcard[hidden] { display: none; }
.ec-work__dom.is-filtering .ec-wcard { opacity: 0; }
.ec-wcard__media { position: relative; display: block; aspect-ratio: 820 / 430; overflow: hidden; background: #d9d9d9; }
.ec-wcard__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform 0.3s ease-out; }
.ec-wcard:hover .ec-wcard__media img,
.ec-wcard:focus-visible .ec-wcard__media img { transform: scale(1.1); }
.ec-wcard__cap {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.55rem 1.6rem 0.6rem 0;
  border-bottom: 1.5px solid #101010;
  font-size: clamp(0.85rem, 1.05vw, 1.05rem);
  line-height: 1.2;
}
.ec-wcard__cap strong { font-weight: 600; }
.ec-wcard__cap svg { position: absolute; right: 0; bottom: 0.55rem; width: 0.75em; height: 0.75em; }
/* Cards rise in from below and curl back under the title as they leave (scroll-driven). */
@supports (animation-timeline: view()) {
  .ec-wcard {
    animation: ec-wcard-in linear both, ec-wcard-out linear both;
    animation-timeline: view(), view();
    animation-range: entry 0% entry 70%, exit 15% exit 100%;
  }
  @keyframes ec-wcard-in { from { opacity: 0; transform: translateY(18%) scale(0.96); } }
  @keyframes ec-wcard-out { to { opacity: 0; transform: translateY(-14%) scale(0.86, 0.6); } }
}
html.ec-work-dom .ec-work__cta { position: fixed; }

/* The site's nav switches to its dark-section colours when the original (dark-topped) Work
   content is hidden; on the light room keep the default blue logo. */
html.ec-work-on .nav-logo,
html.ec-work-dom .nav-logo { color: var(--_colors---swatch--blue, #0038ff) !important; }

.ec-work__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ec-work__sr:focus-within {
  z-index: 3;
  left: 1rem;
  bottom: 5rem;
  width: auto;
  height: auto;
  max-height: 60vh;
  overflow: auto;
  clip: auto;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: #fff;
}
.ec-work__sr ul { margin: 0; padding: 0; list-style: none; }
.ec-work__sr a { color: #101010; line-height: 1.8; }

@media (max-width: 767px) {
  .ec-work__filters { padding-top: 6.25rem; }
  .ec-work__title { font-size: 2.4rem; }
  .ec-work__pills { max-width: calc(100vw - 1.5rem); } /* (wraps to two rows) */
  .ec-work__pill { font-size: 0.72rem; padding: 0.38rem 0.6rem; }
}
