@font-face {
  font-family: 'Inter';
  src: url('fonts/inter.ttf');
  font-style: normal;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-italic.ttf');
  font-style: italic;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', sans-serif;
}

article {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 48ch;
  padding: 120px 24px;
}

h1, h2, p {
  letter-spacing: -0.2px;
}

h1 {
  font-size: 17px;
  line-height: 28px;
  margin: 0;
  font-weight: 600;
}

h2 {
  font-size: 15px;
  line-height: 26px;
  font-weight: 600;
  margin: 0;
}

p {
  font-size: 14px;
  line-height: 24px;
  margin: 0;
}

h1 + h2 {
  margin-top: 32px;
}

h2 + p {
  margin-top: 8px;
}

p + h2 {
  margin-top: 24px;
}

h1 + img {
  margin-top: 28px;
}

img + h2 {
  margin-top: 32px;
}

::selection {
  background: rgba(0, 0, 0, 0.2);
}

#button,
#input {
  padding: 3px 7px;
  border: none;
  border-radius: 5px;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
}

#button {
  background-color: #000;
  background-image:
    linear-gradient(to bottom,
    rgba(255, 255, 255, 0.17) 100%,
    rgba(255, 255, 255, 0) 0%);
  box-shadow: 
    0 1px 2.5px 0 rgba(0, 0, 0, 0.24),
    0 0 0 0.5px rgba(0, 0, 0, 0.12);
  color: #fff;
  transition: all 150ms ease;
  cursor: pointer;
}

#button:active,
#button:focus {
  background-color: #3a3a3a;
}

#button:disabled {
  background: rgba(255, 255, 255, 0.3);
  background-image: none;
  box-shadow: 
    0 0.5px 2.5px 0 rgba(0, 0, 0, 0.3), 
    0 0 0 0.5px rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.3);
  cursor: default;
}

#input {
  width: 125px;
  background: #fff;
  box-shadow: 
    0 0.5px 2.5px 0 rgba(0, 0, 0, 0.3), 
    0 0 0 0.5px rgba(0, 0, 0, 0.05);
  color: #000;
  caret-color: transparent;
  transition: all 150ms ease;
}

#input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

#input:disabled {
  background: rgba(255, 255, 255, 0.3);
  color: rgba(0, 0, 0, 0.3);
}

.container {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  position: relative;
  display: inline-block;
}

.input-wrapper.shake {
  animation: shake 0.5s;
}

.input-wrapper.shake #caret {
  animation: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  14.29%, 42.86%, 71.43% { transform: translateX(-4px); }
  28.57%, 57.14%, 85.71% { transform: translateX(4px); }
}

#caret {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 1em;
  border-radius: 1px;
  background: black;
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

#caret.visible {
  opacity: 1;
}

#caret.blink {
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes load-fade {
  from {
    opacity: 0;
    filter: blur(6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes load-rise {
  from {
    translate: 0 12px;
  }
  to {
    translate: 0 0;
  }
}

.load > * {
  opacity: 0;
  animation:
    load-fade 0.7s ease-out forwards,
    load-rise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-play-state: paused;
}

.load.ready > * {
  animation-play-state: running;
}
