.ref-logo {
  height: 72px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.ref-logo-lg {
  height: 110px;
  max-width: 200px;
}

.ref-logo-md {
  height: 84px;
  max-width: 160px;
}

.ref-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.85rem;
  text-align: center;
  padding: 1.35rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ref-card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
}

.ref-card-featured {
  padding: 2rem 1.5rem;
}

.ref-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.logo-marquee-item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 76px;
  margin: 0.35rem 0.55rem;
  padding: 0.65rem 1.15rem;
  background: #fff;
  border: 1px solid rgba(18, 24, 31, 0.06);
  border-radius: 0.85rem;
  box-shadow:
    0 8px 22px rgba(12, 17, 23, 0.08),
    0 2px 6px rgba(12, 17, 23, 0.04);
  opacity: 1;
  filter: none;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.logo-marquee-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px rgba(12, 17, 23, 0.12),
    0 4px 10px rgba(12, 17, 23, 0.06);
}

.logo-marquee-item img {
  height: 48px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 1.35rem;
  background: #f4f7f8;
  border: 1px solid rgba(18, 24, 31, 0.07);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.project-card:hover {
  background: #eef4f5;
  border-color: rgba(78, 184, 178, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(12, 17, 23, 0.08);
}

.project-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 5.5rem;
  margin-bottom: 0.35rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid rgba(18, 24, 31, 0.08);
  border-radius: 0.75rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.project-card-logo .ref-logo {
  height: 64px;
  max-width: 140px;
}

.project-card-logo-fallback {
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.project-card-tag {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-deep);
}

.project-card-title {
  margin: 0;
  font-family: "Sora", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.project-card-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.project-card-featured {
  gap: 1.25rem;
}

.project-featured-top {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 640px) {
  .project-featured-top {
    grid-template-columns: 10rem 1fr;
    gap: 1.35rem;
  }
}

.project-featured-top .project-card-logo {
  height: 6.5rem;
  margin-bottom: 0;
}

.project-gallery {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .project-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem;
  background: #fff;
  border: 1px solid rgba(18, 24, 31, 0.08);
  border-radius: 0.75rem;
  cursor: zoom-in;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.project-gallery-item:hover {
  border-color: rgba(78, 184, 178, 0.45);
  box-shadow: 0 10px 24px rgba(12, 17, 23, 0.08);
  transform: translateY(-2px);
}

.project-gallery-item img {
  width: 100%;
  height: 11rem;
  object-fit: contain;
  background: #fafbfc;
  border-radius: 0.5rem;
  pointer-events: none;
}

.project-gallery-cap,
.project-gallery-item figcaption {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-soft);
  text-align: center;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: min(960px, 100%);
  max-height: calc(100vh - 2.5rem);
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: calc(100vh - 7rem);
  padding: 1rem;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
}

.lightbox-caption {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 9999px;
  z-index: 2;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(78, 184, 178, 0.85);
  color: #062221;
}

.lightbox-nav {
  top: 50%;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  transform: translateY(-50%);
}

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

@media (max-width: 767px) {
  .lightbox-nav {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
  .lightbox-prev { left: calc(50% - 3.4rem); }
  .lightbox-next { right: calc(50% - 3.4rem); }
}

body.lightbox-open {
  overflow: hidden;
}
