:root {
  color-scheme: dark;
  font-family: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  background: #06070b;
  color: #f1eee8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

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

body,
button {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  color: #06070b;
  background: #f1eee8;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.threshold {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  padding: 1.25rem;
  overflow: hidden;
  flex-direction: column;
  gap: 1.25rem;
  background: #06070b;
}

@supports (min-height: 100svh) {
  .threshold {
    min-height: 100svh;
  }
}

@supports (padding: max(0px)) {
  .threshold {
    padding-top: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-top));
    padding-right: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-right));
    padding-bottom: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-bottom));
    padding-left: max(clamp(1.25rem, 4vw, 3.5rem), env(safe-area-inset-left));
  }
}

.moving-weather,
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.moving-weather {
  z-index: -3;
  overflow: hidden;
  background: #06070b;
}

.moving-weather video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right bottom;
  transform: scale(0.72);
  transform-origin: right bottom;
  background: #06070b;
  -webkit-mask-image: radial-gradient(
    ellipse 105% 110% at 100% 100%,
    #000 0%,
    #000 56%,
    rgba(0, 0, 0, 0.92) 68%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 105% 110% at 100% 100%,
    #000 0%,
    #000 56%,
    rgba(0, 0, 0, 0.92) 68%,
    transparent 100%
  );
}

.veil {
  z-index: -2;
  background:
    linear-gradient(
      180deg,
      #06070b 0%,
      rgba(6, 7, 11, 0.96) 17%,
      rgba(6, 7, 11, 0.18) 38%,
      rgba(6, 7, 11, 0.03) 62%,
      rgba(6, 7, 11, 0.3) 100%
    ),
    linear-gradient(
      90deg,
      rgba(6, 7, 11, 0.72) 0%,
      rgba(6, 7, 11, 0.18) 42%,
      rgba(6, 7, 11, 0.02) 76%
    );
}

.identity,
.forming,
.motion-control,
.not-yet,
.truth {
  position: relative;
  z-index: 1;
}

.identity {
  align-self: flex-start;
}

h1 {
  margin: 0;
  font-size: 1.25rem;
  font-size: clamp(1.25rem, 1.05rem + 0.85vw, 2rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.055em;
}

.forming,
.not-yet,
.truth p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.forming {
  max-width: 27rem;
  margin-top: auto;
  color: #e8e4df;
}

.not-yet {
  align-self: flex-end;
  color: #d0ccd0;
}

.motion-control {
  display: grid;
  min-width: 11.5rem;
  min-height: 3.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(241, 238, 232, 0.48);
  border-radius: 0.15rem;
  grid-template-columns: 0.55rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  align-self: flex-start;
  color: #f1eee8;
  background: rgba(8, 10, 15, 0.86);
  cursor: pointer;
  text-align: left;
  text-transform: lowercase;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.motion-control:hover {
  border-color: rgba(241, 238, 232, 0.86);
  background: rgba(13, 16, 23, 0.94);
}

.motion-control:disabled {
  cursor: default;
  opacity: 0.78;
}

.motion-control:focus-visible {
  outline: 2px solid #f1eee8;
  outline-offset: 4px;
}

.control-signal {
  width: 0.48rem;
  height: 0.48rem;
  border: 1px solid #b9b4bb;
  border-radius: 50%;
  background: transparent;
}

.motion-control[aria-pressed="true"] .control-signal {
  border-color: #cfbfc8;
  background: #cfbfc8;
  box-shadow: 0 0 0.8rem rgba(207, 191, 200, 0.5);
}

.control-label {
  color: #f1eee8;
}

.control-state {
  color: #aaa7aa;
}

.truth {
  display: flex;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(241, 238, 232, 0.15);
  gap: 0.75rem 2rem;
  justify-content: space-between;
  color: #aaa7aa;
}

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

@supports (display: grid) {
  .threshold {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(9rem, 1fr) auto auto;
  }

  .identity {
    grid-column: 1;
    grid-row: 1;
  }

  .motion-control {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .forming {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    margin-top: 0;
  }

  .not-yet {
    grid-column: 2;
    grid-row: 3;
    align-self: end;
    justify-self: end;
  }

  .truth {
    grid-column: 1 / -1;
    grid-row: 4;
  }
}

@media (max-width: 42rem) {
  .moving-weather video {
    object-position: center;
    transform: none;
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 24%,
      #000 41%,
      #000 59%,
      transparent 76%
    );
    mask-image: linear-gradient(
      to bottom,
      transparent 24%,
      #000 41%,
      #000 59%,
      transparent 76%
    );
  }

  .veil {
    background:
      linear-gradient(
        180deg,
        #06070b 0%,
        #06070b 22%,
        rgba(6, 7, 11, 0.08) 40%,
        rgba(6, 7, 11, 0.08) 60%,
        #06070b 78%,
        #06070b 100%
      ),
      linear-gradient(
        90deg,
        rgba(6, 7, 11, 0.66) 0%,
        rgba(6, 7, 11, 0.1) 52%,
        rgba(6, 7, 11, 0.02) 100%
      );
  }

  .truth {
    flex-direction: column;
  }

  @supports (display: grid) {
    .threshold {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: auto minmax(10rem, 1fr) auto auto auto;
    }

    .identity {
      grid-column: 1;
      grid-row: 1;
    }

    .forming,
    .not-yet {
      grid-column: 1;
      grid-row: 3;
    }

    .forming {
      max-width: calc(100% - 5.25rem);
    }

    .not-yet {
      justify-self: end;
    }

    .truth {
      grid-column: 1;
      grid-row: 4;
    }

    .motion-control {
      grid-column: 1;
      grid-row: 5;
      justify-self: start;
    }
  }
}

@media (max-height: 32rem) and (min-width: 36rem) {
  .threshold {
    min-height: 32rem;
    overflow-y: auto;
  }

  @supports (display: grid) {
    .threshold {
      grid-template-rows: auto minmax(7rem, 1fr) auto auto;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .moving-weather,
  .veil {
    display: none;
  }

  .threshold {
    color: CanvasText;
    background: Canvas;
  }

  .motion-control {
    color: ButtonText;
    background: ButtonFace;
    border-color: ButtonText;
    forced-color-adjust: auto;
  }

  .forming,
  .not-yet,
  .truth,
  .control-label,
  .control-state {
    color: CanvasText;
  }
}
