:root {
  --ink: #000;
  --paper: #fff;
  --line: #000;
  --pad: clamp(1.25rem, 5vw, 4rem);
  font-family: "Instrument Sans", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  touch-action: manipulation;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 10;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 500ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem var(--pad);
  z-index: 5;
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.back {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 0.95rem;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 220ms ease;
}

.back:hover,
.back:focus-visible {
  background-size: 100% 1px;
}

main {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem var(--pad);
}

form {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
}

.step {
  display: none;
}

.step.is-active {
  display: block;
  animation: enter 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.step.is-active.back-in {
  animation-name: enter-back;
}

h1,
h2 {
  margin: 0 0 2.5rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

h1 {
  font-size: clamp(2.6rem, 7vw, 5rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 3.2rem);
}

.about {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  max-width: 30rem;
}

.about img {
  width: 96px;
  height: 96px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
}

.about p {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.6rem;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.button:active {
  transform: scale(0.98);
}

.fields + .button,
.other-field + .button {
  margin-top: 2rem;
}

.button[hidden],
.other-field[hidden] {
  display: none;
}

.choices {
  display: grid;
  gap: 0.75rem;
}

.choices label {
  display: block;
  cursor: pointer;
}

.choices input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choices span {
  display: block;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--line);
  font-size: 1.15rem;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.choices.multi span {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.choices.multi span::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid currentColor;
  background:
    linear-gradient(currentColor, currentColor) center / 0 0 no-repeat;
  transition: background-size 180ms ease;
}

.choices.multi input:checked + span::before {
  background-size: 0.6rem 0.6rem;
}

.choices label:hover span,
.choices input:focus-visible + span {
  transform: translateX(6px);
}

.choices input:checked + span {
  background: var(--ink);
  color: var(--paper);
}

.other-field,
.fields input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0;
  font-size: 1.25rem;
  outline: 0;
}

.other-field {
  margin-top: 1.5rem;
  animation: enter 400ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.other-field:focus,
.fields input:focus {
  box-shadow: 0 1px 0 0 var(--ink);
}

.fields {
  display: grid;
  gap: 1.75rem;
}

.fields label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.invalid {
  animation: shake 300ms ease;
}

#form-status {
  margin: 1rem 0 0;
  min-height: 1.5em;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes enter-back {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@media (hover: none) {
  .choices label:hover span {
    transform: none;
  }

  .button:hover {
    background: var(--ink);
    color: var(--paper);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: calc(1.1rem + env(safe-area-inset-top)) var(--pad) 1.1rem;
    background: var(--paper);
  }

  .back {
    padding: 0.6rem 0 0.6rem 1.5rem;
    margin: -0.6rem 0;
  }

  main {
    align-items: flex-start;
    min-height: 100svh;
    padding: calc(5.5rem + env(safe-area-inset-top)) var(--pad)
      calc(2.5rem + env(safe-area-inset-bottom));
  }

  .step.is-active[data-step="intro"] {
    padding-top: 10svh;
  }

  .about {
    gap: 1rem;
    margin-bottom: 2rem;
  }

  .about img {
    width: 72px;
    height: 72px;
  }

  .about p {
    font-size: 1rem;
  }

  h1,
  h2 {
    margin-bottom: 1.75rem;
  }

  h1 {
    font-size: clamp(2.3rem, 11vw, 3.2rem);
  }

  h2 {
    font-size: clamp(1.75rem, 8vw, 2.3rem);
  }

  .choices {
    gap: 0.6rem;
  }

  .choices span {
    padding: 1rem 1.1rem;
    font-size: 1.05rem;
  }

  .button {
    width: 100%;
    padding: 1.05rem 1.25rem;
    text-align: center;
  }

  .fields {
    gap: 1.4rem;
  }

  .other-field,
  .fields input {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
