:root {
  color-scheme: light;
  --ink: #161719;
  --muted: #a7abb0;
  --ring: rgba(18, 19, 22, 0.12);
  --shadow: rgba(16, 18, 20, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.16), transparent 22%),
    linear-gradient(180deg, #f7f7f6 0%, #ffffff 52%, #e6e6e3 100%);
}

.stage {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  isolation: isolate;
}

.stage::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  height: 24vh;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(130, 132, 134, 0.35));
}

.carousel {
  position: relative;
  width: min(82vw, 430px);
  height: min(78vh, 560px);
  outline: none;
}

.slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  filter: blur(3px);
  transform: translate3d(var(--slide-x, 3.2rem), 0, 0) scale(0.965);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 640ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 640ms step-end;
  will-change: opacity, transform, filter;
}

.slide.is-active,
.slide.is-exiting {
  visibility: visible;
}

.slide.is-active {
  opacity: 1;
  pointer-events: auto;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 640ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0ms;
}

.slide.is-exiting {
  opacity: 0;
  filter: blur(3px);
  transform: translate3d(var(--slide-exit-x, -3.2rem), 0, 0) scale(0.985);
  transition:
    opacity 420ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 560ms cubic-bezier(0.4, 0, 0.2, 1),
    filter 560ms cubic-bezier(0.4, 0, 0.2, 1),
    visibility 560ms step-end;
}

.project-button {
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  background: transparent;
  border: 0;
}

.phone-button {
  width: min(54vw, 220px);
  min-width: 144px;
  aspect-ratio: 0.51;
  padding: 0;
}

.iphone {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(125deg, transparent 0 38%, rgba(255, 255, 255, 0.92) 39% 50%, transparent 51% 100%),
    radial-gradient(circle at 28% 4%, #ffffff, transparent 24%),
    linear-gradient(145deg, #f9faf9, #eef0ef 48%, #ffffff);
  border: clamp(4px, 1vw, 7px) solid #111;
  border-radius: 13% / 7%;
  box-shadow:
    0 18px 30px var(--shadow),
    inset 0 0 0 1px rgba(255, 255, 255, 0.64),
    inset 0 0 22px rgba(0, 0, 0, 0.07);
  transform: translateZ(0);
}

.iphone::before,
.iphone::after {
  position: absolute;
  top: 25%;
  width: 2px;
  height: 13%;
  content: "";
  background: #2d2d2f;
}

.iphone::before {
  left: -5px;
}

.iphone::after {
  right: -5px;
}

.dynamic-island {
  position: absolute;
  top: 4.5%;
  left: 50%;
  width: 34%;
  height: 5.5%;
  background: #050506;
  border-radius: 999px;
  transform: translateX(-50%);
}

.phone-glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.7), transparent 34% 100%);
  opacity: 0.55;
}

.project-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  font-size: clamp(0.88rem, 2.4vw, 1.12rem);
  line-height: 1.1;
  text-align: center;
}

.nav-button {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: #858a8f;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(20, 22, 24, 0.08);
  transform: translateY(-50%);
}

.nav-button-left {
  left: calc(50% - min(27vw, 110px) - 4.4rem);
}

.nav-button-right {
  right: calc(50% - min(27vw, 110px) - 4.4rem);
}

.nav-button span {
  margin-top: -0.18em;
  font-size: 2.3rem;
  line-height: 1;
}

.dots {
  position: fixed;
  bottom: clamp(1.5rem, 7vh, 3.2rem);
  left: 50%;
  display: flex;
  gap: 0.55rem;
  transform: translateX(-50%);
}

.dot {
  width: 6px;
  height: 6px;
  padding: 0;
  cursor: pointer;
  background: var(--muted);
  border: 0;
  border-radius: 999px;
  opacity: 0.45;
  transition: background 240ms ease, opacity 240ms ease, transform 240ms ease;
}

.dot.is-active {
  background: #242629;
  opacity: 1;
  transform: scale(1.2);
}

.progress-dialog {
  width: min(88vw, 280px);
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--ring);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.progress-dialog::backdrop {
  background: rgba(255, 255, 255, 0.54);
  backdrop-filter: blur(5px);
}

.progress-dialog form {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 1.5rem;
  place-items: center;
}

.progress-dialog p {
  margin: 0;
  font-size: 1.1rem;
}

.progress-dialog button {
  min-width: 84px;
  padding: 0.65rem 1rem;
  color: #fff;
  cursor: pointer;
  background: #161719;
  border: 0;
  border-radius: 6px;
}

@media (max-width: 620px) {
  .carousel {
    width: min(86vw, 320px);
    height: 68vh;
  }

  .phone-button {
    width: min(46vw, 172px);
  }

  .nav-button {
    width: 38px;
    height: 38px;
  }

  .nav-button-left {
    left: calc(50% - min(23vw, 86px) - 3.1rem);
  }

  .nav-button-right {
    right: calc(50% - min(23vw, 86px) - 3.1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.is-active,
  .slide.is-exiting,
  .dot {
    transition: none;
  }
}
