/* The elevator menu: on a black page, a brushed steel call button with a ring of light. Pressed, a steel lift portal
   arrives round it: a floor dial with a needle, two speed telescopic doors, and behind them the cabin with the menu. */
:root {
  --page: #000000;          /* the page */
  --steel: #a7adb5;         /* the brushed steel of the portal and the doors */
  --steel-dark: #5f656d;    /* the steel in shadow */
  --cabin: #2b2925;         /* the walls of the cabin */
  --lit: #ffb84d;           /* the ring, the lit floor, the arrows */
  --words: #ece6da;         /* the names in the cabin */
  --muted: #9a9286;         /* the notes under them */
  --ink: #2a2d31;           /* the engraving on the call button */
  --jamb: 22px;             /* the width of the steel round the doors */
  --head: 204px;            /* the height of the panel with the dial */
}

@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 20deg;
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--words);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}

/* the lift keeps the room of the open portal, so the page never moves */
.lift {
  position: relative;
  width: min(880px, 100%);
  height: clamp(540px, calc(100svh - 40px), 760px);
}

/* ---------------------------------------------------------------- the call button */
.call {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 88px;
  height: 120px;
  margin: -60px 0 0 -44px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-origin: 50% 50%;
  will-change: transform;
}

.call:focus-visible {
  outline: 2px solid var(--lit);
  outline-offset: 5px;
}

/* the plate: steel brushed across, with a bevel */
.call__plate {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #d5d9de, #a3a9b1 48%, #b7bcc3 70%, #8d939b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(0, 0, 0, 0.25),
    inset 1px 0 0 rgba(255, 255, 255, 0.25),
    inset -1px 0 0 rgba(0, 0, 0, 0.2),
    0 14px 30px -10px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(0, 0, 0, 0.6);
}

/* the ring of light round the button: unlit glass, a glow on hover, bright once called */
.call__ring {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--lit) 14%, #3a3833);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: border-color 0.25s ease, box-shadow 0.35s ease;
}

.call__face {
  position: absolute;
  left: 50%;
  top: 22px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06) 0 1px, rgba(0, 0, 0, 0.04) 1px 2px),
    conic-gradient(from var(--spin), #8f959c, #f1f3f6 12%, #9aa0a7 25%, #d3d7dc 37%, #858b92 50%, #eef1f4 62%, #9aa0a7 75%, #d7dbdf 87%, #8f959c);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 -3px 5px rgba(0, 0, 0, 0.25),
    inset 0 2px 2px rgba(255, 255, 255, 0.6),
    0 3px 5px rgba(0, 0, 0, 0.45);
  transition: --spin 0.9s cubic-bezier(0.3, 0.7, 0.3, 1), transform 0.15s ease, box-shadow 0.15s ease;
}

.call__icon {
  position: absolute;
  width: 22px;
  height: 22px;
  fill: var(--ink);
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
  transition: opacity 0.3s ease;
}

.call__icon--close,
.lift.is-open .call__icon--open {
  opacity: 0;
}

.lift.is-open .call__icon--close {
  opacity: 1;
}

.call__label {
  position: absolute;
  bottom: 13px;
  font-size: 12px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .call:hover .call__face {
    --spin: 75deg;
  }

  .call:hover .call__ring {
    border-color: color-mix(in srgb, var(--lit) 45%, #3a3833);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 10px color-mix(in srgb, var(--lit) 25%, transparent);
  }
}

.call:active .call__face {
  transform: scale(0.95);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    inset 0 3px 6px rgba(0, 0, 0, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.lift.is-called .call__ring,
.call:active .call__ring {
  border-color: var(--lit);
  box-shadow:
    inset 0 0 4px color-mix(in srgb, var(--lit) 70%, #fff),
    0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 14px color-mix(in srgb, var(--lit) 70%, transparent),
    0 0 34px color-mix(in srgb, var(--lit) 30%, transparent);
}

/* ---------------------------------------------------------------- the portal */
.car {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: var(--head) 1fr auto;
  padding: 0 var(--jamb);
  border-radius: 18px;
  visibility: hidden;
  will-change: transform, opacity;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 11px),
    linear-gradient(90deg, #7c828a, #b6bbc2 18%, #9aa0a8 50%, #b9bec5 82%, #7a8088);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 0 1px #000,
    0 40px 90px -30px rgba(255, 184, 77, 0.12),
    0 30px 60px -20px rgba(0, 0, 0, 0.9);
}

.car__head {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px 0 12px;
}

/* where the call button goes when the lift is open */
.car__slot {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 62px;
  height: 85px;
  margin-top: -42px;
}

/* ---------------------------------------------------------------- the dial */
.dial {
  width: auto;
  height: calc(var(--head) - 34px);
  max-width: calc(100% - 170px);
  overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
}

.dial__rim {
  fill: #3b3a38;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
}

.dial__ticks line {
  stroke: rgba(236, 230, 218, 0.35);
  stroke-width: 1;
  stroke-linecap: round;
}

.dial__ticks .is-major {
  stroke: rgba(236, 230, 218, 0.7);
  stroke-width: 1.6;
}

.dial__names text {
  fill: rgba(236, 230, 218, 0.5);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 650;
  font-stretch: 80%;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: fill 0.25s ease;
}

.dial__names text.is-lit {
  fill: var(--lit);
  filter: url(#lift-glow);
}

.dial__dir {
  fill: rgba(236, 230, 218, 0.14);
  transition: fill 0.2s ease;
}

.dial__dir.is-lit {
  fill: var(--lit);
  filter: url(#lift-glow);
}

/* ---------------------------------------------------------------- the opening, the doors, the cabin */
.car__opening {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: #0b0b0b;
  box-shadow: 0 0 0 1px #000, 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.car__sill {
  height: 18px;
  margin: 0 calc(var(--jamb) * -1 + 8px) 10px;
  border-radius: 0 0 6px 6px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.45) 0 2px, transparent 2px 6px),
    linear-gradient(180deg, #d9dde1, #8c9299);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 0 #000;
}

.cabin {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70% 46% at 50% 0%, rgba(255, 214, 150, 0.32), transparent 72%),
    linear-gradient(180deg, transparent 84%, rgba(0, 0, 0, 0.55) 84.2%, #141210),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, transparent 0 calc(33.33% - 1px), rgba(0, 0, 0, 0.45) calc(33.33% - 1px) 33.33%),
    linear-gradient(180deg, #45423d, var(--cabin) 55%, #1e1c19);
}

.cabin__light {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 0;
  height: 5px;
  border-radius: 0 0 4px 4px;
  background: #fff3dc;
  box-shadow: 0 0 18px 4px rgba(255, 220, 160, 0.55), 0 0 60px 16px rgba(255, 210, 140, 0.18);
}

.cabin__rail {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 21%;
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f1f3f5, #8f959c 55%, #5a6067);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5);
}

/* the menu, on the back wall of the cabin */
.menu {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-bottom: 9%;
}

.menu__list {
  display: grid;
  justify-items: center;
  gap: clamp(2px, 1vh, 10px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.floor {
  display: grid;
  justify-items: center;
  padding: 3px 18px 4px;
  border-radius: 10px;
  transition: color 0.25s ease;
}

.floor__name {
  font-size: clamp(30px, 4.6vw, 46px);
  font-weight: 640;
  font-stretch: 76%;
  line-height: 1.02;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  transition: color 0.25s ease, text-shadow 0.25s ease, font-stretch 0.35s ease;
}

.floor__note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 560;
  font-stretch: 100%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.floor[aria-current='page'] .floor__name {
  color: var(--lit);
  text-shadow: 0 0 18px color-mix(in srgb, var(--lit) 45%, transparent);
}

@media (hover: hover) and (pointer: fine) {
  .floor:hover .floor__name {
    font-stretch: 92%;
  }

  .floor:not([aria-current='page']):hover .floor__name {
    color: #fff;
  }
}

.floor:focus-visible {
  outline: 2px solid var(--lit);
  outline-offset: 2px;
}

/* the doors: brushed steel up and down, a bevel on each edge, a rubber strip where they meet, and a reflection the
   script keeps still in the room while the panels slide under it */
.door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  --px: 0px;
  --ow: 800px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #c6cbd1, #9ea4ac 40%, #b3b8bf 72%, #8b919a);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.45),
    inset -1px 0 0 rgba(0, 0, 0, 0.45);
  will-change: transform;
}

.door {
  overflow: hidden;
}

/* the reflection: as wide as the whole opening, and moved back by as much as its panel moves, so it keeps still */
.door__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--px));
  width: var(--ow);
  background: linear-gradient(104deg, transparent 22%, rgba(255, 255, 255, 0.28) 34%, rgba(255, 255, 255, 0.06) 42%, transparent 50%, transparent 66%, rgba(255, 255, 255, 0.14) 74%, transparent 82%);
  opacity: var(--sheen-o, 1);
  transform: translate3d(0, 0, 0);
  will-change: transform;
  pointer-events: none;
}

.door--slow {
  z-index: 2;
}

.door--slow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
}

.door--fast {
  z-index: 3;
  width: calc(25% + 1px);
}

.door--slow.door--left {
  left: 0;
}

.door--fast.door--left {
  left: 25%;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.45), inset -1px 0 0 rgba(0, 0, 0, 0.45), -8px 0 14px -6px rgba(0, 0, 0, 0.55);
}

.door--fast.door--right {
  left: calc(50% - 1px);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.45), inset -1px 0 0 rgba(0, 0, 0, 0.45), 8px 0 14px -6px rgba(0, 0, 0, 0.55);
}

.door--slow.door--right {
  left: 75%;
}

/* the light of the floors going by, running over the shut doors */
.car__pass {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 4;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(255, 226, 180, 0.16) 45%, rgba(255, 255, 255, 0.22) 50%, rgba(255, 226, 180, 0.16) 55%, transparent);
  mix-blend-mode: screen;
  transform: translateY(-120%);
  pointer-events: none;
}

/* the rubber on the leading edges */
.door--fast::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(90deg, #111, #2c2c2c);
}

.door--fast.door--left::before {
  right: 0;
}

.door--fast.door--right::before {
  left: 0;
}

@media (max-width: 560px) {
  :root {
    --jamb: 12px;
    --head: 140px;
  }

  .car {
    border-radius: 14px;
  }

  .dial {
    max-width: calc(100% - 124px);
  }

  .car__slot {
    right: 2px;
    width: 52px;
    height: 71px;
    margin-top: -35px;
  }

  .floor__note {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .call__face,
  .call__ring,
  .call__icon,
  .floor,
  .floor__name {
    transition: none;
  }
}
