/* ==========================================================================
   WORKS PAGE: sliding showcase on a purple panel, category tabs, detail view
   ========================================================================== */

.works-showcase {
  position: relative;
  padding: 72px 0 88px;
  overflow: hidden;
}

/* The purple panel sits behind the cards; the cards run past its edges */
.works-panel {
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 32px));
  border-radius: 28px;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, 0.14), transparent 55%),
    linear-gradient(135deg, #2a0f5e 0%, #4a1fa0 55%, #6a3bd0 100%);
  box-shadow: var(--shadow-purple);
}

.works-head {
  position: relative;
  text-align: center;
  color: #ffffff;
  padding: 24px 16px 8px;
}

.works-head .kicker {
  color: rgba(255, 255, 255, 0.75);
}

.works-title {
  font-size: clamp(2rem, 2.6vw + 1rem, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 8px 0 10px;
  color: #ffffff;
}

.works-subtitle {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 560px;
}

/* Category tabs */
.works-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px auto 8px;
  padding: 0 16px;
}

.works-tab {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.works-tab:hover {
  background: rgba(255, 255, 255, 0.18);
}

.works-tab.is-active {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
}

.works-tab:focus-visible,
.works-arrow:focus-visible,
.works-dot:focus-visible,
.work-card:focus-visible {
  outline: 3px solid #ffd54a;
  outline-offset: 3px;
}

/* Sliding row: full screen width, cards centred and running off both edges.
   The row (.works-rail) is moved with transform by js/works.js. */
.works-track {
  position: relative;
  overflow: hidden;
  overflow: clip;
  padding: 28px 0 34px;
  cursor: grab;
  touch-action: pan-y;
  outline-offset: -3px;
}

.works-rail {
  display: flex;
  gap: 24px;
  width: max-content;
  will-change: transform;
}

.works-controls [hidden] {
  display: none !important;
}

.works-track.is-static {
  cursor: default;
}

.works-track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.works-track.is-dragging .work-card {
  pointer-events: none;
}

.work-card {
  flex: 0 0 clamp(250px, 27vw, 310px);
  appearance: none;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (hover: hover) {
  .work-card:hover {
    transform: translateY(-8px);
  }

  .work-card:hover .work-card__media img {
    transform: scale(1.04);
  }
}

.work-card__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-gray);
}

.work-card--poster .work-card__media {
  aspect-ratio: 3 / 4;
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.work-card__body {
  display: block;
  padding: 16px 18px 18px;
}

.work-card__cat {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

.work-card__title {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.work-card__client {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Brand cards (Branding tab): the client logo on a dark tile, shown white like the
   clients band on the home page (some logos are white and would vanish on white) */
.work-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18% 16%;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(122, 75, 214, 0.35), transparent 60%),
    #120c24;
}

.work-card__logo img,
.brand-hero img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1) invert(1);
  transition: transform 0.5s ease;
}

.work-card__logo-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.4rem;
  text-align: center;
}

@media (hover: hover) {
  .work-card--brand:hover .work-card__logo img {
    transform: scale(1.06);
  }
}

/* Position counter used instead of dots when there are many cards */
.works-count {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  min-width: 70px;
  text-align: center;
}

/* Tile shown until real work is added */
.work-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--primary);
  background:
    repeating-linear-gradient(45deg, rgba(91, 43, 181, 0.05) 0 12px, transparent 12px 24px),
    var(--primary-soft);
}

.work-placeholder__label {
  font-weight: 700;
  font-size: 1.1rem;
}

.work-placeholder__note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dots and arrows */
.works-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0 16px 20px;
}

.works-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 60vw;
}

.works-dot {
  appearance: none;
  border: 0;
  padding: 10px 0;
  width: 28px;
  background: transparent;
  cursor: pointer;
}

.works-dot::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  transition: background-color 0.25s ease;
}

.works-dot.is-active::before {
  background: #ffffff;
}

.works-arrow {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.works-arrow:hover {
  background: rgba(255, 255, 255, 0.22);
}

.works-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.works-empty {
  position: relative;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 16px;
}

/* Detail view: centred on screen, never taller than the screen */
.work-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(760px, calc(100% - 32px));
  height: fit-content;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  overflow: hidden auto;
  background: #ffffff;
  box-shadow: var(--shadow-lg);
}

.work-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: work-dialog-in 0.25s ease-out;
}

@keyframes work-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.work-dialog::backdrop {
  background: rgba(14, 8, 30, 0.72);
}

/* Page behind does not scroll while a work is open */
html:has(.work-dialog[open]) {
  overflow: hidden;
}

.work-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.work-dialog__media {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-gray);
}

.work-dialog__media img {
  display: block;
  max-width: 100%;
  max-height: min(60dvh, 560px);
  object-fit: contain;
}

.work-dialog__media .work-placeholder {
  position: static;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 46dvh;
}

.work-dialog__body {
  padding: 20px 26px 26px;
}

.work-dialog__title {
  font-size: clamp(1.25rem, 1vw + 1rem, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
  color: var(--text-main);
}

.work-dialog__client {
  color: var(--text-muted);
  margin: 0 0 10px;
}

.work-dialog__desc {
  color: var(--text-body);
  line-height: 1.7;
  margin: 0 0 18px;
}

/* Brand gallery (opened from a brand card) */
.work-dialog.is-brand {
  width: min(960px, calc(100% - 32px));
}

.brand-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(160px, 26dvh, 240px);
  padding: 28px 18%;
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(122, 75, 214, 0.4), transparent 60%),
    #120c24;
}

/* Slideshow of a brand's designs */
.work-dialog.is-brand .work-dialog__media {
  flex-direction: column;
  align-items: stretch;
}

.brand-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-gray);
  touch-action: pan-y;
  cursor: grab;
}

.brand-slider:active {
  cursor: grabbing;
}

.brand-slider:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.brand-slides {
  display: flex;
  will-change: transform;
}

.brand-slide {
  flex: 0 0 100%;
  height: clamp(240px, 56dvh, 540px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-slide img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-slider__caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 10px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color, #ececf3);
}

.brand-slider__caption span:first-child {
  color: var(--text-main);
  font-weight: 600;
}

/* Thumbnail strip under the description: scrolls sideways */
.brand-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
}

.brand-strip .brand-thumb {
  flex: 0 0 auto;
  width: 112px;
}

.brand-strip .brand-thumb img {
  aspect-ratio: 4 / 3;
}

.brand-view {
  position: relative;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-gray);
}

.brand-view img {
  display: block;
  max-width: 100%;
  max-height: min(58dvh, 560px);
  object-fit: contain;
}

.brand-view figcaption {
  width: 100%;
  padding: 10px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color, #ececf3);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.brand-view__nav {
  position: absolute;
  top: calc(50% - 22px);
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: 1.2rem;
  color: var(--text-main);
  cursor: pointer;
}

.brand-view__prev { left: 12px; }
.brand-view__next { right: 12px; }

.brand-gallery__count,
.brand-gallery__empty {
  color: var(--text-muted);
  margin: 0 0 14px;
}

.brand-gallery__empty {
  padding: 18px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 500;
}

.brand-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.brand-thumb {
  appearance: none;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-gray);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

/* Whole design visible in the thumbnail (wide banners and tall posters are not cropped) */
.brand-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bg-gray);
}

.brand-thumb span {
  display: block;
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  background: #ffffff;
}

.brand-thumb:hover {
  transform: translateY(-2px);
}

.brand-thumb[aria-current="true"] img {
  opacity: 1;
}

.brand-strip .brand-thumb:not([aria-current="true"]) img {
  opacity: 0.7;
}

.brand-thumb[aria-current="true"] {
  border-color: var(--primary);
}

.brand-thumb:focus-visible,
.brand-view__nav:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .brand-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .brand-slide {
    height: clamp(220px, 40dvh, 380px);
  }

  .brand-view__nav {
    width: 38px;
    height: 38px;
    top: calc(50% - 19px);
    font-size: 1rem;
  }

  .brand-view__prev { left: 8px; }
  .brand-view__next { right: 8px; }

  .brand-strip .brand-thumb {
    width: 92px;
  }
}

/* Empty lines and the link button stay hidden when there is nothing to show */
.work-dialog [hidden] {
  display: none !important;
}

.work-dialog__body > :last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .works-showcase {
    padding: 56px 0 72px;
  }

  .works-panel {
    top: 28px;
    bottom: 28px;
    border-radius: 22px;
  }

  .work-card {
    flex-basis: 72vw;
  }

  .works-rail {
    gap: 16px;
  }

  .works-arrow {
    display: none;
  }

  .works-dots {
    max-width: 92vw;
    gap: 4px;
  }

  .works-dot {
    width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card,
  .work-card__media img {
    transition: none;
  }
}

/* ==========================================================================
   BRAND VIEWER (a brand with designs): dark, full-height, no scrolling.
   Header (logo, name, one-line description) / stage (design, arrows, caption,
   progress line) / thumbnail strip
   ========================================================================== */
.work-dialog.has-designs {
  width: min(1180px, calc(100% - 32px));
  height: min(calc(100dvh - 32px), 880px);
  max-height: none;
  overflow: hidden;
  background: #0d0a19;
  color: #ffffff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.work-dialog.has-designs::backdrop {
  background: rgba(8, 5, 18, 0.82);
  backdrop-filter: blur(6px);
}

.work-dialog.has-designs .work-dialog__body {
  display: none;
}

.work-dialog.has-designs .work-dialog__media {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  background: transparent;
}

.work-dialog.has-designs .work-dialog__close {
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background-color 0.2s ease;
}

.work-dialog.has-designs .work-dialog__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.brand-lb {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Header */
.brand-lb__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 76px 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(122, 75, 214, 0.18), rgba(122, 75, 214, 0));
}

.brand-lb__logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 56px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-lb__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(1) invert(1);
}

.brand-lb__text {
  min-width: 0;
}

.brand-lb__kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b89cff;
}

.brand-lb__title {
  margin: 2px 0 2px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.brand-lb__desc {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stage */
.work-dialog.has-designs .brand-slider {
  flex: 1 1 auto;
  min-height: 0;
  background: radial-gradient(90% 80% at 50% 40%, rgba(122, 75, 214, 0.16), transparent 70%), #0d0a19;
}

.work-dialog.has-designs .brand-slides {
  height: 100%;
}

.work-dialog.has-designs .brand-slide {
  height: 100%;
  padding: 22px 84px 56px;
}

.work-dialog.has-designs .brand-slide img {
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.work-dialog.has-designs .brand-view__nav {
  width: 48px;
  height: 48px;
  top: calc(50% - 40px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.work-dialog.has-designs .brand-view__nav:hover {
  background: rgba(255, 255, 255, 0.22);
}

.work-dialog.has-designs .brand-view__prev { left: 18px; }
.work-dialog.has-designs .brand-view__next { right: 18px; }

.work-dialog.has-designs .brand-slider__caption {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: calc(100% - 32px);
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  white-space: nowrap;
}

.work-dialog.has-designs .brand-slider__caption span:first-child {
  color: #ffffff;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-dialog.has-designs .brand-slider__caption span + span::before {
  content: "·";
  margin-right: 10px;
  color: rgba(255, 255, 255, 0.4);
}

/* Thin line along the stage's bottom edge that fills while each design is shown */
.brand-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, #7a4bd6, #b89cff);
}

.brand-progress.is-running {
  animation: brand-progress 4s linear forwards;
}

@keyframes brand-progress {
  to { transform: scaleX(1); }
}

/* Thumbnail strip */
.work-dialog.has-designs .brand-strip {
  flex: 0 0 auto;
  justify-content: safe center;
  gap: 10px;
  padding: 14px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  scrollbar-width: none;
}

.work-dialog.has-designs .brand-strip::-webkit-scrollbar {
  display: none;
}

.work-dialog.has-designs .brand-thumb {
  width: 104px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.work-dialog.has-designs .brand-thumb img {
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, 0.04);
  transition: opacity 0.2s ease;
}

.work-dialog.has-designs .brand-thumb:not([aria-current="true"]) img {
  opacity: 0.5;
}

.work-dialog.has-designs .brand-thumb:hover img {
  opacity: 0.9;
}

.work-dialog.has-designs .brand-thumb[aria-current="true"] {
  border-color: #ffffff;
}

.work-dialog.has-designs .brand-thumb:focus-visible,
.work-dialog.has-designs .brand-view__nav:focus-visible,
.work-dialog.has-designs .work-dialog__close:focus-visible {
  outline: 3px solid #b89cff;
  outline-offset: 2px;
}

/* Phones: almost full screen, compact header, smaller controls */
@media (max-width: 640px) {
  .work-dialog.has-designs {
    width: calc(100% - 16px);
    height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .brand-lb__head {
    gap: 12px;
    padding: 12px 64px 12px 14px;
  }

  .brand-lb__logo {
    width: 76px;
    height: 44px;
    padding: 6px 8px;
  }

  .brand-lb__title {
    font-size: 1.1rem;
  }

  .brand-lb__desc {
    display: none;
  }

  .work-dialog.has-designs .work-dialog__close {
    top: 12px;
    right: 12px;
  }

  .work-dialog.has-designs .brand-slide {
    padding: 14px 12px 52px;
  }

  .work-dialog.has-designs .brand-view__nav {
    width: 38px;
    height: 38px;
    top: calc(50% - 30px);
  }

  .work-dialog.has-designs .brand-view__prev { left: 8px; }
  .work-dialog.has-designs .brand-view__next { right: 8px; }

  .work-dialog.has-designs .brand-thumb {
    width: 80px;
  }

  .work-dialog.has-designs .brand-strip {
    justify-content: flex-start;
    padding: 12px 12px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-progress { display: none; }
}

/* ==========================================================================
   BRAND SHOWCASE CARDS (Branding tab): a design fills the card, the brand's
   logo sits on top in white, name and design count along the bottom
   ========================================================================== */
.work-card.work-card--brand {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  display: block;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(140, 92, 230, 0.45), transparent 60%),
    linear-gradient(160deg, #1c1238 0%, #0f0a1f 100%);
  color: #ffffff;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-card__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.brand-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.6s ease;
  filter: saturate(0.9);
}

/* Shade: keeps the white logo and text readable on any photo */
.brand-card__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 6, 28, 0.25) 0%, rgba(12, 6, 28, 0.15) 30%, rgba(12, 6, 28, 0.55) 62%, rgba(12, 6, 28, 0.94) 100%);
  transition: opacity 0.6s ease;
}

.work-card--brand.has-cover .brand-card__shade::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(12, 6, 28, 0.12);
  transition: opacity 0.6s ease;
}

.brand-card__logo {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 14%;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.brand-card__logo img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Every logo shows as a white mark, like the clients band on the home page */
  filter: grayscale(1) invert(1) drop-shadow(0 4px 18px rgba(0, 0, 0, 0.45));
}

.brand-card__logo-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}

.brand-card__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 18px 20px 20px;
  text-align: left;
}

.brand-card__cat {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7b1ff;
}

.brand-card__name {
  display: block;
  margin: 4px 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #ffffff;
}

.brand-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-card__count {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
}

.work-card--brand:not(.has-cover) .brand-card__count {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}

.brand-card__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.brand-card__go span {
  display: inline-block;
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .work-card.work-card--brand:hover {
    transform: translateY(-8px);
  }

  .work-card--brand:hover .brand-card__bg img {
    transform: scale(1.12);
    filter: saturate(1.05);
  }

  .work-card--brand.has-cover:hover .brand-card__shade::before {
    opacity: 0.4;
  }

  .work-card--brand:hover .brand-card__logo {
    transform: translateY(-4px) scale(0.96);
  }

  .work-card--brand:hover .brand-card__go span {
    transform: translateX(4px);
  }
}

/* The card's own focus ring sits inside the rounded corner */
.work-card.work-card--brand:focus-visible {
  outline-offset: -3px;
}

@media (max-width: 640px) {
  .brand-card__name {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-card__bg img,
  .brand-card__logo,
  .brand-card__go span {
    transition: none;
  }
}

/* Photo cards: the logo becomes a small frosted badge in the top corner, so it never
   sits on top of the same logo inside the design */
.work-card--brand.has-cover .brand-card__logo {
  left: 16px;
  right: auto;
  top: 16px;
  height: 48px;
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(12, 6, 28, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.work-card--brand.has-cover .brand-card__logo img {
  max-width: 120px;
  filter: grayscale(1) invert(1);
}

@media (hover: hover) {
  .work-card--brand.has-cover:hover .brand-card__logo {
    transform: none;
  }
}

/* ==========================================================================
   BRAND WALLPAPERS for cards whose designs are not added yet
   ========================================================================== */

/* Hikaya: deep maroon, a gold eight-pointed-star lattice (from their emblem),
   warm gold glow, the name in a gold serif */
.work-card--brand.brand-theme-hikaya {
  background-color: #3a0a14;
  background-image:
    radial-gradient(85% 60% at 50% 32%, rgba(214, 168, 86, 0.32), transparent 70%),
    radial-gradient(120% 80% at 50% 110%, rgba(10, 2, 6, 0.85), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23d6a856' stroke-opacity='0.22' stroke-width='1.2'%3E%3Crect x='18' y='18' width='28' height='28'/%3E%3Crect x='18' y='18' width='28' height='28' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3Cpath d='M0 0L10 10M64 0L54 10M0 64L10 54M64 64L54 54'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(165deg, #5e1222 0%, #3a0a14 55%, #1e050b 100%);
  background-size: auto, auto, 64px 64px, auto;
  border-color: rgba(214, 168, 86, 0.35);
}

.brand-theme-hikaya .brand-card__shade {
  background: linear-gradient(180deg, transparent 45%, rgba(20, 3, 8, 0.85) 100%);
}

.brand-theme-hikaya .brand-card__logo-name {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: 2.3rem;
  letter-spacing: 0.22em;
  color: #e9c77e;
  text-shadow: 0 2px 18px rgba(214, 168, 86, 0.45);
}

/* A thin gold star frame behind the name */
.brand-theme-hikaya .brand-card__logo::before {
  content: "";
  position: absolute;
  width: 132px;
  height: 132px;
  border: 1.5px solid rgba(233, 199, 126, 0.55);
  transform: rotate(45deg);
}

.brand-theme-hikaya .brand-card__logo::after {
  content: "";
  position: absolute;
  width: 132px;
  height: 132px;
  border: 1.5px solid rgba(233, 199, 126, 0.55);
}

.brand-theme-hikaya .brand-card__logo-name {
  position: relative;
  padding: 6px 14px;
  background: rgba(58, 10, 20, 0.92);
}

.brand-theme-hikaya .brand-card__cat {
  color: #e9c77e;
}

.brand-theme-hikaya .brand-card__count {
  color: #f3dfb4;
  background: rgba(214, 168, 86, 0.14);
  border-color: rgba(214, 168, 86, 0.4);
}

/* Vastragni: rich black, a tiled pattern of their V mark, a yellow glow and accent */
.work-card--brand.brand-theme-vastragni {
  background-color: #0b0b0b;
  background-image:
    radial-gradient(80% 55% at 50% 30%, rgba(255, 222, 0, 0.2), transparent 70%),
    radial-gradient(120% 80% at 50% 110%, rgba(0, 0, 0, 0.9), transparent 60%),
    linear-gradient(165deg, #1c1c1c 0%, #0b0b0b 60%, #050505 100%);
  border-color: rgba(255, 222, 0, 0.35);
}

.brand-theme-vastragni::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("/assets/images/works/vastragni/vastragni-mark.png");
  background-size: 34px auto;
  background-repeat: space;
  opacity: 0.09;
  transform: rotate(-12deg) scale(1.4);
}

.brand-theme-vastragni .brand-card__shade {
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.88) 100%);
}

.brand-theme-vastragni .brand-card__logo img {
  filter: grayscale(1) invert(1) drop-shadow(0 6px 22px rgba(255, 222, 0, 0.25));
}

/* A short yellow line under the logo */
.brand-theme-vastragni .brand-card__logo::after {
  content: "";
  position: absolute;
  bottom: -14px;
  left: 50%;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  transform: translateX(-50%);
  background: #ffde00;
}

.brand-theme-vastragni .brand-card__cat {
  color: #ffde00;
}

.brand-theme-vastragni .brand-card__count {
  color: #fff6b3;
  background: rgba(255, 222, 0, 0.12);
  border-color: rgba(255, 222, 0, 0.4);
}

/* Themed cards are always clipped (the rotated pattern must not spill out) */
.brand-theme-hikaya,
.brand-theme-vastragni {
  overflow: hidden;
}

/* ==========================================================================
   POSTER VIEWER: dark, the poster at full height on a blurred copy of itself,
   details + prev/next + call to action beside it (below it on phones)
   ========================================================================== */
.work-dialog.is-poster {
  width: min(1040px, calc(100% - 32px));
  height: min(calc(100dvh - 40px), 860px);
  max-height: none;
  overflow: hidden;
  background: #0d0a19;
  color: #ffffff;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.work-dialog.is-poster[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
}

.work-dialog.is-poster::backdrop {
  background: rgba(8, 5, 18, 0.82);
  backdrop-filter: blur(6px);
}

.work-dialog.is-poster .work-dialog__media {
  position: relative;
  min-height: 0;
  overflow: hidden;
  padding: 28px;
  background: #0d0a19;
  touch-action: pan-y;
}

.poster-view__glow {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(1.3);
  opacity: 0.45;
  transform: scale(1.1);
}

.poster-view__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.work-dialog.is-poster .work-dialog__media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  user-select: none;
  animation: poster-in 0.35s ease-out;
}

@keyframes poster-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

.work-dialog.is-poster .work-dialog__body {
  display: flex;
  flex-direction: column;
  padding: 72px 30px 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(122, 75, 214, 0.22), rgba(122, 75, 214, 0) 60%);
  overflow-y: auto;
}

.work-dialog.is-poster .work-dialog__cat {
  color: #b99cff;
}

.work-dialog.is-poster .work-dialog__title {
  color: #ffffff;
  font-size: clamp(1.5rem, 1.2vw + 1.1rem, 2rem);
  line-height: 1.15;
  margin: 10px 0 8px;
}

.work-dialog.is-poster .work-dialog__client {
  color: rgba(255, 255, 255, 0.65);
}

.work-dialog.is-poster .work-dialog__desc {
  color: rgba(255, 255, 255, 0.8);
}

.work-dialog.is-poster .work-dialog__close {
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background-color 0.2s ease;
}

.work-dialog.is-poster .work-dialog__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.work-dialog.is-poster .work-dialog__body > .poster-view__extra {
  margin-top: auto;
}

.poster-view__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.poster-view__btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.poster-view__btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.poster-view__btn:focus-visible,
.work-dialog.is-poster .work-dialog__close:focus-visible {
  outline: 2px solid #b99cff;
  outline-offset: 2px;
}

.poster-view__count {
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.poster-view__count span {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

.poster-view__cta {
  padding-top: 20px;
}

.poster-view__cta p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.5;
}

.poster-view__cta .btn {
  width: 100%;
  justify-content: center;
}

/* Phones and narrow tablets: poster on top, details below */
@media (max-width: 760px) {
  .work-dialog.is-poster {
    width: calc(100% - 20px);
    height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .work-dialog.is-poster[open] {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .work-dialog.is-poster .work-dialog__media {
    padding: 56px 16px 12px;
  }

  .work-dialog.is-poster .work-dialog__body {
    padding: 14px 18px 18px;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    overflow: visible;
  }

  .work-dialog.is-poster .work-dialog__cat {
    display: none;
  }

  .work-dialog.is-poster .work-dialog__title {
    font-size: 1.2rem;
    margin: 0 0 2px;
  }

  .work-dialog.is-poster .work-dialog__client {
    margin-bottom: 12px;
    font-size: 0.92rem;
  }

  .poster-view__nav {
    padding: 0;
    border: 0;
  }

  .poster-view__btn {
    width: 44px;
    height: 44px;
  }

  .poster-view__cta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-dialog.is-poster .work-dialog__media img {
    animation: none;
  }
}

/* ==========================================================================
   WEBSITES: each site shown on a laptop, with the phone version in front.
   Same mockup on the card (light scene) and in the viewer (dark, larger).
   ========================================================================== */
.work-card--site .work-card__media {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(120% 90% at 20% 10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(150deg, #efe9ff 0%, #ddd2fb 55%, #cbbdf5 100%);
}

.device-scene {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6% 12% 6% 6%;
}

.device-laptop {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 14px 18px rgba(40, 20, 90, 0.28));
  transition: transform 0.45s ease;
}

.device-laptop__screen {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10.6;
  padding: 3.2% 3.2% 3.6%;
  background: #17151f;
  border-radius: 10px 10px 2px 2px;
  box-shadow: inset 0 0 0 1px #34313f;
}

.device-laptop__cam {
  position: absolute;
  top: 1.1%;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #3b3846;
}

.work-card .device-laptop__screen img,
.work-dialog .device-laptop__screen img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: top;
  border-radius: 2px;
  box-shadow: none;
  animation: none;
  transform: none;
}

.device-laptop__base {
  position: relative;
  display: block;
  width: 118%;
  height: 0;
  padding-top: 3.4%;
  background: linear-gradient(180deg, #e4e1ec 0%, #b9b5c6 70%, #9893a8 100%);
  border-radius: 2px 2px 14px 14px / 2px 2px 100% 100%;
}

.device-laptop__base::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 15%;
  height: 40%;
  transform: translateX(-50%);
  background: #a6a2b4;
  border-radius: 0 0 6px 6px;
}

.device-phone {
  position: absolute;
  right: 6%;
  bottom: 8%;
  width: 19%;
  aspect-ratio: 9 / 19;
  padding: 1.4%;
  background: #17151f;
  border-radius: 14px;
  box-shadow: 0 14px 26px rgba(40, 20, 90, 0.35), inset 0 0 0 1px #34313f;
  transition: transform 0.45s ease;
}

.work-card .device-phone img,
.work-dialog .device-phone img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  box-shadow: none;
  animation: none;
  transform: none;
}

@media (hover: hover) and (pointer: fine) {
  .work-card--site:hover .work-card__media img { transform: none; }
  .work-card--site:hover .device-laptop { transform: translateY(-4px); }
  .work-card--site:hover .device-phone { transform: translateY(-8px); }
}

/* Viewer: the same mockup, large, on the dark stage */
.work-dialog.is-site {
  width: min(1240px, calc(100% - 32px));
}

.work-dialog.is-site .work-dialog__media {
  padding: 40px 48px;
}

.work-dialog.is-site .device-scene {
  padding: 6% 10% 8% 4%;
}

.work-dialog.is-site .device-laptop {
  width: 86%;
  max-width: 780px;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.6));
  animation: poster-in 0.35s ease-out;
}

.work-dialog.is-site .device-laptop__screen {
  border-radius: 16px 16px 3px 3px;
}

.work-dialog.is-site .device-laptop__cam {
  width: 6px;
  height: 6px;
  margin-left: -3px;
}

.work-dialog.is-site .device-phone {
  right: 5%;
  bottom: 9%;
  width: 18%;
  max-width: 160px;
  padding: 7px;
  border-radius: 28px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), inset 0 0 0 1px #3a3746;
  animation: site-phone-in 0.5s ease-out;
}

.work-dialog.is-site .device-phone img {
  border-radius: 21px;
}

@keyframes site-phone-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

.work-dialog.is-site .work-dialog__link {
  width: 100%;
  justify-content: center;
  margin-bottom: 4px;
}

.work-dialog.is-site .poster-view__cta .btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.work-dialog.is-site .poster-view__cta .btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 760px) {
  .work-dialog.is-site .work-dialog__media {
    padding: 56px 8px 8px;
  }

  .work-dialog.is-site .device-scene {
    padding: 4% 10% 4% 6%;
  }

  .work-dialog.is-site .device-laptop {
    width: 90%;
  }

  .work-dialog.is-site .device-phone {
    right: 2%;
    bottom: auto;
    top: 50%;
    width: 26%;
    margin-top: 2%;
    padding: 4px;
    border-radius: 16px;
  }

  .work-dialog.is-site .device-phone img {
    border-radius: 12px;
  }

  .work-dialog.is-site .work-dialog__desc {
    display: none;
  }

  .work-dialog.is-site .work-dialog__link {
    margin-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-laptop,
  .device-phone,
  .work-dialog.is-site .device-laptop,
  .work-dialog.is-site .device-phone {
    animation: none;
    transition: none;
  }
}

/* ==========================================================================
   POSTER CARDS: the poster fills the whole card; client and title sit on a
   soft dark fade at the bottom; a round "open" button appears on hover
   ========================================================================== */
.work-card--overlay {
  position: relative;
  border-radius: 22px;
  background: #120c24;
  isolation: isolate;
}

.work-card--overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  pointer-events: none;
  z-index: 3;
}

.work-card--overlay .work-card__media {
  background: #120c24;
}

.work-card--overlay .work-card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 6, 24, 0) 48%, rgba(10, 6, 24, 0.7) 70%, rgba(10, 6, 24, 0.96) 100%);
  pointer-events: none;
}

.work-card--overlay .work-card__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
}

.work-card--overlay .work-card__cat {
  display: none;
}

.work-card--overlay .work-card__client {
  order: -1;
  align-self: flex-start;
  margin: 0 0 8px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.work-card--overlay .work-card__client::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #b99cff;
  vertical-align: 1px;
}

.work-card--overlay .work-card__title {
  color: #ffffff;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.poster-card__go {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.8) translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
  .work-card--overlay:hover .poster-card__go {
    opacity: 1;
    transform: none;
  }

  .work-card--poster:hover .work-card__media img {
    transform: scale(1.05);
  }
}

/* Touch screens: the button stays visible on the centre card as a hint to tap */
@media (hover: none) {
  .work-card--overlay.is-current .poster-card__go {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .poster-card__go {
    transition: none;
  }
}

/* Website cards in the same style: the laptop + phone on a dark stage lit by the site's own colours */
.work-card--site.work-card--overlay .work-card__media {
  aspect-ratio: 3 / 4;
  background: #120c24;
}

.site-card__glow {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.4);
  opacity: 0.55;
}

.work-card--site.work-card--overlay .device-scene {
  padding: 4% 13% 34% 7%;
}

.work-card--site.work-card--overlay .device-laptop {
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.55));
}

.work-card--site.work-card--overlay .device-phone {
  right: 7%;
  bottom: 33%;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.55), inset 0 0 0 1px #3a3746;
}

/* ==========================================================================
   SILVER PANEL: the showcase sits on a light brushed-silver panel instead of
   purple; heading, tabs, dots and arrows switch to dark/purple to match
   ========================================================================== */
.works-panel {
  background:
    radial-gradient(70% 55% at 18% 0%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 65%),
    linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.45) 45%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, #eef0f4 0%, #dde0e7 45%, #c9cdd7 100%);
  border: 1px solid rgba(20, 16, 40, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.works-head {
  color: var(--text-main);
}

.works-head .kicker {
  color: var(--primary);
}

.works-title {
  color: var(--text-main);
}

.works-subtitle {
  color: var(--text-muted);
}

.works-tab {
  border-color: rgba(20, 16, 40, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-main);
}

.works-tab:hover {
  background: #ffffff;
  border-color: rgba(91, 43, 181, 0.35);
}

.works-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.works-tab:focus-visible,
.works-arrow:focus-visible,
.works-dot:focus-visible,
.work-card:focus-visible {
  outline-color: var(--primary);
}

.works-dot::before {
  background: rgba(20, 16, 40, 0.18);
}

.works-dot.is-active::before {
  background: var(--primary);
}

.works-count {
  color: var(--text-main);
}

.works-arrow {
  border-color: rgba(20, 16, 40, 0.12);
  background: #ffffff;
  color: var(--primary);
}

.works-arrow:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.works-empty {
  color: var(--text-muted);
}

/* ==========================================================================
   PHONES: heading, cards and arrows fit on one screen. Cards are sized by the
   screen width, but never taller than the space left under the heading, and
   every tab uses the same card shape (3:4) so switching tabs doesn't jump.
   ========================================================================== */
@media (max-width: 640px) {
  .works-showcase {
    padding: 44px 0 52px;
  }

  .works-panel {
    top: 20px;
    bottom: 20px;
  }

  .works-head {
    padding: 18px 16px 0;
  }

  .works-title {
    font-size: 1.9rem;
    margin: 6px 0 6px;
  }

  .works-subtitle {
    font-size: 0.95rem;
    max-width: 300px;
  }

  .works-tabs {
    margin: 16px auto 0;
    gap: 6px;
  }

  .works-tab {
    padding: 7px 15px;
    font-size: 0.88rem;
  }

  .works-track {
    padding: 20px 0 22px;
  }

  .works-rail {
    gap: 14px;
  }

  .work-card {
    flex-basis: clamp(210px, min(66vw, calc((100svh - 330px) * 0.75)), 300px);
    border-radius: 18px;
  }

  .work-card .work-card__media,
  .work-card--overlay .work-card__media,
  .work-card--site.work-card--overlay .work-card__media {
    aspect-ratio: 3 / 4;
  }

  .work-card.work-card--brand {
    aspect-ratio: 3 / 4;
  }

  .work-card--overlay .work-card__body {
    padding: 14px 16px 16px;
  }

  .work-card--overlay .work-card__title {
    font-size: 1rem;
  }

  .work-card--overlay .work-card__client {
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  .poster-card__go {
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .works-controls {
    padding-bottom: 8px;
  }
}
