/* =========================
   GLOBAL SCROLL
========================= */
html {
  scroll-behavior: smooth;
}

 * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

main {
  font-family: 'Inter', sans-serif;
  color: #222;
  line-height: 1.6;
  background: url("../imgs/index_bg.png") center / cover no-repeat fixed;
  min-height: 1000px;
}

main::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(120, 120, 120, 0.35); /* grey tint */
  z-index: -1;
}

/* =========================
   BACK BUTTON
========================= */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 20px;
  margin-left:40px;

  padding: 8px 16px;

  background: rgba(0, 0, 0, 0.5);
  color: white;

  border: none;
  border-radius: 6px;

  font-size: 16px;
  font-weight: 600;

  cursor: pointer;

  transition: background 0.25s ease, transform 0.2s ease;
}

.back-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-1px);
}

/* =========================
   Project Gallery Section
========================= */
.projects-cycle{
  position: relative;
  width: 100%;
  padding: 140px 0;
  padding-bottom: 5px;
}

/* Wrapper layout */
.projects-wrapper{
  width: min(1200px, 92vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 40px;
  align-items: start;
}

/* LEFT */
.projects-left{
  position: relative;
}

.projects-viewport{
  position: relative;
  height: 530px;
  padding: 0px;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
}

/* list that moves */
.projects-list{
  will-change: transform;
  transition: transform 420ms cubic-bezier(.2,.9,.2,1);
  display: flex;
  flex-direction: column;
  gap: 16px; 
}

/* each item */
.project-item{
  height: 160px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  margin-bottom: 0;
  opacity: 0.55;
  transform: scale(0.96);
  transition: opacity 240ms ease, transform 240ms ease, filter 240ms ease;
  cursor: pointer;
}

.project-item:last-child{ margin-bottom: 0; }

.project-item.active{
  opacity: 1;
  transform: scale(1);
  filter: drop-shadow(0 18px 26px rgba(0,0,0,0.35));
}

.project-image{
  height: 160px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}

.project-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* subtle overlay for readability if you put text over image later */
.project-image::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,0.20), rgba(0,0,0,0.02));
  pointer-events:none;
}

/* buttons */
.cycle-btn{
  position: absolute;
  left: 18px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  transition: transform 160ms ease, background 160ms ease;
  user-select: none;
}

.cycle-btn:hover{ background: rgba(0,0,0,0.48); }
.cycle-btn:active{ transform: scale(0.97); }

.cycle-btn.up{ top: 22px; }
.cycle-btn.down{ bottom: 22px; }

/* RIGHT */
.projects-right{
  border-radius: 22px;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,0.3);
  padding: 26px;
  min-height: 520px;
}

.project-details .meta-top{
  display:flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.project-details .project-no{
  font-size: 40px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgba(255,255,255,0.96);
}

.project-details .category{
  font-size: 18px;
  opacity: 0.9;
  color: rgba(255,255,255,0.9);
}

.project-details .period{
  margin-top: 10px;
  font-size: 22px;
  font-weight: 600;
  opacity: 0.95;
  color: rgba(255,255,255,0.96);
}

.project-details .title{
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.45;
  opacity: 0.92;
  color: rgba(255,255,255,0.92);
}

.details-grid{
  margin-top: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.detail{
  color: white;
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.10);
}

.detail .label{
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

.detail .value{
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.35;
  opacity: 0.95;
}

/* ===============================
   Galleria Carousel Gallery
================================ */

.galleria-carousel{
  width: min(1200px, 92vw);
  margin: 0px auto 80px;
  padding: 20px;
  border-radius: 22px;

  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
}

.galleria-carousel-title{
  font-size: 20px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

.galleria-carousel-grid{
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px;
}

.galleria-carousel-item{
  width:100%;
  height:160px;
  border-radius:14px;
  overflow:hidden;
  cursor:pointer;

  background: rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.12);

  transition: transform 200ms ease, box-shadow 200ms ease;
}

.galleria-carousel-item:hover{
  transform: translateY(-3px);
  box-shadow:0 12px 22px rgba(0,0,0,0.35);
}

.galleria-carousel-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* ===============================
   Loader
================================ */

.galleria-carousel-loader{
  grid-column:1/-1;
  display:flex;
  justify-content:center;
  align-items:center;
  height:120px;
}

.galleria-carousel-spinner{
  width:38px;
  height:38px;
  border-radius:50%;

  border:3px solid rgba(255,255,255,0.2);
  border-top:3px solid white;

  animation:galleria-spin 0.9s linear infinite;
}

@keyframes galleria-spin{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}

/* ===============================
   Responsive
================================ */
@media (max-width: 980px){
  main{
    min-height: 1700px;
  }
  
  .projects-wrapper{
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .projects-viewport{
    height: 240px;
    padding: 14px;
  }

  .projects-list{ gap: 14px; }

  .project-item{
    height: 190px;
    margin-top: 0px;
    margin-bottom: 0px;
  }

  .project-image{ height: 190px; }

  .projects-right{
    min-height: unset;
  }

  /* Move buttons to sides on mobile */
  .cycle-btn{
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
  }
  .cycle-btn.up{
    left: 10px;
    top: 50%;
  }
  .cycle-btn.down{
    left: auto;
    right: 10px;
    bottom: auto;
  }

  .details-grid{
    grid-template-columns: 1fr;
  }

  /* Galleria Fixes */
  .galleria-carousel-grid{
    grid-template-columns: repeat(2,1fr);
  }

  .galleria-carousel-item{
    height:140px;
  }
}