/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: #0a0a0a;
  color: #f0ece6;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── LAYOUT UTILITY ── */
.px-global { padding-left: 1rem; padding-right: 1rem; }
@media (min-width: 768px) {
  .px-global { padding-left: 2rem; padding-right: 2rem; }
}

/* ── 16-COL GRID (matches Eladio Dieste) ── */
.grid-16 {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 0;
  row-gap: 3rem;
}
@media (min-width: 768px) {
  .grid-16 { row-gap: 12vh; }
}

/* ── SECTION ── */
.clients-section {
  position: relative;
  min-height: 100vh;
  overflow: clip;
}

/* ── HEADING ── */
.clients-heading {
  padding: 40px;
}
.clients-heading h2 {
  font-size: clamp(3rem, 10vw, 7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
}

/* ── VERTICAL TIMELINE LINE (background, 20% opacity) ── */
.timeline-bg-line {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 20;
  height: 100%;
  width: 1px;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.2);
  pointer-events: none;
}

/* ── ANIMATED TIMELINE LINE (grows with scroll) ── */
.timeline-fg-line {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 30;
  width: 1px;
  transform: translateX(-50%);
  background: #232222;
  height: 0%;
  pointer-events: none;
}
.timeline-tip {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #232222;
  margin-bottom: -1px;
  /* GSAP will handle transform (xPercent, rotation) to avoid conflict */
}

/* ── YEAR LABELS (centered on line) ── */
.year-label-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.year-label {
  font-size: clamp(1.125rem, 2vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0.4;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.year-label.is-active {
  opacity: 1 !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  transform: scale(1.05);
}

/* ── TIMELINE ITEM ── */
.tl-item {
  position: relative;
  display: block;
  padding-bottom: 1.5rem;
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
@media (min-width: 768px) {
  .tl-item { padding-bottom: 0; }
}

/* ── HOVER DIM EFFECT ── */
/* When ANY [data-tl-item] inside .tl-group is hovered, dim ALL items to 30% */
@media (min-width: 768px) {
  .tl-group:has([data-tl-item]:hover) [data-tl-item] {
    opacity: 0.3;
  }
  /* The hovered item stays at full */
  .tl-group:has([data-tl-item]:hover) [data-tl-item]:hover {
    opacity: 1;
  }
}

/* ── IMAGE CONTAINER ── */
.tl-img-wrap {
  overflow: hidden;
  background: rgba(255,255,255,0.07);
  transition: clip-path 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  clip-path: inset(0% 0% 0% 0%);
}
@media (min-width: 768px) {
  .tl-item:hover .tl-img-wrap {
    clip-path: inset(5% 5% 5% 5%);
  }
}
.tl-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s;
}

/* ── PROJECT TITLE (hidden, slides up on hover) ── */
.tl-title-wrap {
  margin-top: 2rem;
  text-align: center;
}
@media (min-width: 768px) {
  .tl-title-wrap {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    max-width: 45ch;
  }
  .tl-title-wrap.pos-right {
    right: -20%;
    text-align: right;
  }
  .tl-title-wrap.pos-left {
    left: -20%;
    text-align: left;
  }
}
.tl-title {
  font-size: clamp(1.25rem, 2vw, 1.875rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.04em;
  /* Glow/Outline effect agar teks tidak bertabrakan dengan gambar gelap di belakangnya */
  text-shadow: 
    -1px -1px 0 #fff,  
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff,
     0 2px 10px rgba(255, 255, 255, 0.8);
}
@media (min-width: 768px) {
  .tl-title-inner {
    transform: translateY(150%);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.2s;
  }
  .tl-item:hover .tl-title-inner {
    transform: translateY(0);
    transition-duration: 0.8s;
  }
  .tl-title-wrap {
    clip-path: inset(-0.3em 0 -0.3em 0);
  }
}

/* ── BOTTOM DIVIDER ── */
.divider-bottom {
  height: 1px;
  background: rgba(255,255,255,0.2);
  margin-top: 1.5rem;
}

/* ── SCROLL REVEAL (GSAP will handle) ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
}

/* ── MOBILE FIXES (from previous session) ── */
@media (max-width: 767px) {
  .grid-16 > div.relative {
    grid-column: 4 / span 10 !important;
  }
  .year-label-row {
    justify-content: flex-start !important;
    position: relative;
    z-index: 10;
  }
  .year-label {
    transform-origin: left center;
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  }
  .tl-title-wrap { margin-top: 1.5rem; clip-path: inset(-0.3em 0 -0.3em 0); }
  .tl-title-inner {
    transform: translateY(150%);
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0.2s;
  }
  .tl-item.is-active .tl-title-inner {
    transform: translateY(0);
    transition-duration: 0.8s;
  }
}

/* ── FILTER VISIBILITY (toggled by JS filter buttons) ── */
.filter-item {
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.filter-item.is-hidden {
  display: none;
}
