/* ── WORKS PAGE ── */

/* Initial hidden states (only when JS is on — avoids FOUC flicker) */
.js .wh__label,
.js .wh__sub,
.js .wh__scroll-hint { opacity: 0; }

.js .wh__line { opacity: 0; }

.js .work__num,
.js .work__tag,
.js .work__title,
.js .work__desc,
.js .work__meta { opacity: 0; }

.js .work:not(:nth-child(even)) .work__photo-wrap { clip-path: inset(0 100% 0 0); }
.js .work:nth-child(even) .work__photo-wrap { clip-path: inset(0 0 0 100%); }


/* ─ Page header ─ */
.wh {
  position: relative;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10rem 5vw 4rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
}

.wh__inner {
  max-width: 900px;
}

.wh__label {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.wh__label .label-line {
  display: inline-block;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
}

.wh__title {
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 300;
  letter-spacing: var(--tracking-tighter);
  line-height: 0.95;
  color: var(--white);
  margin-bottom: 2rem;
}

.wh__title .wh__line {
  display: block;
}

.wh__title em {
  font-style: italic;
  color: var(--accent);
}

.wh__sub {
  font-size: 0.9rem;
  color: var(--gray-300);
  letter-spacing: 0.04em;
}

.wh__scroll-hint {
  position: absolute;
  bottom: 2rem;
  right: 5vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.wh__scroll-line {
  width: 3rem;
  height: 1px;
  background: var(--gray-700);
  animation: wh-pulse 2s ease-in-out infinite;
}

@keyframes wh-pulse {
  0%, 100% { width: 1.5rem; opacity: 0.4; }
  50%       { width: 3rem;   opacity: 1;   }
}

/* ─ Nav active state ─ */
.nav__links .is-current {
  color: var(--accent);
}

/* ─ Works list ─ */
.works {
  position: relative;
}

/* ─ Single work ─ */
.work {
  display: grid;
  grid-template-columns: 62% 38%;
  grid-template-areas: "photo info";
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.work:nth-child(even) {
  grid-template-columns: 38% 62%;
  grid-template-areas: "info photo";
}

/* Photo */
.work__photo-wrap {
  grid-area: photo;
  position: relative;
  overflow: hidden;
}

.work__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  will-change: transform;
}

/* Info panel */
.work__info {
  grid-area: info;
  display: flex;
  align-items: center;
  padding: 3rem 3.5rem;
  background: var(--black);
  position: relative;
}

.work__info::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(192,124,46,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.work:nth-child(even) .work__info::before {
  background: linear-gradient(225deg, rgba(192,124,46,0.04) 0%, transparent 60%);
}

.work__inner {
  width: 100%;
  max-width: 360px;
}

.work:nth-child(even) .work__inner {
  margin-left: auto;
}

/* Number */
.work__num {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

/* Tag */
.work__tag {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1.25rem;
}

/* Title */
.work__title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 300;
  letter-spacing: var(--tracking-tight);
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 1.5rem;
}

/* Description */
.work__desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--gray-300);
  margin-bottom: 2rem;
  text-align: justify;
  text-align-last: left;
  hyphens: none;
}

/* Meta */
.work__meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 1.5rem;
  margin: 0;
}

.work__meta > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.work__meta dt {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.work__meta dd {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-100);
  margin: 0;
  text-align: right;
}

/* Separator line between works */
.work + .work {
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ─ Progress counter ─ */
.w-counter {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 200;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--gray-300);
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.w-counter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.w-counter__current {
  color: var(--accent);
  font-weight: 500;
  min-width: 1.6em;
  text-align: right;
}

.w-counter__sep {
  color: var(--gray-500);
}

.w-counter__total {
  color: var(--gray-500);
}

.w-counter__track {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin-left: 0.6rem;
  position: relative;
  overflow: hidden;
}

.w-counter__bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ─ Footer CTA ─ */
.works-cta {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 5vw;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.works-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.works-cta__title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  letter-spacing: var(--tracking-tighter);
  color: var(--white);
}

.works-cta__sub {
  font-size: 0.9rem;
  color: var(--gray-300);
  letter-spacing: 0.04em;
}

.works-cta__btns {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.works-cta .btn {
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  animation: btnPulse 2.2s ease-in-out infinite;
}

.btn--accent:hover {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  animation: none;
}

@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(192, 124, 46, 0.8); }
  70%  { box-shadow: 0 0 0 18px rgba(192, 124, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 124, 46, 0); }
}

/* ─ Works footer ─ */
.works-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: var(--black);
}

.works-footer__left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.works-footer__copy {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.works-footer__socials {
  display: flex;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .works-footer {
    flex-direction: column;
    gap: 1.25rem;
    padding: 2rem 1.5rem 3rem;
    text-align: center;
  }
  .works-footer__left {
    flex-direction: column;
    gap: 1.25rem;
  }
}

/* ─ Mobile ─ */
@media (max-width: 768px) {
  .wh {
    min-height: 50vh;
    padding: 7rem 1.5rem 3rem;
  }

  .wh__scroll-hint {
    display: none;
  }

  .work,
  .work:nth-child(even) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "photo"
      "info";
    min-height: auto;
  }

  .work__photo-wrap {
    height: 55vw;
    min-height: 240px;
  }

  .work__desc {
    text-align: justify;
    text-align-last: left;
  }

  .work__info {
    padding: 2.5rem 1.5rem;
  }

  .work:nth-child(even) .work__inner {
    margin-left: 0;
  }

  .work__title {
    font-size: 1.75rem;
  }

  .w-counter {
    right: 1rem;
    bottom: 1rem;
    font-size: 0.7rem;
  }

  .w-counter__track {
    width: 40px;
  }
}
