/* ===================================
   Project Detail Page
   =================================== */

/* Override body scroll lock & gradient for detail pages */
body.detail-page {
  background: #f5f5f5;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ===================================
   Hero Animations
   =================================== */

/* Fade-in (icons, nav) */
.anim--fade {
  --delay: 0s;
  opacity: 0;
}

.is-visible .anim--fade {
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--delay) forwards;
}

/* Clipped reveal — wrapper clips, child slides up */
.anim--rise {
  --delay: 0s;
  overflow: hidden;
}

.anim--rise > * {
  transform: translateY(100%);
  opacity: 0;
}

.is-visible .anim--rise > * {
  animation: revealUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) var(--delay) forwards;
}

@keyframes revealUp {
  from {
    transform: translateY(30%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scale + blur reveal (gallery images) */
.anim--blur {
  transform: scale(1.06);
  filter: blur(10px);
}

.is-visible .anim--blur {
  animation: contentReveal 0.7s cubic-bezier(0.33, 1, 0.68, 1) 0s forwards;
}

@keyframes contentReveal {
  from {
    transform: scale(1.06);
    filter: blur(10px);
  }
  to {
    transform: scale(1);
    filter: blur(0);
  }
}

/* ===================================
   Detail wrapper
   =================================== */

.detail {
  max-width: 1440px;
  margin: 40px auto 0;
  width: calc(100% - 80px);
  border: 1px solid #efefef;
}

/* ===================================
   Detail Navigation (centered on divider)
   =================================== */

.detail__nav {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: #16120F;
  border-radius: 48px;
  cursor: pointer;
  overflow: hidden;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.45),
    inset 0 -4px 4px rgba(0, 0, 0, 0.2),
    inset 0 4px 4px rgba(225, 219, 215, 0.2);
}

.detail__nav.is-open {
  width: 360px;
  cursor: default;
}

.detail__nav-group {
  display: flex;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.3s ease 0s, width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  pointer-events: none;
}

.detail__nav.is-open .detail__nav-group {
  opacity: 1;
  flex: 1;
  width: auto;
  transition: opacity 0.3s ease 0.2s, width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.detail__nav-group--left {
  justify-content: flex-end;
  padding-right: 0;
}

.detail__nav.is-open .detail__nav-group--left {
  padding-right: 28px;
}

.detail__nav-group--right {
  justify-content: flex-start;
  padding-left: 0;
}

.detail__nav.is-open .detail__nav-group--right {
  padding-left: 28px;
}

.detail__nav-link {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: #AC9D94;
  text-decoration: none;
  transition: color 0.3s ease;
}

.detail__nav-link:hover {
  color: #FFBA93;
}

.detail__nav-logo {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-open .detail__nav-logo {
  transform: rotate(90deg);
}

/* ===================================
   Hero
   =================================== */

.detail__hero {
  position: relative;
  height: 824px;
  background: #171414;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}

.detail__hero-split {
  display: flex;
  height: 100%;
}

/* Left half — solid dark, holds client logo */
.detail__hero-left {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #171514;
}

/* Right half — gradient + red divider stroke on left edge */
.detail__hero-right {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  background: linear-gradient(to right, #1f1514, rgba(23, 20, 20, 0));
  border-left: 1px solid rgba(213, 43, 30, 0.2);
}

.detail__hero-right .detail__hero-info {
  margin: 0 40px;
}

/* Corner pinwheel icons */
.detail__hero-corner {
  position: absolute;
  top: 40px;
  left: 40px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail__hero-corner--right {
  left: auto;
  right: 40px;
}

/* Client logo */
.detail__hero-logo {
  width: 215px;
  height: auto;
}

/* Project info block */
.detail__hero-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 513px;
  flex: 1;
  min-width: 0;
}

.detail__hero-title {
  font-family: var(--font-body);
  font-size: 64px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.3;
}

.detail__hero-desc {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.5;
  opacity: 0.6;
  letter-spacing: 0.08em;
}

/* Metrics row */
.detail__hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 19px;
}

.detail__metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #201514;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(213, 43, 30, 0.2);
  flex: 1 1 120px;
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
}

.detail__metric-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  opacity: 0.4;
}

.detail__metric-value {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}

/* ===================================
   Gallery Sections
   =================================== */

.detail__gallery {
  position: relative;
  overflow: hidden;
}

.detail__gallery--light {
  background: #FBF7F0;
}

.detail__gallery--dark {
  background: #141715;
}

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

/* GIF pair layout */
.detail__gallery--gifs {
  padding: 60px 40px;
}

.detail__gif-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.detail__gif {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 32px;
  display: block;
}

@media (max-width: 768px) {
  .detail__gallery--gifs {
    padding: 40px 20px;
  }

  .detail__gif-row {
    flex-direction: column;
    gap: 24px;
  }

  .detail__gif {
    max-width: 300px;
  }
}

/* ===================================
   Text Sections
   =================================== */

.detail__text-section {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 120px;
  padding: 120px 40px;
}

.detail__text-section--compact {
  gap: 80px;
  padding-bottom: 80px;
}

.detail__text-section--compact + .detail__text-section {
  padding-top: 40px;
}

.detail__text-block {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 784px;
}

.detail__heading {
  font-family: var(--font-body);
  font-size: 64px;
  font-weight: 500;
  color: #AEACA8;
  line-height: 1;
}

.detail__body {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: #141715;
  line-height: 1.7;
}

ul.detail__body {
  list-style-position: outside;
  padding-left: 1.2em;
}

ul.detail__body li + li {
  margin-top: 12px;
}

/* ===================================
   Approach Steps
   =================================== */

.detail__steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 784px;
}

.detail__step {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.detail__step:first-child {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.detail__step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 64px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.detail__step-header:hover {
  opacity: 0.7;
}

.detail__step-text {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 500;
  color: #AEACA8;
  line-height: 1.3;
  text-align: left;
}

.detail__step-arrow {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail__step.is-open .detail__step-arrow {
  transform: rotate(180deg);
}

.detail__step-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease;
}

.detail__step.is-open .detail__step-content {
  opacity: 1;
}

.detail__step-content .detail__body {
  padding: 0 0 24px;
}

/* ===================================
   Footer — Next Project
   =================================== */

.detail__footer {
  position: relative;
  height: 824px;
  background: #141715;
  border-radius: 0;
  overflow: hidden;
}

/* Footer scroll-in animation — initial hidden states */
.detail__footer .detail__footer-heading,
.detail__footer .detail__footer-next {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail__footer .detail__footer-corner {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail__footer .detail__footer-next {
  transition-delay: 0.1s;
}

/* Footer scroll-in animation — visible states */
.detail__footer.is-visible .detail__footer-heading,
.detail__footer.is-visible .detail__footer-next {
  opacity: 1;
  transform: translateY(0);
}

.detail__footer.is-visible .detail__footer-corner {
  opacity: 1;
}

.detail__footer.is-visible .detail__footer-heading {
  transition-delay: 0.1s;
}

.detail__footer.is-visible .detail__footer-next {
  transition-delay: 0.25s;
}

.detail__footer.is-visible .detail__footer-corner {
  transition-delay: 0.35s;
}

.detail__footer-split {
  display: flex;
  height: 100%;
}

/* Footer left — solid dark, text right-aligned toward divider */
.detail__footer-left {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 0 40px 0 120px;
  background: #171514;
}

/* Footer right — gradient + red divider stroke, text left-aligned near divider */
.detail__footer-right {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 120px 0 40px;
  background: linear-gradient(to right, #1f1514, rgba(23, 20, 20, 0));
  border-left: 1px solid rgba(213, 43, 30, 0.2);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.detail__footer-right:hover {
  opacity: 0.85;
}

/* Corner labels */
.detail__footer-corner {
  position: absolute;
  top: 40px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.detail__footer-corner--right {
  left: auto;
  right: 40px;
}

.detail__footer-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: #ADA6A3;
  letter-spacing: 0.05em;
}

.detail__footer-heading {
  font-family: var(--font-body);
  font-size: 80px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.2;
  text-align: right;
}

.detail__footer-next {
  font-family: var(--font-body);
  font-size: 48px;
  font-weight: 500;
  color: #FFB991;
  line-height: 1.3;
}

/* ===================================
   Tablet — max 1024px
   =================================== */

@media (max-width: 1200px) {
  .detail {
    width: calc(100% - 40px);
    margin-top: 20px;
  }

  /* Hero — still 50/50 split */
  .detail__hero-right .detail__hero-info {
    margin: 0 24px;
  }

  .detail__hero-title {
    font-size: 42px;
  }

  .detail__hero-info {
    max-width: none;
  }

  .detail__hero-desc {
    font-size: 13px;
  }

  .detail__hero-metrics {
    gap: 12px;
  }

  /* Text sections */
  .detail__text-section {
    padding: 100px 40px;
    gap: 100px;
  }

  .detail__heading {
    font-size: 48px;
  }

  .detail__step-text {
    font-size: 22px;
  }

  /* Footer */
  .detail__footer {
    height: 700px;
  }

  .detail__footer-left {
    padding: 0 30px 0 60px;
  }

  .detail__footer-right {
    padding: 0 60px 0 30px;
  }

  .detail__footer-heading {
    font-size: 56px;
  }

  .detail__footer-next {
    font-size: 36px;
  }
}

/* ===================================
   Mobile — max 768px (stacked layout)
   =================================== */

@media (max-width: 768px) {
  .detail {
    width: calc(100% - 24px);
    margin-top: 16px;
  }

  /* Nav */
  .detail__nav.is-open {
    width: calc(100% - 48px);
  }

  /* Hero — stacked vertically */
  .detail__hero {
    height: auto;
    min-height: 0;
  }

  .detail__hero-split {
    flex-direction: column;
  }

  .detail__hero-left {
    padding: 100px 40px 80px;
    justify-content: center;
    align-items: center;
    min-height: 327px;
  }

  .detail__hero-logo {
    width: 129px;
  }

  .detail__hero-right {
    position: static;
    padding: 40px 24px 60px;
    background: linear-gradient(to bottom, #1f1514, rgba(23, 20, 20, 0));
    border-left: none;
    border-top: 1px solid rgba(213, 43, 30, 0.15);
    align-items: flex-start;
    justify-content: flex-start;
  }

  .detail__hero-right .detail__hero-info {
    margin: 0;
  }

  .detail__hero-title {
    font-size: 40px;
  }

  .detail__hero-metrics {
    gap: 10px;
  }

  .detail__hero-corner--right {
    display: flex;
    position: absolute;
    top: 40px;
    right: 40px;
    left: auto;
  }

  /* Text sections */
  .detail__text-section {
    padding: 64px 24px;
    gap: 80px;
  }

  .detail__text-section--compact {
    gap: 48px;
  }

  .detail__heading {
    font-size: 36px;
  }

  .detail__body {
    font-size: 13px;
  }

  .detail__step-text {
    font-size: 18px;
  }

  .detail__step-header {
    height: auto;
    min-height: 52px;
    padding: 16px 0;
    gap: 16px;
  }

  .detail__step-arrow {
    width: 18px;
    height: 18px;
  }

  /* Footer — stacked */
  .detail__footer {
    height: auto;
  }

  .detail__footer-split {
    flex-direction: column;
  }

  .detail__footer-left {
    padding: 40px 40px 60px;
    align-items: flex-start;
    min-height: 303px;
    justify-content: flex-end;
  }

  .detail__footer-right {
    position: static;
    padding: 0 32px 60px;
    border-left: none;
    border-top: 1px solid rgba(213, 43, 30, 0.2);
    background: linear-gradient(to bottom, #1f1514, rgba(23, 20, 20, 0));
    min-height: 301px;
    justify-content: center;
  }

  .detail__footer-heading {
    font-size: 48px;
    text-align: left;
  }

  .detail__footer-next {
    font-size: 32px;
  }

  /* Hide "SELECTED WORKS" label text on mobile */
  .detail__footer-corner .detail__footer-label {
    display: none;
  }

  .detail__footer-corner {
    position: absolute;
    top: 40px;
    left: 40px;
    margin-bottom: 0;
  }

  .detail__footer-corner--right {
    left: auto;
    right: 40px;
    top: 40px;
  }

  /* Show "UP NEXT" label on mobile, hide its icon */
  .detail__footer-corner--right .detail__footer-label {
    display: block;
  }

  .detail__footer-corner--right svg {
    display: none;
  }
}

/* ===================================
   Sequoia Theme Overrides
   =================================== */

body.detail-page.theme-sequoia {
  background: #f5f5f5;
}

.theme-sequoia .detail__hero-logo {
  width: 247px;
}

.theme-sequoia .detail__hero {
  background: #141715;
}

.theme-sequoia .detail__hero-left {
  background: #141715;
}

.theme-sequoia .detail__hero-right {
  background: linear-gradient(to right, #15201a, rgba(20, 23, 21, 0));
  border-left: 1px solid rgba(1, 181, 116, 0.2);
}

.theme-sequoia .detail__metric {
  background: #152015;
  border: 1px solid rgba(1, 181, 116, 0.2);
}

.theme-sequoia .detail__footer-left {
  background: #141715;
}

.theme-sequoia .detail__footer-right {
  background: linear-gradient(to right, #15201a, rgba(20, 23, 21, 0));
  border-left: 1px solid rgba(1, 181, 116, 0.2);
}

.theme-sequoia .detail__footer {
  background: #141715;
}


@media (max-width: 768px) {
  .theme-sequoia .detail__hero-right {
    background: linear-gradient(to bottom, #15201a, rgba(20, 23, 21, 0));
    border-left: none;
    border-top: 1px solid rgba(1, 181, 116, 0.15);
  }

  .theme-sequoia .detail__footer-right {
    border-left: none;
    border-top: 1px solid rgba(1, 181, 116, 0.2);
    background: linear-gradient(to bottom, #15201a, rgba(20, 23, 21, 0));
  }
}

/* ===================================
   Lava Theme Overrides
   =================================== */

body.detail-page.theme-lava {
  background: #f5f5f5;
}

.theme-lava .detail__hero {
  background: #0E102B;
}

.theme-lava .detail__hero-left {
  background: #0E102B;
}

.theme-lava .detail__hero-right {
  background: linear-gradient(to right, #1E1A38, rgba(14, 16, 43, 0));
  border-left: 1px solid rgba(122, 129, 224, 0.2);
}

.theme-lava .detail__metric {
  background: #1E1A38;
  border: 1px solid rgba(122, 129, 224, 0.2);
}

.theme-lava .detail__footer-left {
  background: #0E102B;
}

.theme-lava .detail__footer-right {
  background: linear-gradient(to right, #1E1A38, rgba(14, 16, 43, 0));
  border-left: 1px solid rgba(122, 129, 224, 0.2);
}

.theme-lava .detail__footer {
  background: #0E102B;
}

@media (max-width: 768px) {
  .theme-lava .detail__hero-right {
    background: linear-gradient(to bottom, #1E1A38, rgba(14, 16, 43, 0));
    border-left: none;
    border-top: 1px solid rgba(122, 129, 224, 0.15);
  }

  .theme-lava .detail__footer-right {
    border-left: none;
    border-top: 1px solid rgba(122, 129, 224, 0.2);
    background: linear-gradient(to bottom, #1E1A38, rgba(14, 16, 43, 0));
  }
}

/* ---- Goldstar Theme ---- */

body.detail-page.theme-goldstar {
  background: #f5f5f5;
}

.theme-goldstar .detail__hero-logo {
  width: 247px;
}

.theme-goldstar .detail__hero {
  background: #171514;
}

.theme-goldstar .detail__hero-left {
  background: #171514;
}

.theme-goldstar .detail__hero-right {
  background: linear-gradient(to right, #211A01, rgba(23, 21, 20, 0));
  border-left: 1px solid rgba(254, 194, 0, 0.2);
}

.theme-goldstar .detail__metric {
  background: #211A01;
  border: 1px solid rgba(254, 194, 0, 0.2);
}

.theme-goldstar .detail__footer-left {
  background: #171514;
}

.theme-goldstar .detail__footer-right {
  background: linear-gradient(to right, #211A01, rgba(23, 21, 20, 0));
  border-left: 1px solid rgba(254, 194, 0, 0.2);
}

.theme-goldstar .detail__footer {
  background: #171514;
}

@media (max-width: 768px) {
  .theme-goldstar .detail__hero-right {
    background: linear-gradient(to bottom, #211A01, rgba(23, 21, 20, 0));
    border-left: none;
    border-top: 1px solid rgba(254, 194, 0, 0.15);
  }

  .theme-goldstar .detail__footer-right {
    border-left: none;
    border-top: 1px solid rgba(254, 194, 0, 0.2);
    background: linear-gradient(to bottom, #211A01, rgba(23, 21, 20, 0));
  }
}

/* ---- Stellar Theme ---- */

body.detail-page.theme-stellar {
  background: #f5f5f5;
}

.theme-stellar .detail__hero {
  background: #0F0B21;
}

.theme-stellar .detail__hero-left {
  background: #0F0B21;
}

.theme-stellar .detail__hero-right {
  background: linear-gradient(to right, #18132F, rgba(15, 11, 33, 0));
  border-left: 1px solid rgba(112, 69, 244, 0.2);
}

.theme-stellar .detail__metric {
  background: #18132F;
  border: 1px solid rgba(112, 69, 244, 0.2);
}

.theme-stellar .detail__footer-left {
  background: #0F0B21;
}

.theme-stellar .detail__footer-right {
  background: linear-gradient(to right, #18132F, rgba(15, 11, 33, 0));
  border-left: 1px solid rgba(112, 69, 244, 0.2);
}

.theme-stellar .detail__footer {
  background: #0F0B21;
}

@media (max-width: 768px) {
  .theme-stellar .detail__hero-right {
    background: linear-gradient(to bottom, #18132F, rgba(15, 11, 33, 0));
    border-left: none;
    border-top: 1px solid rgba(112, 69, 244, 0.15);
  }

  .theme-stellar .detail__footer-right {
    border-left: none;
    border-top: 1px solid rgba(112, 69, 244, 0.2);
    background: linear-gradient(to bottom, #18132F, rgba(15, 11, 33, 0));
  }
}
