/* =========================================
   PROJECTS — alternating editorial split layout
========================================= */
.projects {
  width: 100%;
  position: relative;
  z-index: 40;
  background: #fff;
}

.section-spacer--projects {
  --section-divider-max-cover: 82px;
  background: #ffffff;
}

.projects-inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 0 clamp(6.5rem, 12vh, 8.5rem);
  font-family: var(--font-body), sans-serif;
  background: #fff;
}

.projects-header {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding:
    clamp(0.9rem, 1.3vw, 1.08rem)
    clamp(1rem, 2.4vw, 2rem)
    clamp(0.9rem, 1.35vw, 1.1rem);
  display: flex;
  align-items: flex-end;
}

.projects-title {
  margin: 0;
  font-family: var(--font-display), sans-serif;
  font-size: clamp(1.75rem, 4.2vw, 2.7rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #1a1a1a;
}

.projects-viewport {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project-feature {
  display: grid;
  grid-template-columns: 44vw 56vw;
  gap: 0;
  align-items: stretch;
  width: 100%;
  background: #fff;
}

.project-feature--text-right {
  grid-template-columns: 56vw 44vw;
}

.project-feature--text-right .project-feature-panel {
  order: 2;
}

.project-feature--text-right .project-feature-media {
  order: 1;
}

.project-feature-panel {
  background: #0b0d11;
  color: #f4f5f7;
  padding: clamp(1.15rem, 2.1vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 100vh;
  text-align: left;
}

.project-feature-top {
  width: min(30rem, 100%);
}

.project-feature-date {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  color: rgba(247, 249, 252, 0.9);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display), sans-serif;
}

.project-feature-date-mark {
  width: 1.32rem;
  height: 1.32rem;
  border-radius: 999px;
  border: 1px solid rgba(247, 249, 252, 0.56);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  line-height: 1;
}

.project-feature-copy {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  max-width: none;
}

.project-feature-title {
  font-family: var(--font-display), sans-serif;
  font-weight: 600;
  font-size: clamp(2rem, 4.1vw, 3.55rem);
  line-height: 1.03;
  margin: 0;
  color: #fff;
  letter-spacing: 0.018em;
}

.project-feature-title-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.project-view-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.36rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display), sans-serif;
  font-size: clamp(0.66rem, 0.9vw, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.project-view-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 0.95;
}

.project-feature-divider {
  width: 100%;
  height: 1px;
  margin: 0.12rem 0 0.1rem;
  background: rgba(245, 247, 252, 0.3);
}

.project-feature-skills {
  margin: 0;
  font-family: var(--font-display), sans-serif;
  font-size: clamp(0.9rem, 1.15vw, 1.04rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.55;
  color: rgba(239, 242, 248, 0.84);
}

.project-feature-description {
  margin: 0;
  color: rgba(242, 244, 246, 0.9);
  width: 100%;
  max-width: none;
  font-size: clamp(1.38rem, 2.25vw, 2.06rem);
  line-height: 1.46;
  letter-spacing: 0.012em;
}

.project-feature-media {
  --project-mask-bar-h: clamp(5rem, 6.8vw, 6rem);
  min-width: 0;
  background: #fff;
  min-height: 100vh;
  overflow: hidden;
}

.project-feature-viewport {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  border: none;
  box-shadow: none;
  background: #fff;
  position: relative;
}

.project-feature-track {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
}

.project-feature-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  opacity: 0;
  transition: none;
  overflow: hidden;
  will-change: clip-path, opacity;
}

.project-feature-slide:first-child {
  opacity: 1;
}

.project-feature-slide.is-active {
  transform: none;
}

.project-feature-slide--phone {
  background: linear-gradient(168deg, #f4f6fa, #e9edf5);
  padding: clamp(0.75rem, 1.7vw, 1.35rem);
}

.project-feature-slide:not(.project-feature-slide--phone) {
  align-items: stretch;
  justify-content: stretch;
  background: #fff;
}

.project-feature-image {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center top;
  background: #fff;
  border-radius: 0;
  display: block;
}

.project-phone-pair {
  width: min(96%, 980px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 1.8vw, 1.45rem);
  margin: 0 auto;
}

.project-phone-device {
  position: relative;
  width: min(38%, 280px);
  aspect-ratio: 9 / 19.5;
  border-radius: 2rem;
  padding: 0.56rem;
  background: linear-gradient(170deg, #1f2633 0%, #0e1119 100%);
  box-shadow:
    0 20px 34px rgba(14, 17, 25, 0.28),
    inset 0 0 0 1px rgba(164, 177, 204, 0.22);
}

.project-phone-image {
  width: 100%;
  height: 100%;
  border-radius: 1.52rem;
  object-fit: cover;
  object-position: center;
  background: #10141d;
  display: block;
}

.project-caption-bar {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--project-mask-bar-h);
  background: rgba(255, 255, 255, 0.97);
  display: flex;
  align-items: center;
  padding: 1rem 1.2rem;
  z-index: 7;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(10, 16, 24, 0.1);
}

.project-caption-text {
  margin: 0;
  color: rgba(12, 16, 22, 0.9);
  font-family: var(--font-body), sans-serif;
  font-size: 0.94rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  max-width: 100%;
}

.project-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid transparent;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-family: var(--font-display), sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.project-pill:hover {
  background: #112C64;
  color: #fff;
  transform: translateY(-1px);
}

.project-pill--light {
  background: #fff;
  color: #0d1018;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-pill--light:hover {
  background: #f1f3f8;
  color: #0d1018;
  transform: translateY(-1px);
}

.project-pill--small {
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

.project-arrow-link {
  color: #fff;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  display: inline-block;
  margin-bottom: 0.2rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.project-arrow-link:hover {
  opacity: 0.8;
}

.project-arrow-link--left:hover {
  transform: translateX(-3px);
}

.project-arrow-link--right:hover {
  transform: translateX(3px);
  opacity: 0.8;
}

.project-arrow-link--right {
  margin-left: 0;
}

.project-arrow-link--left {
  margin-right: 0;
}

.project-feature--4rked .project-feature-copy {
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
}

.project-feature--4rked .project-arrow-link {
  align-self: flex-end;
}

.project-feature--4rked .project-feature-title-row {
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

.project-feature--4rked .project-feature-title {
  text-align: left;
}

.project-feature--4rked .project-view-pill {
  flex-shrink: 0;
}

.project-feature-media--left .project-feature-image {
  object-position: left top;
}

.project-feature-media--right .project-feature-image {
  object-position: right top;
}

.project-feature--gallery .project-feature-slide:first-child .project-feature-image {
  object-position: left top;
}

.project-feature--kanonyx .project-feature-slide {
  background: linear-gradient(160deg, #f7f3ec 0%, #ebe7de 100%);
}

.project-feature--kanonyx .project-feature-image {
  object-fit: contain;
  object-position: center;
  padding: clamp(0.9rem, 2.35vw, 2rem);
  background: transparent;
}

.project-feature--kanonyx .project-feature-slide:first-child .project-feature-image {
  object-fit: cover;
  object-position: left top;
  padding: 0;
}

body.projects-overlay-open {
  overflow: hidden;
}

.project-expanded {
  position: fixed;
  inset: 0;
  z-index: 160;
  pointer-events: none;
  visibility: hidden;
}

.project-expanded--active {
  pointer-events: auto;
  visibility: visible;
}

.project-expanded-panel {
  width: 100%;
  height: 100%;
  background: #06080d;
  color: #f4f7fb;
  padding: clamp(1.1rem, 2.6vw, 2.4rem);
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-expanded-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-expanded-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(3rem, 5.5vw, 5.8rem);
  height: 100%;
  min-height: 0;
}

.project-expanded-arrow {
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font-body), sans-serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  margin: 0 0 0.2rem;
  width: fit-content;
}

.project-expanded-arrow:hover {
  opacity: 0.82;
  transform: none;
}

.project-expanded-arrow--left {
  animation: none;
}

.project-expanded-arrow--right {
  animation: none;
}

.project-expanded-media {
  --expanded-media-columns: 3;
  --expanded-media-ratio: 16 / 10;
  display: grid;
  grid-template-columns: repeat(var(--expanded-media-columns), minmax(0, 1fr));
  grid-auto-flow: row;
  grid-auto-columns: auto;
  gap: 0.72rem;
  align-content: start;
  padding-right: 0.25rem;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.project-expanded--solrise .project-expanded-media {
  --expanded-media-ratio: 9 / 19.5;
}

.project-expanded-image-card {
  margin: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  min-height: 0;
  aspect-ratio: var(--expanded-media-ratio);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.project-expanded-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
}

.project-expanded-copy {
  max-width: none;
  width: 100%;
  align-self: stretch;
  min-height: 0;
  padding-top: 0.3rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.project-expanded-copy::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-expanded-copy > .project-expanded-arrow,
.project-expanded-copy > .project-expanded-title,
.project-expanded-copy > .project-expanded-skills,
.project-expanded-copy > .project-expanded-divider {
  flex-shrink: 0;
}

.project-expanded-title {
  margin: 0;
  font-family: var(--font-display), sans-serif;
  width: 100%;
  font-size: clamp(2.5rem, 5vw, 4.35rem);
  line-height: 1.04;
  color: #fff;
}

.project-expanded-skills {
  margin: 0.95rem 0 0;
  width: 100%;
  font-family: var(--font-display), sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.16rem);
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(238, 244, 252, 0.75);
}

.project-expanded-divider {
  width: 100%;
  height: 1px;
  margin: 0.9rem 0 1rem;
  background: rgba(238, 244, 252, 0.2);
}

.project-expanded--text-right .project-expanded-copy {
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
}

.project-expanded--text-right .project-expanded-arrow {
  margin-left: auto;
}

.project-expanded--solrise .project-expanded-image-card {
  aspect-ratio: 9 / 19.5;
}

.project-expanded--solrise .project-expanded-image {
  object-fit: cover;
  object-position: center;
  background: transparent;
}

.project-expanded--4rked .project-expanded-image,
.project-expanded--gallery .project-expanded-image,
.project-expanded--kanonyx .project-expanded-image {
  object-fit: contain;
  background: transparent;
}

.project-expanded--kanonyx .project-expanded-image-card {
  background: #f2eee6;
}

.project-expanded--kanonyx .project-expanded-image {
  padding: 0.45rem;
}

.project-expanded-body p {
  margin: 0 0 1rem;
  width: 100%;
  font-size: clamp(1.28rem, 2.05vw, 1.82rem);
  line-height: 1.58;
  color: rgba(244, 247, 252, 0.93);
}

.project-expanded-body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 1025px) {
  .project-expanded-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    width: 100%;
    padding-right: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
}

.project-slide-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(26, 26, 26, 0.55);
  padding: 0.2em 0.6em;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
}

.project-slide-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.projects-secondary {
  margin: 0 auto 0;
  border-top: none;
  padding: 0 clamp(1.35rem, 5.5vw, 3.75rem) clamp(3.25rem, 7.5vh, 4.75rem);
  width: 100%;
  max-width: min(1680px, 100%);
  box-sizing: border-box;
  min-height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  isolation: isolate;
  background: linear-gradient(180deg, #080808 0%, #020202 100%);
}

.projects-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #080808 0%, #020202 100%);
  z-index: -1;
}

.projects-secondary-head {
  position: relative;
  z-index: 1;
  margin: 0 0 clamp(2.35rem, 4.5vh, 3.35rem);
  padding: clamp(1.75rem, 4vh, 2.75rem) 0 clamp(1.2rem, 2.4vh, 1.6rem);
}

.projects-secondary-head::before {
  content: '';
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #fff;
  z-index: -1;
}

.projects-secondary-label {
  margin: 0 0 clamp(0.65rem, 1.4vh, 0.95rem);
  font-family: var(--font-display), sans-serif;
  font-size: clamp(1.75rem, 4.2vw, 2.7rem);
  font-weight: 600;
  color: #111;
  letter-spacing: 0.015em;
  line-height: 1.12;
}

/* Full-bleed rule under the section title (viewport width) */
.projects-secondary-head-rule {
  height: 1px;
  background: rgba(0, 0, 0, 0.14);
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-bottom: 0;
}

.project-slide-tags--inline {
  justify-content: flex-start;
}

.projects-secondary .project-slide-tag {
  color: rgba(248, 245, 239, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
}

.projects-secondary .project-pill {
  background: #f7f4ee;
  color: #080808;
  border-color: rgba(247, 244, 238, 0.95);
}

.projects-secondary .project-pill:hover {
  background: #112C64;
  color: #fff;
}

.projects-secondary-funrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-content: center;
  align-items: stretch;
  gap: 0;
  column-gap: clamp(0.85rem, 2.2vw, 1.65rem);
  width: 100%;
  padding-top: clamp(0.35rem, 1vh, 0.75rem);
}

.projects-secondary-funrow-sep {
  width: 1px;
  align-self: stretch;
  min-height: 9.5rem;
  background: rgba(255, 255, 255, 0.14);
  justify-self: center;
}

.project-triple {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  width: 100%;
  max-width: none;
}

.project-triple--fun {
  min-width: 0;
  width: 100%;
  max-width: min(58vw, 480px);
  margin-inline: auto;
  justify-self: center;
  gap: 0.95rem;
}

.project-triple--fun .project-triple-media {
  aspect-ratio: 16 / 10;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.project-triple-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-color: #111;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
}

.project-triple-media--gallery {
  background-image: url('/images/gallery_img/home.png');
  background-position: left top;
}

.project-triple-media--nyt {
  background-image: url('/images/sample1.jpg');
  background-position: center top;
}

.project-triple-title {
  font-weight: 600;
  color: #f4f1ea;
  font-size: 1rem;
}

.project-triple-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 0.45rem;
  padding: 0 0.25rem;
}

.project-triple-copy {
  margin: 0;
  color: rgba(244, 241, 234, 0.82);
  font-size: 0.94rem;
  line-height: 1.58;
}

@media (max-width: 1024px) {
  .project-feature,
  .project-feature--text-right {
    grid-template-columns: 1fr;
    min-height: auto;
    width: 100%;
  }

  .project-feature--text-right .project-feature-panel,
  .project-feature--text-right .project-feature-media {
    order: initial;
  }

  .project-feature-panel {
    min-height: auto;
    gap: 1.8rem;
  }

  .project-feature-media {
    --project-mask-bar-h: 4.8rem;
    min-height: auto;
  }

  .project-feature-viewport {
    height: 72vh;
  }

  .project-phone-device {
    width: min(40%, 248px);
  }

  .project-expanded-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
  }

  .project-expanded-panel {
    overflow: auto;
  }

  .project-expanded-media {
    order: 2;
    grid-template-rows: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    height: auto;
    overflow: visible;
  }

  .project-expanded-copy {
    order: 1;
    max-width: none;
    justify-content: flex-start;
    overflow: visible;
  }
}

@media (max-width: 768px) {
  .projects-inner {
    padding: 0 0 clamp(4.75rem, 11vh, 6.5rem);
  }

  .projects-title {
    font-size: 1rem;
  }

  .project-feature-panel {
    padding: 1.3rem 1rem 1.6rem;
  }

  .project-feature-copy {
    max-width: none;
  }

  .project-feature-title-row {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.65rem;
  }

  .project-view-pill {
    font-size: 0.68rem;
  }

  .project-feature-media {
    --project-mask-bar-h: 4.6rem;
  }

  .project-feature-viewport {
    height: 64vh;
  }

  .project-feature-slide {
    padding: 0;
  }

  .project-feature-slide--phone {
    padding: 0.65rem;
  }

  .project-phone-pair {
    gap: 0.65rem;
    width: 100%;
  }

  .project-phone-device {
    width: min(44%, 196px);
    border-radius: 1.5rem;
    padding: 0.42rem;
  }

  .project-phone-image {
    border-radius: 1.15rem;
  }

  .project-caption-bar {
    padding: 0.72rem 0.8rem;
  }

  .project-caption-text {
    font-size: 0.84rem;
    line-height: 1.38;
  }

  .project-arrow-link {
    font-size: 1.75rem;
  }

  .project-expanded-panel {
    padding: 0.95rem;
  }

  .project-expanded-media {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
  }

  .project-triple--fun {
    max-width: min(92vw, 440px);
  }

  .projects-secondary-funrow {
    grid-template-columns: 1fr;
    gap: 0;
    row-gap: 0;
  }

  .projects-secondary-funrow-sep {
    width: min(72%, 15rem);
    height: 1px;
    min-height: 0;
    margin: clamp(0.85rem, 2vh, 1.25rem) auto;
    justify-self: center;
  }

  .project-triple-media {
    aspect-ratio: 16 / 10;
  }
}
