/* ─────────────────────────────────────────────
   Image Preview Cursor Follower
   Portfolio list with a floating image preview
   that follows the cursor (GSAP + directional wipe)
───────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Premium light editorial palette */
  --color-bg: #f7f5f2;
  --color-bg-elevated: #fbfaf8;
  --color-ink: #141311;
  --color-ink-muted: rgba(20, 19, 17, 0.48);
  --color-line: rgba(20, 19, 17, 0.28);
  --color-line-soft: rgba(20, 19, 17, 0.2);
  --color-cursor-label-bg: #ffffff;
  --font-sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --ease-reveal: cubic-bezier(0.65, 0.1, 0, 1);
  --preview-width: 20em;
  --preview-radius: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: none;
  -webkit-user-drag: none;
  user-select: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Stage ─────────────────────────────────── */

.stage {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  background:
    radial-gradient(
      ellipse 85% 55% at 50% 0%,
      rgba(255, 255, 255, 0.85) 0%,
      transparent 58%
    ),
    radial-gradient(
      ellipse 60% 40% at 80% 100%,
      rgba(236, 232, 224, 0.55) 0%,
      transparent 50%
    ),
    var(--color-bg);
}

/* ── Root component ────────────────────────── */

.preview-follower {
  width: 100%;
  max-width: 76em;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2em;
  padding-right: 2em;
  position: relative;
}

/* ── Header row ────────────────────────────── */

.preview-follower__header {
  width: 100%;
}

.preview-follower__header .preview-follower__row {
  padding-bottom: 0.5em;
}

.preview-follower__col-label {
  color: var(--color-ink-muted);
  text-transform: uppercase;
  font-size: 0.75em;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ── Collection / list ─────────────────────── */

.preview-follower__collection {
  width: 100%;
  margin-top: 0.5em;
}

.preview-follower__list {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
}

/* ── Item ──────────────────────────────────── */

.preview-follower__item {
  width: 100%;
  transition: opacity 0.2s ease;
}

.preview-follower__link {
  display: block;
  width: 100%;
  border-top: 1px solid var(--color-line-soft);
  padding-top: 2.5em;
  padding-bottom: 2.5em;
  cursor: pointer;
}

.preview-follower__item:last-of-type .preview-follower__link {
  border-bottom: 1px solid var(--color-line);
}

/* ── Row / columns ─────────────────────────── */

.preview-follower__row {
  display: flex;
  flex-flow: wrap;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.preview-follower__col {
  flex: 1;
  min-width: 0;
}

.preview-follower__col--name {
  max-width: 45%;
}

.preview-follower__col--location,
.preview-follower__col--year {
  max-width: 15%;
}

.preview-follower__col--services {
  max-width: 25%;
}

/* ── Typography ────────────────────────────── */

.preview-follower__heading {
  margin: 0;
  font-size: 3.5em;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.preview-follower__text {
  margin: 0;
  font-size: 1.25em;
  font-weight: 400;
  line-height: 1.2;
}

/* ── Inline visual (hidden on desktop) ─────── */

.preview-follower__visual {
  aspect-ratio: 1 / 1.25;
  width: var(--preview-width);
  display: none;
  position: absolute;
  overflow: hidden;
  border-radius: 0;
}

.preview-follower__visual-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* ── Floating cursor preview ───────────────── */

.preview-follower__cursor {
  z-index: 100;
  aspect-ratio: 1 / 1.25;
  pointer-events: none;
  border-radius: 0;
  justify-content: center;
  align-items: center;
  width: var(--preview-width);
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  will-change: transform;
}

.preview-follower__cursor-inner {
  z-index: 2;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  opacity: 0;
  transform: scale(0);
  transition:
    opacity 0.1s ease,
    transform 0.6s var(--ease-reveal);
  will-change: transform, opacity;
  overflow: hidden;
}

/*
  Media stack: own stacking context so GSAP layer z-index
  can never paint above the Explore label.
*/
.preview-follower__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: 0;
  pointer-events: none;
}

/*
  Permanent image layers inside the media stack only.
  Do NOT set CSS transform here — GSAP owns yPercent / force3D.
*/
.preview-follower__layer {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 0;
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.preview-follower__layer-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

/*
  Explore label: sibling of media, always on top.
  Never animated away; never shares z-index with image layers.
*/
.preview-follower__cursor-label {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: none;
}

.preview-follower__cursor-label-text {
  display: block;
  position: relative;
  z-index: 1;
  background-color: var(--color-cursor-label-bg);
  border-radius: 0;
  padding: 0.75em 1.25em;
  font-size: 1em;
  font-weight: 500;
  color: var(--color-ink);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(20, 19, 17, 0.08);
}

/* ── Hover interactions (desktop + hover) ──── */

@media (hover: hover) and (min-width: 992px) {
  body:has([data-preview-follower-collection]:hover)
    .preview-follower__cursor-inner {
    opacity: 1;
    transform: scale(1);
  }

  body:has(.preview-follower__item:hover)
    .preview-follower__item:not(:hover) {
    opacity: 0.5;
  }
}

/* ── Tablet ────────────────────────────────── */

@media screen and (max-width: 991px) {
  .preview-follower__header {
    display: none;
  }

  .preview-follower__list {
    flex-flow: wrap;
    column-gap: 1em;
    row-gap: 4em;
  }

  .preview-follower__item {
    width: calc(50% - 0.5em);
  }

  .preview-follower__link {
    border: none;
    border-top: none;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    flex-flow: column;
  }

  .preview-follower__item:last-of-type .preview-follower__link {
    border-bottom: none;
  }

  .preview-follower__row {
    row-gap: 0.5em;
  }

  .preview-follower__col--name {
    flex: none;
    order: -1;
    width: 100%;
    max-width: none;
  }

  .preview-follower__col--location {
    display: none;
  }

  .preview-follower__col--year {
    text-align: right;
    max-width: 20%;
  }

  .preview-follower__col--services {
    order: -1;
    max-width: 80%;
  }

  .preview-follower__heading {
    font-size: 2em;
  }

  .preview-follower__visual {
    border-radius: 0;
    order: -1;
    width: 100%;
    margin-bottom: 1em;
    display: block;
    position: relative;
  }

  .preview-follower__cursor {
    display: none;
  }
}

/* ── Mobile ────────────────────────────────── */

@media screen and (max-width: 767px) {
  .stage {
    padding: 2.5rem 0;
  }

  .preview-follower {
    padding-left: 1em;
    padding-right: 1em;
  }

  .preview-follower__list {
    row-gap: 3em;
  }

  .preview-follower__item {
    width: 100%;
  }
}

/* ── Reduced motion ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .preview-follower__item,
  .preview-follower__cursor-inner,
  .preview-follower__cursor-label {
    transition: none !important;
  }

  .preview-follower__cursor {
    display: none;
  }

  .preview-follower__visual {
    display: block;
    position: relative;
    width: 100%;
    max-width: 20em;
    margin-bottom: 1em;
  }
}
