@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
.projects-body {
  overflow: hidden;
}
.projects-page,
.proj-modal {
  --info-w: clamp(360px, 32vw, 520px);
  --pad-x: clamp(32px, 4vw, 64px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}
:is(.projects-page, .proj-modal) :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.slider {
  position: relative;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  transition: --p 0.85s cubic-bezier(0.77, 0, 0.18, 1);
}
.slider.is-dragging {
  transition: none;
}
.slide {
  position: absolute;
  inset: 0;
  transform: translate3d(calc((var(--i) - var(--p)) * 100%), 0, 0);
  will-change: transform;
}
.frame {
  overflow: hidden;
  background: #111;
  min-height: 0;
}
.parallax-img {
  display: block;
  width: 124%;
  height: 100%;
  margin-left: -12%;
  object-fit: cover;
  -webkit-user-drag: none;
  transform: translate3d(calc((var(--i) - var(--p)) * -9.7%), 0, 0);
}
.round-btn {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: var(--white, #fff);
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    opacity 0.25s,
    transform 0.25s;
}
.round-btn:hover:not(:disabled) {
  background: var(--gold, #ffc107);
  color: #111;
}
.round-btn:active:not(:disabled) {
  transform: scale(0.92);
}
.round-btn:disabled {
  opacity: 0.25;
  cursor: default;
}
.round-btn--glass {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: currentColor;
  opacity: 0.3;
  transition: width 0.35s var(--ease-out), opacity 0.35s;
}
.dot::after {
  content: "";
  position: absolute;
  inset: -12px -4px;
}
.dot.is-active {
  width: 22px;
  opacity: 1;
}
.projects-page {
  position: relative;
  margin-top: 90px;
  height: calc(100vh - 90px);
  height: calc(100dvh - 90px);
  overflow: hidden;
  background: var(--white);
}
.projects-track {
  position: absolute;
  inset: 0;
}
.proj-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--info-w);
  cursor: pointer;
}
.proj-entry .parallax-img {
  scale: 1.08;
  transition: scale 1.6s var(--ease-out);
}
.proj-entry.is-active .parallax-img {
  scale: 1;
}
.proj-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad-x) 96px;
  background: var(--white);
}
.proj-tags {
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #777;
}
.proj-name {
  margin-bottom: 36px;
  font-size: clamp(2.8rem, 4.4vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: #111;
}
.proj-show-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111;
  cursor: pointer;
  transition: gap 0.3s var(--ease-out);
}
.proj-show-btn:hover {
  gap: 20px;
}
.arrow-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1.5px solid #111;
  border-radius: 50%;
  font-size: 0.85rem;
  transition: background 0.25s, color 0.25s;
}
.proj-show-btn:hover .arrow-icon {
  background: #111;
  color: var(--white);
}
.reveal {
  transition: opacity 0.7s ease, translate 0.9s var(--ease-out);
  transition-delay: calc(0.35s + var(--k, 0) * 0.09s);
}
.proj-entry:not(.is-active) .reveal {
  opacity: 0;
  translate: 0 28px;
  transition-duration: 0.25s;
  transition-delay: 0s;
}
.proj-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: var(--info-w);
  padding: 0 var(--pad-x) 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.proj-counter {
  font-size: 0.9rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #999;
}
.proj-counter b {
  color: #111;
  font-weight: 700;
}
.proj-arrows {
  display: flex;
  gap: 10px;
}
.projects-page .dots {
  display: none;
  color: #111;
}
.proj-modal {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--info-w);
  background: #111;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s 0.45s;
}
.proj-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.modal-gallery {
  position: relative;
  overflow: hidden;
}
.modal-slides {
  position: absolute;
  inset: 0;
  cursor: grab;
}
.modal-slides.is-dragging {
  cursor: grabbing;
}
.modal-counter {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 2;
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
.modal-nav {
  position: absolute;
  bottom: 28px;
  left: 28px;
  z-index: 2;
  display: flex;
  gap: 8px;
}
.modal-gallery .dots {
  position: absolute;
  bottom: 40px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  color: var(--white);
}
.modal-gallery .dots:empty {
  display: none;
}
.modal-info {
  padding: 84px 40px 40px;
  overflow-y: auto;
  background: #111;
  color: var(--white);
  transform: translateX(40px);
  transition: transform 0.6s var(--ease-out) 0.1s;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.proj-modal.is-open .modal-info {
  transform: none;
}
.modal-category {
  margin-bottom: 12px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
}
.modal-title {
  margin-bottom: 40px;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--white);
}
.modal-row {
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-row:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-row b {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
}
.modal-row span {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.55);
}
.modal-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding: 14px 28px;
  border-radius: 4px;
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  transition: background 0.25s, gap 0.3s var(--ease-out);
}
.modal-view-btn:hover {
  gap: 20px;
  background: var(--gold);
  color: #111;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.modal-close:active {
  transform: scale(0.92);
}
@media (max-width: 900px) {
  .proj-entry {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .proj-info {
    justify-content: flex-start;
    padding: 22px 22px 60px;
  }
  .proj-name {
    margin-bottom: 20px;
    font-size: clamp(2.2rem, 9vw, 3.2rem);
  }
  .proj-controls {
    width: 100%;
    padding: 0 0 calc(22px + env(safe-area-inset-bottom));
    justify-content: center;
  }
  .proj-counter,
  .proj-arrows {
    display: none;
  }
  .projects-page .dots {
    display: flex;
  }
  .proj-modal {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 58vh minmax(0, 1fr);
    grid-template-rows: 58dvh minmax(0, 1fr);
  }
  .modal-nav {
    display: none;
  }
  .modal-gallery .dots {
    bottom: 22px;
  }
  .modal-info {
    padding: 28px 22px calc(32px + env(safe-area-inset-bottom));
    transform: translateY(40px);
  }
  .modal-title {
    margin-bottom: 28px;
    font-size: 2rem;
  }
}
@media (max-width: 900px) {
  .frame:not(.slide) {
    position: relative;
  }
  .frame::before {
    content: "";
    position: absolute;
    inset: -40px;
    background: var(--bg) center / cover no-repeat;
    filter: blur(26px) brightness(0.55) saturate(1.1);
  }
  .parallax-img {
    position: relative;
    width: 100%;
    margin-left: 0;
    object-fit: contain;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .slider,
  .reveal,
  .proj-entry .parallax-img,
  .modal-info {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }
}
