/* Registered so the glow can drift on its own on touch screens */
@property --x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 70%;
}
@property --y {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 30%;
}
.home-lab {
  --x: 70%;
  --y: 30%;
  min-height: calc(100vh - 82px);
  position: relative;
  overflow: hidden;
  padding: clamp(55px, 7vw, 100px) var(--edge) 56px;
  background: radial-gradient(circle at var(--x) var(--y), var(--glow-a) 0, transparent 20%),
    radial-gradient(circle at 20% 80%, var(--glow-b) 0, transparent 26%), var(--lab-base);
  transition: background 0.25s;
}
.home-lab[data-color="blue"] {
  background-color: var(--blue);
}
.home-lab[data-color="peach"] {
  background-color: var(--peach);
}
.home-lab[data-color="purple"] {
  background-color: var(--lav);
}
.home-lab[data-color="pink"] {
  background-color: var(--pink);
}
.lab-copy {
  position: relative;
  z-index: 2;
  max-width: 900px;
}
.lab-copy h1 {
  font-size: clamp(68px, 9vw, 128px);
  line-height: 0.8;
  margin: 25px 0 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.lab-copy h1 span,
.lab-copy h1 em {
  display: block;
  animation: word-in 0.65s both;
}
.lab-copy h1 span:nth-child(2) {
  animation-delay: 0.12s;
}
.lab-copy h1 em {
  animation-delay: 0.24s;
  font-style: italic;
}
.lab-note {
  max-width: 430px;
  font-size: 18px;
  margin: 0;
}
.lab-orbit {
  position: absolute;
  border: 2px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-a {
  width: min(57vw, 750px);
  height: min(57vw, 750px);
  right: -11vw;
  top: -23vw;
  animation: spin 25s linear infinite;
}
.orbit-b {
  width: min(35vw, 455px);
  height: min(35vw, 455px);
  right: 12%;
  bottom: -20vw;
  border-style: dashed;
  animation: spin 15s linear infinite reverse;
}
.float {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font: 600 34px var(--serif);
  animation: bob 3.4s ease-in-out infinite;
}
.float-a {
  width: 84px;
  height: 84px;
  right: 22%;
  top: 18%;
  background: var(--blue);
}
.float-b {
  width: 66px;
  height: 66px;
  right: 6%;
  top: 52%;
  background: var(--paper);
  animation-delay: -1.2s;
}
.float-c {
  width: 54px;
  height: 54px;
  right: 26%;
  top: 60%;
  background: var(--lav);
  animation-delay: -2.2s;
}
/* Secret doors to the arcade: links that only hint when you get close */
a.float {
  z-index: 3;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.25s;
}
.float-a:hover,
.float-a:focus-visible {
  box-shadow:
    0 0 0 6px rgba(158, 219, 232, 0.6),
    0 0 26px 6px rgba(63, 169, 255, 0.55);
}
.float-b:hover,
.float-b:focus-visible {
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.6),
    0 0 26px 6px rgba(255, 95, 180, 0.55);
}
.float-c:hover,
.float-c:focus-visible {
  box-shadow:
    0 0 0 6px rgba(199, 182, 240, 0.55),
    0 0 26px 6px rgba(180, 124, 255, 0.6);
}
.lab-cursor {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 2px solid var(--line-mid);
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition:
    transform 0.08s linear,
    opacity 0.2s;
  mix-blend-mode: multiply;
}
.home-lab.tracking .lab-cursor {
  opacity: 1;
}
.path-panel {
  position: relative;
  z-index: 3;
  margin-top: clamp(56px, 7vw, 96px);
  max-width: 1000px;
}
.path-panel > p {
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  margin: 0 0 13px;
}
.path-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1.5px solid var(--ink);
  background: var(--frost);
  backdrop-filter: blur(6px);
}
/* Number and arrow share the top row; the title sits along the bottom */
.path-choices a {
  min-height: 150px;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  border-right: 1.5px solid var(--ink);
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.25s;
}
.path-choices a:last-child {
  border-right: 0;
}
.path-choices a:hover,
.path-choices a:focus-visible,
.path-choices a:active {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-8px);
}
.path-choices span {
  font: 500 11px var(--mono);
}
.path-choices i {
  grid-area: 1 / 2;
  font-style: normal;
  font-size: 26px;
  line-height: 1;
}
.path-choices strong {
  grid-area: 2 / 1 / 3 / 3;
  align-self: end;
  font: 600 clamp(24px, 2.7vw, 36px) / 0.95 var(--serif);
  letter-spacing: -0.03em;
}
@keyframes word-in {
  from {
    opacity: 0;
    transform: translateY(35px) rotate(2deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes drift {
  0% {
    --x: 72%;
    --y: 22%;
  }
  50% {
    --x: 28%;
    --y: 48%;
  }
  100% {
    --x: 78%;
    --y: 68%;
  }
}
@media (hover: none) {
  .home-lab {
    animation: drift 12s ease-in-out infinite alternate;
  }
}
@media (max-width: 700px) {
  .home-lab {
    min-height: 0;
    padding-top: 72px;
  }
  .lab-copy h1 {
    font-size: clamp(44px, 12.5vw, 100px);
  }
  .lab-note {
    font-size: 17px;
  }
  .lab-orbit {
    opacity: 0.35;
  }
  .orbit-a {
    width: 110vw;
    height: 110vw;
    right: -48vw;
    top: -30vw;
  }
  .orbit-b,
  .lab-cursor {
    display: none;
  }
  .float-b {
    width: 40px;
    height: 40px;
    right: 132px;
    top: 17px;
    font-size: 20px;
  }
  .float-c {
    width: 40px;
    height: 40px;
    right: 80px;
    top: 17px;
    font-size: 20px;
  }
  .float-a {
    width: 46px;
    height: 46px;
    right: 22px;
    top: 14px;
    font-size: 22px;
  }
  .path-choices {
    grid-template-columns: 1fr;
  }
  .path-choices a {
    min-height: 0;
    border-right: 0;
    border-bottom: 1.5px solid var(--ink);
  }
  .path-choices a:last-child {
    border-bottom: 0;
  }
  .path-choices a:hover,
  .path-choices a:focus-visible,
  .path-choices a:active {
    transform: none;
  }
  .path-panel {
    margin-top: 56px;
  }
}
