@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

.btx-projects,
.btx-projects * {
  box-sizing: border-box;
  font-family: 'Poppins', Arial, sans-serif;
}

.btx-projects {
  --btx-gold: #e2a926;
  --btx-gold-soft: #b67f16;
  --btx-black: #080808;
  --btx-brown: #2d1305;
  --btx-cream: #f2e4c1;
  --btx-line: rgba(226, 169, 38, .32);
  width: 100%;
  color: #fff;
}

.btx-projects-grid {
  display: grid;
  grid-template-columns: repeat(var(--btx-columns, 2), minmax(0, 1fr));
  gap: clamp(18px, 2.2vw, 32px);
}

.btx-project-card {
  min-width: 0;
}

.btx-project-open {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.btx-project-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(226, 169, 38, .22);
  border-radius: 3px;
  background: #15100b;
}

.btx-project-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 58%);
  opacity: 0;
  transition: opacity .35s ease;
}

.btx-project-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.16, 1, .3, 1), filter .4s ease;
}

.btx-project-placeholder {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(226, 169, 38, .16), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 34px),
    #121212;
}

.btx-project-view {
  position: absolute;
  z-index: 2;
  right: 20px;
  bottom: 18px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .35s ease, transform .35s ease;
}

.btx-project-card-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 2px 0;
}

.btx-project-card-copy strong {
  color: #fff;
  font-size: clamp(16px, 1.4vw, 21px);
  font-weight: 500;
  line-height: 1.25;
}

.btx-project-card-copy small {
  color: rgba(255, 255, 255, .52);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.btx-project-open:hover .btx-project-cover::after,
.btx-project-open:focus-visible .btx-project-cover::after {
  opacity: 1;
}

.btx-project-open:hover img,
.btx-project-open:focus-visible img {
  transform: scale(1.045);
  filter: brightness(.82);
}

.btx-project-open:hover .btx-project-view,
.btx-project-open:focus-visible .btx-project-view {
  opacity: 1;
  transform: translateY(0);
}

.btx-project-open:focus-visible {
  outline: 2px solid var(--btx-gold);
  outline-offset: 5px;
}

.btx-project-modal[hidden] {
  display: none !important;
}

.btx-project-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 30px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s ease, visibility .26s ease;
}

.btx-project-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.btx-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  backdrop-filter: blur(8px);
}

.btx-modal-dialog {
  position: relative;
  width: min(1320px, 100%);
  height: min(760px, calc(100vh - 38px));
  overflow: hidden;
  border: 1px solid rgba(226, 169, 38, .24);
  background: var(--btx-brown);
  box-shadow: 0 32px 100px rgba(0, 0, 0, .65);
  transform: translateY(22px) scale(.985);
  transition: transform .32s cubic-bezier(.16, 1, .3, 1);
}

.btx-project-modal.is-open .btx-modal-dialog {
  transform: translateY(0) scale(1);
}

.btx-modal-close {
  position: absolute;
  z-index: 10;
  top: 34px;
  right: 36px;
  min-width: 96px;
  min-height: 48px;
  border: 1px solid #fff;
  color: #111;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}

.btx-modal-close:hover,
.btx-modal-close:focus-visible {
  color: #fff;
  border-color: var(--btx-gold);
  background: var(--btx-gold-soft);
  outline: 0;
}

.btx-modal-content,
.btx-project-detail {
  height: 100%;
}

.btx-project-detail {
  padding: 31px 39px 25px;
}

.btx-modal-title {
  height: 66px;
  max-width: calc(100% - 150px);
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 2.5vw, 38px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.035em;
}

.btx-detail-layout {
  height: calc(100% - 66px);
  display: grid;
  grid-template-columns: minmax(310px, .86fr) minmax(0, 2fr);
  gap: clamp(28px, 3.3vw, 48px);
}

.btx-project-info {
  min-height: 0;
  overflow: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .52) transparent;
}

.btx-project-info::-webkit-scrollbar {
  width: 7px;
}

.btx-project-info::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, .48);
}

.btx-info-row {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 20px;
  padding: 21px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .17);
}

.btx-info-row:first-child {
  padding-top: 0;
}

.btx-info-row > span {
  color: rgba(255, 255, 255, .88);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

.btx-info-row > strong,
.btx-info-row > div {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.btx-info-description > div p:first-child {
  margin-top: 0;
}

.btx-info-description > div p:last-child {
  margin-bottom: 0;
}

.btx-project-gallery {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 74px;
  gap: 18px;
}

.btx-gallery-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #100b07;
}

.btx-gallery-main {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
  transform: scale(1);
  transition: opacity .18s ease, transform .5s ease;
}

.btx-gallery-main.is-changing {
  opacity: .2;
  transform: scale(1.015);
}

.btx-gallery-arrow {
  position: absolute;
  top: 50%;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  font-size: 31px;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .25s ease, background .25s ease;
}

.btx-gallery-stage:hover .btx-gallery-arrow,
.btx-gallery-arrow:focus-visible {
  opacity: 1;
}

.btx-gallery-arrow:hover {
  background: rgba(182, 127, 22, .9);
}

.btx-gallery-prev { left: 18px; }
.btx-gallery-next { right: 18px; }

.btx-gallery-footer {
  min-width: 0;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.btx-gallery-count {
  color: var(--btx-gold);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -.04em;
}

.btx-gallery-count strong {
  font-weight: 400;
}

.btx-gallery-thumbs {
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 3px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(226, 169, 38, .5) transparent;
}

.btx-gallery-thumb {
  flex: 0 0 74px;
  width: 74px;
  height: 48px;
  padding: 0;
  border: 2px solid transparent;
  background: #120d09;
  cursor: pointer;
  opacity: .63;
  transition: border-color .2s ease, opacity .2s ease, transform .2s ease;
}

.btx-gallery-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.btx-gallery-thumb:hover,
.btx-gallery-thumb.is-active,
.btx-gallery-thumb:focus-visible {
  border-color: var(--btx-gold);
  opacity: 1;
  transform: translateY(-2px);
  outline: 0;
}

.btx-gallery-empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px dashed rgba(226, 169, 38, .4);
  color: rgba(255, 255, 255, .6);
}

html.btx-modal-open,
body.btx-modal-open {
  overflow: hidden !important;
}

@media (max-width: 980px) {
  .btx-projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btx-modal-dialog {
    height: min(900px, calc(100vh - 24px));
  }

  .btx-project-detail {
    padding: 24px;
  }

  .btx-detail-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(190px, .7fr) minmax(330px, 1.3fr);
    gap: 22px;
  }

  .btx-project-info {
    padding-right: 8px;
  }

  .btx-info-row {
    grid-template-columns: 120px minmax(0, 1fr);
    padding: 13px 0;
  }

  .btx-modal-close {
    top: 20px;
    right: 24px;
  }
}

@media (max-width: 620px) {
  .btx-projects-grid {
    grid-template-columns: 1fr;
  }

  .btx-project-card-copy {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .btx-project-modal {
    padding: 0;
  }

  .btx-modal-dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
  }

  .btx-project-detail {
    padding: 18px 15px 16px;
  }

  .btx-modal-title {
    height: 60px;
    max-width: calc(100% - 88px);
    font-size: 23px;
  }

  .btx-modal-close {
    top: 14px;
    right: 15px;
    min-width: 72px;
    min-height: 40px;
    font-size: 12px;
  }

  .btx-detail-layout {
    height: calc(100% - 60px);
    grid-template-rows: minmax(170px, .82fr) minmax(300px, 1.18fr);
    gap: 15px;
  }

  .btx-info-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 0;
  }

  .btx-info-row > span,
  .btx-info-row > strong,
  .btx-info-row > div {
    font-size: 12.5px;
  }

  .btx-project-gallery {
    grid-template-rows: minmax(0, 1fr) 64px;
    gap: 10px;
  }

  .btx-gallery-footer {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
  }

  .btx-gallery-count {
    font-size: 20px;
  }

  .btx-gallery-thumb {
    flex-basis: 62px;
    width: 62px;
    height: 42px;
  }

  .btx-gallery-arrow {
    width: 36px;
    height: 36px;
    font-size: 26px;
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btx-projects *,
  .btx-projects *::before,
  .btx-projects *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 980px) {
  .btx-projects.btx-columns-1 .btx-projects-grid { grid-template-columns: 1fr; }
  .btx-projects.btx-columns-2 .btx-projects-grid,
  .btx-projects.btx-columns-3 .btx-projects-grid,
  .btx-projects.btx-columns-4 .btx-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
