/* ==========================================================================
   premium.css — interactions & motion only.
   Scroll reveals, the home slideshow, loading skeletons. (Lightbox and the
   designers carousel will be added here alongside their pages.)
   All motion degrades gracefully under prefers-reduced-motion (see style.css,
   which neutralises transitions/animations globally).
   ========================================================================== */

/* ---- Scroll reveals -------------------------------------------------------
   Elements tagged .reveal start slightly down + transparent; premium.js adds
   .is-visible when they scroll into view. Add inline style="--reveal-delay:..."
   to stagger siblings.                                                       */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* If JS never runs, never leave content invisible. */
.no-js .reveal {
  opacity: 1;
  transform: none;
}

/* ---- Loading skeletons ---------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--paper) 60%, transparent),
    transparent
  );
  animation: skeleton-sweep 1.6s var(--ease) infinite;
}
@keyframes skeleton-sweep {
  100% {
    transform: translateX(100%);
  }
}

/* ==========================================================================
   Home slideshow — slow crossfade, arrows, dots.
   premium.js fetches homeSlide docs and injects .slide elements into the track.
   ========================================================================== */
.slideshow {
  position: relative;
  width: 100%;
}
.slideshow__viewport {
  position: relative;
  aspect-ratio: 16 / 10;
  max-height: 82vh;
  overflow: hidden;
  background: var(--paper-2);
}
@media (min-width: 768px) {
  .slideshow__viewport {
    aspect-ratio: 2 / 1;
  }
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.slide.is-active {
  opacity: 1;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Arrows — quiet by default, clearer on hover/focus */
.slideshow__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: var(--paper);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  mix-blend-mode: difference;
}
.slideshow:hover .slideshow__arrow,
.slideshow__arrow:focus-visible {
  opacity: 0.9;
}
.slideshow__arrow--prev {
  left: 0.5rem;
}
.slideshow__arrow--next {
  right: 0.5rem;
}
.slideshow__arrow svg {
  width: 1.75rem;
  height: 1.75rem;
}

/* Dots */
.slideshow__dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.slideshow__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.slideshow__dot.is-active {
  background: var(--ink);
  transform: scale(1.35);
}

/* ---- Full-bleed home hero overrides --------------------------------------
   In the home hero the slideshow fills the whole viewport behind the name,
   so the viewport ignores its aspect-ratio and the controls go light + float
   over the image. */
.home-hero .slideshow,
.home-hero .slideshow__viewport {
  position: absolute;
  inset: 0;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}
.home-hero .slideshow {
  z-index: 1;
}
.home-hero .slide__img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.home-hero .slide.is-active .slide__img {
  animation: kenburns 14s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.07); }
}

.home-hero .slideshow__arrow {
  z-index: 5;
}
.home-hero .slideshow__dots {
  position: absolute;
  right: var(--gutter);
  bottom: 2rem;
  z-index: 5;
  margin-top: 0;
}
.home-hero .slideshow__dot {
  background: rgba(255, 255, 255, 0.45);
}
.home-hero .slideshow__dot.is-active {
  background: #fff;
  transform: scale(1.35);
}

/* ==========================================================================
   Lightbox — full-screen image viewer (artwork detail, large works).
   premium.js builds the markup once and wires delegation/keyboard.
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3.5rem);
  background: color-mix(in srgb, var(--near-black) 95%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox__btn {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  color: #fff;
  opacity: 0.75;
  transition: opacity var(--dur) var(--ease);
}
.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  opacity: 1;
}
.lightbox__btn svg {
  width: 1.75rem;
  height: 1.75rem;
}
.lightbox__close {
  top: 1rem;
  right: 1rem;
}
.lightbox__prev {
  left: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__next {
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox__count {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}
/* Single-image lightbox hides the prev/next + counter. */
.lightbox--single .lightbox__prev,
.lightbox--single .lightbox__next,
.lightbox--single .lightbox__count {
  display: none;
}
body.lightbox-open {
  overflow: hidden;
}

/* ==========================================================================
   In-situ carousel — designers page. Works shown installed, at scale.
   No autoplay (let the visitor linger); slow horizontal slide + prev/next.
   designers.js injects .insitu__slide elements into the track.
   ========================================================================== */
.insitu {
  position: relative;
}
.insitu__viewport {
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
  aspect-ratio: 3 / 2;
  max-height: 82vh;
}
.insitu__track {
  display: flex;
  height: 100%;
  transition: transform 0.8s var(--ease);
}
.insitu__slide {
  flex: 0 0 100%;
  height: 100%;
}
.insitu__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--paper);
}
.insitu__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  color: var(--paper);
  background: color-mix(in srgb, var(--near-black) 45%, transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}
.insitu__viewport:hover .insitu__arrow,
.insitu__arrow:focus-visible {
  opacity: 1;
}
.insitu__arrow:hover {
  background: color-mix(in srgb, var(--near-black) 70%, transparent);
}
.insitu__arrow[disabled] {
  opacity: 0;
  pointer-events: none;
}
.insitu__arrow--prev {
  left: 0;
}
.insitu__arrow--next {
  right: 0;
}
.insitu__arrow svg {
  width: 1.75rem;
  height: 1.75rem;
}
.insitu__footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 1.25rem;
}
.insitu__caption {
  color: var(--muted);
  font-size: 0.95rem;
}
.insitu__counter {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--muted);
  flex-shrink: 0;
}
