.creative-work {
  --creative-gutter: clamp(24px, 4.6vw, 88px);
  --creative-ink: #faf7ff;
  --creative-muted: #c0b8cb;
  position: relative;
  z-index: 1;
  padding: clamp(64px, 7vw, 118px) var(--creative-gutter) clamp(64px, 7vw, 112px);
  color: var(--creative-ink);
}

.creative-work::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 28% at 10% 8%, #17142e9c, transparent),
    #070915;
  mask-image: linear-gradient(180deg, transparent, #000 160px, #000 calc(100% - 150px), transparent);
  pointer-events: none;
}

.creative-work-inner {
  max-width: 1640px;
  margin-inline: auto;
}

.creative-work svg,
.creative-viewer svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.creative-work-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(42px, 5.5vw, 84px);
}

.creative-work-title {
  margin: 0;
  font-size: clamp(46px, 6.3vw, 102px);
  font-weight: 650;
  line-height: 1.02;
  letter-spacing: -.065em;
}

.creative-work-line {
  display: block;
  padding: .04em .06em .10em 0;
  margin-bottom: -.10em;
  overflow: clip;
}

.creative-work-line > span {
  display: block;
  transition: transform .85s cubic-bezier(.2,.75,.22,1);
}

.creative-work-header.is-waiting .creative-work-line > span { transform: translateY(112%); }

.creative-work-all {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  gap: 12px;
  margin-bottom: 7px;
  border-bottom: 1px solid #e6b2dd5c;
  color: #f9e1f5;
  font-size: clamp(14px, 1.25vw, 17px);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, border-color .2s ease;
}

.creative-work-all:hover { color: #fff; border-color: #f7b9e8; }
.creative-work-all svg { width: 17px; height: 17px; }

.creative-work-stack {
  --creative-pin: 94px;
  --creative-step: 16px;
  --creative-frame: clamp(375px, min(76svh, 57vw), 850px);
  display: grid;
  gap: clamp(30px, 3.45vw, 52px);
}

.creative-work-layer {
  position: sticky;
  top: calc(var(--creative-pin) + var(--creative-order, 0) * var(--creative-step));
  height: var(--creative-frame);
}

.creative-project {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(22px, 2.4vw, 38px);
  background: #111426;
  box-shadow: 0 16px 35px #0005;
  color: #fff;
  text-decoration: none;
  transform: scale(calc(1 - var(--creative-depth, 0) * .10));
  transform-origin: center top;
}

.creative-project::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  background: #03040a;
  opacity: calc(var(--creative-depth, 0) * .60);
  pointer-events: none;
}

.creative-project:focus-visible { outline-offset: -5px; }

.creative-project-image,
.creative-project-shade {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.creative-project-image { object-fit: cover; }

.creative-project-shade {
  background: linear-gradient(180deg, #07051027, transparent 28%, transparent 62%, #07051035);
  pointer-events: none;
}

.creative-project-caption {
  position: absolute;
  z-index: 1;
  left: clamp(16px, 2.65vw, 40px);
  bottom: clamp(16px, 2.65vw, 40px);
  display: block;
  max-width: calc(100% - 32px);
  padding: clamp(16px, 2vw, 30px);
  border: 1px solid #fff3;
  border-radius: clamp(15px, 1.45vw, 22px);
  background: #0d0f1a9e;
  color: #fff;
  backdrop-filter: blur(18px) saturate(120%);
}

.creative-project-category {
  display: block;
  margin: 0 0 10px;
  color: #e8e1ef;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.creative-project-title {
  margin: 0;
  font-size: clamp(27px, 3.4vw, 54px);
  font-weight: 620;
  line-height: 1.04;
  letter-spacing: -.045em;
}

.creative-project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: clamp(11px, 1.35vw, 20px);
}

.creative-project-tags > span {
  padding: 6px 9px;
  border: 1px solid #fff4;
  border-radius: 99px;
  background: #fff1;
  color: #faf4ff;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
}

.creative-project-action {
  position: absolute;
  top: clamp(16px, 2.65vw, 40px);
  right: clamp(16px, 2.65vw, 40px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border: 1px solid #fff5;
  border-radius: 99px;
  background: #0d0f1aac;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

.creative-project-action svg { width: 13px; height: 13px; }
.creative-project-pointer { display: none; }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .creative-project-pointer {
    position: absolute;
    z-index: 2;
    left: var(--creative-pointer-x, 50%);
    top: var(--creative-pointer-y, 50%);
    display: grid;
    width: 84px;
    aspect-ratio: 1;
    place-items: center;
    border: 1px solid #fff6;
    border-radius: 50%;
    background: #1714236b;
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.62);
    backdrop-filter: blur(12px);
    pointer-events: none;
    transition: opacity .2s ease, transform .32s cubic-bezier(.2,.75,.22,1);
  }

  .creative-project.is-pointing .creative-project-pointer {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .creative-project-pointer svg { width: 27px; height: 27px; }
}

.creative-work-rail {
  --creative-rail-gap: clamp(16px, 2vw, 30px);
  margin-top: clamp(54px, 7vw, 108px);
}

.creative-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.creative-rail-header h3 {
  margin: 0;
  color: var(--creative-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.creative-rail-controls { display: flex; gap: 9px; }
.creative-rail-controls[hidden] { display: none; }

.creative-rail-button,
.creative-viewer-close {
  display: grid;
  place-items: center;
  width: clamp(44px, 4.2vw, 61px);
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #e0c2f23b;
  border-radius: 50%;
  background: linear-gradient(140deg, #f4d4f319, #f2c8f109);
  color: #faf0ff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.creative-rail-button:not([aria-disabled="true"]):hover,
.creative-viewer-close:hover { border-color: #edb2eaa1; background: #eeb9eb2a; }
.creative-rail-button[aria-disabled="true"] { opacity: .45; cursor: default; }
.creative-rail-button svg,
.creative-viewer-close svg { width: 18px; height: 18px; }

.creative-rail-track {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 3 * var(--creative-rail-gap)) / 3.32);
  align-items: start;
  gap: var(--creative-rail-gap);
  overflow-x: auto;
  padding: 4px 0 7px;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.creative-rail-track::-webkit-scrollbar { display: none; }

.creative-rail-item {
  display: block;
  color: inherit;
  text-decoration: none;
  scroll-snap-align: start;
}

.creative-rail-item:focus-visible { outline-offset: -3px; border-radius: 18px; }

.creative-rail-image {
  display: block;
  overflow: hidden;
  border-radius: clamp(15px, 1.7vw, 24px);
  aspect-ratio: 4 / 3;
  background: #14152a;
}

.creative-rail-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s cubic-bezier(.2,.75,.22,1);
}

.creative-rail-item:hover img { transform: scale(1.035); }
.creative-rail-item .creative-project-category { margin: 15px 0 7px; color: var(--creative-muted); }
.creative-rail-title { font-size: clamp(17px, 1.65vw, 25px); line-height: 1.25; letter-spacing: -.03em; }

.creative-viewer {
  width: min(1040px, calc(100vw - 36px));
  max-width: none;
  max-height: calc(100svh - 28px);
  padding: clamp(14px, 2vw, 25px);
  border-color: #f0b3e449;
  background: #101223;
}

.creative-viewer::backdrop { background: #030511e6; }
.creative-viewer.is-video { width: min(480px, calc(100vw - 36px)); }
.creative-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.creative-viewer .creative-viewer-title { margin: 0; font-size: clamp(20px, 3vw, 34px); }
.creative-viewer-close { width: 44px; flex: none; }
.creative-viewer-art { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100svh - 124px); margin-inline: auto; border-radius: 9px; }
.creative-viewer-video { display: block; width: min(100%, 360px); max-height: calc(100svh - 124px); aspect-ratio: 9 / 16; margin-inline: auto; border-radius: 9px; background: #050611; }
.creative-viewer [hidden] { display: none; }

@media (max-width: 960px) {
  .creative-rail-track { grid-auto-columns: calc((100% - 2 * var(--creative-rail-gap)) / 2.48); }
}

@media (max-width: 760px) {
  .creative-work {
    --creative-gutter: clamp(18px, 5.5vw, 28px);
    padding-block: 45px 54px;
  }

  .creative-work-header { align-items: start; flex-direction: column; gap: 14px; margin-bottom: 28px; }
  .creative-work-title { font-size: clamp(39px, 10.9vw, 70px); }
  .creative-work-all { min-height: 40px; margin-bottom: 0; }

  .creative-work-stack {
    --creative-pin: 76px;
    --creative-step: 11px;
    --creative-frame: clamp(350px, 62svh, 560px);
    gap: 24px;
  }

  .creative-project-caption { backdrop-filter: blur(9px); }
  .creative-project-category { margin-bottom: 7px; }
  .creative-project-action { padding: 8px 10px; font-size: 11px; }
  .creative-work-rail { margin-top: 44px; }
  .creative-rail-track { grid-auto-columns: min(76%, 385px); }
}

@media (max-height: 500px) {
  .creative-work-layer { position: relative; top: auto; }
  .creative-project { transform: none; }
  .creative-project::after { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .creative-work-layer { position: relative; top: auto; }
  .creative-project,
  .creative-work-header.is-waiting .creative-work-line > span,
  .creative-rail-item:hover img { transform: none; }
  .creative-project::after { opacity: 0; }
}
