.project-card__media {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-card__title-row h3 {
  margin: 0;
}

.project-card__title-row h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card__title-row h3 a:hover {
  color: var(--cyan);
}

.bestui-project-more {
  display: inline-flex;
  margin-top: 14px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.bestui-project-more:hover {
  gap: 6px;
}

.portfolio-site {
  background:
    radial-gradient(circle at 12% 8%, rgba(79, 124, 255, .12), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(139, 92, 246, .12), transparent 24%),
    var(--bg);
}

.bestui-case {
  padding: 132px 0 88px;
}

.bestui-case__back {
  display: flex;
  width: fit-content;
  margin: 0 auto 28px;
  color: #9eb0de;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.bestui-case__back:hover {
  color: var(--cyan);
}

/* Persian: first column (copy) sits on the right, cover on the left.
   English body.bestui-en flips the inline direction so copy is left and cover is right. */
.bestui-case__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .92fr);
  gap: 72px;
  align-items: start;
  direction: rtl;
}

.bestui-en .bestui-case__split {
  direction: ltr;
}

.bestui-case__body,
.bestui-case__cover {
  min-width: 0;
}

.bestui-case__hero {
  max-width: none;
}

.bestui-case__hero h1 {
  margin: 14px 0 18px;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.35;
}

.bestui-case__hero > p {
  max-width: 68ch;
  color: var(--muted, #b7c3e6);
  font-size: 16px;
}

.bestui-case__table {
  width: 100%;
  margin: 28px 0 8px;
  border-collapse: collapse;
  font-size: 15px;
}

.bestui-case__table th,
.bestui-case__table td {
  padding: 14px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: start;
}

.bestui-case__table th {
  width: 34%;
  color: #8ea0cc;
  font-weight: 600;
}

.bestui-case__stage {
  position: sticky;
  top: 96px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  direction: ltr;
}

.bestui-case__frame {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: #0a1121;
}

.bestui-case__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.bestui-case__zoom img {
  display: block;
  width: 100%;
  height: auto;
}

.bestui-case__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #1b2438;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.bestui-case__nav--prev { left: 12px; }
.bestui-case__nav--next { right: 12px; }

.bestui-case__stage:not(:has(.bestui-case__thumbs)) .bestui-case__nav {
  display: none;
}

.bestui-case__thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 72px;
  max-height: 520px;
  overflow: auto;
}

.bestui-case__thumb {
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #0a1121;
  cursor: pointer;
}

.bestui-case__thumb.is-active {
  border-color: #7aa2ff;
  box-shadow: 0 0 0 3px rgba(90, 140, 255, .25);
}

.bestui-case__thumb img {
  display: block;
  width: 100%;
  height: 64px;
  object-fit: cover;
}

.bestui-case__story {
  display: grid;
  gap: 18px;
  margin-top: 32px;
}

.bestui-case__story ul,
.bestui-case__content ul,
.bestui-case__content ol {
  margin: 8px 0 0;
  padding-inline-start: 1.2em;
}

.bestui-case__story li,
.bestui-case__content li {
  margin: 4px 0;
}

.bestui-case__cta {
  margin: 28px 0 0;
}

/* Technologies reuse the homepage .skills-cloud pills (components.css + revisions.css). */
.bestui-case__skills {
  margin-top: 28px;
}

.bestui-case__story article,
.bestui-case__content {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
}

.bestui-case__story h2,
.bestui-case__gallery h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.bestui-case__story p,
.bestui-case__content {
  color: #c5d0ee;
  font-size: 14px;
  line-height: 1.9;
}

.bestui-case__content {
  margin-top: 16px;
}

.bestui-case__content > *:first-child {
  margin-top: 0;
}

.bestui-case__tags {
  margin-top: 18px;
}

.bestui-case__gallery {
  margin-top: 34px;
}

.bestui-case__shots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.bestui-shot {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: #0a1121;
  cursor: zoom-in;
}

.bestui-shot img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: top;
  transition: transform .35s ease;
}

.bestui-shot:hover img {
  transform: scale(1.03);
}

.bestui-lightbox {
  width: min(1100px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: #070b17;
  color: white;
}

.bestui-lightbox::backdrop {
  background: rgba(4, 7, 16, .82);
}

.bestui-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.bestui-lightbox__close {
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  color: white;
  background: transparent;
  cursor: pointer;
}

.bestui-archive {
  padding-top: 140px;
}

html[data-theme='light'] .bestui-case__back {
  color: #1d4ed8;
}

html[data-theme='light'] .bestui-case__hero h1,
html[data-theme='light'] .bestui-case__story h2,
html[data-theme='light'] .bestui-case__table td {
  color: #172033;
}

html[data-theme='light'] .bestui-case__hero > p,
html[data-theme='light'] .bestui-case__story p,
html[data-theme='light'] .bestui-case__content {
  color: #3d4b66;
}

html[data-theme='light'] .bestui-case__table th {
  color: #5b6b8a;
}

html[data-theme='light'] .bestui-case__table th,
html[data-theme='light'] .bestui-case__table td {
  border-bottom-color: rgba(45, 75, 144, .12);
}

html[data-theme='light'] .bestui-case__story article,
html[data-theme='light'] .bestui-case__content {
  border-color: rgba(45, 75, 144, .12);
  background: rgba(255, 255, 255, .72);
}

html[data-theme='light'] .bestui-case__frame,
html[data-theme='light'] .bestui-case__stage {
  background: #f4f7fd;
}

html[data-theme='light'] .bestui-case__frame {
  border-color: rgba(45, 75, 144, .14);
  box-shadow: 0 18px 40px rgba(42, 70, 136, .08);
}

html[data-theme='light'] .bestui-case__thumb {
  border-color: rgba(45, 75, 144, .16);
  background: #fff;
}

.bestui-en .bestui-case__hero,
.bestui-en .bestui-case__story,
.bestui-en .bestui-case__content,
.bestui-en .bestui-case__table {
  text-align: left;
}

@media (max-width: 860px) {
  .bestui-case__split {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .bestui-case__stage {
    position: static;
    order: -1;
  }

  .bestui-case__thumbs {
    max-height: none;
    width: 64px;
  }
}
