:root {
  --bg: #020202;
  --steel-edge: #828285;
  --steel-mid: #c5c5c7;
  --steel-light: #f5f5f6;
  --steel-shadow: #5f5f62;
  --door-duration: 850ms;
  --door-ease: cubic-bezier(0.6, 0, 0.2, 1);
  --indicator: #f6a623;
  --stage-vertical-margin: clamp(1.25rem, 3vh, 1.75rem);
  --control-panel-width: 112px;
  --elevator-shell-width: min(60rem, calc((100vh - (var(--stage-vertical-margin) * 2) - 1.25rem) * 1.14));
}

* {
  box-sizing: border-box;
}

html,
body {
  cursor: url("customCursor/p3-medium.cur"), auto;
}

a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
label[for],
summary,
select {
  cursor: url("customCursor/p1-medium.cur"), pointer;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background-color: #000;
}

body {
  overflow: hidden;
  font-family: Aptos, "Segoe UI", sans-serif;
  color: #fff;
}

.projects-app {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  padding: var(--stage-vertical-margin) 1.25rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 1rem;
  overflow: hidden;
  isolation: isolate;
  background-color: #000;
}

.projects-app::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("homeAnimation/backgroundTile.png");
  background-position: top left;
  background-repeat: repeat;
  background-size: 108px 108px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.home-link {
  position: fixed;
  top: 0;
  left: clamp(0.45rem, 1vw, 0.85rem);
  z-index: 20;
  display: block;
  width: clamp(64px, 5vw, 82px);
  aspect-ratio: 649 / 419;
  border-radius: 0;
  background-image: url("homeButton/hb1.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  text-decoration: none;
  transition: transform 160ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  background-image: url("homeButton/hb2.png");
  transform: translateY(-1px);
}

.home-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.48);
  outline-offset: 3px;
}

.projects-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.control-panel {
  width: min(100%, var(--control-panel-width));
  min-width: 84px;
  padding: clamp(0.9rem, 1.2vw, 1.15rem) 0.55rem;
  display: grid;
  gap: clamp(0.75rem, 1vw, 0.95rem);
  justify-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0)),
    linear-gradient(90deg, var(--steel-edge) 0%, var(--steel-light) 14%, var(--steel-mid) 31%, var(--steel-light) 50%, var(--steel-mid) 67%, var(--steel-light) 86%, var(--steel-edge) 100%);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.floor-button {
  width: clamp(2.9rem, 4vw, 3.35rem);
  height: clamp(2.9rem, 4vw, 3.35rem);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 28%),
    #040404;
  color: #fff;
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  line-height: 1;
  cursor: url("customCursor/p1-medium.cur"), pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.floor-button:hover,
.floor-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.07);
}

.floor-button.is-selected {
  border-color: rgba(255, 222, 151, 0.95);
  box-shadow:
    0 0 0 5px rgba(246, 166, 35, 0.15),
    0 0 28px rgba(246, 166, 35, 0.26);
}

.elevator-shell {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 16%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(90deg, var(--steel-edge) 0%, var(--steel-light) 6%, var(--steel-mid) 19%, var(--steel-light) 50%, var(--steel-mid) 81%, var(--steel-light) 94%, var(--steel-edge) 100%);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.elevator-top-bar {
  position: relative;
  height: clamp(44px, 5vw, 54px);
}

.elevator-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: clamp(74px, 10vw, 92px);
  padding: 0.2rem 0.7rem 0.1rem;
  border-radius: 0.2rem;
  background: #020202;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.18em;
  color: var(--indicator);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.elevator-shell.is-moving .elevator-indicator {
  animation: indicator-pulse 500ms steps(2, end) infinite;
}

.elevator-frame {
  position: relative;
  aspect-ratio: 1.23 / 1;
  margin: clamp(0.7rem, 1vw, 0.9rem);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.05) 2%, rgba(255, 255, 255, 0.05) 98%, rgba(0, 0, 0, 0.34)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.12));
}

.elevator-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

.cabin-backdrop {
  position: absolute;
  inset: clamp(0.8rem, 1.4vw, 1rem);
  background: #fff;
  border: clamp(5px, 0.7vw, 8px) solid #48484d;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.08);
}

.cabin-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.floor-panel-content {
  position: absolute;
  inset: 0;
  background: #fff;
}

.floor-panel-content[hidden] {
  display: none;
}

.placeholder-sheet {
  position: absolute;
  inset: 0;
  padding: clamp(1rem, 2.1vw, 1.7rem);
  color: #111;
}

.placeholder-sheet--spotify {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  row-gap: clamp(0.35rem, 0.8vw, 0.65rem);
  padding: clamp(0.45rem, 1vw, 0.85rem) clamp(0.75rem, 1.6vw, 1.1rem) clamp(0.65rem, 1vw, 0.9rem);
  background: #48484d;
  color: #f2f2f2;
}

.sheet-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.07);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sheet-frame {
  height: calc(100% - 2.7rem);
  margin-top: 1rem;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(25, 25, 25, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 250, 250, 0.92));
}

.sheet-frame--spotify {
  height: auto;
  min-height: 0;
  margin-top: 0;
  padding: clamp(0.2rem, 0.55vw, 0.4rem);
  border: 0;
  background: transparent;
}

.sheet-label--spotify {
  justify-self: center;
  padding: 0;
  background: transparent;
  color: #f7f7f7;
  font-size: 1.8rem;
  line-height: 1;
}

.placeholder-sheet--three-d .sheet-label--spotify {
  letter-spacing: 0;
}

.sheet-frame p {
  margin: 0;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.34);
}

.spotify-embed {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.placeholder-sheet--visuals {
  row-gap: clamp(0.4rem, 0.85vw, 0.7rem);
}

.sheet-frame--visuals {
  align-items: stretch;
  padding: clamp(0.2rem, 0.45vw, 0.35rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.55rem, 0.9vw, 0.8rem);
  width: 100%;
  align-content: start;
}

.visual-tile {
  margin: 0;
  overflow: hidden;
  border-radius: 0.9rem;
  background: rgba(20, 20, 22, 0.5);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.visual-tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.visual-tile--wide {
  grid-column: 1 / -1;
}

.visual-tile--wide img {
  aspect-ratio: 16 / 8.2;
}

.sheet-frame--visuals::-webkit-scrollbar {
  width: 0.7rem;
}

.sheet-frame--visuals::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.sheet-frame--visuals::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.sheet-frame--visuals::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

.placeholder-sheet--three-d {
  row-gap: clamp(0.45rem, 0.85vw, 0.75rem);
}

.sheet-frame--three-d {
  align-items: stretch;
  padding: clamp(0.25rem, 0.55vw, 0.4rem);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.three-d-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.65rem, 1vw, 0.9rem);
  width: 100%;
  align-content: start;
}

.three-d-tile {
  margin: 0;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(20, 20, 22, 0.45);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.three-d-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: rgba(10, 10, 12, 0.16);
}

.three-d-tile:first-child .three-d-media {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: transparent;
}

.three-d-tile--video .three-d-media {
  max-height: clamp(17rem, 42vh, 24rem);
}

.sheet-frame--three-d::-webkit-scrollbar {
  width: 0.7rem;
}

.sheet-frame--three-d::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.sheet-frame--three-d::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.sheet-frame--three-d::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.34);
}

.elevator-door {
  position: absolute;
  top: clamp(0.8rem, 1.4vw, 1rem);
  bottom: clamp(0.8rem, 1.4vw, 1rem);
  width: calc(50% - clamp(0.4rem, 0.6vw, 0.5rem));
  transition: transform var(--door-duration) var(--door-ease);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 12%, rgba(0, 0, 0, 0.13) 58%, rgba(255, 255, 255, 0.28) 100%),
    linear-gradient(180deg, #d2d2d4 0%, #f2f2f3 29%, #b8b8bb 50%, #d4d4d7 72%, #ececee 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    inset 0 0 35px rgba(255, 255, 255, 0.2);
}

.elevator-door::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 22%, rgba(255, 255, 255, 0.28) 56%, rgba(0, 0, 0, 0.08) 83%, rgba(255, 255, 255, 0.18)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.36), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.18));
}

.elevator-door-left {
  left: clamp(0.8rem, 1.4vw, 1rem);
}

.elevator-door-right {
  right: clamp(0.8rem, 1.4vw, 1rem);
}

.elevator-door-left::after,
.elevator-door-right::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(90, 90, 90, 0.8), rgba(255, 255, 255, 0.84));
}

.elevator-door-left::after {
  right: 0;
}

.elevator-door-right::after {
  left: 0;
}

.elevator-shell.is-open .elevator-door-left {
  transform: translateX(-104%);
}

.elevator-shell.is-open .elevator-door-right {
  transform: translateX(104%);
}

@media (min-width: 861px) {
  .control-panel {
    position: absolute;
    top: 50%;
    left: max(1.25rem, calc(((100vw - var(--elevator-shell-width)) / 4) - (var(--control-panel-width) / 2)));
    transform: translateY(-50%);
  }

  .elevator-shell {
    width: min(100%, var(--elevator-shell-width));
    aspect-ratio: 1.14 / 1;
    justify-self: center;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes indicator-pulse {
  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

@media (max-width: 860px) {
  .projects-app {
    padding: 4.5rem 1rem 1.25rem;
    grid-template-rows: auto auto;
  }

  .projects-stage {
    width: min(96vw, 720px);
    height: auto;
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .control-panel {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: min(100%, 340px);
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding: 0.9rem 1rem;
  }

  .elevator-shell {
    width: 100%;
    aspect-ratio: auto;
  }
}

@media (max-width: 540px) {
  .home-link {
    top: 0;
    left: 0.8rem;
  }

  .control-panel {
    gap: 0.7rem;
  }

  .sheet-frame p {
    text-align: center;
    padding: 0 1rem;
    line-height: 1.45;
  }
}
