/* ==========================================================================
   REFERENCES PAGE - PREMIUM HYBRID REDESIGN
   ========================================================================== */

:root {
  --ref-bg: #f8fafb;
  --ref-accent: #0b5e92;
  --ref-card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --ref-glass: rgba(0, 15, 30, 0.7);
}

/* --- GRID SECTION --- */
.references-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
  margin-top: 50px;
  margin-bottom: 100px;
}

/* --- FILTERS --- */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 60px;
}

.chip {
  background: #ffffff;
  border: 1px solid #e1e8f0;
  color: #5a6a85;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 1, 0.3, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.chip:hover {
  border-color: var(--ref-accent);
  color: var(--ref-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(11, 94, 146, 0.1);
}

.chip.active {
  background: var(--ref-accent);
  border-color: var(--ref-accent);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(11, 94, 146, 0.3);
}

/* --- CARDS BASE --- */
.ref-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.2, 1, 0.3, 1);
  background: #ffffff;
  box-shadow: var(--ref-card-shadow);
}

.ref-link[hidden] {
  display: none !important;
}

.ref-card {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  background: #001226;
  /* Dark base for photos */
}

/* --- IMAGE HANDLING --- */
.ref-image-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.ref-image-wrapper img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

/* LOGO MODE: Centers logo on clean white background */
.ref-link.is-logo .ref-card {
  background: #ffffff;
}

.ref-link.is-logo .ref-image-wrapper {
  padding: 45px;
  background: radial-gradient(circle at center, #ffffff 0%, #f9fafb 100%);
}

.ref-link.is-logo img {
  object-fit: contain;
}

/* --- OVERLAY & TEXT --- */
.ref-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 15, 30, 0.9) 0%, rgba(0, 15, 30, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  transition: all 0.4s ease;
}

/* Glass effect on title area for logo cards */
.ref-link.is-logo .ref-overlay {
  background: linear-gradient(to top, rgba(0, 15, 35, 0.85) 0%, rgba(0, 15, 35, 0.1) 60%, transparent 100%);
}

.ref-meta {
  transform: translateY(5px);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
}

.ref-title {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* --- HOVER EFFECTS --- */
.ref-link:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 60px rgba(0, 18, 38, 0.18);
}

.ref-link:hover img {
  transform: scale(1.06);
}

.ref-link:hover .ref-overlay {
  background: linear-gradient(to top, rgba(0, 15, 30, 0.95) 0%, rgba(0, 15, 30, 0.4) 80%, transparent 100%);
}

.ref-link:hover .ref-meta {
  transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {
  .references-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .references-grid {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
  }

  .ref-title {
    font-size: 1.05rem;
  }
}