@font-face {
  font-family: "Formation Sans";
  src: url("../../assets/fonts/shore-type-lab/inter.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Formation Display";
  src: url("../../assets/fonts/shore-type-lab/oswald.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #050506;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  overflow: hidden;
  background: #050506;
  color: #f5f6f7;
  font-family: "Formation Sans", Arial, sans-serif;
}

button {
  font: inherit;
}

.formation-lab,
.formation-lab__stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  background: #050506;
}

.formation-lab__model,
.formation-lab__particles {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.formation-lab__model {
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

.formation-lab__model:active {
  cursor: grabbing;
}

.formation-lab__particles {
  z-index: 2;
  pointer-events: none;
}

.formation-lab__source {
  position: absolute;
  z-index: -1;
  inset: 0;
  color: #fff;
  text-align: center;
  visibility: hidden;
}

.formation-lab__source p {
  margin: 0;
  word-break: keep-all;
}

.formation-lab__source-word {
  display: inline-block;
}

.formation-lab__source-headline,
.formation-lab__source-introduction {
  position: absolute;
  left: 50%;
  width: min(94vw, 1440px);
  transform: translate(-50%, -50%);
}

.formation-lab__source-headline {
  top: 41%;
  width: max-content;
  font-family: "Formation Display", Arial, sans-serif;
  font-size: min(179px, 10.9vw);
  font-style: normal;
  font-weight: 370;
  letter-spacing: -0.01em;
  line-height: 0.98;
  text-transform: uppercase;
  white-space: nowrap;
}

.formation-lab__source-introduction {
  top: 53%;
  transform: translateX(-50%);
}

.formation-lab__source-identity {
  font-size: 54px;
  font-weight: 660;
  letter-spacing: -0.035em;
  line-height: 1.3;
}

.formation-lab__source-support {
  display: grid;
  gap: 0.42rem;
  margin-top: clamp(1.35rem, 3vh, 2.3rem);
  color: rgb(255 255 255 / 68%);
  font-size: 24px;
  font-weight: 420;
  letter-spacing: -0.018em;
  line-height: 1.65;
}

.formation-lab__caption {
  position: absolute;
  z-index: 4;
  top: clamp(22px, 4vh, 46px);
  left: clamp(20px, 3.2vw, 56px);
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.formation-lab__caption span {
  color: rgb(200 210 216 / 46%);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.22em;
}

.formation-lab__caption strong {
  color: rgb(238 241 243 / 82%);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.14em;
}

.formation-lab__status {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  margin: 0;
  color: rgb(220 227 231 / 44%);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
  transform: translate(-50%, 86px);
  transition: opacity 180ms ease;
}

.formation-lab[data-ready="true"] .formation-lab__status {
  opacity: 0;
}

.formation-lab__controls {
  position: absolute;
  z-index: 5;
  right: clamp(18px, 3vw, 48px);
  bottom: clamp(24px, 4vh, 42px);
  display: flex;
  gap: 8px;
}

.formation-lab__controls button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgb(206 215 220 / 22%);
  border-radius: 999px;
  background: rgb(14 16 18 / 76%);
  color: rgb(239 242 244 / 86%);
  font-size: 10px;
  font-weight: 660;
  letter-spacing: 0.08em;
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.formation-lab__controls button:hover,
.formation-lab__controls button:focus-visible {
  border-color: rgb(220 229 234 / 52%);
  background: rgb(28 32 35 / 88%);
  outline: none;
}

.formation-lab__timeline {
  --formation-progress: 0;
  position: absolute;
  z-index: 4;
  bottom: clamp(29px, 4.6vh, 48px);
  left: clamp(20px, 3.2vw, 56px);
  display: grid;
  grid-template-columns: auto clamp(84px, 13vw, 180px) auto;
  align-items: center;
  gap: 10px;
  color: rgb(213 220 224 / 42%);
  font-size: 8px;
  font-weight: 720;
  letter-spacing: 0.16em;
}

.formation-lab__timeline i {
  position: relative;
  display: block;
  height: 1px;
  overflow: hidden;
  background: rgb(216 224 229 / 17%);
}

.formation-lab__timeline b {
  position: absolute;
  inset: 0;
  display: block;
  background: rgb(209 222 230 / 78%);
  transform: scaleX(var(--formation-progress));
  transform-origin: left center;
}

@media (max-width: 760px) {
  .formation-lab__source-headline {
    width: calc(100vw - 28px);
    font-size: clamp(2.35rem, 10vw, 3rem);
    white-space: normal;
  }

  .formation-lab__source-introduction {
    width: calc(100vw - 28px);
    text-align: left;
  }

  .formation-lab__source-identity {
    font-size: clamp(25px, 7.8vw, 36px);
  }

  .formation-lab__source-support {
    gap: 0.62rem;
    margin-top: 1.4rem;
    font-size: clamp(14px, 4vw, 18px);
    line-height: 1.6;
  }

  .formation-lab__caption {
    top: 20px;
    left: 18px;
  }

  .formation-lab__timeline {
    right: 18px;
    bottom: 78px;
    left: 18px;
    grid-template-columns: auto 1fr auto;
  }

  .formation-lab__controls {
    right: 14px;
    bottom: 18px;
    left: 14px;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .formation-lab__timeline b {
    transition: none;
  }
}
