@font-face {
  font-family: Poppins;
  src: url("../assets/uiux/poppins-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

.uiux-page {
  --project-gutter: 50px;
  --project-radius: 100px;
  --project-width: 80%;
  --project-gap: 300px;
  --project-font: 24px;
  --title-gap-ratio: 8.8;
  --device-inset: 35px;
  --device-size: .612;
  --hint-width: 16%;
  --hint-font: 16px;
}

.uiux-hero {
  --mark-width: max(28%, 340px);
  --mark-left: 32%;
}
.hero-mark {
  --hero-entrance-spring: cubic-bezier(.2, .87, .25, 1.17);
  --hero-block-spring: cubic-bezier(.12, .86, .22, 1.38);
  --hero-letter-spring: cubic-bezier(.28, .76, .32, 1.07);
  position: absolute;
  top: 50%;
  left: var(--mark-left);
  width: var(--mark-width);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) perspective(500px) rotateY(var(--mark-tilt, 13deg));
}
@supports (animation-timing-function: linear(0, 1)) {
  .hero-mark {
    /* The three curves are sampled from the published Framer hero. */
    --hero-entrance-spring: linear(0, .104 5%, .413 10%, .746 15%, .996 20%,
      1.13 25%, 1.163 30%, 1.079 40%, .992 50%, .974 60%, .998 75%, 1.004 86%, 1);
    --hero-block-spring: linear(0, .154 3.3%, .746 6.6%, 1.072 8.3%,
      1.49 12.8%, 1.469 14.9%, 1.171 18.3%, .85 21.7%, .735 25.7%, .89 30%,
      1.061 33.3%, 1.145 37%, 1.071 41.6%, .976 45%, .926 48.3%, .957 53.3%,
      1.007 56.6%, 1.04 61%, .98 74%, 1.011 85%, 1);
    --hero-letter-spring: linear(0, .108 8.2%, .248 12.5%, .561 20.8%, .683 25%,
      .868 33.2%, .923 37.5%, .988 45.8%, 1.004 49.8%, 1.015 61%,
      1.009 75%, 1.003 87.5%, 1);
  }
}
.hero-tile {
  position: absolute;
  top: 0;
  left: 0;
  width: 29.4118%;
  aspect-ratio: 1;
  object-fit: contain;
  translate: calc(var(--column) * 120%) calc(var(--row) * 120%);
  animation: tile-enter 1s var(--entry-spring, var(--hero-entrance-spring)) var(--delay, 1s) both;
}
.hero-tile:not(.hero-letter) { z-index: 1; }
.hero-red { --column: 1; --row: 2; --from-y: -120px; }
.hero-blue { --column: 2; --row: 1; --from-x: -120px; }
.hero-pink {
  --column: 1;
  --row: 1;
  --from-scale: .5;
  --delay: .5s;
  --entry-spring: var(--hero-block-spring);
}
.hero-tile.hero-pink { z-index: 2; }
.hero-green { --column: 0; --row: 1; --from-x: 120px; }
.hero-orange { --column: 1; --row: 0; --from-y: 120px; }
.hero-letter {
  --delay: 1.5s;
  transition: translate .4s var(--hero-letter-spring);
}
.hero-u-first { --column: 0; --row: 0; --from-x: 120px; --from-y: 120px; }
.hero-i { --column: 2; --row: 0; --from-x: -120px; --from-y: 120px; }
.hero-u-second { --column: 0; --row: 2; --from-x: 120px; --from-y: -120px; }
.hero-x { --column: 2; --row: 2; --from-x: -120px; --from-y: -120px; }
@keyframes tile-enter {
  from {
    opacity: 0;
    transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(var(--from-scale, 1));
  }
}


.projects {
  --end-divider-height: var(--project-gap);
  --end-margin: min(100vw / 12, 300px);
  position: relative;
  z-index: 2;
  margin-bottom: var(--end-margin);
}
/* Keep the trailing divider inside the sticky card's containing block. */
.projects::after { content: ""; display: block; height: var(--end-divider-height); }
.project {
  position: sticky;
  top: 0;
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  padding: var(--project-gutter) var(--project-side, var(--project-gutter)) 0;
  transform: scale(var(--project-scale, 1));
  overflow: clip;
}
/* Keep the preceding sticky card centered as the incoming card covers it. */
.project ~ .project { margin-top: var(--project-gap); }
.project:last-child { padding-bottom: var(--project-gutter); }
.project-card {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: var(--project-radius) var(--project-radius) 0 0;
  background: linear-gradient(var(--project-color), var(--project-end, #000));
  overflow: hidden;
}
.readolution {
  --project-color: #205599;
  --title-width: 160%;
}
.nexvox { --project-color: #22668a; }
.droppy { --project-color: #217661; }
.darwinism {
  --project-color: #8f3b3f;
  --project-end: #1c0c0c;
  --title-width: 146%;
  --title-entry-x: -160px;
  --device-enlarge: .066;
  --device-start-scale: .54;
}
.darwinism .project-card { border-radius: var(--project-radius); }
.project-inner {
  position: relative;
  display: flex;
  width: var(--project-width);
  height: 100%;
}
.project-info, .project-device { width: 50%; position: relative; }
.project-info {
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}
.project-title {
  margin: 0;
  width: var(--title-width, 100%);
  filter: drop-shadow(8px 8px 14px #0008);
  transform: translateX(calc(var(--title-entry-x, -110px) * var(--title-remaining, 0))) scale(var(--title-scale, 1));
}
.project-title img { width: 100%; height: auto; }
.project-description {
  display: grid;
  justify-items: start;
  gap: 40px;
  width: 100%;
  margin-top: calc(100% / var(--title-gap-ratio));
}
.project-copy {
  width: 100%;
  max-width: 400px;
  font-size: var(--project-font);
  line-height: 1.6;
  overflow-wrap: break-word;
}
.project-copy p { margin: 0; }
.app-store-link {
  --store-arrow-size: 32px;
  --store-label-inset: calc(var(--store-arrow-size) + 20px);
  --store-arrow-ease: cubic-bezier(.18, .86, .28, 1);
  --store-label-ease: cubic-bezier(.18, .82, .28, 1.03);
  display: inline-grid;
  align-items: center;
  padding: 11px 20px 11px 10px;
  border-radius: 22px;
  color: #555;
  background: #fff;
  font: 400 16px/1.4 Poppins, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: auto;
}
.app-store-arrow, .app-store-label { grid-area: 1 / 1; }
.app-store-arrow { justify-self: stretch; }
.app-store-label { margin-inline-start: var(--store-label-inset); }
.app-store-link:is(:hover, :focus-visible) .app-store-arrow {
  translate: calc(100% - var(--store-arrow-size)) 0;
}
.app-store-link:is(:hover, :focus-visible) .app-store-label {
  translate: calc(-1 * var(--store-label-inset)) 0;
}
@supports (animation-timing-function: linear(0, 1)) {
  .app-store-link {
    /* Sampled from the original App Store button's two movements. */
    --store-arrow-ease: linear(0, .11 4.6%, .42 11.2%, .70 19.9%, .87 30.4%,
      .96 47.4%, .992 68.4%, 1);
    --store-label-ease: linear(0, .03 3.5%, .175 8.5%, .426 15.1%, .70 23.1%,
      .918 36%, 1.011 52%, 1.007 75%, 1);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .app-store-arrow { transition: translate .76s var(--store-arrow-ease); }
  .app-store-arrow img { animation: store-arrow-drift 1.5s var(--float) infinite alternate; }
  .app-store-label { animation: store-label-enter 1s var(--store-label-ease) both; }
  .app-store-link:is(:hover, :focus-visible) .app-store-label {
    animation-name: store-label-hover;
  }
}
@keyframes store-arrow-drift { to { translate: 5px 0; } }
@keyframes store-label-enter { from { scale: .5; } }
@keyframes store-label-hover { from { scale: .5; } }

.device-art {
  --device-scale: calc(var(--device-size) + var(--device-enlarge, 0));
  --device-y: -50px;
  --device-angle: 15deg;
  position: absolute;
  top: var(--device-top, 49%);
  left: var(--device-inset);
  width: var(--device-width, 100%);
  aspect-ratio: 370 / 802;
  padding: 0;
  border: 0;
  border-radius: 14.05% / 6.48%;
  background: none;
  color: inherit;
  overflow: hidden;
  cursor: pointer;
  transform: translateY(-50%) perspective(1200px) scale(var(--device-scale))
    rotate(var(--device-angle)) rotateY(-30deg) skewY(-4deg);
}
.device-art img { width: 100%; height: 100%; object-fit: cover; }
.device-art { animation: device-float 3s var(--float) infinite alternate; animation-play-state: paused; }
.project.is-visible .device-art { animation-play-state: running; }
@keyframes device-float { to { translate: 0 var(--device-y); } }
@media (width >= 600px) and (prefers-reduced-motion: no-preference) {
  .motion-ready .device-art {
    --device-scale: calc(var(--device-start-scale, .45) +
      (.9 - var(--device-start-scale, .45)) * var(--device-entry, 0));
  }
}
.device-art:focus-visible { outline-offset: -6px; }
.gallery-pointer-input :is(.device-art, .gallery-close):focus { outline: none; }
.motion-ready .project-description > :not(.project-hint) {
  opacity: var(--description-opacity, 1);
  translate: 0 var(--description-offset, 0px);
}
.project:focus-within .project-description > :not(.project-hint) { opacity: 1; translate: none; }

html.gallery-open { overflow: hidden; }
.gallery {
  --gallery-width: min(80%, 1600px);
  --caption-width: 100%;
  --gallery-radius: 50px;
  --close-size: 40px;
  --close-inset: 30px;
  --slide-width: 32%;
  --slide-gap: 30px;
  --arrow-size: 90px;
  --arrow-overlap: 80px;
  --dots-spacing: 20px;
  --top-space: 100px;
  --gallery-home-gap: calc(50px + 5%);
  --header-height: 6dvh;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  color: #fff;
  overflow: hidden;
}
/* The full-screen dialog itself provides the animated black backdrop. */
.gallery::backdrop { background: transparent; }
.gallery[data-project="readolution"] { --gallery-color: #6595c9; }
.gallery[data-project="nexvox"] { --gallery-color: #639fc2; }
.gallery[data-project="droppy"] { --gallery-color: #71a899; --top-space: 50px; }
.gallery[data-project="darwinism"] { --gallery-color: #6b6978; --top-space: 50px; }
.gallery-layout {
  width: var(--gallery-width);
  height: 100%;
  margin: 0 auto;
}
.gallery-title {
  width: var(--caption-width);
  height: var(--header-height);
  display: flex;
  align-items: center;
  margin: 0 auto;
  padding-inline: 5%;
  color: #aaa;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}
.gallery-panel {
  position: relative;
  height: calc(100% - var(--header-height));
  border-radius: var(--gallery-radius) var(--gallery-radius) 0 0;
  background: linear-gradient(var(--gallery-color), #000);
  overflow: hidden;
}
.gallery-close, .gallery-arrow, .gallery-dots button, .slide-video-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.gallery-close {
  position: absolute;
  width: var(--close-size);
  height: var(--close-size);
  top: var(--close-inset);
  right: var(--close-inset);
  z-index: 3;
}
.gallery-close img, .gallery-arrow img { width: 100%; height: 100%; object-fit: contain; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .gallery-close img {
    transition: transform .42s ease-out;
    /* Framer's hover spring overshoots the quarter-turn slightly. */
    transition-timing-function: linear(0, .097 6%, .298 12%, .514 18%, .7 24%, .839 30%,
      .933 36%, 1.017 48%, 1.028 57%, 1.017 71%, 1.005 86%, 1);
  }
  .gallery-close:hover img { transform: rotate(90deg); }
}
.gallery-scroll {
  position: relative;
  height: 100%;
  padding: var(--top-space) 0 10%;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.gallery-stage {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: clip;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  user-select: none;
}
.gallery-stage.is-dragging { cursor: grabbing; }
.gallery-stage.is-dragging .gallery-slide { transition: none; }
.gallery-slides {
  width: var(--slide-width);
  aspect-ratio: 370 / 802;
}
.gallery-slide {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--slide-width);
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 14.05% / 6.48%;
  overflow: hidden;
  transform: translateX(calc(var(--offset) * (100% + var(--slide-gap)) - var(--side) * 10% - 50% + var(--drag-x, 0px))) scale(.8);
  transition: transform .36s cubic-bezier(.2,.6,.3,1);
}
.gallery-slide.is-selected {
  z-index: 1;
  transform: translateX(calc(-50% + var(--drag-x, 0px)));
}
.gallery-slide.is-distant { visibility: hidden; }
.gallery-slide:is(.is-distant, .is-wrapping) { transition: none; }
.gallery-slide > img, .gallery-slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.slide-video-toggle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.slide-video-toggle img {
  width: 21%;
  height: auto;
  pointer-events: none;
}
.slide-video-toggle[aria-label^="Pause"] img { opacity: 0; }
.slide-video-toggle:focus-visible { outline-offset: -6px; }
.gallery-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: var(--arrow-size);
  height: var(--arrow-size);
  transform: translateY(-50%);
}
.gallery-previous { right: calc(50% + var(--slide-width) / 2 - var(--arrow-size) + var(--arrow-overlap)); }
.gallery-next { left: calc(50% + var(--slide-width) / 2 - var(--arrow-size) + var(--arrow-overlap)); }
.gallery-dots {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 20px auto 0;
  padding-inline: 5px;
  border-radius: 50px;
  background: #0003;
}
.gallery-dots button {
  width: var(--dots-spacing);
  height: 30px;
  display: grid;
  place-items: center;
}
.gallery-dots button::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff3;
}
.gallery-dots button[aria-current="true"]::after { background: #fff; }
.gallery-home {
  display: block;
  width: 34px;
  margin: var(--gallery-home-gap) auto 0;
}
.gallery-home img { animation: hand-down 2.4s var(--float) infinite alternate; }

@media (900px <= width < 1200px) {
  .uiux-page {
    --project-radius: 75px;
    --project-font: 20px;
    --title-gap-ratio: 6.4;
    --device-inset: 31px;
    --device-size: .645;
    --hint-width: 21%;
    --hint-font: 12px;
  }
  .uiux-hero {
    --mark-width: min(34%, 340px);
  }
  .projects { --end-margin: min(100vw / 9, 225px); }
}

@media (600px <= width < 900px) {
  .uiux-page {
    --project-radius: 50px;
    --project-width: 85%;
    --project-font: 16px;
    --title-gap-ratio: 4.24;
    --device-inset: 26px;
    --device-size: .742;
    --device-width: 120%;
    --hint-width: 60px;
    --hint-font: 12px;
  }
  .uiux-hero {
    --mark-width: min(39%, 340px);
    --mark-left: 37%;
  }
  .projects { --end-margin: min(100vw / 6, 150px); }
  .darwinism { --device-enlarge: .049; }
  .project-hint { justify-self: center; }
  .gallery {
    --gallery-width: min(90%, 1600px);
    --gallery-radius: 35px;
    --slide-width: 52%;
    --close-size: 30px;
    --close-inset: 20px;
  }
}

@media (width < 600px) {
  .uiux-page {
    --project-gutter: 30px;
    --project-side: 0px;
    --project-radius: 36px;
    --project-width: 88%;
    --project-gap: 200px;
    --project-font: 14px;
    --title-gap-ratio: 2.8;
    --device-inset: 0px;
    --device-width: 160%;
    --device-top: 50%;
    --hint-width: 45px;
    --hint-font: 12px;
  }
  .uiux-hero {
    --mark-width: min(61%, 270px);
    --mark-left: 45%;
    --mark-tilt: 27deg;
  }
  .projects { --end-divider-height: 300px; --end-margin: 0px; }
  .project { --title-width: 180%; }
  .darwinism { --project-gap: 300px; --title-width: 190%; }
  .readolution .project-description { margin-top: 50px; }
  /* Keep the overlapping title above the animated 3D phone in mobile Safari. */
  .project-info { transform: translateZ(0); }
  .project-device { z-index: 0; }
  .project-title { filter: drop-shadow(8px 8px 11px #0008); transform: none; }
  .device-art {
    --device-scale: .9;
    --device-y: 50px;
    --device-angle: 6deg;
  }

  .gallery {
    --gallery-width: 100%;
    --caption-width: 90%;
    --gallery-radius: 30px;
    --close-size: 30px;
    --close-inset: 20px;
    --slide-width: 67%;
    --gallery-home-gap: calc(50px + 12.5%);
    --slide-gap: 20px;
    --arrow-size: 60px;
    --arrow-overlap: 55px;
    --dots-spacing: min(30px, (100vw - 24px) / 11);
  }
  .gallery[data-project="droppy"], .gallery[data-project="darwinism"] {
    --top-space: 40px;
    --gallery-home-gap: 12.5%;
  }
  .gallery-title { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-tile, .project, .project-title, .device-art, .project.is-visible .device-art,
  .gallery-slide, .gallery-home img {
    animation: none;
    transition: none;
  }
  .project { position: relative; }
  .motion-ready .project-description > :not(.project-hint) { opacity: 1; translate: none; }
}
