/* ========================= Repository Page ========================= */

/* ---- Hero ---- */
.repo-hero {
  padding-top: 160px;
  padding-bottom: 48px;
  background: var(--bg);
}

.repo-hero__inner {
  width: min(1441px, calc(100% - 96px));
  margin: 0 auto;
}

.repo-hero__title {
  display: flex;
  flex-direction: column;
  font-family: 'Test Sohne', sans-serif;
  font-weight: 400;
  font-size: 52px;
  line-height: 0.97;
  letter-spacing: -1.04px;
  margin: 0;
}

.repo-hero__title-accent {
  color: transparent;
  background-image: linear-gradient(270deg, #ff8e1b 7.41%, #f8280d 101.85%);
  background-clip: text;
  -webkit-background-clip: text;
}

.repo-hero__title-copy {
  color: var(--fg);
}

.repo-hero__subtitle {
  margin-top: 24px;
  font-family: 'PP Neue Montreal', sans-serif;
  font-size: 18px;
  line-height: 1.5;
  color: var(--gray);
  max-width: 560px;
  text-wrap: balance;
}

/* ---- Logo marquee ---- */
.repo-marquee {
  overflow: hidden;
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--bg);
}

/* ---- Portfolio section ---- */
.repo-portfolio {
  background: var(--bg);
  padding-top: 48px;
  padding-bottom: 120px;
  scroll-margin-top: 112px;
}

.repo-portfolio__inner {
  width: min(1441px, calc(100% - 96px));
  margin: 0 auto;
}

/* ---- Format tabs (Video / Image) ---- */
.repo-portfolio__tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.repo-portfolio__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: 'PP Neue Montreal', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--gray);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.repo-portfolio__tab:hover {
  color: var(--fg);
}

.repo-portfolio__tab.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.repo-portfolio__tab svg {
  flex-shrink: 0;
}

/* ---- Category pills ---- */
.repo-portfolio__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.repo-portfolio__pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 100px;
  background: transparent;
  font-family: 'PP Neue Montreal', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  color: var(--gray);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.repo-portfolio__pill:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.35);
}

.repo-portfolio__pill.is-active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ---- Grid ---- */
.repo-portfolio__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

/* ---- Card ---- */
.repo-portfolio__card {
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.repo-portfolio__card:hover {
  transform: translateY(-4px);
}

.repo-portfolio__card.is-hidden {
  display: none;
}

.repo-portfolio__card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.repo-portfolio__card-media img,
.repo-portfolio__card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}

.repo-portfolio__card-media img {
  position: relative;
  z-index: 2;
}

.repo-portfolio__card-media video {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* On hover: hide img, let clicks reach video controls */
.repo-portfolio__card:hover .repo-portfolio__card-media img {
  opacity: 0;
  pointer-events: none;
}

/* Bring video above img on hover so controls are interactive */
.repo-portfolio__card:hover .repo-portfolio__card-media video {
  z-index: 3;
}

.repo-portfolio__card:hover .repo-portfolio__card-media img,
.repo-portfolio__card:hover .repo-portfolio__card-media video {
  transform: scale(1.04);
}

/* ---- Load more ---- */
.repo-portfolio__load-more {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}

.repo-portfolio__load-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  height: 48px;
  padding: 0 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  font-family: 'PP Neue Montreal', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  color: var(--fg);
  cursor: pointer;
  transition: all 0.25s ease;
}

.repo-portfolio__load-btn:hover {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* ========================= Responsive ========================= */

@media (max-width: 1199px) {
  .repo-hero {
    padding-top: 140px;
    padding-bottom: 40px;
  }

  .repo-hero__inner {
    width: calc(100% - 64px);
  }

  .repo-hero__title {
    font-size: clamp(2.75rem, 5.4vw, 3.25rem);
  }

  .repo-portfolio__inner {
    width: calc(100% - 64px);
  }

  .repo-portfolio__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 991px) {
  .repo-portfolio {
    scroll-margin-top: 96px;
  }

  .repo-hero {
    padding-top: 120px;
    padding-bottom: 36px;
  }

  .repo-hero__inner {
    width: calc(100% - 48px);
  }

  .repo-hero__title {
    font-size: clamp(2.25rem, 6vw, 2.75rem);
  }

  .repo-portfolio__inner {
    width: calc(100% - 48px);
  }

  .repo-portfolio__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .repo-portfolio__categories {
    gap: 8px;
  }
}

@media (max-width: 767px) {
  .repo-portfolio {
    scroll-margin-top: 84px;
  }

  .repo-hero {
    padding-top: 104px;
    padding-bottom: 32px;
  }

  .repo-hero__inner {
    width: calc(100% - 32px);
  }

  .repo-hero__title {
    font-size: clamp(2rem, 10vw, 2.5rem);
    line-height: 1;
  }

  .repo-hero__subtitle {
    font-size: 16px;
    margin-top: 16px;
  }

  .repo-portfolio__inner {
    width: calc(100% - 32px);
  }

  .repo-portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .repo-portfolio__tabs {
    margin-bottom: 16px;
  }

  .repo-portfolio__tab {
    padding: 12px 20px;
    font-size: 14px;
  }

  .repo-portfolio__pill {
    padding: 6px 16px;
    font-size: 13px;
  }

  .repo-portfolio__categories {
    margin-bottom: 28px;
  }

  .repo-portfolio {
    padding-bottom: 80px;
  }
}

@media (max-width: 479px) {
  .repo-hero__inner,
  .repo-portfolio__inner {
    width: calc(100% - 24px);
  }

  .repo-hero__title {
    font-size: clamp(1.75rem, 9vw, 2.25rem);
  }

  .repo-portfolio__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }

  .repo-portfolio__categories {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 8px;
  }

  .repo-portfolio__categories::-webkit-scrollbar {
    display: none;
  }
}

/* ---- CTA ---- */
.repo-cta {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8280d 0%, #ff8e1b 50%, #f8280d 100%);
  background-size: 200% 200%;
  animation: repo-cta-shift 8s ease infinite;
  padding: 160px 0;
}

@keyframes repo-cta-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Grain overlay */
.repo-cta__grain {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
  pointer-events: none;
}

/* Content */
.repo-cta__inner {
  position: relative;
  z-index: 2;
  width: min(1441px, calc(100% - 96px));
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.repo-cta__eyebrow {
  font-family: 'Nord', sans-serif;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(8, 9, 10, 0.55);
  margin-bottom: 24px;
}

.repo-cta__title {
  font-family: 'Tomato Grotesk', sans-serif;
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
  letter-spacing: -2px;
  color: #08090a;
  margin: 0;
  max-width: 800px;
}

.repo-cta__subtitle {
  margin-top: 24px;
  font-family: 'PP Neue Montreal', sans-serif;
  font-size: 19px;
  line-height: 1.5;
  color: rgba(8, 9, 10, 0.65);
}

.repo-cta__button {
  margin-top: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 220px;
  height: 3rem;
  padding: 0 44px;
  border-radius: 0.25rem;
  background: #08090a;
  font-family: 'PP Neue Montreal', sans-serif;
  font-weight: 600;
  font-size: 17px;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, gap 0.3s ease;
}

.repo-cta__button svg {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.repo-cta__button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
  gap: 14px;
}

.repo-cta__button:hover svg {
  transform: translateX(4px);
}

@media (max-width: 991px) {
  .repo-cta {
    padding: 120px 0;
  }
  .repo-cta__inner {
    width: calc(100% - 48px);
  }
  .repo-cta__title {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    letter-spacing: -1px;
  }
}

@media (max-width: 767px) {
  .repo-cta {
    padding: 96px 0;
  }
  .repo-cta__inner {
    width: calc(100% - 32px);
  }
  .repo-cta__title {
    font-size: clamp(2rem, 10vw, 2.75rem);
    letter-spacing: -0.5px;
  }
  .repo-cta__title br { display: none; }
  .repo-cta__subtitle {
    font-size: 16px;
  }
  .repo-cta__button {
    width: 100%;
  }
}

