/* ============================================================
   PROJECT DETAIL — Terra Design Studio
   Sticky-left / scroll-right layout + GSAP ScrollTrigger
   ============================================================ */

/* ── Project hero ─────────────────────────────────────────── */
.project-hero {
  height: 70vh;
  min-height: 480px;
  position: relative;
  overflow: hidden;
  background: var(--clr-dark);
}

.project-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.project-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(26, 26, 26, 0.75) 100%
  );
}

.project-hero__meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--sp-12) var(--gutter);
  max-width: var(--max-w);
  margin-inline: auto;
}

.project-hero__tag {
  display: inline-flex;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--clr-accent);
  padding: 0.35em 0.9em;
  border: 1px solid rgba(240, 120, 32, 0.4);
  border-radius: var(--radius-pill);
  margin-bottom: var(--sp-4);
}

.project-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: var(--fw-bold);
  color: var(--clr-white);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  margin-bottom: var(--sp-4);
}

.project-hero__info {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.project-hero__info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-hero__info-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.project-hero__info-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  color: var(--clr-white);
}

/* ── Sticky scroll container ──────────────────────────────── */
.project-scroll {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .project-scroll {
    grid-template-columns: 1fr;
  }
}

/* ── Left: sticky image panel ─────────────────────────────── */
.project-scroll__left {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  background: var(--clr-dark);
}

@media (max-width: 900px) {
  .project-scroll__left {
    position: relative;
    height: 55vw;
    min-height: 300px;
    top: auto;
  }
}

/* Image slides inside the sticky panel */
.sticky-images {
  position: relative;
  width: 100%;
  height: 100%;
}

.sticky-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.7s var(--ease);
  /* slight zoom on active for polish */
  transform: scale(1.03);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.sticky-image.is-active {
  opacity: 1;
  transform: scale(1);
}

/* Progress indicator on left panel */
.sticky-progress {
  position: absolute;
  right: var(--sp-6);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  z-index: 2;
}

.sticky-progress__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background var(--dur-base) var(--ease),
              transform var(--dur-base) var(--ease);
  cursor: pointer;
}

.sticky-progress__dot.is-active {
  background: var(--clr-accent);
  transform: scale(1.4);
}

/* Slide counter badge */
.sticky-counter {
  position: absolute;
  bottom: var(--sp-6);
  left: var(--sp-6);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  color: rgba(255, 255, 255, 0.5);
  z-index: 2;
}
.sticky-counter strong {
  color: var(--clr-white);
}

/* ── Right: scrollable content ────────────────────────────── */
.project-scroll__right {
  display: flex;
  flex-direction: column;
}

/* Each scroll section fills at least the viewport height */
.scroll-section {
  min-height: calc(100vh - var(--header-h));
  padding: var(--sp-16) var(--sp-12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--clr-border);
  position: relative;
}

.scroll-section:last-child {
  border-bottom: none;
}

@media (max-width: 1200px) {
  .scroll-section { padding: var(--sp-12) var(--sp-8); }
}

@media (max-width: 900px) {
  .scroll-section {
    min-height: unset;
    padding: var(--sp-10) var(--gutter);
  }
}

/* Section number badge */
.scroll-section__num {
  font-family: var(--font-display);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  color: var(--clr-border);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: var(--sp-4);
}

/* Section label */
.scroll-section__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--clr-accent);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.scroll-section__label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--clr-accent);
}

/* Section heading */
.scroll-section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--fw-bold);
  color: var(--clr-dark);
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-6);
  max-width: 22ch;
}

/* Section body text */
.scroll-section__text {
  font-size: var(--fs-base);
  line-height: var(--lh-loose);
  color: var(--clr-fg);
  max-width: 52ch;
}

.scroll-section__text p + p {
  margin-top: var(--sp-4);
}

/* Spec list (project details) */
.spec-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-top: var(--sp-6);
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-6);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--clr-border);
  font-size: var(--fs-sm);
}

.spec-item__label {
  color: var(--clr-fg-muted);
  flex-shrink: 0;
}

.spec-item__value {
  font-weight: var(--fw-semi);
  color: var(--clr-dark);
  text-align: right;
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}

.tag-cloud__tag {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--clr-fg);
  padding: 0.35em 0.9em;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
}

/* Scroll section enter animation */
.scroll-section__content {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

.scroll-section.is-active .scroll-section__content {
  opacity: 1;
  transform: translateY(0);
}

/* ── Project nav (prev/next) ──────────────────────────────── */
.project-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--clr-border);
}

.project-nav__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--gutter);
  transition: background var(--dur-base) var(--ease);
}

.project-nav__item:hover {
  background: var(--clr-bg-alt);
}

.project-nav__item:last-child {
  border-left: 1px solid var(--clr-border);
  align-items: flex-end;
  text-align: right;
}

.project-nav__dir {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--clr-fg-muted);
}

.project-nav__title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--clr-dark);
  letter-spacing: -0.01em;
  line-height: var(--lh-snug);
}

.project-nav__meta {
  font-size: var(--fs-xs);
  color: var(--clr-fg-muted);
  letter-spacing: var(--ls-wide);
}

/* ── Mobile: 768px ───────────────────────────────────────── */
@media (max-width: 768px) {
  .page-header {
    padding-top: calc(var(--header-h) + var(--sp-8));
    padding-bottom: var(--sp-8);
    margin-bottom: var(--sp-6);
  }

  .project-nav { grid-template-columns: 1fr; }
  .project-nav__item:last-child {
    border-left: none;
    border-top: 1px solid var(--clr-border);
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .page-header__title { font-size: var(--fs-2xl); }
  .page-header__sub   { font-size: var(--fs-base); }
}
